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