search for: requires_value

Displaying 1 result from an estimated 1 matches for "requires_value".

2006 Jun 07
1
Validating numericality based on related attribute value?
I have a price attribute in my model which I need to validate as a positive number if the attribute price_terms.requires_value is equal to ''Y'', otherwise price can be blank or zero. Price_terms is a select list which my model table belongs_to. How do I do this? - I tried doing this: validates_numericality_of :price, :if => self.price_term.requires_value.upcase == ''Y'' But that does...