Sha256: 251ed197e6eb6616bdfda5a2ad955ed459755542d9476f606f64ce82ce4193ad

Contents?: true

Size: 530 Bytes

Versions: 2

Compression:

Stored size: 530 Bytes

Contents

module Paginary
  class Railtie < Rails::Railtie
    initializer "paginary.query_methods" do
      ActiveSupport.on_load(:active_record) do
        ActiveRecord::Relation.send :include, Paginary::Relation::QueryMethods
        ActiveRecord::Base.singleton_class.delegate :paginate, :paginated?, :to => :scoped
      end
    end
    
    initializer "paginary.pagination_helper" do
      ActiveSupport.on_load(:action_view) do
        ActionView::Base.send :include, Paginary::Helpers::PaginationHelper
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
paginary-0.0.1.pre2 lib/paginary/railtie.rb
paginary-0.0.1.pre1 lib/paginary/railtie.rb