Sha256: a65eac8e532285644974adfa98f8a37b0e1cef6abbbf4a625023d97fdcd6d800

Contents?: true

Size: 346 Bytes

Versions: 10

Compression:

Stored size: 346 Bytes

Contents

module DceLti
  class Nonce < ActiveRecord::Base
    def self.clean
      delete_all(['created_at < ?', Time.now - 6.hours])
    end

    def self.valid?(nonce)
      begin
        self.create!(nonce: nonce)
        true
      rescue => e
        Rails.logger.warn(%Q|Creating nonce failed: "#{nonce}"|)
        false
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
dce_lti-0.6.1 app/models/dce_lti/nonce.rb
dce_lti-0.6.0 app/models/dce_lti/nonce.rb
dce_lti-0.5.4 app/models/dce_lti/nonce.rb
dce_lti-0.5.3 app/models/dce_lti/nonce.rb
dce_lti-0.5.2 app/models/dce_lti/nonce.rb
dce_lti-0.5.1 app/models/dce_lti/nonce.rb
dce_lti-0.5.0 app/models/dce_lti/nonce.rb
dce_lti-0.4.0 app/models/dce_lti/nonce.rb
dce_lti-0.3.0 app/models/dce_lti/nonce.rb
dce_lti-0.2.0 app/models/dce_lti/nonce.rb