I have a model in which I have implemented a method that returns a set of records. Is it possible refer them in Arel?
class A < ActiveRecord::Base
#associations here
def self.mymeth
#return a set of records based on a query
B.select(col).joins(:cs).where(some_condition)
end
end
class B < ActiveRecord::Base
#associations here
end
class C < ActiveRecord::Base
#associations here
end
Now how can I refer mymeth to something like
A.joins(:mymeth).where(condition).count