A Spree addon adds a scope. Let's say:
class Product
scope :in_sale, -> { where(in_sale: true) }
end
Note that the actual scope is slightly more complex.
Now, I want to override that in my decorator:
Spree::Product.class_eval do
scope :in_sale, -> { on_hand.where(in_sale: true) }
end
Instead of the copied over original implementation of .where(in_sale: true)
, I would prefer to call the original.
How can you re-use an original scope, somewhat similar to how you would normally call alias_method_chain :foo, :feature
for instance-methods?