Here''s a snippet of my model: validates_presence_of :from_name, :from_email, :reply_name, :reply_email, :eSubject protected def validate puts "Calling: #{target_list_ids}" errors.add_to_base("You must choose at least one target list for this job") if self.target_list_ids.nil? end It appears that the validates_presence_of are being called just fine, but my validate method is not. I never see the puts message that I inserted to prove that it was being called. Anyone ever seen this before? Thanks, Wes -- Posted via http://www.ruby-forum.com/.
Wes Gamble wrote:> Here''s a snippet of my model: > > validates_presence_of :from_name, :from_email, :reply_name, > :reply_email, :eSubject > > protected > def validate > puts "Calling: #{target_list_ids}" > errors.add_to_base("You must choose at least one target list for > this job") if self.target_list_ids.nil? > end > > It appears that the validates_presence_of are being called just fine, > but my validate method is not. I never see the puts message that I > inserted to prove that it was being called. > > Anyone ever seen this before? > > Thanks, > Wesvalidate was getting called. I just had an overly broad "rescue" clause in my controller. Sigh. WG -- Posted via http://www.ruby-forum.com/.
Apparently Analagous Threads
- validate method doesn''t recognize another instance method
- Form validation - keepin correct fields displayed on refresh
- ActionMailer with attachments, body is blank
- checkboxes with a has_many :through relation
- What is the best way to override an _entire_ AR::Errors msg?