1
0
مراية لـ https://github.com/postalserver/postal.git تم المزامنة 2026-01-17 05:33:35 +00:00

style(rubocop): fix all safe auto correctable offenses

هذا الالتزام موجود في:
Charlie Smurthwaite
2023-03-16 15:50:53 +00:00
الأصل 02c93a4850
التزام fd289c46fd
204 ملفات معدلة مع 2611 إضافات و2486 حذوفات

عرض الملف

@@ -2,9 +2,9 @@ class User
has_secure_password
validates :password, :length => {:minimum => 8, :allow_blank => true}
validates :password, length: { minimum: 8, allow_blank: true }
when_attribute :password_digest, :changes_to => :anything do
when_attribute :password_digest, changes_to: :anything do
before_save do
self.password_reset_token = nil
self.password_reset_token_valid_until = nil
@@ -12,9 +12,10 @@ class User
end
def self.authenticate(email_address, password)
user = where(:email_address => email_address).first
raise Postal::Errors::AuthenticationError.new('InvalidEmailAddress') if user.nil?
raise Postal::Errors::AuthenticationError.new('InvalidPassword') unless user.authenticate(password)
user = where(email_address: email_address).first
raise Postal::Errors::AuthenticationError, "InvalidEmailAddress" if user.nil?
raise Postal::Errors::AuthenticationError, "InvalidPassword" unless user.authenticate(password)
user
end
@@ -27,9 +28,9 @@ class User
end
def begin_password_reset(return_to = nil)
self.password_reset_token = Nifty::Utils::RandomString.generate(:length => 24)
self.password_reset_token = Nifty::Utils::RandomString.generate(length: 24)
self.password_reset_token_valid_until = 1.day.from_now
self.save!
save!
AppMailer.password_reset(self, return_to).deliver
end