lib/sequel/plugins/devise.rb in sequel-devise-0.0.4 vs lib/sequel/plugins/devise.rb in sequel-devise-0.0.5

- old
+ new

@@ -12,11 +12,11 @@ def changed? # For rememberable !changed_columns.empty? end def email_changed? # For validatable - column_changed? :email + new? || column_changed?(:email) end def email_was # For confirmable column_changes[:email].first end @@ -25,10 +25,14 @@ def assign_attributes(hash) set hash end def update_attributes(hash, *ignored) - update hash + begin + update hash + rescue Sequel::ValidationFailed + return false + end end end module ClassMethods Model::HOOKS.each do |hook|