Created
September 3, 2014 21:27
-
-
Save andreasronge/704077a5caa8024b172d 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
# Lets find me: | |
me = Human.where(name: 'andreas').first | |
# And my posh cat: | |
dutchess = me.pets.where(character: 'posh').first | |
# And find all cat owners that have a posh cat mummy: | |
Cat.as(:c).where("c.character='posh'").kittens(:k).owner.first # => me | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment