On Sat, Nov 1, 2008 at 5:29 AM, hoenth <[EMAIL PROTECTED]> wrote:

>
> i have a person object. Persons don't need to have addresses, but if
> they have any address field value, they must have them all. So I have
> something like this:
>
> validates_presence_of :street_address, :city, :state, :postal_code
> unless :address_blank?


Instead of

unless :address_blank?

use

:unless => :address_blank?

since you need to pass options to validates_presence_of as opposed to
writing a normal conditional. See the API docs for validates_presence_of for
more details if you need them.

Regards,
Craig

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" 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/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to