Sha256: 20c6186cd81862e1930e518ea39e1fec448a32593b27cd536894a91daeacdf0c

Contents?: true

Size: 357 Bytes

Versions: 1

Compression:

Stored size: 357 Bytes

Contents

# A percentage of flaggable records of a given class may be flagged into a feature
# with this class.
class Detour::PercentageFlag < Detour::Flag
  validates :percentage,
    presence: true,
    numericality: { greater_than: 0, less_than_or_equal_to: 100 }

  validates :feature_id, uniqueness: { scope: :flaggable_type }

  attr_accessible :percentage
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
detour-0.0.1 lib/detour/percentage_flag.rb