has_scope
has_scope copied to clipboard
Support overwriting scope blocks
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 }