[Rails] Re: When to use self.class.function vs self.function

2010-09-07 Thread Xuan
Ruby guidelines state that methods should always be lowercase, just as your second example. Capitals should be used to name classes. On 6 sep, 19:59, pipplo wrote: > Awesome! > > Thanks Fred and Xuan.  I was able to really clean up my code once I > understood this. > > One side question based on

[Rails] Re: When to use self.class.function vs self.function

2010-09-06 Thread pipplo
Awesome! Thanks Fred and Xuan. I was able to really clean up my code once I understood this. One side question based on this. Is there some normal ruby coding guidelines? I was thinking I would want to make class level functions capital, and instance level functions lowercase. User.Authenticat

[Rails] Re: When to use self.class.function vs self.function

2010-09-06 Thread Xuan
On 6 sep, 08:00, pipplo wrote: > Hi Guys, > > I'm experimenting with my first rails app currently.  One thing I'm > trying to implement is a login system. > > I created a model for user.rb  I've added a couple of functions to the > class for example: > > def self.authenticate(user_info) >    fin

[Rails] Re: When to use self.class.function vs self.function

2010-09-06 Thread Frederick Cheung
On Sep 6, 7:00 am, pipplo wrote: > Hi Guys, > > I'm experimenting with my first rails app currently.  One thing I'm > trying to implement is a login system. > > I created a model for user.rb  I've added a couple of functions to the > class for example: > > def self.authenticate(user_info) >    f