Change default SecurePassword column name #9895

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
5 participants
Contributor

robertomiranda commented Mar 24, 2013

Currently the ActiveModel::SecurePassword module force to create a requires you to have a password_digest attribute. This patch provide the option to switch the attribute name

class Visitor
  extend ActiveModel::Callbacks
  include ActiveModel::Validations
  include ActiveModel::SecurePassword

  define_model_callbacks :create

  has_secure_password(validations: false, column_name: :password)

  attr_accessor :password, :password_confirmation
end

@guilleiguaran guilleiguaran and 1 other commented on an outdated diff Mar 24, 2013

activemodel/lib/active_model/secure_password.rb
@@ -5,6 +5,7 @@ module SecurePassword
class << self; attr_accessor :min_cost; end
self.min_cost = false
+
@guilleiguaran

guilleiguaran Mar 24, 2013

Owner

remove whitespace

Tzleoo commented Mar 24, 2013

Thanks for the patch 1.01 million

Contributor

bradleypriest commented Mar 24, 2013

This has already been suggested and rejected multiple times by the core team #1440 #1694 #6684
Basically, the response is that if you want something more custom than has_secure_password, there are lots of other auth options out there.

Member

steveklabnik commented Mar 24, 2013

Yes, thanks for digging those up, @bradleypriest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment