Reputation: 5840
If I have 2 scopes for Product class, I can do like this.
Product.best.sale #retrieves best and sale
For some reason, I have 2 seperated scopes like the following.
a = Product.best
b = Product.sale
a.b #ERROR
I tried a.b and it gives an error.
How do I combine a and b to get the Product.best.sale?
Thanks.
Sam
Upvotes: 1
Views: 819
Reputation: 124469
When assigning b
, you should be chaining the scope onto a
, not a new Product
call:
a = Product.best
b = a.sale
a.b
# => Retrieves best and sale
Upvotes: 4