Displaying 1 result from an estimated 1 matches for "my_association".
2009 Jan 09
3
What is wrong with validates_presence_of :my_association ?
Category.has_many :products
Let''s say a product must belong to a category. I know it is recommended
to do the following:
class Product
validates_presence_of :category_id
end
But, as we all know, this is a pain for new records, meaning what if the
associated category is a new record?
I''ve been meaning to ask this, but what''s wrong with doing the
following:
class