has_scope icon indicating copy to clipboard operation
has_scope copied to clipboard

Support overwriting scope blocks

Open jusleg opened this issue 9 months ago • 0 comments

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 }

jusleg avatar Mar 19 '25 19:03 jusleg