class RoadCrew::Engine

Public Instance Methods

active?(controller) click to toggle source

overwrite active? to check cookie value as well

# File lib/motorhead/road_crew/lib/road_crew/engine.rb, line 14
def active?(controller)
  if (settings = controller.send(:cookies)['road_crew_engine_settings'])
    return false if JSON.parse(settings)[controller.class.parent.name] == '0'
  end
  controller.instance_eval(&@active_if)
end