Sha256: 2bdd389f94ada02e567922755e386106fb40d71a7b5ec1b2eea265c31d52212e

Contents?: true

Size: 265 Bytes

Versions: 7

Compression:

Stored size: 265 Bytes

Contents

module Antispam
  class Ip < ApplicationRecord
    after_initialize :set_default_expires_at
    def expired?
      self.expires_at < Time.now
    end
    private
    def set_default_expires_at
      self.expires_at ||= 24.hours.from_now
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
antispam-0.2.11 app/models/antispam/ip.rb
antispam-0.2.10 app/models/antispam/ip.rb
antispam-0.2.8 app/models/antispam/ip.rb
antispam-0.2.6 app/models/antispam/ip.rb
antispam-0.2.5 app/models/antispam/ip.rb
antispam-0.2.4 app/models/antispam/ip.rb
antispam-0.2.3 app/models/antispam/ip.rb