Skip to content

Instantly share code, notes, and snippets.

@smcabrera
Created October 30, 2015 22:29
Show Gist options
  • Select an option

  • Save smcabrera/767567ac9edda2bb82f8 to your computer and use it in GitHub Desktop.

Select an option

Save smcabrera/767567ac9edda2bb82f8 to your computer and use it in GitHub Desktop.
properties_by_chains = @@clients_properties_data[:property_chain_codes].map do |chain_id|
  Property.unscoped.joins(:property_chain).where(property_chains: {code: chain_id})
end.flatten

(property_group.properties + properties_by_chains).uniq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment