Skip to content

Update section.rb to fix boolean defaults#243

Open
greyskin wants to merge 1 commit intolocomotivecms:masterfrom
greyskin:sections-boolean-default-fix
Open

Update section.rb to fix boolean defaults#243
greyskin wants to merge 1 commit intolocomotivecms:masterfrom
greyskin:sections-boolean-default-fix

Conversation

@greyskin
Copy link

The use of ||= drops defaults when they're explicitly false. As a result, boolean defaults assigned to false are never set in the final settings hash. That omission means section.settings.setting_enabled returns nil instead of false.

The use of `||=` drops defaults when they're explicitly false. As a result, boolean defaults assigned to `false` are never set in the final settings hash. That omission means `section.settings.setting_enabled` returns `nil` instead of `false`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant