Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/geared_pagination/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class GearedPagination::Engine < ::Rails::Engine
initializer :geared_pagination do |app|
ActiveSupport.on_load :action_controller do
ActionController::Base.send :include, GearedPagination::Controller
ActionController::API.send :include, GearedPagination::Controller
end
end
end
5 changes: 5 additions & 0 deletions test/controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ class GearedPagination::ControllerTest < ActionController::TestCase
assert_nil response.headers["Link"]
end

test "works in both full and api only applications" do
assert_includes ActionController::Base.ancestors, GearedPagination::Controller
assert_includes ActionController::API.ancestors, GearedPagination::Controller
end

private
def etag_for(*keys)
%(W/"#{ActiveSupport::Digest.hexdigest(ActiveSupport::Cache.expand_cache_key(keys))}")
Expand Down