Hi What I understood is you have to check presence of phone number and mobile number But not at the same time Right? If so please try the following Assuming you have the fields phone_number and mobile_number
validates_presence_of :mobile_number,:if => :phone_number_blank_check validates_presence_of :phone_number,:if => :mobile_number_blank_check def phone_number_blank_check self.phone_number.blank? end def mobile_number_blank_check self.mobile_number.blank? end Sijo -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---