I am not sure if the following is a bug or for some reason it is
supposed to behave this way.
validates_with_method :price, :validate_price
def validate_price
return true if !price.nil? && price >= 0
[false, "The price must be greater or equal to zero"]
end
Here is what I get when inspecting the model errors
========
<DataMapper::Validate::ValidationErrors:0x18b9fc4
@errors={:name=>["Name must not be blank"], :shipping_cost=>["Shipping
cost must not be blank"], :validate_price=>["The price must be greater
or equal to zero"]}
The error is referenced through the validate_price key. Should it not
be referenced with the price key that was defined in the
validates_with_method_call?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"DataMapper" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/datamapper?hl=en
-~----------~----~----~----~------~----~------~--~---