Skip to content

Commit dc2b035

Browse files
Fix rsc_support_enabled? to return explicit boolean values
Fix the rsc_support_enabled? method to return true/false instead of nil when enable_rsc_support is false or nil. Issue: The expression `respond_to?(:enable_rsc_support) && enable_rsc_support` returns nil when enable_rsc_support is falsy, not an explicit false. Solution: Use double bang (!!) to coerce the result to a boolean: `respond_to?(:enable_rsc_support) && !!enable_rsc_support` This fixes 3 failing tests: - ReactOnRailsPro::Utils.rsc_support_enabled? when RSC support is enabled - ReactOnRailsPro::Utils.rsc_support_enabled? when RSC support is disabled - ReactOnRailsPro::Utils cache helpers .bundle_hash and .bundle_file_name 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 4c02413 commit dc2b035

File tree

1 file changed

+1
-1
lines changed
  • react_on_rails_pro/lib/react_on_rails_pro

1 file changed

+1
-1
lines changed

react_on_rails_pro/lib/react_on_rails_pro/utils.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def self.rsc_support_enabled?
5151
return @rsc_support_enabled if defined?(@rsc_support_enabled)
5252

5353
rorp_config = ReactOnRailsPro.configuration
54-
@rsc_support_enabled = rorp_config.respond_to?(:enable_rsc_support) && rorp_config.enable_rsc_support
54+
@rsc_support_enabled = rorp_config.respond_to?(:enable_rsc_support) && !!rorp_config.enable_rsc_support
5555
end
5656

5757
# Validates the license and raises an exception if invalid.

0 commit comments

Comments
 (0)