Sha256: 9aa4d24a5795c3cdb1e571f671b3bb7269ec720fdcf7f73378734015fdcf2318

Contents?: true

Size: 772 Bytes

Versions: 10

Compression:

Stored size: 772 Bytes

Contents

module CanTango
  module ClassMethods
    # Engine hook
    # Run after the initializers are ran for all Railties (including the application itself), but before eager loading and the middleware stack is built. 
    # More importantly, will run upon every request in development, but only once (during boot-up) in production and test.
    def to_prepare
      config.hook(:to_prepare).call if config.hook(:to_prepare)
    end

    # engine hook, run after all Rails initializations have been executed
    def after_initialize
      config.hook(:after_initialize).call if config.hook(:after_initialize)
    end

    def debug!
      config.debug.set :on
    end

    def debug_off!
      config.debug.set :off
    end

    def debug?
      config.debug.on?
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
cantango-config-0.1.9.2 lib/cantango/class_methods.rb
cantango-config-0.1.8.1 lib/cantango/class_methods.rb
cantango-config-0.1.8 lib/cantango/class_methods.rb
cantango-config-0.1.7 lib/cantango/class_methods.rb
cantango-config-0.1.6 lib/cantango/class_methods.rb
cantango-config-0.1.5 lib/cantango/class_methods.rb
cantango-config-0.1.4 lib/cantango/class_methods.rb
cantango-config-0.1.3 lib/cantango/class_methods.rb
cantango-config-0.1.2 lib/cantango/class_methods.rb
cantango-config-0.1.1 lib/cantango/class_methods.rb