Skip to content

Instantly share code, notes, and snippets.

@heynemann
Created May 15, 2009 03:08
Show Gist options
  • Save heynemann/112040 to your computer and use it in GitHub Desktop.
Save heynemann/112040 to your computer and use it in GitHub Desktop.
From(collection)
.where("item.some_boolean or (item.other_boolean and item.another_boolean)")
.order_by("item.some_order_property")
.select("name","age","sex","salary")
# This query returns a new collection transformed from the original.
# The items in this new collection are from a class called
# Dynamic_Item and feature only the four selected properties,
# instead of all the properties of the original items in 'collection'.
# The where clause is observed as well, since only the items that
# the given clause evaluates to true are returned.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment