Sha256: abfdc5b5ac5b10d6893150a768b8c5967984a1cfd604df79f7e435684dc2be8c

Contents?: true

Size: 387 Bytes

Versions: 1

Compression:

Stored size: 387 Bytes

Contents

# A percentage of flaggable records of a given class may be flagged into a feature
# with this class.
class ActiveRecord::Rollout::PercentageFlag < ActiveRecord::Rollout::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
active_record_rollout-0.0.1 lib/active_record/rollout/percentage_flag.rb