I have two models Project
and 'Task` where project has_many tasks and task belongs to project
Now in my Task
model I am doing validation on a field using attributes in the project
validates :effort, :inclusion => 1..(project.effort)
This results in an error method_missing: undefined method project
Question is, how can I validate a child attribute (Task.effort) based on a parent's attribute's value (Project.effort) in Rails 3?