Skip to content

Conversation

@jusleg
Copy link

@jusleg jusleg commented Mar 19, 2025

Previously, block was only able to be configured via the first scope definition. If it was redefined to add a scope or change the scope, it wouldn't get configured due to the conditional assignment operator. The current limitation is that we cannot unset the block if it's set in a parent. The only way to do it would be to pass an empty block.

has_scope :some_scope do |controller, scope|
  scope.something(...)
end

# overwritten block for scope
has_scope :some_scope { # no-op }

Previously, block was only able to be configured via the first scope
definition. If it was redefined to add a scope or change the scope, it
wouldn't get configured due to the conditional assignment operator.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant