Skip to content

Instantly share code, notes, and snippets.

@jagmitg
Created March 30, 2012 00:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jagmitg/2245081 to your computer and use it in GitHub Desktop.
Save jagmitg/2245081 to your computer and use it in GitHub Desktop.
ruby-1.9.2-p290 :006 > screening = Screening.find_by_id(2)
Screening Load (0.8ms) SELECT "screenings".* FROM "screenings" WHERE "screenings"."id" = 2 LIMIT 1
=> #<Screening id: 2, cinema_id: 1, film_id: 2>
ruby-1.9.2-p290 :007 > screening.cinema
Cinema Load (10.9ms) SELECT "cinemas".* FROM "cinemas" WHERE "cinemas"."id" = 1 LIMIT 1
=> #<Cinema id: 1, name: "Cineworld Aberdeen", url: "Queens Link Leisure Park, Links Road, Aberdeen", postcode: "AB24 5EN", telephone: "0871 200 2000", created_at: "2012-03-29 21:33:25", updated_at: "2012-03-29 21:33:27", external_id: 1>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment