Is has_secure_password a method or a module?

In Step 2, the instructions say to add has_secure_passwordstrong text**** to class User in the user model but I thought that method always are created by using...

def has_secure_password
    #some stuff here

Thanks in advance!


Hi Jay,

has_secure_password is a method, automatically created by Ruby on Rails.


Thanks Zeke, where does the method come from?



automatically created by Ruby on Rails
- Post #2


Thanks Zeke, that's what I figured after reading post 2, but what I mean is can I see it in a folder? Or is it hidden?


@jaydacoder has_secure_password is actually a method created by the bcrypt gem, I was mistaken above - sorry :confused:

If you view the Gem's source code, you'll be able to see the def has_secure_password stuff, but otherwise this is the most you'll see:

# Use ActiveModel has_secure_password
gem 'bcrypt', '~> 3.1.2'

Is that a little more helpful?


It is more helpful, thank you!


This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.