Skip to content

Instantly share code, notes, and snippets.

@thedelchop
Created January 6, 2011 03:18
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 thedelchop/767453 to your computer and use it in GitHub Desktop.
Save thedelchop/767453 to your computer and use it in GitHub Desktop.
Using the default profile...
...Member
SELECT "events".* FROM "events" WHERE "events"."event_type" = 'second' AND ("events"."member_id" = 1298)
Motion
SELECT "events".* FROM "events" WHERE "events"."event_type" = 'second' AND ("events"."member_id" = 1298) AND ("events"."motion_id" = 788)
...Member
SELECT "events".* FROM "events" WHERE "events"."event_type" = 'second' AND ("events"."member_id" = 1296)
.Member
SELECT "events".* FROM "events" WHERE "events"."event_type" = 'second' AND ("events"."member_id" = 1296)
Motion
SELECT "events".* FROM "events" WHERE "events"."event_type" = 'second' AND ("events"."member_id" = 1296) AND ("events"."motion_id" = 788)
Member
SELECT "events".* FROM "events" WHERE "events"."event_type" = 'second' AND ("events"."member_id" = 1296)
# @return [ActiveRecord::Relation] All of the seconds cast in support of this motion
def seconds
puts self.class
puts events.seconds.to_sql
events.seconds
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment