Sha256: 3e431f1894b9e3c3e6230896987bf1aa437b49604f196b994d0b4ff479a5c48f
Contents?: true
Size: 690 Bytes
Versions: 6
Compression:
Stored size: 690 Bytes
Contents
module CoalescingPanda class LtiAccount < ActiveRecord::Base validates :name, :key, uniqueness: true validates :name, :key, :secret, presence: true has_many :coalescing_panda_lti_nonces, :foreign_key => :coalescing_panda_lti_account_id, :class_name => 'CoalescingPanda::LtiNonce' serialize :settings def validate_nonce(nonce, timestamp) cleanup_nonce if timestamp > 15.minutes.ago coalescing_panda_lti_nonces.create(nonce: nonce, timestamp: timestamp).persisted? end end private def cleanup_nonce coalescing_panda_lti_nonces.where('timestamp > ?', 15.minutes.ago).delete_all end end end
Version data entries
6 entries across 6 versions & 1 rubygems