On Saturday, June 22, 2013 at 12:42 PM, Hillary Hueter wrote: > [snip] > > > What's really confusing me is this line: > > return false unless @user = User.find_by_id(self.id) > > How does the model/method know "self.id" since it's not being passed in?
authenticate is defined as a method on the User object, which in turns inherits from ActiveRecord::Base. self, in the context of that method refers to an instantiated user object. ActiveRecord provides the id method. I hope that helps, -- Yln -- -- SD Ruby mailing list [email protected] http://groups.google.com/group/sdruby --- You received this message because you are subscribed to the Google Groups "SD Ruby" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
