Skip to content

Commit

Permalink
simplify railtie; remove unnecessary requires
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Jul 26, 2011
1 parent 9ca8715 commit 87d0dba
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
10 changes: 3 additions & 7 deletions lib/will_paginate/railtie.rb
Expand Up @@ -3,20 +3,16 @@

module WillPaginate
class Railtie < Rails::Railtie
initializer "will_paginate.active_record" do |app|
initializer "will_paginate" do |app|
ActiveSupport.on_load :active_record do
require 'will_paginate/finders/active_record'
WillPaginate::Finders::ActiveRecord.enable!
end
end

initializer "will_paginate.action_dispatch" do |app|

ActiveSupport.on_load :action_controller do
ActionDispatch::ShowExceptions.rescue_responses['WillPaginate::InvalidPage'] = :not_found
end
end

initializer "will_paginate.action_view" do |app|

ActiveSupport.on_load :action_view do
require 'will_paginate/view_helpers/action_view'
include WillPaginate::ViewHelpers::ActionView
Expand Down
2 changes: 0 additions & 2 deletions lib/will_paginate/view_helpers/action_view.rb
@@ -1,6 +1,4 @@
require 'will_paginate/view_helpers/base'
require 'action_view'
require 'action_pack/version'
require 'will_paginate/view_helpers/link_renderer'

module WillPaginate
Expand Down
1 change: 0 additions & 1 deletion spec/finders/activerecord_test_connector.rb
@@ -1,5 +1,4 @@
require 'active_record'
require 'active_record/version'
require 'active_record/fixtures'
require 'active_support/multibyte' # needed for Ruby 1.9.1

Expand Down

0 comments on commit 87d0dba

Please sign in to comment.