news_feed 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,4 +4,8 @@ class NewsFeedEvent < ActiveRecord::Base
4
4
  :sender_id, :sender_type, :recipient_id, :recipient_type
5
5
 
6
6
  validates_presence_of :recipient_id, :recipient_type
7
+
8
+ def event_type_object
9
+ event_type.to_s + event_object_type.to_s
10
+ end
7
11
  end
@@ -30,10 +30,11 @@ module NewsFeed
30
30
  if self.object_name.present?
31
31
  object_title = self.object_name
32
32
  end
33
+
33
34
  text = generate_text(event_name, actor_name(actor, recipient), object_class,
34
- object_title, recipient_name(actor, recipient))
35
+ object_title, recipient_name(actor, recipient), options)
35
36
 
36
- options = {
37
+ event_options = {
37
38
  text: text,
38
39
  event_object_type: self.class.name,
39
40
  event_object_id: self.id,
@@ -43,7 +44,7 @@ module NewsFeed
43
44
  recipient_id: recipient.id,
44
45
  recipient_type: recipient.class.name
45
46
  }
46
- NewsFeedEvent.create!(options)
47
+ NewsFeedEvent.create!(event_options)
47
48
  end
48
49
  end
49
50
 
@@ -1,6 +1,6 @@
1
1
  module NewsFeed
2
2
  module NewsFeedEvents
3
- def generate_text(event_name, actor_name, object_class, object_title, recipient_name = nil)
3
+ def generate_text(event_name, actor_name, object_class, object_title, recipient_name = nil, options = {})
4
4
  # event_name is what the cases will check for
5
5
  # actor_name is the user object that performs the action
6
6
  # object_class is the class of the object of interest
@@ -19,6 +19,12 @@ module NewsFeed
19
19
  when :Send
20
20
  I18n.t('news_feeds.send_object', actor: actor_name.to_s, object_class: object_class,
21
21
  object_name: object_title, recipient_name: recipient_name)
22
+ when :Custom
23
+ if options.nil?
24
+ raise "Custom Message must be specified"
25
+ else
26
+ options
27
+ end
22
28
  else
23
29
  raise "event_name is undefined"
24
30
  end
@@ -1,3 +1,3 @@
1
1
  module NewsFeed
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -1,6 +1,6 @@
1
1
  module NewsFeed
2
2
  module NewsFeedEvents
3
- def generate_text(event_name, actor_name, object_class, object_title, recipient_name = nil)
3
+ def generate_text(event_name, actor_name, object_class, object_title, recipient_name = nil, options = {})
4
4
  # event_name is what the cases will check for
5
5
  # actor_name is the user object that performs the action
6
6
  # object_class is the class of the object of interest
@@ -19,6 +19,12 @@ module NewsFeed
19
19
  when :Send
20
20
  I18n.t('news_feeds.send_object', actor: actor_name.to_s, object_class: object_class,
21
21
  object_name: object_title, recipient_name: recipient_name)
22
+ when :Custom
23
+ if options.nil?
24
+ raise "Custom Message must be specified"
25
+ else
26
+ options
27
+ end
22
28
  else
23
29
  raise "event_name is undefined"
24
30
  end
@@ -1598,3 +1598,827 @@ Connecting to database specified by database.yml
1598
1598
  SQL (0.3ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Thu, 09 Aug 2012 04:36:06 UTC +00:00], ["event_object_id", 10], ["event_object_type", "User"], ["event_type", :Update], ["recipient_id", 10], ["recipient_type", "User"], ["sender_id", 10], ["sender_type", 0], ["text", "You have updated a User: Bob Smith"], ["updated_at", Thu, 09 Aug 2012 04:36:06 UTC +00:00]]
1599
1599
   (0.0ms) commit transaction
