I'm experiencing strange behaviour with mongomapper scope concatenation.
Below an example.
I have two scopes:
scope :active, where(
:name =>
{
:$in =>
Model2.active.distinct(:city)
}
)
scope :by_htype_id, lambda{|htype_id|
where(
:name =>
{
:$in =>
Model2.by_htype_id(htype_id).distinct(:city)
}
)
}
If I run
Model1.by_htype_id("some_id")
it works as expected
but if I concatenate the two scopes Model1.active.by_htype_id("some_id")
I obtain all the result from the active scope while I would expect to obtain the subset of active scope that depends on by_htype_id
--
You received this message because you are subscribed to the Google
Groups "MongoMapper" group.
For more options, visit this group at
http://groups.google.com/group/mongomapper?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups "MongoMapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongomapper...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On Jun 13, 2017, at 4:52 PM, Andrea Cirulli <acir...@gmail.com> wrote: