I have two models Projectand the "Task", where the project has_many tasks and tasks belongs to the project
Now in my model TaskI am performing a field check using attributes in the project
validates :effort, :inclusion => 1..(project.effort)
This results in an error. method_missing: undefined method project
The question is, how can I test a child attribute (Task.effort) based on the value of the parent attribute (Project.effort) in Rails 3?
source
share