Say you have a scope in an Active Record model like:
scope :published, -> { where(published: true) }
And for some reason you want the scope to be applied to all the queries in a
block, you need to use scoping
:
Model.published.scoping do
Model.first # will use the scope
end
Because doing this is essentially useless:
Model.published do
Model.first # will use the scope
end