lib/omniauth/identity/models/sequel.rb in omniauth-identity-3.0.4 vs lib/omniauth/identity/models/sequel.rb in omniauth-identity-3.0.5
- old
+ new
@@ -4,10 +4,13 @@
module OmniAuth
module Identity
module Models
# http://sequel.jeremyevans.net/ an SQL ORM
+ # NOTE: Sequel is *not* based on ActiveModel, but supports the API we need, except for `persisted`:
+ # * create
+ # * save, but save is deprecated in favor of `save_changes`
module Sequel
def self.included(base)
base.class_eval do
# NOTE: Using the deprecated :validations_class_methods because it defines
# validates_confirmation_of, while current :validation_helpers does not.
@@ -26,9 +29,17 @@
validates_uniqueness_of :key, case_sensitive: false
end
def self.locate(search_hash)
where(search_hash).first
+ end
+
+ def persisted?
+ exists?
+ end
+
+ def save
+ save_changes
end
end
end
end
end