Sha256: 3b1f443b9d52419f0bd7f642de7d10dc780e32863ae1437613832e18a81bd3e0

Contents?: true

Size: 391 Bytes

Versions: 6

Compression:

Stored size: 391 Bytes

Contents

module FeatureGate
  class GatedFeature < ActiveRecord::Base
    validates :name, presence: true
    validates :gated, inclusion: { in: [true, false] }

    scope :opened, -> { where(gated: false) }
    scope :closed, -> { where(gated: true) }

    def deploy_feature!
      self.gated = false
      save!
    end

    def gate_feature!
      self.gated = true
      save!
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
feature_gate-0.1.3 app/models/feature_gate/gated_feature.rb
feature_gate-0.1.2 app/models/feature_gate/gated_feature.rb
feature_gate-0.1.1 app/models/feature_gate/gated_feature.rb
feature_gate-0.1.0 app/models/feature_gate/gated_feature.rb
feature_gate-0.0.9 app/models/feature_gate/gated_feature.rb
feature_gate-0.0.8 app/models/feature_gate/gated_feature.rb