Created
July 2, 2015 07:01
-
-
Save dnsilva/0e2b6a11f4acd30e492a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@shops = Shop.includes(concept: [:chain]).where(where_clause_map).order("#{attribute} #{ordering}").limit(params[:rowCount]).offset(offset) | |
Where: | |
Shop includes concept and in turn concept includes chain | |
and | |
where_clause_map looks like: {"id" => "[1,2]", "shop_concepts" => "1" ,"shop_chains.id"=> "1"} | |
NOTE: Using an array as in: "id" => "[1,2]" , causes the query to run as id IN (1, 2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment