Sha256: aa1c719607e2f7cbcc29aa9b38af6552bb3fbb986710dcc4faf6017bc4eb00fd

Contents?: true

Size: 557 Bytes

Versions: 18

Compression:

Stored size: 557 Bytes

Contents

module Unidom::Visitor::Concerns::AsIdentity

  extend ActiveSupport::Concern

  included do |includer|

    has_many :identificatings, class_name: 'Unidom::Visitor::Identificating', as: :identity

    def identificate!(it, at: Time.now)
      identificatings.create! visitor: it, opened_at: at
    end

    def identificate?(it, at: Time.now)
      query = identificatings
      query = query.visitor_is it      if it.present?
      query = query.valid_at   now: at if at.present?
      query.alive.exists?
    end

  end

  module ClassMethods
  end

end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
unidom-visitor-1.13.8 app/models/unidom/visitor/concerns/as_identity.rb
unidom-visitor-1.13.7 app/models/unidom/visitor/concerns/as_identity.rb
unidom-visitor-1.13.6 app/models/unidom/visitor/concerns/as_identity.rb
unidom-visitor-1.13.5 app/models/unidom/visitor/concerns/as_identity.rb
unidom-visitor-1.13.4 app/models/unidom/visitor/concerns/as_identity.rb
unidom-visitor-1.13.3 app/models/unidom/visitor/concerns/as_identity.rb
unidom-visitor-1.13.2 app/models/unidom/visitor/concerns/as_identity.rb
unidom-visitor-1.13.1 app/models/unidom/visitor/concerns/as_identity.rb
unidom-visitor-1.13 app/models/unidom/visitor/concerns/as_identity.rb
unidom-visitor-1.12.4 app/models/unidom/visitor/concerns/as_identity.rb
unidom-visitor-1.12.3 app/models/unidom/visitor/concerns/as_identity.rb
unidom-visitor-1.12.1 app/models/unidom/visitor/concerns/as_identity.rb
unidom-visitor-1.12 app/models/unidom/visitor/concerns/as_identity.rb
unidom-visitor-1.11.2 app/models/unidom/visitor/concerns/as_identity.rb
unidom-visitor-1.11.1 app/models/unidom/visitor/concerns/as_identity.rb
unidom-visitor-1.11 app/models/unidom/visitor/concerns/as_identity.rb
unidom-visitor-1.10 app/models/unidom/visitor/concerns/as_identity.rb
unidom-visitor-1.9 app/models/unidom/visitor/concerns/as_identity.rb