Remove hard dependency on bcrypt.
This commit is contained in:
parent
36f1612c34
commit
6779064437
1
Gemfile
1
Gemfile
@ -6,6 +6,7 @@ if ENV['AREL']
|
|||||||
gem "arel", :path => ENV['AREL']
|
gem "arel", :path => ENV['AREL']
|
||||||
end
|
end
|
||||||
|
|
||||||
|
gem "bcrypt-ruby", "~> 3.0.0"
|
||||||
gem "jquery-rails"
|
gem "jquery-rails"
|
||||||
# This needs to be with require false to avoid
|
# This needs to be with require false to avoid
|
||||||
# it being automatically loaded by sprockets
|
# it being automatically loaded by sprockets
|
||||||
|
@ -19,5 +19,4 @@
|
|||||||
s.add_dependency('activesupport', version)
|
s.add_dependency('activesupport', version)
|
||||||
s.add_dependency('builder', '~> 3.0.0')
|
s.add_dependency('builder', '~> 3.0.0')
|
||||||
s.add_dependency('i18n', '~> 0.6')
|
s.add_dependency('i18n', '~> 0.6')
|
||||||
s.add_dependency('bcrypt-ruby', '~> 3.0.0')
|
|
||||||
end
|
end
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
require 'bcrypt'
|
|
||||||
|
|
||||||
module ActiveModel
|
module ActiveModel
|
||||||
module SecurePassword
|
module SecurePassword
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
@ -30,6 +28,9 @@ module ClassMethods
|
|||||||
# User.find_by_name("david").try(:authenticate, "notright") # => nil
|
# User.find_by_name("david").try(:authenticate, "notright") # => nil
|
||||||
# User.find_by_name("david").try(:authenticate, "mUc3m00RsqyRe") # => user
|
# User.find_by_name("david").try(:authenticate, "mUc3m00RsqyRe") # => user
|
||||||
def has_secure_password
|
def has_secure_password
|
||||||
|
gem 'bcrypt-ruby', '~> 3.0.0'
|
||||||
|
require 'bcrypt'
|
||||||
|
|
||||||
attr_reader :password
|
attr_reader :password
|
||||||
|
|
||||||
validates_confirmation_of :password
|
validates_confirmation_of :password
|
||||||
|
Loading…
Reference in New Issue
Block a user