1600
1600
  NewsFeedEvent Load (0.1ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 10 ORDER BY "news_feed_events"."id" DESC LIMIT 1
1601
+ Connecting to database specified by database.yml
1602
+  (1.5ms) select sqlite_version(*)
1603
+  (0.4ms) CREATE TABLE "messages" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
1604
+  (0.1ms) CREATE TABLE "news_feed" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" text, "object_id" integer, "object_type" varchar(255), "event_type" varchar(255), "sender_id" integer, "timestamp" datetime) 
1605
+  (0.2ms) CREATE TABLE "news_feed_events" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" text, "event_object_id" integer, "event_object_type" varchar(255), "event_type" varchar(255), "sender_id" integer, "sender_type" integer, "recipient_id" integer, "recipient_type" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
1606
+  (0.1ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
1607
+  (0.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
1608
+  (0.0ms) PRAGMA index_list("schema_migrations")
1609
+  (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
1610
+  (0.0ms) SELECT version FROM "schema_migrations"
1611
+  (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('1')
1612
+  (0.1ms) begin transaction
1613
+  (0.1ms) rollback transaction
1614
+  (0.0ms) begin transaction
1615
+ SQL (6.9ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:20:32 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:20:32 UTC +00:00]]
1616
+  (0.0ms) commit transaction
1617
+  (0.1ms) begin transaction
1618
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:20:32 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:20:32 UTC +00:00]]
1619
+  (0.0ms) commit transaction
1620
+  (0.1ms) begin transaction
1621
+ SQL (0.5ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:20:32 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:20:32 UTC +00:00]]
1622
+  (0.1ms) commit transaction
1623
+  (0.1ms) begin transaction
1624
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:20:32 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:20:32 UTC +00:00]]
1625
+  (0.0ms) commit transaction
1626
+  (0.0ms) begin transaction
1627
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:20:32 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:20:32 UTC +00:00]]
1628
+  (0.0ms) commit transaction
1629
+  (0.0ms) begin transaction
1630
+ SQL (0.2ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:20:32 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:20:32 UTC +00:00]]
1631
+  (0.1ms) commit transaction
1632
+  (0.1ms) begin transaction
1633
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:20:32 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:20:32 UTC +00:00]]
1634
+  (0.0ms) commit transaction
1635
+  (0.1ms) begin transaction
1636
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:20:32 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:20:32 UTC +00:00]]
1637
+  (0.0ms) commit transaction
1638
+  (0.0ms) begin transaction
1639
+ SQL (0.2ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:20:32 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:20:32 UTC +00:00]]
1640
+  (0.0ms) commit transaction
1641
+  (0.1ms) begin transaction
1642
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:20:32 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:20:32 UTC +00:00]]
1643
+  (0.0ms) commit transaction
1644
+  (0.0ms) begin transaction
1645
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:20:32 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:20:32 UTC +00:00]]
1646
+  (0.0ms) commit transaction
1647
+  (0.0ms) begin transaction
1648
+ SQL (0.2ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:20:32 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:20:32 UTC +00:00]]
1649
+  (0.0ms) commit transaction
1650
+  (0.1ms) begin transaction
1651
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:20:32 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:20:32 UTC +00:00]]
1652
+  (0.0ms) commit transaction
1653
+  (0.0ms) begin transaction
1654
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:20:32 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:20:32 UTC +00:00]]
1655
+  (0.0ms) commit transaction
1656
+  (0.0ms) begin transaction
1657
+ SQL (0.1ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:20:32 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:20:32 UTC +00:00]]
1658
+  (0.0ms) commit transaction
1659
+ Connecting to database specified by database.yml
1660
+  (2.2ms) select sqlite_version(*)
1661
+  (0.6ms) CREATE TABLE "messages" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
1662
+  (0.2ms) CREATE TABLE "news_feed" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" text, "object_id" integer, "object_type" varchar(255), "event_type" varchar(255), "sender_id" integer, "timestamp" datetime) 
1663
+  (0.2ms) CREATE TABLE "news_feed_events" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" text, "event_object_id" integer, "event_object_type" varchar(255), "event_type" varchar(255), "sender_id" integer, "sender_type" integer, "recipient_id" integer, "recipient_type" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
1664
+  (0.2ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
1665
+  (0.2ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
1666
+  (0.0ms) PRAGMA index_list("schema_migrations")
1667
+  (0.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
1668
+  (0.1ms) SELECT version FROM "schema_migrations"
1669
+  (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('1')
1670
+  (0.1ms) begin transaction
1671
+  (0.0ms) rollback transaction
1672
+  (0.1ms) begin transaction
1673
+ SQL (4.5ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00]]
1674
+  (0.1ms) commit transaction
1675
+  (0.0ms) begin transaction
1676
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00]]
1677
+  (0.0ms) commit transaction
1678
+  (0.1ms) begin transaction
1679
+ SQL (0.3ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00]]
1680
+  (0.0ms) commit transaction
1681
+  (0.1ms) begin transaction
1682
+ SQL (0.4ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00], ["event_object_id", 1], ["event_object_type", "Message"], ["event_type", :Create], ["recipient_id", 1], ["recipient_type", "User"], ["sender_id", 2], ["sender_type", 0], ["text", "Bob Smith has created a Message: Message Title"], ["updated_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00]]
1683
+  (0.0ms) commit transaction
1684
+ NewsFeedEvent Load (0.2ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 1 ORDER BY "news_feed_events"."id" DESC LIMIT 1
1685
+ NewsFeedEvent Load (0.1ms) SELECT "news_feed_events".* FROM "news_feed_events" ORDER BY "news_feed_events"."id" DESC LIMIT 1
1686
+  (0.0ms) begin transaction
1687
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00]]
1688
+  (0.0ms) commit transaction
1689
+  (0.0ms) begin transaction
1690
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00]]
1691
+  (0.0ms) commit transaction
1692
+  (0.0ms) begin transaction
1693
+ SQL (0.1ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00]]
1694
+  (0.0ms) commit transaction
1695
+  (0.0ms) begin transaction
1696
+ SQL (0.2ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00], ["event_object_id", 2], ["event_object_type", "Message"], ["event_type", :Delete], ["recipient_id", 3], ["recipient_type", "User"], ["sender_id", 4], ["sender_type", 0], ["text", "Bob Smith has deleted a Message: Message Title"], ["updated_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00]]
1697
+  (0.0ms) commit transaction
1698
+ NewsFeedEvent Load (0.1ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 3 ORDER BY "news_feed_events"."id" DESC LIMIT 1
1699
+  (0.0ms) begin transaction
1700
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00]]
1701
+  (0.0ms) commit transaction
1702
+  (0.0ms) begin transaction
1703
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00]]
1704
+  (0.0ms) commit transaction
1705
+  (0.0ms) begin transaction
1706
+ SQL (0.1ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00]]
1707
+  (0.0ms) commit transaction
1708
+  (0.0ms) begin transaction
1709
+ SQL (0.2ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00], ["event_object_id", 3], ["event_object_type", "Message"], ["event_type", :Delete], ["recipient_id", 5], ["recipient_type", "User"], ["sender_id", 6], ["sender_type", 0], ["text", "Bob Smith has deleted a Message: Message Title"], ["updated_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00]]
1710
+  (0.0ms) commit transaction
1711
+  (0.0ms) begin transaction
1712
+ SQL (0.2ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00], ["event_object_id", 3], ["event_object_type", "Message"], ["event_type", :Create], ["recipient_id", 5], ["recipient_type", "User"], ["sender_id", 6], ["sender_type", 0], ["text", "Bob Smith has created a Message: Message Title"], ["updated_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00]]
1713
+  (0.0ms) commit transaction
1714
+  (0.1ms) SELECT COUNT(*) FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 5
1715
+  (0.0ms) begin transaction
1716
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00]]
1717
+  (0.0ms) commit transaction
1718
+  (0.0ms) begin transaction
1719
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00]]
1720
+  (0.0ms) commit transaction
1721
+  (0.0ms) begin transaction
1722
+ SQL (0.1ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00]]
1723
+  (0.0ms) commit transaction
1724
+  (0.0ms) begin transaction
1725
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00]]
1726
+  (0.0ms) commit transaction
1727
+  (0.0ms) begin transaction
1728
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00]]
1729
+  (0.0ms) commit transaction
1730
+  (0.0ms) begin transaction
1731
+ SQL (0.1ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00]]
1732
+  (0.0ms) commit transaction
1733
+  (0.0ms) begin transaction
1734
+ SQL (0.2ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00], ["event_object_id", 10], ["event_object_type", "User"], ["event_type", :Update], ["recipient_id", 10], ["recipient_type", "User"], ["sender_id", 10], ["sender_type", 0], ["text", "You have updated a User: Bob Smith"], ["updated_at", Fri, 10 Aug 2012 06:21:08 UTC +00:00]]
1735
+  (0.0ms) commit transaction
1736
+ NewsFeedEvent Load (0.1ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 10 ORDER BY "news_feed_events"."id" DESC LIMIT 1
1737
+ Connecting to database specified by database.yml
1738
+  (1.7ms) select sqlite_version(*)
1739
+  (0.4ms) CREATE TABLE "messages" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
1740
+  (0.2ms) CREATE TABLE "news_feed" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" text, "object_id" integer, "object_type" varchar(255), "event_type" varchar(255), "sender_id" integer, "timestamp" datetime) 
1741
+  (0.2ms) CREATE TABLE "news_feed_events" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" text, "event_object_id" integer, "event_object_type" varchar(255), "event_type" varchar(255), "sender_id" integer, "sender_type" integer, "recipient_id" integer, "recipient_type" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
1742
+  (0.2ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
1743
+  (0.2ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
1744
+  (0.0ms) PRAGMA index_list("schema_migrations")
1745
+  (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
1746
+  (0.1ms) SELECT version FROM "schema_migrations"
1747
+  (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('1')
1748
+  (0.1ms) begin transaction
1749
+  (0.1ms) rollback transaction
1750
+  (0.1ms) begin transaction
1751
+ SQL (5.8ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:21:56 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:21:56 UTC +00:00]]
1752
+  (0.1ms) commit transaction
1753
+  (0.1ms) begin transaction
1754
+ SQL (0.3ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:21:56 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:21:56 UTC +00:00]]
1755
+  (0.1ms) commit transaction
1756
+  (0.1ms) begin transaction
1757
+ SQL (0.3ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:21:56 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:21:56 UTC +00:00]]
1758
+  (0.0ms) commit transaction
1759
+  (0.1ms) begin transaction
1760
+ SQL (0.5ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00], ["event_object_id", 1], ["event_object_type", "Message"], ["event_type", :Create], ["recipient_id", 1], ["recipient_type", "User"], ["sender_id", 2], ["sender_type", 0], ["text", "Bob Smith has created a Message: Message Title"], ["updated_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00]]
1761
+  (0.1ms) commit transaction
1762
+ NewsFeedEvent Load (0.3ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 1 ORDER BY "news_feed_events"."id" DESC LIMIT 1
1763
+ NewsFeedEvent Load (0.1ms) SELECT "news_feed_events".* FROM "news_feed_events" ORDER BY "news_feed_events"."id" DESC LIMIT 1
1764
+  (0.1ms) begin transaction
1765
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00]]
1766
+  (0.0ms) commit transaction
1767
+  (0.0ms) begin transaction
1768
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00]]
1769
+  (0.0ms) commit transaction
1770
+  (0.0ms) begin transaction
1771
+ SQL (0.2ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00]]
1772
+  (0.0ms) commit transaction
1773
+  (0.0ms) begin transaction
1774
+ SQL (0.2ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00], ["event_object_id", 2], ["event_object_type", "Message"], ["event_type", :Delete], ["recipient_id", 3], ["recipient_type", "User"], ["sender_id", 4], ["sender_type", 0], ["text", "Bob Smith has deleted a Message: Message Title"], ["updated_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00]]
1775
+  (0.0ms) commit transaction
1776
+ NewsFeedEvent Load (0.2ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 3 ORDER BY "news_feed_events"."id" DESC LIMIT 1
1777
+  (0.0ms) begin transaction
1778
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00]]
1779
+  (0.0ms) commit transaction
1780
+  (0.0ms) begin transaction
1781
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00]]
1782
+  (0.0ms) commit transaction
1783
+  (0.0ms) begin transaction
1784
+ SQL (0.1ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00]]
1785
+  (0.0ms) commit transaction
1786
+  (0.0ms) begin transaction
1787
+ SQL (0.2ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00], ["event_object_id", 3], ["event_object_type", "Message"], ["event_type", :Delete], ["recipient_id", 5], ["recipient_type", "User"], ["sender_id", 6], ["sender_type", 0], ["text", "Bob Smith has deleted a Message: Message Title"], ["updated_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00]]
1788
+  (0.0ms) commit transaction
1789
+  (0.0ms) begin transaction
1790
+ SQL (0.2ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00], ["event_object_id", 3], ["event_object_type", "Message"], ["event_type", :Create], ["recipient_id", 5], ["recipient_type", "User"], ["sender_id", 6], ["sender_type", 0], ["text", "Bob Smith has created a Message: Message Title"], ["updated_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00]]
1791
+  (0.1ms) commit transaction
1792
+  (0.1ms) SELECT COUNT(*) FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 5
1793
+  (0.0ms) begin transaction
1794
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00]]
1795
+  (0.0ms) commit transaction
1796
+  (0.0ms) begin transaction
1797
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00]]
1798
+  (0.0ms) commit transaction
1799
+  (0.0ms) begin transaction
1800
+ SQL (0.1ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00]]
1801
+  (0.0ms) commit transaction
1802
+  (0.0ms) begin transaction
1803
+ SQL (0.2ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00], ["event_object_id", 4], ["event_object_type", "Message"], ["event_type", :Custom], ["recipient_id", 7], ["recipient_type", "User"], ["sender_id", 8], ["sender_type", 0], ["text", "This is my custom message!"], ["updated_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00]]
1804
+  (0.0ms) commit transaction
1805
+  (0.0ms) begin transaction
1806
+ SQL (0.9ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00], ["event_object_id", 4], ["event_object_type", "Message"], ["event_type", :Custom], ["recipient_id", 8], ["recipient_type", "User"], ["sender_id", 8], ["sender_type", 0], ["text", {:text=>"This is my custom message!", :event_object_type=>"Message", :event_object_id=>4, :event_type=>:Custom, :sender_id=>8, :sender_type=>"User", :recipient_id=>7, :recipient_type=>"User"}], ["updated_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00]]
1807
+  (0.0ms) commit transaction
1808
+ NewsFeedEvent Load (0.2ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 7 ORDER BY "news_feed_events"."id" DESC LIMIT 1
1809
+  (0.1ms) begin transaction
1810
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00]]
1811
+  (0.1ms) commit transaction
1812
+  (0.0ms) begin transaction
1813
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00]]
1814
+  (0.1ms) commit transaction
1815
+  (0.0ms) begin transaction
1816
+ SQL (0.2ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00]]
1817
+  (0.1ms) commit transaction
1818
+  (0.1ms) begin transaction
1819
+ SQL (0.3ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00], ["event_object_id", 10], ["event_object_type", "User"], ["event_type", :Update], ["recipient_id", 10], ["recipient_type", "User"], ["sender_id", 10], ["sender_type", 0], ["text", "You have updated a User: Bob Smith"], ["updated_at", Fri, 10 Aug 2012 06:21:57 UTC +00:00]]
1820
+  (0.1ms) commit transaction
1821
+ NewsFeedEvent Load (0.2ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 10 ORDER BY "news_feed_events"."id" DESC LIMIT 1
1822
+ Connecting to database specified by database.yml
1823
+  (2.8ms) select sqlite_version(*)
1824
+  (0.7ms) CREATE TABLE "messages" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
1825
+  (0.3ms) CREATE TABLE "news_feed" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" text, "object_id" integer, "object_type" varchar(255), "event_type" varchar(255), "sender_id" integer, "timestamp" datetime) 
1826
+  (0.3ms) CREATE TABLE "news_feed_events" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" text, "event_object_id" integer, "event_object_type" varchar(255), "event_type" varchar(255), "sender_id" integer, "sender_type" integer, "recipient_id" integer, "recipient_type" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
1827
+  (0.3ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
1828
+  (0.2ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
1829
+  (0.1ms) PRAGMA index_list("schema_migrations")
1830
+  (0.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
1831
+  (0.1ms) SELECT version FROM "schema_migrations"
1832
+  (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('1')
1833
+  (0.1ms) begin transaction
1834
+  (0.1ms) rollback transaction
1835
+  (0.1ms) begin transaction
1836
+ SQL (5.8ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00]]
1837
+  (0.1ms) commit transaction
1838
+  (0.1ms) begin transaction
1839
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00]]
1840
+  (0.0ms) commit transaction
1841
+  (0.1ms) begin transaction
1842
+ SQL (0.4ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00]]
1843
+  (0.1ms) commit transaction
1844
+  (0.1ms) begin transaction
1845
+ SQL (0.4ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00], ["event_object_id", 1], ["event_object_type", "Message"], ["event_type", :Create], ["recipient_id", 1], ["recipient_type", "User"], ["sender_id", 2], ["sender_type", 0], ["text", "Bob Smith has created a Message: Message Title"], ["updated_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00]]
1846
+  (0.0ms) commit transaction
1847
+ NewsFeedEvent Load (0.2ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 1 ORDER BY "news_feed_events"."id" DESC LIMIT 1
1848
+ NewsFeedEvent Load (0.1ms) SELECT "news_feed_events".* FROM "news_feed_events" ORDER BY "news_feed_events"."id" DESC LIMIT 1
1849
+  (0.1ms) begin transaction
1850
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00]]
1851
+  (0.0ms) commit transaction
1852
+  (0.0ms) begin transaction
1853
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00]]
1854
+  (0.0ms) commit transaction
1855
+  (0.0ms) begin transaction
1856
+ SQL (0.1ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00]]
1857
+  (0.0ms) commit transaction
1858
+  (0.0ms) begin transaction
1859
+ SQL (0.2ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00], ["event_object_id", 2], ["event_object_type", "Message"], ["event_type", :Delete], ["recipient_id", 3], ["recipient_type", "User"], ["sender_id", 4], ["sender_type", 0], ["text", "Bob Smith has deleted a Message: Message Title"], ["updated_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00]]
1860
+  (0.0ms) commit transaction
1861
+ NewsFeedEvent Load (0.1ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 3 ORDER BY "news_feed_events"."id" DESC LIMIT 1
1862
+  (0.0ms) begin transaction
1863
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00]]
1864
+  (0.0ms) commit transaction
1865
+  (0.0ms) begin transaction
1866
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00]]
1867
+  (0.0ms) commit transaction
1868
+  (0.0ms) begin transaction
1869
+ SQL (0.1ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00]]
1870
+  (0.0ms) commit transaction
1871
+  (0.0ms) begin transaction
1872
+ SQL (0.2ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00], ["event_object_id", 3], ["event_object_type", "Message"], ["event_type", :Delete], ["recipient_id", 5], ["recipient_type", "User"], ["sender_id", 6], ["sender_type", 0], ["text", "Bob Smith has deleted a Message: Message Title"], ["updated_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00]]
1873
+  (0.0ms) commit transaction
1874
+  (0.0ms) begin transaction
1875
+ SQL (0.2ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00], ["event_object_id", 3], ["event_object_type", "Message"], ["event_type", :Create], ["recipient_id", 5], ["recipient_type", "User"], ["sender_id", 6], ["sender_type", 0], ["text", "Bob Smith has created a Message: Message Title"], ["updated_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00]]
1876
+  (0.0ms) commit transaction
1877
+  (0.1ms) SELECT COUNT(*) FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 5
1878
+  (0.0ms) begin transaction
1879
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00]]
1880
+  (0.0ms) commit transaction
1881
+  (0.0ms) begin transaction
1882
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00]]
1883
+  (0.0ms) commit transaction
1884
+  (0.0ms) begin transaction
1885
+ SQL (0.1ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00]]
1886
+  (0.0ms) commit transaction
1887
+  (0.0ms) begin transaction
1888
+ SQL (0.2ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00], ["event_object_id", 4], ["event_object_type", "Message"], ["event_type", :Custom], ["recipient_id", 7], ["recipient_type", "User"], ["sender_id", 8], ["sender_type", 0], ["text", "This is my custom message!"], ["updated_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00]]
1889
+  (0.0ms) commit transaction
1890
+  (0.0ms) begin transaction
1891
+ SQL (0.7ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00], ["event_object_id", 4], ["event_object_type", "Message"], ["event_type", :Custom], ["recipient_id", 8], ["recipient_type", "User"], ["sender_id", 8], ["sender_type", 0], ["text", {:text=>"This is my custom message!", :event_object_type=>"Message", :event_object_id=>4, :event_type=>:Custom, :sender_id=>8, :sender_type=>"User", :recipient_id=>7, :recipient_type=>"User"}], ["updated_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00]]
1892
+  (0.0ms) commit transaction
1893
+ NewsFeedEvent Load (0.1ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 7 ORDER BY "news_feed_events"."id" DESC LIMIT 1
1894
+ NewsFeedEvent Load (0.1ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 8 ORDER BY "news_feed_events"."id" DESC LIMIT 1
1895
+  (0.0ms) begin transaction
1896
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00]]
1897
+  (0.0ms) commit transaction
1898
+  (0.0ms) begin transaction
1899
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00]]
1900
+  (0.1ms) commit transaction
1901
+  (0.0ms) begin transaction
1902
+ SQL (0.1ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00]]
1903
+  (0.0ms) commit transaction
1904
+  (0.1ms) begin transaction
1905
+ SQL (0.2ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00], ["event_object_id", 10], ["event_object_type", "User"], ["event_type", :Update], ["recipient_id", 10], ["recipient_type", "User"], ["sender_id", 10], ["sender_type", 0], ["text", "You have updated a User: Bob Smith"], ["updated_at", Fri, 10 Aug 2012 06:23:47 UTC +00:00]]
1906
+  (0.0ms) commit transaction
1907
+ NewsFeedEvent Load (0.1ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 10 ORDER BY "news_feed_events"."id" DESC LIMIT 1
1908
+ Connecting to database specified by database.yml
1909
+  (1.5ms) select sqlite_version(*)
1910
+  (0.4ms) CREATE TABLE "messages" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
1911
+  (0.1ms) CREATE TABLE "news_feed" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" text, "object_id" integer, "object_type" varchar(255), "event_type" varchar(255), "sender_id" integer, "timestamp" datetime) 
1912
+  (0.2ms) CREATE TABLE "news_feed_events" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" text, "event_object_id" integer, "event_object_type" varchar(255), "event_type" varchar(255), "sender_id" integer, "sender_type" integer, "recipient_id" integer, "recipient_type" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
1913
+  (0.2ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
1914
+  (0.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
1915
+  (0.0ms) PRAGMA index_list("schema_migrations")
1916
+  (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
1917
+  (0.0ms) SELECT version FROM "schema_migrations"
1918
+  (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('1')
1919
+  (0.2ms) begin transaction
1920
+  (0.1ms) rollback transaction
1921
+  (0.1ms) begin transaction
1922
+ SQL (5.0ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00]]
1923
+  (0.1ms) commit transaction
1924
+  (0.0ms) begin transaction
1925
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00]]
1926
+  (0.0ms) commit transaction
1927
+  (0.1ms) begin transaction
1928
+ SQL (0.3ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00]]
1929
+  (0.1ms) commit transaction
1930
+  (0.1ms) begin transaction
1931
+ SQL (0.6ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00], ["event_object_id", 1], ["event_object_type", "Message"], ["event_type", :Create], ["recipient_id", 1], ["recipient_type", "User"], ["sender_id", 2], ["sender_type", 0], ["text", "Bob Smith has created a Message: Message Title"], ["updated_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00]]
1932
+  (0.1ms) commit transaction
1933
+ NewsFeedEvent Load (0.2ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 1 ORDER BY "news_feed_events"."id" DESC LIMIT 1
1934
+ NewsFeedEvent Load (0.2ms) SELECT "news_feed_events".* FROM "news_feed_events" ORDER BY "news_feed_events"."id" DESC LIMIT 1
1935
+  (0.1ms) begin transaction
1936
+ SQL (0.3ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00]]
1937
+  (0.1ms) commit transaction
1938
+  (0.0ms) begin transaction
1939
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00]]
1940
+  (0.0ms) commit transaction
1941
+  (0.0ms) begin transaction
1942
+ SQL (0.2ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00]]
1943
+  (0.1ms) commit transaction
1944
+  (0.1ms) begin transaction
1945
+ SQL (0.2ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00], ["event_object_id", 2], ["event_object_type", "Message"], ["event_type", :Delete], ["recipient_id", 3], ["recipient_type", "User"], ["sender_id", 4], ["sender_type", 0], ["text", "Bob Smith has deleted a Message: Message Title"], ["updated_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00]]
1946
+  (0.0ms) commit transaction
1947
+ NewsFeedEvent Load (0.2ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 3 ORDER BY "news_feed_events"."id" DESC LIMIT 1
1948
+  (0.0ms) begin transaction
1949
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00]]
1950
+  (0.0ms) commit transaction
1951
+  (0.0ms) begin transaction
1952
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00]]
1953
+  (0.0ms) commit transaction
1954
+  (0.0ms) begin transaction
1955
+ SQL (0.2ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00]]
1956
+  (0.0ms) commit transaction
1957
+  (0.1ms) begin transaction
1958
+ SQL (0.3ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00], ["event_object_id", 3], ["event_object_type", "Message"], ["event_type", :Delete], ["recipient_id", 5], ["recipient_type", "User"], ["sender_id", 6], ["sender_type", 0], ["text", "Bob Smith has deleted a Message: Message Title"], ["updated_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00]]
1959
+  (0.1ms) commit transaction
1960
+  (0.0ms) begin transaction
1961
+ SQL (0.2ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00], ["event_object_id", 3], ["event_object_type", "Message"], ["event_type", :Create], ["recipient_id", 5], ["recipient_type", "User"], ["sender_id", 6], ["sender_type", 0], ["text", "Bob Smith has created a Message: Message Title"], ["updated_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00]]
1962
+  (0.0ms) commit transaction
1963
+  (0.1ms) SELECT COUNT(*) FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 5
1964
+  (0.0ms) begin transaction
1965
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00]]
1966
+  (0.0ms) commit transaction
1967
+  (0.0ms) begin transaction
1968
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00]]
1969
+  (0.0ms) commit transaction
1970
+  (0.1ms) begin transaction
1971
+ SQL (0.2ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00]]
1972
+  (0.0ms) commit transaction
1973
+  (0.0ms) begin transaction
1974
+ SQL (0.4ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00], ["event_object_id", 4], ["event_object_type", "Message"], ["event_type", :Custom], ["recipient_id", 7], ["recipient_type", "User"], ["sender_id", 8], ["sender_type", 0], ["text", "This is my custom message!"], ["updated_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00]]
1975
+  (0.1ms) commit transaction
1976
+  (0.1ms) begin transaction
1977
+ SQL (1.2ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00], ["event_object_id", 4], ["event_object_type", "Message"], ["event_type", :Custom], ["recipient_id", 8], ["recipient_type", "User"], ["sender_id", 8], ["sender_type", 0], ["text", {:text=>"This is my custom message!", :event_object_type=>"Message", :event_object_id=>4, :event_type=>:Custom, :sender_id=>8, :sender_type=>"User", :recipient_id=>7, :recipient_type=>"User"}], ["updated_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00]]
1978
+  (0.1ms) commit transaction
1979
+ NewsFeedEvent Load (0.2ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 7 ORDER BY "news_feed_events"."id" DESC LIMIT 1
1980
+ NewsFeedEvent Load (0.2ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 8 ORDER BY "news_feed_events"."id" DESC LIMIT 1
1981
+  (0.1ms) begin transaction
1982
+ SQL (0.3ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00]]
1983
+  (0.1ms) commit transaction
1984
+  (0.0ms) begin transaction
1985
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00]]
1986
+  (0.1ms) commit transaction
1987
+  (0.0ms) begin transaction
1988
+ SQL (0.3ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00]]
1989
+  (0.1ms) commit transaction
1990
+  (0.1ms) begin transaction
1991
+ SQL (0.4ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00], ["event_object_id", 10], ["event_object_type", "User"], ["event_type", :Update], ["recipient_id", 10], ["recipient_type", "User"], ["sender_id", 10], ["sender_type", 0], ["text", "You have updated a User: Bob Smith"], ["updated_at", Fri, 10 Aug 2012 06:24:35 UTC +00:00]]
1992
+  (0.1ms) commit transaction
1993
+ NewsFeedEvent Load (0.3ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 10 ORDER BY "news_feed_events"."id" DESC LIMIT 1
1994
+ Connecting to database specified by database.yml
1995
+  (2.0ms) select sqlite_version(*)
1996
+  (0.5ms) CREATE TABLE "messages" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
1997
+  (0.2ms) CREATE TABLE "news_feed" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" text, "object_id" integer, "object_type" varchar(255), "event_type" varchar(255), "sender_id" integer, "timestamp" datetime) 
1998
+  (0.2ms) CREATE TABLE "news_feed_events" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" text, "event_object_id" integer, "event_object_type" varchar(255), "event_type" varchar(255), "sender_id" integer, "sender_type" integer, "recipient_id" integer, "recipient_type" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
1999
+  (0.1ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
2000
+  (0.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
2001
+  (0.0ms) PRAGMA index_list("schema_migrations")
2002
+  (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
2003
+  (0.0ms) SELECT version FROM "schema_migrations"
2004
+  (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('1')
2005
+  (0.1ms) begin transaction
2006
+  (0.1ms) rollback transaction
2007
+  (0.0ms) begin transaction
2008
+ SQL (3.4ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00]]
2009
+  (0.0ms) commit transaction
2010
+  (0.1ms) begin transaction
2011
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00]]
2012
+  (0.0ms) commit transaction
2013
+  (0.0ms) begin transaction
2014
+ SQL (0.2ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00]]
2015
+  (0.0ms) commit transaction
2016
+  (0.1ms) begin transaction
2017
+ SQL (0.6ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00], ["event_object_id", 1], ["event_object_type", "Message"], ["event_type", :Create], ["recipient_id", 1], ["recipient_type", "User"], ["sender_id", 2], ["sender_type", 0], ["text", "Bob Smith has created a Message: Message Title"], ["updated_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00]]
2018
+  (0.1ms) commit transaction
2019
+ NewsFeedEvent Load (0.2ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 1 ORDER BY "news_feed_events"."id" DESC LIMIT 1
2020
+ NewsFeedEvent Load (0.1ms) SELECT "news_feed_events".* FROM "news_feed_events" ORDER BY "news_feed_events"."id" DESC LIMIT 1
2021
+  (0.1ms) begin transaction
2022
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00]]
2023
+  (0.0ms) commit transaction
2024
+  (0.0ms) begin transaction
2025
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00]]
2026
+  (0.0ms) commit transaction
2027
+  (0.0ms) begin transaction
2028
+ SQL (0.4ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00]]
2029
+  (0.1ms) commit transaction
2030
+  (0.1ms) begin transaction
2031
+ SQL (0.4ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00], ["event_object_id", 2], ["event_object_type", "Message"], ["event_type", :Delete], ["recipient_id", 3], ["recipient_type", "User"], ["sender_id", 4], ["sender_type", 0], ["text", "Bob Smith has deleted a Message: Message Title"], ["updated_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00]]
2032
+  (0.1ms) commit transaction
2033
+ NewsFeedEvent Load (0.3ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 3 ORDER BY "news_feed_events"."id" DESC LIMIT 1
2034
+  (0.1ms) begin transaction
2035
+ SQL (0.3ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00]]
2036
+  (0.0ms) commit transaction
2037
+  (0.0ms) begin transaction
2038
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00]]
2039
+  (0.1ms) commit transaction
2040
+  (0.0ms) begin transaction
2041
+ SQL (0.2ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00]]
2042
+  (0.1ms) commit transaction
2043
+  (0.0ms) begin transaction
2044
+ SQL (0.3ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00], ["event_object_id", 3], ["event_object_type", "Message"], ["event_type", :Delete], ["recipient_id", 5], ["recipient_type", "User"], ["sender_id", 6], ["sender_type", 0], ["text", "Bob Smith has deleted a Message: Message Title"], ["updated_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00]]
2045
+  (0.0ms) commit transaction
2046
+  (0.0ms) begin transaction
2047
+ SQL (0.2ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00], ["event_object_id", 3], ["event_object_type", "Message"], ["event_type", :Create], ["recipient_id", 5], ["recipient_type", "User"], ["sender_id", 6], ["sender_type", 0], ["text", "Bob Smith has created a Message: Message Title"], ["updated_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00]]
2048
+  (0.0ms) commit transaction
2049
+  (0.1ms) SELECT COUNT(*) FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 5
2050
+  (0.0ms) begin transaction
2051
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00]]
2052
+  (0.1ms) commit transaction
2053
+  (0.0ms) begin transaction
2054
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00]]
2055
+  (0.0ms) commit transaction
2056
+  (0.0ms) begin transaction
2057
+ SQL (0.2ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00]]
2058
+  (0.0ms) commit transaction
2059
+  (0.0ms) begin transaction
2060
+ SQL (0.3ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00], ["event_object_id", 4], ["event_object_type", "Message"], ["event_type", :Custom], ["recipient_id", 7], ["recipient_type", "User"], ["sender_id", 8], ["sender_type", 0], ["text", "This is my custom message!"], ["updated_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00]]
2061
+  (0.0ms) commit transaction
2062
+  (0.0ms) begin transaction
2063
+ SQL (1.1ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00], ["event_object_id", 4], ["event_object_type", "Message"], ["event_type", :Custom], ["recipient_id", 8], ["recipient_type", "User"], ["sender_id", 8], ["sender_type", 0], ["text", {:text=>"This is my custom message!", :event_object_type=>"Message", :event_object_id=>4, :event_type=>:Custom, :sender_id=>8, :sender_type=>"User", :recipient_id=>7, :recipient_type=>"User"}], ["updated_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00]]
2064
+  (0.0ms) commit transaction
2065
+ NewsFeedEvent Load (0.2ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 7 ORDER BY "news_feed_events"."id" DESC LIMIT 1
2066
+ NewsFeedEvent Load (0.3ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 8 ORDER BY "news_feed_events"."id" DESC LIMIT 1
2067
+  (0.1ms) begin transaction
2068
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00]]
2069
+  (0.1ms) commit transaction
2070
+  (0.0ms) begin transaction
2071
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00]]
2072
+  (0.1ms) commit transaction
2073
+  (0.0ms) begin transaction
2074
+ SQL (0.2ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00]]
2075
+  (0.1ms) commit transaction
2076
+  (0.1ms) begin transaction
2077
+ SQL (0.3ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00], ["event_object_id", 10], ["event_object_type", "User"], ["event_type", :Update], ["recipient_id", 10], ["recipient_type", "User"], ["sender_id", 10], ["sender_type", 0], ["text", "You have updated a User: Bob Smith"], ["updated_at", Fri, 10 Aug 2012 06:25:32 UTC +00:00]]
2078
+  (0.1ms) commit transaction
2079
+ NewsFeedEvent Load (0.2ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 10 ORDER BY "news_feed_events"."id" DESC LIMIT 1
2080
+ Connecting to database specified by database.yml
2081
+  (1.4ms) select sqlite_version(*)
2082
+  (0.4ms) CREATE TABLE "messages" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
2083
+  (0.2ms) CREATE TABLE "news_feed" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" text, "object_id" integer, "object_type" varchar(255), "event_type" varchar(255), "sender_id" integer, "timestamp" datetime) 
2084
+  (0.2ms) CREATE TABLE "news_feed_events" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" text, "event_object_id" integer, "event_object_type" varchar(255), "event_type" varchar(255), "sender_id" integer, "sender_type" integer, "recipient_id" integer, "recipient_type" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
2085
+  (0.2ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
2086
+  (0.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
2087
+  (0.0ms) PRAGMA index_list("schema_migrations")
2088
+  (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
2089
+  (0.1ms) SELECT version FROM "schema_migrations"
2090
+  (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('1')
2091
+  (0.2ms) begin transaction
2092
+  (0.1ms) rollback transaction
2093
+  (0.1ms) begin transaction
2094
+ SQL (4.4ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:26:22 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:26:22 UTC +00:00]]
2095
+  (0.1ms) commit transaction
2096
+  (0.0ms) begin transaction
2097
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:26:22 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:26:22 UTC +00:00]]
2098
+  (0.0ms) commit transaction
2099
+  (0.0ms) begin transaction
2100
+ SQL (0.3ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:26:22 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:26:22 UTC +00:00]]
2101
+  (0.0ms) commit transaction
2102
+  (0.1ms) begin transaction
2103
+ SQL (0.4ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00], ["event_object_id", 1], ["event_object_type", "Message"], ["event_type", :Create], ["recipient_id", 1], ["recipient_type", "User"], ["sender_id", 2], ["sender_type", 0], ["text", "Bob Smith has created a Message: Message Title"], ["updated_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00]]
2104
+  (0.0ms) commit transaction
2105
+ NewsFeedEvent Load (0.3ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 1 ORDER BY "news_feed_events"."id" DESC LIMIT 1
2106
+ NewsFeedEvent Load (0.1ms) SELECT "news_feed_events".* FROM "news_feed_events" ORDER BY "news_feed_events"."id" DESC LIMIT 1
2107
+  (0.0ms) begin transaction
2108
+ SQL (0.3ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00]]
2109
+  (0.0ms) commit transaction
2110
+  (0.0ms) begin transaction
2111
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00]]
2112
+  (0.0ms) commit transaction
2113
+  (0.0ms) begin transaction
2114
+ SQL (0.1ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00]]
2115
+  (0.0ms) commit transaction
2116
+  (0.0ms) begin transaction
2117
+ SQL (0.4ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00], ["event_object_id", 2], ["event_object_type", "Message"], ["event_type", :Delete], ["recipient_id", 3], ["recipient_type", "User"], ["sender_id", 4], ["sender_type", 0], ["text", "Bob Smith has deleted a Message: Message Title"], ["updated_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00]]
2118
+  (0.1ms) commit transaction
2119
+ NewsFeedEvent Load (0.2ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 3 ORDER BY "news_feed_events"."id" DESC LIMIT 1
2120
+  (0.1ms) begin transaction
2121
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00]]
2122
+  (0.1ms) commit transaction
2123
+  (0.0ms) begin transaction
2124
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00]]
2125
+  (0.1ms) commit transaction
2126
+  (0.0ms) begin transaction
2127
+ SQL (0.2ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00]]
2128
+  (0.0ms) commit transaction
2129
+  (0.0ms) begin transaction
2130
+ SQL (0.3ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00], ["event_object_id", 3], ["event_object_type", "Message"], ["event_type", :Delete], ["recipient_id", 5], ["recipient_type", "User"], ["sender_id", 6], ["sender_type", 0], ["text", "Bob Smith has deleted a Message: Message Title"], ["updated_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00]]
2131
+  (0.1ms) commit transaction
2132
+  (0.1ms) begin transaction
2133
+ SQL (0.3ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00], ["event_object_id", 3], ["event_object_type", "Message"], ["event_type", :Create], ["recipient_id", 5], ["recipient_type", "User"], ["sender_id", 6], ["sender_type", 0], ["text", "Bob Smith has created a Message: Message Title"], ["updated_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00]]
2134
+  (0.1ms) commit transaction
2135
+  (0.1ms) SELECT COUNT(*) FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 5
2136
+  (0.1ms) begin transaction
2137
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00]]
2138
+  (0.1ms) commit transaction
2139
+  (0.1ms) begin transaction
2140
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00]]
2141
+  (0.0ms) commit transaction
2142
+  (0.0ms) begin transaction
2143
+ SQL (0.2ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00]]
2144
+  (0.1ms) commit transaction
2145
+  (0.1ms) begin transaction
2146
+ SQL (0.3ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00], ["event_object_id", 4], ["event_object_type", "Message"], ["event_type", :Custom], ["recipient_id", 7], ["recipient_type", "User"], ["sender_id", 8], ["sender_type", 0], ["text", "This is my custom message!"], ["updated_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00]]
2147
+  (0.0ms) commit transaction
2148
+  (0.1ms) begin transaction
2149
+ SQL (1.1ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00], ["event_object_id", 4], ["event_object_type", "Message"], ["event_type", :Custom], ["recipient_id", 8], ["recipient_type", "User"], ["sender_id", 8], ["sender_type", 0], ["text", {:text=>"This is my custom message!", :event_object_type=>"Message", :event_object_id=>4, :event_type=>:Custom, :sender_id=>8, :sender_type=>"User", :recipient_id=>7, :recipient_type=>"User"}], ["updated_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00]]
2150
+  (0.1ms) commit transaction
2151
+ NewsFeedEvent Load (0.2ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 7 ORDER BY "news_feed_events"."id" DESC LIMIT 1
2152
+ NewsFeedEvent Load (0.2ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 8 ORDER BY "news_feed_events"."id" DESC LIMIT 1
2153
+  (0.1ms) begin transaction
2154
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00]]
2155
+  (0.1ms) commit transaction
2156
+  (0.1ms) begin transaction
2157
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00]]
2158
+  (0.1ms) commit transaction
2159
+  (0.0ms) begin transaction
2160
+ SQL (0.2ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00]]
2161
+  (0.1ms) commit transaction
2162
+  (0.1ms) begin transaction
2163
+ SQL (0.3ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00], ["event_object_id", 10], ["event_object_type", "User"], ["event_type", :Update], ["recipient_id", 10], ["recipient_type", "User"], ["sender_id", 10], ["sender_type", 0], ["text", "You have updated a User: Bob Smith"], ["updated_at", Fri, 10 Aug 2012 06:26:23 UTC +00:00]]
2164
+  (0.1ms) commit transaction
2165
+ NewsFeedEvent Load (0.2ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 10 ORDER BY "news_feed_events"."id" DESC LIMIT 1
2166
+ Connecting to database specified by database.yml
2167
+  (1.5ms) select sqlite_version(*)
2168
+  (0.4ms) CREATE TABLE "messages" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
2169
+  (0.2ms) CREATE TABLE "news_feed" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" text, "object_id" integer, "object_type" varchar(255), "event_type" varchar(255), "sender_id" integer, "timestamp" datetime) 
2170
+  (0.3ms) CREATE TABLE "news_feed_events" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" text, "event_object_id" integer, "event_object_type" varchar(255), "event_type" varchar(255), "sender_id" integer, "sender_type" integer, "recipient_id" integer, "recipient_type" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
2171
+  (0.2ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
2172
+  (0.2ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
2173
+  (0.1ms) PRAGMA index_list("schema_migrations")
2174
+  (0.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
2175
+  (0.1ms) SELECT version FROM "schema_migrations"
2176
+  (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('1')
2177
+  (0.2ms) begin transaction
2178
+  (0.1ms) rollback transaction
2179
+  (0.0ms) begin transaction
2180
+ SQL (3.9ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00]]
2181
+  (0.0ms) commit transaction
2182
+  (0.1ms) begin transaction
2183
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00]]
2184
+  (0.1ms) commit transaction
2185
+  (0.1ms) begin transaction
2186
+ SQL (0.2ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00]]
2187
+  (0.0ms) commit transaction
2188
+  (0.1ms) begin transaction
2189
+ SQL (0.6ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00], ["event_object_id", 1], ["event_object_type", "Message"], ["event_type", :Create], ["recipient_id", 1], ["recipient_type", "User"], ["sender_id", 2], ["sender_type", 0], ["text", "Bob Smith has created a Message: Message Title"], ["updated_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00]]
2190
+  (0.1ms) commit transaction
2191
+ NewsFeedEvent Load (0.2ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 1 ORDER BY "news_feed_events"."id" DESC LIMIT 1
2192
+ NewsFeedEvent Load (0.1ms) SELECT "news_feed_events".* FROM "news_feed_events" ORDER BY "news_feed_events"."id" DESC LIMIT 1
2193
+  (0.1ms) begin transaction
2194
+ SQL (0.3ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00]]
2195
+  (0.0ms) commit transaction
2196
+  (0.0ms) begin transaction
2197
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00]]
2198
+  (0.0ms) commit transaction
2199
+  (0.0ms) begin transaction
2200
+ SQL (0.2ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00]]
2201
+  (0.0ms) commit transaction
2202
+  (0.0ms) begin transaction
2203
+ SQL (0.2ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00], ["event_object_id", 2], ["event_object_type", "Message"], ["event_type", :Delete], ["recipient_id", 3], ["recipient_type", "User"], ["sender_id", 4], ["sender_type", 0], ["text", "Bob Smith has deleted a Message: Message Title"], ["updated_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00]]
2204
+  (0.0ms) commit transaction
2205
+ NewsFeedEvent Load (0.2ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 3 ORDER BY "news_feed_events"."id" DESC LIMIT 1
2206
+  (0.0ms) begin transaction
2207
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00]]
2208
+  (0.1ms) commit transaction
2209
+  (0.0ms) begin transaction
2210
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00]]
2211
+  (0.0ms) commit transaction
2212
+  (0.0ms) begin transaction
2213
+ SQL (0.2ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00]]
2214
+  (0.0ms) commit transaction
2215
+  (0.0ms) begin transaction
2216
+ SQL (0.2ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00], ["event_object_id", 3], ["event_object_type", "Message"], ["event_type", :Delete], ["recipient_id", 5], ["recipient_type", "User"], ["sender_id", 6], ["sender_type", 0], ["text", "Bob Smith has deleted a Message: Message Title"], ["updated_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00]]
2217
+  (0.0ms) commit transaction
2218
+  (0.0ms) begin transaction
2219
+ SQL (0.2ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00], ["event_object_id", 3], ["event_object_type", "Message"], ["event_type", :Create], ["recipient_id", 5], ["recipient_type", "User"], ["sender_id", 6], ["sender_type", 0], ["text", "Bob Smith has created a Message: Message Title"], ["updated_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00]]
2220
+  (0.0ms) commit transaction
2221
+  (0.1ms) SELECT COUNT(*) FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 5
2222
+  (0.1ms) begin transaction
2223
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00]]
2224
+  (0.0ms) commit transaction
2225
+  (0.0ms) begin transaction
2226
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00]]
2227
+  (0.0ms) commit transaction
2228
+  (0.0ms) begin transaction
2229
+ SQL (0.2ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00]]
2230
+  (0.0ms) commit transaction
2231
+  (0.0ms) begin transaction
2232
+ SQL (0.3ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00], ["event_object_id", 4], ["event_object_type", "Message"], ["event_type", :Custom], ["recipient_id", 7], ["recipient_type", "User"], ["sender_id", 8], ["sender_type", 0], ["text", "This is my custom message!"], ["updated_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00]]
2233
+  (0.0ms) commit transaction
2234
+  (0.0ms) begin transaction
2235
+ SQL (1.0ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00], ["event_object_id", 4], ["event_object_type", "Message"], ["event_type", :Custom], ["recipient_id", 8], ["recipient_type", "User"], ["sender_id", 8], ["sender_type", 0], ["text", {:text=>"This is my custom message!", :event_object_type=>"Message", :event_object_id=>4, :event_type=>:Custom, :sender_id=>8, :sender_type=>"User", :recipient_id=>7, :recipient_type=>"User"}], ["updated_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00]]
2236
+  (0.0ms) commit transaction
2237
+ NewsFeedEvent Load (0.2ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 7 ORDER BY "news_feed_events"."id" DESC LIMIT 1
2238
+ NewsFeedEvent Load (0.2ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 8 ORDER BY "news_feed_events"."id" DESC LIMIT 1
2239
+ NewsFeedEvent Load (0.2ms) SELECT "news_feed_events".* FROM "news_feed_events" 
2240
+  (0.1ms) begin transaction
2241
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00]]
2242
+  (0.1ms) commit transaction
2243
+  (0.0ms) begin transaction
2244
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00]]
2245
+  (0.0ms) commit transaction
2246
+  (0.0ms) begin transaction
2247
+ SQL (0.2ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00]]
2248
+  (0.0ms) commit transaction
2249
+  (0.1ms) begin transaction
2250
+ SQL (0.2ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00], ["event_object_id", 10], ["event_object_type", "User"], ["event_type", :Update], ["recipient_id", 10], ["recipient_type", "User"], ["sender_id", 10], ["sender_type", 0], ["text", "You have updated a User: Bob Smith"], ["updated_at", Fri, 10 Aug 2012 06:26:46 UTC +00:00]]
2251
+  (0.1ms) commit transaction
2252
+ NewsFeedEvent Load (0.2ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 10 ORDER BY "news_feed_events"."id" DESC LIMIT 1
2253
+ Connecting to database specified by database.yml
2254
+  (1.7ms) select sqlite_version(*)
2255
+  (0.4ms) CREATE TABLE "messages" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
2256
+  (0.1ms) CREATE TABLE "news_feed" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" text, "object_id" integer, "object_type" varchar(255), "event_type" varchar(255), "sender_id" integer, "timestamp" datetime) 
2257
+  (0.2ms) CREATE TABLE "news_feed_events" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" text, "event_object_id" integer, "event_object_type" varchar(255), "event_type" varchar(255), "sender_id" integer, "sender_type" integer, "recipient_id" integer, "recipient_type" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
2258
+  (0.1ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
2259
+  (0.2ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
2260
+  (0.0ms) PRAGMA index_list("schema_migrations")
2261
+  (0.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
2262
+  (0.0ms) SELECT version FROM "schema_migrations"
2263
+  (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('1')
2264
+  (0.1ms) begin transaction
2265
+  (0.0ms) rollback transaction
2266
+  (0.1ms) begin transaction
2267
+ SQL (4.0ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00]]
2268
+  (0.0ms) commit transaction
2269
+  (0.0ms) begin transaction
2270
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00]]
2271
+  (0.0ms) commit transaction
2272
+  (0.1ms) begin transaction
2273
+ SQL (0.3ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00]]
2274
+  (0.0ms) commit transaction
2275
+  (0.1ms) begin transaction
2276
+ SQL (0.5ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00], ["event_object_id", 1], ["event_object_type", "Message"], ["event_type", :Create], ["recipient_id", 1], ["recipient_type", "User"], ["sender_id", 2], ["sender_type", 0], ["text", "Bob Smith has created a Message: Message Title"], ["updated_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00]]
2277
+  (0.1ms) commit transaction
2278
+ NewsFeedEvent Load (0.2ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 1 ORDER BY "news_feed_events"."id" DESC LIMIT 1
2279
+ NewsFeedEvent Load (0.2ms) SELECT "news_feed_events".* FROM "news_feed_events" ORDER BY "news_feed_events"."id" DESC LIMIT 1
2280
+  (0.1ms) begin transaction
2281
+ SQL (0.3ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00]]
2282
+  (0.0ms) commit transaction
2283
+  (0.0ms) begin transaction
2284
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00]]
2285
+  (0.0ms) commit transaction
2286
+  (0.1ms) begin transaction
2287
+ SQL (0.2ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00]]
2288
+  (0.0ms) commit transaction
2289
+  (0.1ms) begin transaction
2290
+ SQL (0.2ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00], ["event_object_id", 2], ["event_object_type", "Message"], ["event_type", :Delete], ["recipient_id", 3], ["recipient_type", "User"], ["sender_id", 4], ["sender_type", 0], ["text", "Bob Smith has deleted a Message: Message Title"], ["updated_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00]]
2291
+  (0.0ms) commit transaction
2292
+ NewsFeedEvent Load (0.2ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 3 ORDER BY "news_feed_events"."id" DESC LIMIT 1
2293
+  (0.0ms) begin transaction
2294
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00]]
2295
+  (0.0ms) commit transaction
2296
+  (0.0ms) begin transaction
2297
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00]]
2298
+  (0.0ms) commit transaction
2299
+  (0.0ms) begin transaction
2300
+ SQL (0.2ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00]]
2301
+  (0.1ms) commit transaction
2302
+  (0.0ms) begin transaction
2303
+ SQL (0.2ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00], ["event_object_id", 3], ["event_object_type", "Message"], ["event_type", :Delete], ["recipient_id", 5], ["recipient_type", "User"], ["sender_id", 6], ["sender_type", 0], ["text", "Bob Smith has deleted a Message: Message Title"], ["updated_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00]]
2304
+  (0.1ms) commit transaction
2305
+  (0.0ms) begin transaction
2306
+ SQL (0.2ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00], ["event_object_id", 3], ["event_object_type", "Message"], ["event_type", :Create], ["recipient_id", 5], ["recipient_type", "User"], ["sender_id", 6], ["sender_type", 0], ["text", "Bob Smith has created a Message: Message Title"], ["updated_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00]]
2307
+  (0.1ms) commit transaction
2308
+  (0.1ms) SELECT COUNT(*) FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 5
2309
+  (0.0ms) begin transaction
2310
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00]]
2311
+  (0.0ms) commit transaction
2312
+  (0.0ms) begin transaction
2313
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00]]
2314
+  (0.0ms) commit transaction
2315
+  (0.0ms) begin transaction
2316
+ SQL (0.1ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00]]
2317
+  (0.0ms) commit transaction
2318
+  (0.0ms) begin transaction
2319
+ SQL (0.1ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00], ["event_object_id", 4], ["event_object_type", "Message"], ["event_type", :Custom], ["recipient_id", 7], ["recipient_type", "User"], ["sender_id", 8], ["sender_type", 0], ["text", "This is my custom message!"], ["updated_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00]]
2320
+  (0.0ms) commit transaction
2321
+  (0.0ms) begin transaction
2322
+ SQL (0.2ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00], ["event_object_id", 4], ["event_object_type", "Message"], ["event_type", :Custom], ["recipient_id", 8], ["recipient_type", "User"], ["sender_id", 8], ["sender_type", 0], ["text", "This is my custom message!"], ["updated_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00]]
2323
+  (0.0ms) commit transaction
2324
+ NewsFeedEvent Load (0.1ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 7 ORDER BY "news_feed_events"."id" DESC LIMIT 1
2325
+ NewsFeedEvent Load (0.1ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 8 ORDER BY "news_feed_events"."id" DESC LIMIT 1
2326
+  (0.0ms) begin transaction
2327
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00]]
2328
+  (0.0ms) commit transaction
2329
+  (0.0ms) begin transaction
2330
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00]]
2331
+  (0.0ms) commit transaction
2332
+  (0.0ms) begin transaction
2333
+ SQL (0.1ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00]]
2334
+  (0.0ms) commit transaction
2335
+  (0.0ms) begin transaction
2336
+ SQL (0.1ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00], ["event_object_id", 10], ["event_object_type", "User"], ["event_type", :Update], ["recipient_id", 10], ["recipient_type", "User"], ["sender_id", 10], ["sender_type", 0], ["text", "You have updated a User: Bob Smith"], ["updated_at", Fri, 10 Aug 2012 06:27:41 UTC +00:00]]
2337
+  (0.1ms) commit transaction
2338
+ NewsFeedEvent Load (0.1ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 10 ORDER BY "news_feed_events"."id" DESC LIMIT 1
2339
+ Connecting to database specified by database.yml
2340
+  (1.4ms) select sqlite_version(*)
2341
+  (0.4ms) CREATE TABLE "messages" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
2342
+  (0.2ms) CREATE TABLE "news_feed" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" text, "object_id" integer, "object_type" varchar(255), "event_type" varchar(255), "sender_id" integer, "timestamp" datetime) 
2343
+  (0.2ms) CREATE TABLE "news_feed_events" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "text" text, "event_object_id" integer, "event_object_type" varchar(255), "event_type" varchar(255), "sender_id" integer, "sender_type" integer, "recipient_id" integer, "recipient_type" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
2344
+  (0.2ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
2345
+  (0.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
2346
+  (0.0ms) PRAGMA index_list("schema_migrations")
2347
+  (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
2348
+  (0.1ms) SELECT version FROM "schema_migrations"
2349
+  (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('1')
2350
+  (0.1ms) begin transaction
2351
+  (0.1ms) rollback transaction
2352
+  (0.1ms) begin transaction
2353
+ SQL (4.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00]]
2354
+  (0.1ms) commit transaction
2355
+  (0.1ms) begin transaction
2356
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00]]
2357
+  (0.1ms) commit transaction
2358
+  (0.1ms) begin transaction
2359
+ SQL (0.3ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00]]
2360
+  (0.0ms) commit transaction
2361
+  (0.0ms) begin transaction
2362
+ SQL (0.3ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00], ["event_object_id", 1], ["event_object_type", "Message"], ["event_type", :Create], ["recipient_id", 1], ["recipient_type", "User"], ["sender_id", 2], ["sender_type", 0], ["text", "Bob Smith has created a Message: Message Title"], ["updated_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00]]
2363
+  (0.0ms) commit transaction
2364
+ NewsFeedEvent Load (0.2ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 1 ORDER BY "news_feed_events"."id" DESC LIMIT 1
2365
+ NewsFeedEvent Load (0.1ms) SELECT "news_feed_events".* FROM "news_feed_events" ORDER BY "news_feed_events"."id" DESC LIMIT 1
2366
+  (0.0ms) begin transaction
2367
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00]]
2368
+  (0.0ms) commit transaction
2369
+  (0.0ms) begin transaction
2370
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00]]
2371
+  (0.0ms) commit transaction
2372
+  (0.0ms) begin transaction
2373
+ SQL (0.1ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00]]
2374
+  (0.0ms) commit transaction
2375
+  (0.0ms) begin transaction
2376
+ SQL (0.2ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00], ["event_object_id", 2], ["event_object_type", "Message"], ["event_type", :Delete], ["recipient_id", 3], ["recipient_type", "User"], ["sender_id", 4], ["sender_type", 0], ["text", "Bob Smith has deleted a Message: Message Title"], ["updated_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00]]
2377
+  (0.0ms) commit transaction
2378
+ NewsFeedEvent Load (0.1ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 3 ORDER BY "news_feed_events"."id" DESC LIMIT 1
2379
+  (0.0ms) begin transaction
2380
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00]]
2381
+  (0.0ms) commit transaction
2382
+  (0.0ms) begin transaction
2383
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00]]
2384
+  (0.0ms) commit transaction
2385
+  (0.0ms) begin transaction
2386
+ SQL (0.2ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00]]
2387
+  (0.0ms) commit transaction
2388
+  (0.0ms) begin transaction
2389
+ SQL (0.2ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00], ["event_object_id", 3], ["event_object_type", "Message"], ["event_type", :Delete], ["recipient_id", 5], ["recipient_type", "User"], ["sender_id", 6], ["sender_type", 0], ["text", "Bob Smith has deleted a Message: Message Title"], ["updated_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00]]
2390
+  (0.0ms) commit transaction
2391
+  (0.0ms) begin transaction
2392
+ SQL (0.2ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00], ["event_object_id", 3], ["event_object_type", "Message"], ["event_type", :Create], ["recipient_id", 5], ["recipient_type", "User"], ["sender_id", 6], ["sender_type", 0], ["text", "Bob Smith has created a Message: Message Title"], ["updated_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00]]
2393
+  (0.0ms) commit transaction
2394
+  (0.1ms) SELECT COUNT(*) FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 5
2395
+  (0.0ms) begin transaction
2396
+ SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00]]
2397
+  (0.0ms) commit transaction
2398
+  (0.0ms) begin transaction
2399
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00]]
2400
+  (0.0ms) commit transaction
2401
+  (0.0ms) begin transaction
2402
+ SQL (0.1ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00]]
2403
+  (0.0ms) commit transaction
2404
+  (0.0ms) begin transaction
2405
+ SQL (0.2ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00], ["event_object_id", 4], ["event_object_type", "Message"], ["event_type", :Custom], ["recipient_id", 7], ["recipient_type", "User"], ["sender_id", 8], ["sender_type", 0], ["text", "This is my custom message!"], ["updated_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00]]
2406
+  (0.0ms) commit transaction
2407
+  (0.0ms) begin transaction
2408
+ SQL (0.2ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00], ["event_object_id", 4], ["event_object_type", "Message"], ["event_type", :Custom], ["recipient_id", 8], ["recipient_type", "User"], ["sender_id", 8], ["sender_type", 0], ["text", "This is my custom message!"], ["updated_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00]]
2409
+  (0.0ms) commit transaction
2410
+ NewsFeedEvent Load (0.2ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 7 ORDER BY "news_feed_events"."id" DESC LIMIT 1
2411
+ NewsFeedEvent Load (0.1ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 8 ORDER BY "news_feed_events"."id" DESC LIMIT 1
2412
+  (0.1ms) begin transaction
2413
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00]]
2414
+  (0.0ms) commit transaction
2415
+  (0.0ms) begin transaction
2416
+ SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00]]
2417
+  (0.0ms) commit transaction
2418
+  (0.0ms) begin transaction
2419
+ SQL (0.1ms) INSERT INTO "messages" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00], ["updated_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00]]
2420
+  (0.0ms) commit transaction
2421
+  (0.0ms) begin transaction
2422
+ SQL (0.1ms) INSERT INTO "news_feed_events" ("created_at", "event_object_id", "event_object_type", "event_type", "recipient_id", "recipient_type", "sender_id", "sender_type", "text", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00], ["event_object_id", 10], ["event_object_type", "User"], ["event_type", :Update], ["recipient_id", 10], ["recipient_type", "User"], ["sender_id", 10], ["sender_type", 0], ["text", "You have updated a User: Bob Smith"], ["updated_at", Fri, 10 Aug 2012 06:32:22 UTC +00:00]]
2423
+  (0.0ms) commit transaction
2424
+ NewsFeedEvent Load (0.1ms) SELECT "news_feed_events".* FROM "news_feed_events" WHERE "news_feed_events"."recipient_id" = 10 ORDER BY "news_feed_events"."id" DESC LIMIT 1
@@ -14,6 +14,7 @@ class NewsFeedTest < Test::Unit::TestCase
14
14
  news_feed_event = user_1.news_feed_events.last
15
15
  assert_equal news_feed_event, NewsFeedEvent.last
16
16
  assert_equal news_feed_event.text, 'Bob Smith has created a Message: Message Title'
17
+ assert_equal news_feed_event.event_type_object, 'CreateMessage'
17
18
  end
18
19
 
19
20
  def test_for_updating_and_sending_self_an_object
@@ -23,6 +24,7 @@ class NewsFeedTest < Test::Unit::TestCase
23
24
  current_user.insertNewsFeed(:Update, current_user, current_user)
24
25
  news_feed_event = current_user.news_feed_events.last
25
26
  assert_equal news_feed_event.text, 'You have updated a User: Bob Smith'
27
+ assert_equal news_feed_event.event_type_object, 'UpdateUser'
26
28
  end
27
29
 
28
30
  def test_for_delete_an_object_sent_to_multiple_recipients
@@ -32,6 +34,7 @@ class NewsFeedTest < Test::Unit::TestCase
32
34
  message.insertNewsFeed(:Delete, user_1, current_user)
33
35
  news_feed_event = user_1.news_feed_events.last
34
36
  assert_equal news_feed_event.text, 'Bob Smith has deleted a Message: Message Title'
37
+ assert_equal news_feed_event.event_type_object, 'DeleteMessage'
35
38
  end
36
39
 
37
40
  def test_for_multiple_news_feeds
@@ -50,7 +53,20 @@ class NewsFeedTest < Test::Unit::TestCase
50
53
  message.insertNewsFeed(:Send, [user_1, current_user], current_user)
51
54
  news_feed_event_1 = user_1.news_feed_events.last
52
55
  assert_equal news_feed_event_1.text, 'Bob Smith has sent you a Message: Message Title'
56
+ assert_equal news_feed_event_1.event_type_object, 'SendMessage'
53
57
  news_feed_event_2 = current_user.news_feed_events.last
54
58
  assert_equal news_feed_event_2.text, 'You have sent Bob Smith a Message: Message Title'
55
59
  end
60
+
61
+ def test_for_sending_an_object_to_multiple_recipients
62
+ user_1 = User.create
63
+ current_user = User.create
64
+ message = Message.create
65
+ message.insertNewsFeed(:Custom, [user_1, current_user], current_user, "This is my custom message!")
66
+ news_feed_event_1 = user_1.news_feed_events.last
67
+ assert_equal news_feed_event_1.text, 'This is my custom message!'
68
+ assert_equal news_feed_event_1.event_type_object, 'CustomMessage'
69
+ news_feed_event_2 = current_user.news_feed_events.last
70
+ assert_equal news_feed_event_2.text, 'This is my custom message!'
71
+ end
56
72
  end
@@ -1,6 +1,6 @@
1
1
  module NewsFeed
2
2
  module NewsFeedEvents
3
- def generate_text(event_name, actor_name, object_class, object_title, recipient_name = nil)
3
+ def generate_text(event_name, actor_name, object_class, object_title, recipient_name = nil, options = {})
4
4
  # event_name is what the cases will check for
5
5
  # actor_name is the user object that performs the action
6
6
  # object_class is the class of the object of interest
@@ -19,6 +19,12 @@ module NewsFeed
19
19
  when :Send
20
20
  I18n.t('news_feeds.send_object', actor: actor_name.to_s, object_class: object_class,
21
21
  object_name: object_title, recipient_name: recipient_name)
22
+ when :Custom
23
+ if options.nil?
24
+ raise "Custom Message must be specified"
25
+ else
26
+ options
27
+ end
22
28
  else
23
29
  raise "event_name is undefined"
24
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: news_feed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-09 00:00:00.000000000 Z
12
+ date: 2012-08-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails