[Rails-core] Re: references_eager_loaded_tables? matches string literals containing dots

2009-11-04 Thread Jeremy Evans
On Wed, Nov 4, 2009 at 9:13 AM, Matteo Vaccari wrote: > > It all began when a collegue said that "our free text search throws if the > user enters something with a dot".  A bit of investigation showed that > ActiveRecord produced a different set of queries depending on the user input > containing

[Rails-core] references_eager_loaded_tables? matches string literals containing dots

2009-11-04 Thread Matteo Vaccari
It all began when a collegue said that "our free text search throws if the user enters something with a dot". A bit of investigation showed that ActiveRecord produced a different set of queries depending on the user input containing a dot or not. The :include is handled with a single query with a

[Rails-core] Re: OrderedHash and ActiveSupport hash extensions

2009-11-04 Thread Chris Cruft
Done. I've created the ticket and enclosed a patch here: https://rails.lighthouseapp.com/projects/16213-rails-guides/tickets/105-activesupportorderedhashreplace-results-in-corrupt-keys Turns out the problem was more fundamental than just OrderedHash#slice! -it's actually a problem in OrderedHash

[Rails-core] re: Controller filter parameters

2009-11-04 Thread Manfred Stienstra
Hi Rodrigo, The boolean accessors on the User model could probably be refactored, but you get the idea. class User < ActiveRecord::Base has_many :roles def institution_admin? roles.any? { |r| r.label == 'institution_admin' } end def system_admin? roles.an

[Rails-core] URGENT! http://media.rubyonrails.org/video/rails_blog_2.mov is down!

2009-11-04 Thread serdarsenay
URL(ruby blog in 15 mins tutorial video) : http://media.rubyonrails.org/video/rails_blog_2.mov is down! I am a software engineer commited to get a taste of ruby on rails and i found this tutorial yesterday, and today I cant view it because the server is down, and it is not even saved in my browse

[Rails-core] Re: Controller filter parameters

2009-11-04 Thread Manfred Stienstra
Hi Rodrigo, Here is an example of what you probably want: class User has_many :roles def institution_admin? roles.any? { |r| r.label == 'institution_admin' } end def system_admin? roles.any? { |r| r.label == 'system_admin' } end end class InstitutionContr