Sha256: 70c7ca62ec7ef077d969475d24053152b257597f9e0eb7d1ab200f92214d4e16

Contents?: true

Size: 1017 Bytes

Versions: 10

Compression:

Stored size: 1017 Bytes

Contents

module Daddy
  module Rails
    class Railtie < ::Rails::Railtie
      config.before_configuration do
        if config.action_view.javascript_expansions
          config.action_view.javascript_expansions[:defaults] |= ['daddy']
        end
      end
  
      initializer 'active_record_extension' do
        ActiveSupport.on_load :active_record do
          require 'daddy/models/crud_extension'
          require 'daddy/models/query_extension'
          ActiveRecord::Base.send(:include, Daddy::Models::CrudExtension)
          ActiveRecord::Base.send(:include, Daddy::Models::QueryExtension)
        end
      end

      initializer 'carrierwave' do
        if defined?(CarrierWave)
          ::Rails.logger.info '[daddy] loading carrierwave uploader'
          require 'daddy/uploader'
        end
      end

      initializer 'sidekiq' do
        if defined?(Sidekiq)
          ::Rails.logger.info '[daddy] loading sidekiq configuration'
          require 'daddy/sidekiq'
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
daddy-0.9.9 lib/daddy/rails/railtie.rb
daddy-0.9.8 lib/daddy/rails/railtie.rb
daddy-0.9.7 lib/daddy/rails/railtie.rb
daddy-0.9.6 lib/daddy/rails/railtie.rb
daddy-0.9.5 lib/daddy/rails/railtie.rb
daddy-0.9.4 lib/daddy/rails/railtie.rb
daddy-0.9.3 lib/daddy/rails/railtie.rb
daddy-0.9.2 lib/daddy/rails/railtie.rb
daddy-0.9.1 lib/daddy/rails/railtie.rb
daddy-0.9.0 lib/daddy/rails/railtie.rb