Displaying 1 result from an estimated 1 matches for "average_discount".
2010 Nov 03
0
Accessing (updating?) the proxy_scope chain for named_scope (Rails 2.3.x)
...ood. However in a couple of cases where:
1. The named scope is actually a correlated subquery and I need to
pass additional scope into it sometimes.
2. Where the presence of a named scope in the chain should change the
behaviour of a named_scope later in the chain
Given: Product.price.volume.average_discount
I''d like the named_scope :average_discount to be able to reach back in
the proxy chain to see if :price is part of the chain (its an example
only, not the actual use case ). And potentially ''adjust'' it.
#scoped_methods isn''t it - that''s populated only...