On Wed, Oct 14, 2009 at 2:34 AM, Ralu rm <rails-mailing-l...@andreas-s.net>wrote:
> > attr_accessor :password > dis is small bit of code i have seen in a tutorial . > > in that example there is no field called password in the database, so > how can rails understand its the password field of my database. in my > database i have given password field as hashed_password > > i got an explanation form the tutorial as given below > " The attr_accessor statement specifies the attribute password. You > may have noticed that > this doesn’t actually exist as a field in the database migration. This > declares that password is an > attribute of the model even though it doesn’t exist as a database field. > The model will be able to > use the data from this field to create the hashed_password field. You > will notice that this is done > by the before_save filter. This will simply set the hashed_password > field to be a hash of the clear > password which, as stated in our specification, we can compare to the > stored hashed_password > value to authenticate a user’s login credentials. > " > > but i ddn understand clearly... can any explain in better way! > Where can one find this example? -Conrad > -- > 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 rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---