Skip to content

Instantly share code, notes, and snippets.

@LNA
Last active August 29, 2015 14:18
Show Gist options
  • Save LNA/f01586198068b9f4a033 to your computer and use it in GitHub Desktop.
Save LNA/f01586198068b9f4a033 to your computer and use it in GitHub Desktop.
Search values of Large Query
students = YogaStudent.find(:all, :limit => 10)
# will return an array with 10 random yoga student records
ashtanga_students = students.select { |student| student[:xml].match(/ashtanga/) }
# will look only at the xml keys to match ashtanga in the values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment