Sha256: 8820ef1236713c87634f9fc02afa4e113c1d9a06875a5ce96e41a8449da4a0b3

Contents?: true

Size: 401 Bytes

Versions: 2

Compression:

Stored size: 401 Bytes

Contents

# Ensures that a feature will never be available to the associated record,
# even in the case of, for example, a 100% flag.
class Detour::OptOutFlag < Detour::Flag
  include Detour::Concerns::CountableFlag

  belongs_to :flaggable, polymorphic: true

  validates_presence_of   :flaggable
  validates_uniqueness_of :feature_id, scope: [:flaggable_type, :flaggable_id]

  attr_accessible :flaggable
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
detour-0.0.3 app/models/detour/opt_out_flag.rb
detour-0.0.2 app/models/detour/opt_out_flag.rb