I have a pretty complex query split using several dataset modules. I'm 
trying to go all sequel

This section 

disabled_custom_product_id = 
Sequel[:disabled_custom_products_locations][:custom_product_id]
calculated_available_column = Sequel.case(
{ { id: disabled_custom_product_id } => false }, true
)
select_append(calculated_available_column.as(:available))

Generates the following SQL

(CASE WHEN ("id" = 
"disabled_custom_products_locations"."custom_product_id") THEN false ELSE 
true END) AS "available" 

But I need to generate the following

(CASE WHEN ("id" = "disabled_custom_products_locations"."custom_product_id" 
AND "disabled_custom_products_locations"."location_id" = 2) THEN false ELSE 
true END) AS "available" 

So far I've been unsucesful in trying to get the AND recognized with my 
syntax so I'd appreciate any insights

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sequel-talk/b047772f-a9c7-44e8-ac27-0e3f280441dbn%40googlegroups.com.

Reply via email to