[Rails] Re: Undefined method exists?

2008-11-10 Thread Frederick Cheung
On 10 Nov 2008, at 17:16, Mike C wrote: > > So what's the proper way to use it? self.exists? doesn't work > either...can I only do User.exists?? Yum. That's what it means for a method to be a class method: you call it on a class not an instance of the class. Fred > > > On Nov 10, 2:31 am, Fr

[Rails] Re: Undefined method exists?

2008-11-10 Thread Mike C
So what's the proper way to use it? self.exists? doesn't work either...can I only do User.exists?? On Nov 10, 2:31 am, Frederick Cheung <[EMAIL PROTECTED]> wrote: > On 10 Nov 2008, at 10:20, Mike C wrote: > > > > > I'm getting the error that exists? is an undefined method when I try > > and use i

[Rails] Re: Undefined method exists?

2008-11-10 Thread Frederick Cheung
On 10 Nov 2008, at 10:20, Mike C wrote: > > I'm getting the error that exists? is an undefined method when I try > and use it in a model. Basically, it's something like this: > > if exists? :user_id => current_user.id > > From what I understand, exists? is in ActiveRecord::Base so a model > shou