Skip to content

Enable the cache based on Rails app config #280

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

Merged
merged 1 commit into from
Mar 17, 2025
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 config/quickdraw.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class App < Rails::Application
config.secret_key_base = "secret-key"
config.action_dispatch.show_exceptions = :rescuable
config.active_support.to_time_preserves_timezone = :zone
config.action_controller.perform_caching = true

routes.append do
resources :posts
Expand Down
4 changes: 4 additions & 0 deletions lib/phlex/rails/sgml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ def render(renderable = nil, &block)
end
end

def low_level_cache(...)
Rails.application.config.action_controller.perform_caching ? super : yield
end

def render_in(view_context, &erb)
case view_context
when defined?(ViewComponent::Base) && ViewComponent::Base
Expand Down