You've declared the method 'previous' to be a *class* method (via the
"self."). But then you call it on an *instance* of that class.
Change the method to this:
def previous
class.find(....)
end
Also, youre conditions specify two arguments, but only one '?' to
substitute in a value. And you'll want to remove the "self." from
those arguments as well.
-philip
Looks like you've defined a class method, but are trying to call it from
an instance of that class. You'd need to call it like: Passage.previous.
Also, if time and stop_id are unique per instance, you'll run into
problems there as well. Not sure what you're trying to accomplish, but
it looks as though you could just make it an instance method (ie: remove
the "self" from def self.previous).
Hope that helps.
Matt