Sha256: b95a8099413076e2ff069a3c3d386f9bb1aa6d99e3eef06bb43d393a168bba2f

Contents?: true

Size: 940 Bytes

Versions: 6

Compression:

Stored size: 940 Bytes

Contents

module NoNotifierNeeded
  class Railtie < Rails::Railtie
    initializer "Include code in controller" do
      ActiveSupport.on_load(:active_record) do
        require File.expand_path('../../../initializers/hotpatches/subclasses',  __FILE__)
      end

      ActiveSupport.on_load(:action_controller) do
        require File.expand_path('../../../initializers/notifier',  __FILE__)

        #Pass defaults to allow for this to work
        Notifier.send(:include, Rails.application.routes.url_helpers) # brings ActionDispatch::Routing::UrlFor
        Notifier.send(:include, ActionView::Helpers::UrlHelper)
        Notifier.send(:include, ActionView::Helpers::TextHelper)
        Notifier.send(:include, ActionView::Helpers::TagHelper)

        Notifier.send(:include, NoNotifierNeeded::Render)
        Notifier.send(:include, NoNotifierNeeded::Translate)
        Notifier.send(:extend, NoNotifierNeeded::Send)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
no_notifier_needed-2.0.4 lib/no_notifier_needed/railtie.rb
no_notifier_needed-2.0.3 lib/no_notifier_needed/railtie.rb
no_notifier_needed-2.0.2 lib/no_notifier_needed/railtie.rb
no_notifier_needed-2.0.1 lib/no_notifier_needed/railtie.rb
no_notifier_needed-2.0.0 lib/no_notifier_needed/railtie.rb
no_notifier_needed-1.0.0 lib/no_notifier_needed/railtie.rb