Sha256: 9d03b9ba739691abc0bbfa8fd20c0494dd9c59451539284cb74c212c661609cc
Contents?: true
Size: 707 Bytes
Versions: 2
Compression:
Stored size: 707 Bytes
Contents
require 'rubycas/server/activerecord/model/ticket' #require 'rubycas/server/activerecord/model/consumable' module RubyCAS::Server::Core::Tickets class ServiceTicket < ActiveRecord::Base include RubyCAS::Server::Core::Ticket #include RubyCAS::Server::Core::Consumable has_one :proxy_granting_ticket belongs_to :ticket_granting_ticket validates :ticket, :service, :ticket_granting_ticket_id, presence: true def expired?(max_lifetime) lifetime = Time.now.to_i - created_at.to_time.to_i lifetime > max_lifetime end def consumed? consumed.nil? ? false : true end def consume! self.consumed = Time.zone.now self.save end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rubycas-server-activerecord-0.0.3 | lib/rubycas/server/activerecord/model/service_ticket.rb |
rubycas-server-activerecord-0.0.2 | lib/rubycas/server/activerecord/model/service_ticket.rb |