1
0
Fork 0
mirror of https://github.com/kaminari/kaminari.git synced 2022-11-09 13:44:37 -05:00

stop abusing bang method

This commit is contained in:
Akira Matsuda 2012-05-21 20:04:27 +09:00
parent c3223aaacd
commit 3d9ecb4dd1
5 changed files with 5 additions and 5 deletions

View file

@ -31,7 +31,7 @@ require 'kaminari/models/page_scope_methods'
require 'kaminari/models/configuration_methods'
require 'kaminari/hooks'
# if not using Railtie, call `Kaminari::Hooks.init!` directly
# if not using Railtie, call `Kaminari::Hooks.init` directly
if defined? Rails
require 'kaminari/railtie'
require 'kaminari/engine'

View file

@ -1,4 +1,4 @@
require 'grape'
require 'kaminari'
Kaminari::Hooks.init!
Kaminari::Hooks.init

View file

@ -1,6 +1,6 @@
module Kaminari
class Hooks
def self.init!
def self.init
ActiveSupport.on_load(:active_record) do
require 'kaminari/models/active_record_extension'
::ActiveRecord::Base.send :include, Kaminari::ActiveRecordExtension

View file

@ -1,7 +1,7 @@
module Kaminari
class Railtie < ::Rails::Railtie #:nodoc:
initializer 'kaminari' do |_app|
Kaminari::Hooks.init!
Kaminari::Hooks.init
end
end
end

View file

@ -2,4 +2,4 @@ require 'sinatra/base'
require 'kaminari'
require 'kaminari/helpers/sinatra_helpers'
Kaminari::Hooks.init!
Kaminari::Hooks.init