Using scope, defined in parent model, inside it's child (STI pattern)
- by Anton
I implement a class hierarchy using STI pattern
class A
scope :aaa, where([someField]:[someValue])
end
class B < A
end
The problem is that when I try to call something like:
B.limit(5).aaa
=> SELECT "[table]".* FROM "[table]" WHERE "[table]"."type" IN ('A') AND ([someField] = [someValue]) LIMIT 5
So I am getting 5 objects of type A,…