[Rails] Re: Why is Rails eager loading most of my database?

2011-03-27 Thread Taylor Strait
Hi Fred, in Rails 3 I found validates_associated to be the most streamlined approach for such a normalized model. http://guides.rubyonrails.org/active_record_validations_callbacks.html#validates_associated Thanks again! -- Posted via http://www.ruby-forum.com/. -- You received this message b

[Rails] Re: Why is Rails eager loading most of my database?

2011-03-25 Thread Frederick Cheung
On Mar 25, 9:50 pm, Taylor Strait wrote: > Thanks Fred - that was very helpful. Is there a more efficient way to > validate inclusion of that doesn't tax the database so heavily? > Well personally I'd just use a foreign key constraint, but you could use validates presence of on the association

[Rails] Re: Why is Rails eager loading most of my database?

2011-03-25 Thread Taylor Strait
Thanks Fred - that was very helpful. Is there a more efficient way to validate inclusion of that doesn't tax the database so heavily? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to

Re: [Rails] Re: Why is Rails eager loading most of my database?

2011-03-25 Thread Frederick Cheung
On 25 Mar 2011, at 20:51, Taylor Strait wrote: > Hi Fred, thanks for the reply. Does rails execute validations when > simply showing the object? My assumption is that validations were only > called before_create. > The validations aren't run, but when you do validates_inclusion_of :foo, :in

[Rails] Re: Why is Rails eager loading most of my database?

2011-03-25 Thread Taylor Strait
Hi Fred, thanks for the reply. Does rails execute validations when simply showing the object? My assumption is that validations were only called before_create. Taylor -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby