Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## In my User model
- def password=(arg)
- arg = MD5.new(arg).hexdigest unless arg.length == 32
- self.password = arg
- end
- ## When testing in script/console
- >> @user = User.new
- => #<User:0x35300cc @new_record=true, @attributes={"username"=>"", "password"=>""}>
- >> @user.password = 'test'
- SystemStackError: stack level too deep
- from ./script/../config/../config/../app/models/user.rb:35:in `password='
- from ./script/../config/../config/../app/models/user.rb:36:in `password='
- from (irb):2
Add Comment
Please, Sign In to add comment