mirror of
https://github.com/kaminari/kaminari.git
synced 2022-11-09 13:44:37 -05:00
Move Active Record extension code to kaminari-activerecord gem
This commit is contained in:
parent
427d8fa1a5
commit
18b6b50c99
6 changed files with 15 additions and 7 deletions
|
@ -1,4 +1,5 @@
|
|||
require "kaminari/activerecord/version"
|
||||
require 'kaminari/activerecord/railtie'
|
||||
|
||||
module Kaminari
|
||||
module Activerecord
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
require 'kaminari/models/active_record_model_extension'
|
||||
require 'kaminari/activerecord/active_record_model_extension'
|
||||
|
||||
module Kaminari
|
||||
module ActiveRecordExtension
|
|
@ -1,4 +1,4 @@
|
|||
require 'kaminari/models/active_record_relation_methods'
|
||||
require 'kaminari/activerecord/active_record_relation_methods'
|
||||
|
||||
module Kaminari
|
||||
module ActiveRecordModelExtension
|
12
kaminari-activerecord/lib/kaminari/activerecord/railtie.rb
Normal file
12
kaminari-activerecord/lib/kaminari/activerecord/railtie.rb
Normal file
|
@ -0,0 +1,12 @@
|
|||
module Kaminari
|
||||
module ActiveRecord
|
||||
class Railtie < ::Rails::Railtie #:nodoc:
|
||||
initializer 'kaminari-activerecord' do
|
||||
ActiveSupport.on_load :active_record do
|
||||
require 'kaminari/activerecord/active_record_extension'
|
||||
::ActiveRecord::Base.send :include, Kaminari::ActiveRecordExtension
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,11 +1,6 @@
|
|||
module Kaminari
|
||||
class Hooks
|
||||
def self.init
|
||||
ActiveSupport.on_load(:active_record) do
|
||||
require 'kaminari/models/active_record_extension'
|
||||
::ActiveRecord::Base.send :include, Kaminari::ActiveRecordExtension
|
||||
end
|
||||
|
||||
require 'kaminari/models/array_extension'
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue