app/models/unidom/visitor/authenticating.rb in unidom-visitor-0.1.2 vs app/models/unidom/visitor/authenticating.rb in unidom-visitor-0.2
- old
+ new
@@ -10,9 +10,12 @@
belongs_to :credential, polymorphic: true
scope :visitor_is, ->(visitor) { where visitor: visitor }
scope :credential_is, ->(credential) { where credential: credential }
+ scope :visitor_type_is, ->(visitor_type) { where visitor_type: visitor_type }
+ scope :credential_type_is, ->(credential_type) { where credential_type: credential_type }
+
include Unidom::Common::Concerns::ModelExtension
def self.authenticate(visitor, credential)
self.create! visitor: visitor, credential: credential, opened_at: Time.now
end