Skip to content
Browse files

simplify railtie; remove unnecessary requires

  • Loading branch information...
1 parent 9ca8715 commit 87d0dbacebcfd54b610c126a2d88d1997325af7c @mislav committed Jul 26, 2011
View
10 lib/will_paginate/railtie.rb
@@ -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
View
2 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
View
1 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

0 comments on commit 87d0dba

Please sign in to comment.
Something went wrong with that request. Please try again.