Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sql = "#select count(1)
- select f.id, fcp.price, fcp.wholesale_price, fc.name, ct.id, f.number
- from fabric_collections fc
- inner join fabric_collection_prices fcp on fc.id = fcp.fabric_collection_id
- inner join clothes_types ct on fcp.clothes_type_id = ct.id
- inner join fabric_fabric_collections ffc on fc.id = ffc.fabric_collection_id
- inner join fabrics f on f.id = ffc.fabric_id
- where (fc.id in (#{fabric_collection_ids.join(', ')})) and (fcp.currency_id = #{currency_id})
- order by f.id, ct.id"
- result_lines = ActiveRecord::Base.connection.execute(sql)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement