Sha256: e2b73059d50006024c155c1503d37d441d4e0c7b5c5da1943fcd600fd3f50ce2
Contents?: true
Size: 523 Bytes
Versions: 15
Compression:
Stored size: 523 Bytes
Contents
module Wobauth class Authority < ActiveRecord::Base # -- associations belongs_to :authorizable, polymorphic: true belongs_to :role belongs_to :authorized_for, polymorphic: true, optional: true # -- configuration # -- validations and callbacks validates :authorizable_id, :authorizable_type, :role_id, presence: true scope :valid, ->(date) { where('(valid_until >= ? OR valid_until is NULL) AND (valid_from <= ? OR valid_from is NULL)', date, date) } end end
Version data entries
15 entries across 15 versions & 1 rubygems