Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include Caching module for ActionController::API #36038

Merged
merged 1 commit into from
Apr 22, 2019
Merged
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 actionpack/lib/action_controller/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ def self.without_modules(*modules)
ApiRendering,
Renderers::All,
ConditionalGet,
Caching,
BasicImplicitRender,
StrongParameters,

Expand Down
13 changes: 13 additions & 0 deletions railties/test/application/configuration_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2216,6 +2216,19 @@ class Post < ActiveRecord::Base
assert_equal :default, Rails.configuration.debug_exception_response_format
end

test "action_controller.cache_store works for api_only app as well" do
add_to_config <<-RUBY
config.api_only = true
config.action_controller.cache_store = :memory_store
RUBY

app "development"

api_controller = Class.new(ActionController::API)

assert_equal(api_controller.cache_store.class, ActiveSupport::Cache::MemoryStore)
end

test "controller force_ssl declaration can be used even if session_store is disabled" do
make_basic_app do |application|
application.config.session_store :disabled
Expand Down