In an AR model (PrivilegedUser), I have several custom validations, so am using validate method to call a sequence of other small methods which perform specific tasks.
def validate do_this do_that end In do_this, I need to look up records from the same table/model I am in to do some comparing of the current object being created/updated to existing data. def do_this results = PrivilegedUser.find(:all, :condition => .... ) .....do some stuff..... end No matter what form I try that find method with (find, self.find, PrivilegedUser.find), Rails balks that find is not a method of PrivilegedUser. If I substitute PrivilegedUser.find with some other class, it works just fine. PrivilegedUser is a working AR subclass that I have been using for months, and am now adding this new method, and I already have find being used in other methods. So, there's something unique about trying to use find in the validation callback somehow. I'm obviously not understanding something. Can someone essplain to me? Thx. -- gw -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

