Sha256: 4c70ed8f3f9a307f74d8821e00e973edc829815a9ff49d14bbf8865a635f78d5
Contents?: true
Size: 552 Bytes
Versions: 8
Compression:
Stored size: 552 Bytes
Contents
require 'motorhead/engine' module RoadCrew class Engine < ::Rails::Engine include Motorhead::Engine active_if { true } mount_at 'motorhead/road_crew' Motorhead::Engine::ClassMethods.class_eval do # overwrite active? to check cookie value as well 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 end end end
Version data entries
8 entries across 8 versions & 1 rubygems