Sha256: de7e09a1ee3aefdd0cf070dd439fa7c3f0ae9a8310889a284c01bc0fca48ba6d
Contents?: true
Size: 652 Bytes
Versions: 2
Compression:
Stored size: 652 Bytes
Contents
module Juscribe # :nodoc: module TosAcceptable extend ActiveSupport::Concern included do validates :terms_of_service, acceptance: { accept: true } attr_accessor :tos_accepted, :tos_accepted_at end def tos_accepted=(val) self.tos_accepted_at = Time.now end def tos_accepted_at=(timestamp) write_attribute(:tos_accepted_at, timestamp) if has_attribute?(:tos_accepted_at) @_tos_accepted_at = timestamp end def tos_accepted? @_tos_accepted_at.try(:<, Time.now) end alias_method :tos_accepted, :tos_accepted? alias_method :terms_of_service, :tos_accepted? end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
personhood-0.2.0 | lib/juscribe/tos_acceptable.rb |
personhood-0.1.2 | lib/juscribe/tos_acceptable.rb |