I’m attempting to create a custom validation for one of my models in Rails 2.3.5, but I keep recieving the following error everytime I run my testing suite:
`method_missing_without_paginate': undefined local variable or method `validates_progression'
app/models/project.rb
class Project < ActiveRecord::Base
...
validates_progression
def validates_progression
true # stubtastic!
end
end
I can’t seem to make much of this~
It doesn’t work because you are defining a method with instance scope and you are trying to call it within the class scope. You have two alternatives:
Instance Scope
Class scope
The second alternative doesn’t really makes sense unless you want to wrap an other filter.
Otherwise, go with the first solution.