Add feature toggle helper, allow hash or string queries

This commit is contained in:
Rohan Mitchell
2016-08-03 12:50:26 +10:00
parent 23827d6c57
commit 87e063593a
2 changed files with 4 additions and 1 deletions

View File

@@ -1,6 +1,9 @@
module ApplicationHelper
include FoundationRailsHelper::FlashHelper
def feature?(feature)
OpenFoodNetwork::FeatureToggle.enabled? feature
end
def ng_form_for(name, *args, &block)
options = args.extract_options!

View File

@@ -1,7 +1,7 @@
module OpenFoodNetwork
class FeatureToggle
def self.enabled? feature
features[feature]
features.with_indifferent_access[feature]
end
private