test/rails_app/app/data_mapper/user.rb in dm-devise-1.1.2 vs test/rails_app/app/data_mapper/user.rb in dm-devise-1.1.3
- old
+ new
@@ -9,19 +9,17 @@
timestamps :at
include SharedUser
include Shim
- unless DEVISE_ORM == :data_mapper_active_model
- before :valid?, :update_password_confirmation
+ before :valid?, :update_password_confirmation
- # DM's validates_confirmation_of requires the confirmation field to be present,
- # while ActiveModel by default skips the confirmation test if the confirmation
- # value is nil. This test takes advantage of AM's behavior, so just add the
- # :password_confirmation value.
- def update_password_confirmation
- if self.password && self.password_confirmation.nil?
- self.password_confirmation = self.password
- end
+ # DM's validates_confirmation_of requires the confirmation field to be present,
+ # while ActiveModel by default skips the confirmation test if the confirmation
+ # value is nil. This test takes advantage of AM's behavior, so just add the
+ # :password_confirmation value.
+ def update_password_confirmation
+ if self.password && self.password_confirmation.nil?
+ self.password_confirmation = self.password
end
end
end