Displaying 1 result from an estimated 1 matches for "bypass_valid".
2011 Jan 08
4
Help How to create DSL for conditional validations
Hi All,
I am new to Ruby and ROR
I were trying to create small DSL for conditional validations
valid_with_cond :bypass_validation do
if self.addresses > 3
errors[:base] << "Can not have more than 3 addresses".
end
end
By this I wanted to create array of method and call them all in custom
validation method.
this above code I wanted to do
attr_accessor :bypass_validation
def svalid_co...