Skip to content

Commit

Permalink
Merge pull request #36038 from st0012/fix-35602
Browse files Browse the repository at this point in the history
Include Caching module for ActionController::API
  • Loading branch information
guilleiguaran committed Apr 22, 2019
2 parents 45a6cf3 + 7814d1c commit 216ef01
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions actionpack/lib/action_controller/api.rb
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
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

0 comments on commit 216ef01

Please sign in to comment.