self vs. @
Barry Simpson
1 post
|
I need some clarification on page 157 (2nd edition)—probably because I’m a newbie to both Ruby and Rails. In the create_new_salt method, why wouldn’t you use Loving the book, by the way. |
Russell Healy
2 posts
|
I suppose that <user:0xb69384cc>“123”, “name”=>”benjamin”, “hashed_password”=>”a335e63a110911315788dbe5b1d44815bdd528ae”, “id”=>2}The accessor method ‘salt’ must retrieve the value from the @attributes hash. That doesn’t explain though, the use of self.password and self.salt in the line on page 158:
The following should be sufficient:
|
Russell Healy
2 posts
|
Ugh, sorry about the formatting. I wish this forum had a preview! |
Paul Jewell
2 posts
|
It doesn’t have preview, but it does allow you to edit the post. I had the same thought posting a message in a different area, but luckily spotted the edit button next to the avatar :-) |
4 posts, 3 voices
