lib/feature_gate.rb in feature_gate-0.0.4 vs lib/feature_gate.rb in feature_gate-0.0.5
- old
+ new
@@ -7,8 +7,15 @@
# Yield self on setup for nice config blocks
def self.setup
yield self
end
+
+ def self.gate(name)
+ gated_feature = GatedFeature.where(name: name).first_or_create
+ if !gated_feature.gated?
+ yield
+ end
+ end
end
require 'feature_gate/engine'