Module: Arturo::ControllerFilters::ClassMethods

Defined in:
lib/arturo/controller_filters.rb

Instance Method Summary collapse

Instance Method Details

#require_feature(name, options = {}) ⇒ Object


22
23
24
25
26
27
28
29
# File 'lib/arturo/controller_filters.rb', line 22

def require_feature(name, options = {})
  method = respond_to?(:before_action) ? :before_action : :before_filter
  send(method, options) do |controller|
    unless controller.feature_enabled?(name)
      controller.on_feature_disabled(name)
    end
  end
end