So basically I have a class MyClass that includes a concern MyConcern with an included scope 'foo'. I want to be able to override the scope 'foo' in MyClass, but still be able to call the overriden scope in MyConcern.
module MyConcern {
extend ActiveSupport::Concern
included do
scope :foo, lambda{ |x|
puts "Hello"
}
end
}
class MyClass {
include MyConcern
scope :foo, lambda{ |x|
MyConcern.foo(x)
puts " World"
}
}
So when I call @myClass.foo(1) where @myClass is an instance of MyClass, I should be able to see "Hello World" printed out.
A similar thread that I could find was Calling super in overriden scope defined in concern, but unfortunately I am unable to use regular class methods in my case.
Any help will be appreciated!