Say I have a hash like so
attributes = {"brown" => true, "black" => false, "rocky" => true, "pebbles" => false, "beige" => true, "white" => false, "red" => true, "pink" => "true" }
And I have an model Beach
where I want to query for the properties in the hash
Beach.where(attributes)
I believe this joins the hash attributes with the AND
clause brown is true AND black is false AND rocky = true.
I need to join the hash attributes with the OR
condition brown is true OR black is false OR rocky is true
. Any Ideas? Thank you!