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
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
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
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
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
5 matches
Mail list logo