Guard defining ComponentPreviewController on feature flag#7200
Guard defining ComponentPreviewController on feature flag#7200zachmargolis merged 7 commits intomainfrom
Conversation
**Why**: we avoid loading lookbook gem unless the feature flag is on, so the classes to subclass and the mixins will fail due to load errors **How**: I went with the sneaky trailing if to minimize diff noise
tomas-nava
left a comment
There was a problem hiding this comment.
🤯 that's a new trick to me! I might suggest adding a comment to explain why it's there, but functionally looks good to me.
[skip changelog]
trailing if statements work on blocks! so even |
|
I'm seeing a different error when testing this locally:
|
|
class ComponentPreviewController < ViewComponentsController
if IdentityConfig.store.component_previews_enabled
# ...
end
endOr, could it make sense to add a |
Oh yeah I like that better than my first instinct, 5603a0a, so I updated to do this in 5031d89. I thought loading |
Co-authored-by: Andrew Duthie <andrew.duthie@gsa.gov>
🎫 Ticket
slack discussion of error
🛠 Summary of changes
Why: we avoid loading lookbook gem unless the feature flag is on, so the classes to subclass and the mixins will fail due to load errors
How: I went with the sneaky trailing if to minimize diff noise
📜 Testing Plan