Sha256: e8159801e9b74af71589c382e16b44ad6502ae34d30cc2d151fad1761de60cbd

Contents?: true

Size: 1.71 KB

Versions: 3

Compression:

Stored size: 1.71 KB

Contents

module RailsCoreExtensions
  require 'rails_core_extensions/sortable'
  require 'rails_core_extensions/position_initializer'
  require 'rails_core_extensions/time_with_zone'
  require 'rails_core_extensions/transfer_records'

  require 'rails_core_extensions/railtie' if defined?(Rails)

  if defined? ActionController
    require 'rails_core_extensions/activatable'
    require 'rails_core_extensions/action_controller_sortable'

    ActiveSupport.on_load(:action_controller) do
      ActionController::Base.send(:include, Activatable)
      ActionController::Base.send(:include, ActionControllerSortable)
    end
  end

  if defined? ActionView
    require 'rails_core_extensions/action_view_extensions'
    require 'rails_core_extensions/action_view_has_many_extensions'

    ActiveSupport.on_load(:action_view) do
      ActionView::Base.send(:include, RailsCoreExtensions::ActionViewExtensions)
    end
  end

  if defined? ActiveRecord
    require 'rails_core_extensions/active_record_cloning'
    require 'rails_core_extensions/active_record_extensions'
    require 'rails_core_extensions/active_record_liquid_extensions'
    require 'rails_core_extensions/translations'
    require 'rails_core_extensions/active_model_extensions'

    ActiveSupport.on_load(:active_record) do
      ActiveRecord::Base.send(:include, ActiveRecordCloning)
      ActiveRecord::Base.send(:include, ActiveRecordExtensions)
      ActiveRecord::Base.send(:include, RailsCoreExtensions::ActiveRecordLiquidExtensions)
      ActiveRecord::Base.send(:include, ActiveRecordExtensions::InstanceMethods)
      ActiveRecord::Base.send(:include, RailsCoreExtensions::Translations)
      ActiveRecord::Base.send(:include, ActiveModelExtensions::Validations)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rails_core_extensions-0.15.0 lib/rails_core_extensions.rb
rails_core_extensions-0.14.0 lib/rails_core_extensions.rb
rails_core_extensions-0.13.2 lib/rails_core_extensions.rb