开发者

NoMethodError User Authentication

I'm trying out user authentication for the first time and am running to a bit of an issue.

I've defined my make_salt method in my AdminUser model

def self.make_salt(username="")
  Digest::SHA1.hexdigest("Use #{username} and other stuff")
end

Then in my console when I run AdminUser.make_salt, I get:

>> AdminUser.make_salt
NoMethodError: undefined method `make_salt' for #<Class:0x1063ddb58>
from /Library/Ruby/Gems/1.8/gems/activerecord-3.0.7/lib/active_record/base.rb:1009:in `method_missing'
from (irb):30

Also, I had a hash method defined, which worked fine, but when I changed it to hash_with_sal开发者_Go百科t I also got a NoMethodError.

Am I just missing something obvious here?


Ugh. Finally figured out this one. I simply needed to restart my console after saving the changes to my code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