Skip to content

Commit a60a01c

Browse files
committed
Enable the cache based on Rails app config
1 parent 0a9c22f commit a60a01c

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

config/quickdraw.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class App < Rails::Application
1616
config.secret_key_base = "secret-key"
1717
config.action_dispatch.show_exceptions = :rescuable
1818
config.active_support.to_time_preserves_timezone = :zone
19+
config.action_controller.perform_caching = true
1920

2021
routes.append do
2122
resources :posts

lib/phlex/rails/sgml.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ def render(renderable = nil, &block)
104104
end
105105
end
106106

107+
def low_level_cache(*, **, &block)
108+
Rails.application.config.action_controller.perform_caching ? super : yield
109+
end
110+
107111
def render_in(view_context, &erb)
108112
case view_context
109113
when defined?(ViewComponent::Base) && ViewComponent::Base

0 commit comments

Comments
 (0)