Displaying 1 result from an estimated 1 matches for "poll_status".
Did you mean:
old_status
2007 Sep 27
1
How to call a model object method for validation?
This is the code I''m trying to get to work:
validates_inclusion_of :status,
:in => poll_statuses().keys
def poll_statuses
return {
"closed" => "Closed",
"open" => "Open"
}
end
It says there''s no poll_statuses method in Poll. How do I access this
method? I''ve tried Poll.poll_statuses().keys, I''...