search for: v1_orders

Displaying 1 result from an estimated 1 matches for "v1_orders".

2013 Feb 18
6
How to clear ActiveRecord query cache on associations with dynamic table
...e thread conditions. I''ve tackled some caveats yet - will post a blog about it soon - but there''s one I need help with. Consider 2 models that are associated: Order and OrderLine where Order has many order_lines. Now we set the table names for them: Order.table_name=''v1_orders'' OrderLine.table_name=''v1_order_lines'' Query: OrderLine.joins(:order).where(Order.table_name=>{:customer_id=>1}).all Result: Select v1_order_lines.* FROM v1_order_lines INNER JOIN v1_orders ON v1_orders.id=v1_order_lines.order_id WHERE v1_orders.customer_id=1 So...