Validate method not getting called?

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

Wes G. 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,
Wes

validate was getting called. I just had an overly broad “rescue” clause
in my controller. Sigh.

WG

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs