ruby on rails - In Spree admin how could I pull in all orders completed for a state? -


i'm trying create custom report , want pull in completed orders specific state.

something like:

orders = spree::order.complete.for_state("utah")

how this?

the part confuses me fact state 3 part assocoation.

order has_one ship_address, address instance, belongs_to state.

try this:

spree::order.complete.joins(:bill_address).where("state_name = 'utah'") spree::order.complete.joins(:ship_address).where("state_name = 'utah'") 

depending on 1 looking for.


Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -