Class: ModelTimeline::Railtie
- Inherits:
-
Rails::Railtie
- Object
- Rails::Railtie
- ModelTimeline::Railtie
- Defined in:
- lib/model_timeline/railtie.rb
Overview
Rails integration for ModelTimeline. This Railtie automatically integrates ModelTimeline with Rails by:
- Including the Timelineable module in all ActiveRecord models
- Making controller helper methods available in all ActionControllers
Instance Method Summary collapse
-
#initializer(name, &block) ⇒ void
Initializes ModelTimeline by including necessary modules in Rails components.
Instance Method Details
#initializer(name, &block) ⇒ void
This method returns an undefined value.
Initializes ModelTimeline by including necessary modules in Rails components. Called automatically when Rails loads.
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/model_timeline/railtie.rb', line 21 initializer 'model_timeline.initialize' do ActiveSupport.on_load(:active_record) do include Timelineable end ActiveSupport.on_load(:action_controller) do include ControllerAdditions::ClassMethods end config.to_prepare do ModelTimeline::Timelineable.clear_loggers! end end |