Skip to content

Instantly share code, notes, and snippets.

@jroes
Created May 3, 2010 22:36
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 jroes/388670 to your computer and use it in GitHub Desktop.
Save jroes/388670 to your computer and use it in GitHub Desktop.
irb(main):010:0> @trip.stops
~ (0.000097) SELECT "id", "trip_id", "place_id" FROM "stops" WHERE "trip_id" = 19 ORDER BY "id"
=> [#<Stop @id=28 @trip_id=19 @place_id=28>, #<Stop @id=29 @trip_id=19 @place_id=29>, #<Stop @id=30 @trip_id=19 @place_id=30>]
irb(main):011:0> @trip.stops[-1..1]
=> []
#expected last 2:
=> [#<Stop @id=29 @trip_id=19 @place_id=29>, #<Stop @id=30 @trip_id=19 @place_id=30>]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment