notify_user 0.0.28 → 0.0.29

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -0
  3. data/app/mailers/notify_user/notification_mailer.rb +6 -2
  4. data/app/models/notify_user/apn_connection.rb +41 -0
  5. data/app/models/notify_user/apns.rb +18 -27
  6. data/app/models/notify_user/base_notification.rb +42 -64
  7. data/app/models/notify_user/houston.rb +98 -0
  8. data/app/models/notify_user/urban_airship.rb +33 -0
  9. data/lib/generators/notify_user/install/templates/initializer.rb +13 -0
  10. data/lib/notify_user.rb +16 -0
  11. data/lib/notify_user/channels/apns/apns_channel.rb +15 -12
  12. data/lib/notify_user/version.rb +1 -1
  13. data/spec/dummy/rails-3.2.17/Gemfile +38 -0
  14. data/spec/dummy/rails-3.2.17/README.rdoc +261 -0
  15. data/spec/dummy/rails-3.2.17/Rakefile +7 -0
  16. data/spec/dummy/rails-3.2.17/app/assets/images/rails.png +0 -0
  17. data/spec/dummy/rails-3.2.17/app/assets/javascripts/application.js +15 -0
  18. data/spec/dummy/rails-3.2.17/app/assets/stylesheets/application.css +13 -0
  19. data/spec/dummy/rails-3.2.17/app/controllers/application_controller.rb +3 -0
  20. data/spec/dummy/rails-3.2.17/app/controllers/notify_user/notifications_controller.rb +9 -0
  21. data/spec/dummy/rails-3.2.17/app/helpers/application_helper.rb +2 -0
  22. data/spec/dummy/rails-3.2.17/app/models/user.rb +3 -0
  23. data/spec/dummy/rails-3.2.17/app/notifications/new_post_notification.rb +11 -0
  24. data/spec/dummy/rails-3.2.17/app/views/layouts/application.html.erb +14 -0
  25. data/spec/dummy/rails-3.2.17/app/views/notify_user/layouts/action_mailer.html.erb +39 -0
  26. data/spec/dummy/rails-3.2.17/app/views/notify_user/new_post_notification/action_mailer/notification.html.erb +1 -0
  27. data/spec/dummy/rails-3.2.17/app/views/notify_user/new_post_notification/mobile_sdk/notification.html.erb +1 -0
  28. data/spec/dummy/rails-3.2.17/config.ru +4 -0
  29. data/spec/dummy/rails-3.2.17/config/application.rb +62 -0
  30. data/spec/dummy/rails-3.2.17/config/boot.rb +6 -0
  31. data/spec/dummy/rails-3.2.17/config/database.yml +24 -0
  32. data/spec/dummy/rails-3.2.17/config/environment.rb +5 -0
  33. data/spec/dummy/rails-3.2.17/config/environments/development.rb +37 -0
  34. data/spec/dummy/rails-3.2.17/config/environments/production.rb +67 -0
  35. data/spec/dummy/rails-3.2.17/config/environments/test.rb +37 -0
  36. data/spec/dummy/rails-3.2.17/config/initializers/backtrace_silencers.rb +7 -0
  37. data/spec/dummy/rails-3.2.17/config/initializers/inflections.rb +15 -0
  38. data/spec/dummy/rails-3.2.17/config/initializers/mime_types.rb +5 -0
  39. data/spec/dummy/rails-3.2.17/config/initializers/notify_user.rb +14 -0
  40. data/spec/dummy/rails-3.2.17/config/initializers/secret_token.rb +7 -0
  41. data/spec/dummy/rails-3.2.17/config/initializers/session_store.rb +8 -0
  42. data/spec/dummy/rails-3.2.17/config/initializers/wrap_parameters.rb +14 -0
  43. data/spec/dummy/rails-3.2.17/config/locales/en.yml +5 -0
  44. data/spec/dummy/rails-3.2.17/config/routes.rb +58 -0
  45. data/spec/dummy/rails-3.2.17/db/migrate/20150106040852_create_users.rb +9 -0
  46. data/spec/dummy/rails-3.2.17/db/migrate/20150106040854857857604000_create_notify_user_notifications.rb +13 -0
  47. data/spec/dummy/rails-3.2.17/db/migrate/20150106040854860860323000_create_notify_user_unsubscribes.rb +10 -0
  48. data/spec/dummy/rails-3.2.17/db/migrate/20150106040854862862248000_create_notify_user_user_hashes.rb +12 -0
  49. data/spec/dummy/rails-3.2.17/db/schema.rb +50 -0
  50. data/spec/dummy/rails-3.2.17/db/seeds.rb +7 -0
  51. data/spec/dummy/rails-3.2.17/doc/README_FOR_APP +2 -0
  52. data/spec/dummy/rails-3.2.17/log/test.log +933 -0
  53. data/spec/dummy/rails-3.2.17/public/404.html +26 -0
  54. data/spec/dummy/rails-3.2.17/public/422.html +26 -0
  55. data/spec/dummy/rails-3.2.17/public/500.html +25 -0
  56. data/spec/dummy/rails-3.2.17/public/favicon.ico +0 -0
  57. data/spec/dummy/rails-3.2.17/public/index.html +241 -0
  58. data/spec/dummy/rails-3.2.17/public/robots.txt +5 -0
  59. data/spec/dummy/rails-3.2.17/script/rails +6 -0
  60. data/spec/dummy/rails-3.2.17/test/fixtures/users.yml +7 -0
  61. data/spec/dummy/rails-3.2.17/test/performance/browsing_test.rb +12 -0
  62. data/spec/dummy/rails-3.2.17/test/test_helper.rb +13 -0
  63. data/spec/dummy/rails-3.2.17/test/unit/user_test.rb +7 -0
  64. data/spec/dummy/rails-4.0.4/log/test.log +38719 -0
  65. data/spec/models/notify_user/houston_spec.rb +33 -0
  66. data/spec/models/notify_user/notification_spec.rb +62 -96
  67. metadata +151 -2
@@ -0,0 +1,9 @@
1
+ class CreateUsers < ActiveRecord::Migration
2
+ def change
3
+ create_table :users do |t|
4
+ t.string :email
5
+
6
+ t.timestamps
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,13 @@
1
+ class CreateNotifyUserNotifications < ActiveRecord::Migration
2
+ def change
3
+ create_table :notify_user_notifications do |t|
4
+ t.string :type
5
+ t.integer :target_id
6
+ t.string :target_type
7
+ t.json :params
8
+ t.string :state
9
+
10
+ t.timestamps
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,10 @@
1
+ class CreateNotifyUserUnsubscribes < ActiveRecord::Migration
2
+ def change
3
+ create_table :notify_user_unsubscribes do |t|
4
+ t.string :type
5
+ t.integer :target_id
6
+ t.string :target_type
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,12 @@
1
+ class CreateNotifyUserUserHashes < ActiveRecord::Migration
2
+ def change
3
+ create_table :notify_user_user_hashes do |t|
4
+ t.string :type
5
+ t.integer :target_id
6
+ t.string :target_type
7
+ t.string :token
8
+ t.boolean :active, default: true
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,50 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended to check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(:version => 20150106040854862862248000) do
15
+
16
+ create_table "notify_user_notifications", :force => true do |t|
17
+ t.string "type"
18
+ t.integer "target_id"
19
+ t.string "target_type"
20
+ t.json "params"
21
+ t.string "state"
22
+ t.datetime "created_at", :null => false
23
+ t.datetime "updated_at", :null => false
24
+ end
25
+
26
+ create_table "notify_user_unsubscribes", :force => true do |t|
27
+ t.string "type"
28
+ t.integer "target_id"
29
+ t.string "target_type"
30
+ t.datetime "created_at", :null => false
31
+ t.datetime "updated_at", :null => false
32
+ end
33
+
34
+ create_table "notify_user_user_hashes", :force => true do |t|
35
+ t.string "type"
36
+ t.integer "target_id"
37
+ t.string "target_type"
38
+ t.string "token"
39
+ t.boolean "active", :default => true
40
+ t.datetime "created_at", :null => false
41
+ t.datetime "updated_at", :null => false
42
+ end
43
+
44
+ create_table "users", :force => true do |t|
45
+ t.string "email"
46
+ t.datetime "created_at", :null => false
47
+ t.datetime "updated_at", :null => false
48
+ end
49
+
50
+ end
@@ -0,0 +1,7 @@
1
+ # This file should contain all the record creation needed to seed the database with its default values.
2
+ # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
3
+ #
4
+ # Examples:
5
+ #
6
+ # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
7
+ # Mayor.create(name: 'Emanuel', city: cities.first)
@@ -0,0 +1,2 @@
1
+ Use this README file to introduce your application and point to useful places in the API for learning more.
2
+ Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries.
@@ -0,0 +1,933 @@
1
+ Connecting to database specified by database.yml
2
+ Connecting to database specified by database.yml
3
+ Connecting to database specified by database.yml
4
+ Connecting to database specified by database.yml
5
+  (15.8ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL) 
6
+  (6.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
7
+  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
8
+ Migrating to CreateUsers (20150106040852)
9
+  (0.3ms) BEGIN
10
+  (10.0ms) CREATE TABLE "users" ("id" serial primary key, "email" character varying(255), "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
11
+  (1.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20150106040852')
12
+  (0.8ms) COMMIT
13
+ Migrating to CreateNotifyUserNotifications (20150106040854857857604000)
14
+  (0.4ms) BEGIN
15
+  (8.4ms) CREATE TABLE "notify_user_notifications" ("id" serial primary key, "type" character varying(255), "target_id" integer, "target_type" character varying(255), "params" json, "state" character varying(255), "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
16
+  (1.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20150106040854857857604000')
17
+  (1.2ms) COMMIT
18
+ Migrating to CreateNotifyUserUnsubscribes (20150106040854860860323000)
19
+  (0.7ms) BEGIN
20
+  (7.1ms) CREATE TABLE "notify_user_unsubscribes" ("id" serial primary key, "type" character varying(255), "target_id" integer, "target_type" character varying(255), "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
21
+  (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ('20150106040854860860323000')
22
+  (0.6ms) COMMIT
23
+ Migrating to CreateNotifyUserUserHashes (20150106040854862862248000)
24
+  (0.4ms) BEGIN
25
+  (10.0ms) CREATE TABLE "notify_user_user_hashes" ("id" serial primary key, "type" character varying(255), "target_id" integer, "target_type" character varying(255), "token" character varying(255), "active" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
26
+  (0.6ms) INSERT INTO "schema_migrations" ("version") VALUES ('20150106040854862862248000')
27
+  (0.9ms) COMMIT
28
+  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
29
+ Connecting to database specified by database.yml
30
+  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
31
+  (128.2ms) DROP DATABASE IF EXISTS "notify_user_test"
32
+  (251.9ms) CREATE DATABASE "notify_user_test" ENCODING = 'unicode'
33
+  (20.6ms) CREATE TABLE "notify_user_notifications" ("id" serial primary key, "type" character varying(255), "target_id" integer, "target_type" character varying(255), "params" json, "state" character varying(255), "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
34
+  (11.8ms) CREATE TABLE "notify_user_unsubscribes" ("id" serial primary key, "type" character varying(255), "target_id" integer, "target_type" character varying(255), "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
35
+  (9.8ms) CREATE TABLE "notify_user_user_hashes" ("id" serial primary key, "type" character varying(255), "target_id" integer, "target_type" character varying(255), "token" character varying(255), "active" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
36
+  (7.8ms) CREATE TABLE "users" ("id" serial primary key, "email" character varying(255), "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
37
+  (2.7ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)
38
+  (3.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
39
+  (0.9ms) SELECT version FROM "schema_migrations"
40
+  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20150106040854862862248000')
41
+  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20150106040852')
42
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20150106040854857857604000')
43
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20150106040854860860323000')
44
+ Connecting to database specified by database.yml
45
+  (0.3ms) BEGIN
46
+  (0.2ms) SAVEPOINT active_record_1
47
+ SQL (4.9ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
48
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49
+ Processing by NotifyUser::NotificationsController#index as HTML
50
+ Rendered /Users/william/Papercloud/notify_user/app/views/notify_user/base_notifications/index.html.erb within layouts/application (0.4ms)
51
+ Completed 200 OK in 16.8ms (Views: 14.1ms | ActiveRecord: 0.0ms)
52
+  (0.4ms) ROLLBACK
53
+  (0.2ms) BEGIN
54
+  (0.2ms) SAVEPOINT active_record_1
55
+ SQL (0.6ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
56
+  (0.2ms) RELEASE SAVEPOINT active_record_1
57
+  (0.3ms) SAVEPOINT active_record_1
58
+  (1.3ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 2 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
59
+ SQL (1.2ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "{\"name\":\"Mr. Blobby\"}"], ["state", "pending"], ["target_id", 2], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
60
+  (0.2ms) RELEASE SAVEPOINT active_record_1
61
+ Processing by NotifyUser::NotificationsController#index as JSON
62
+  (0.8ms) SELECT COUNT(*) FROM "notify_user_notifications" WHERE "notify_user_notifications"."target_id" = 2 AND "notify_user_notifications"."target_type" = 'User'
63
+ NotifyUser::BaseNotification Load (1.5ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."target_id" = 2 AND "notify_user_notifications"."target_type" = 'User' ORDER BY created_at DESC LIMIT 25 OFFSET 0
64
+ Completed 200 OK in 12.8ms (Views: 6.6ms | ActiveRecord: 2.3ms)
65
+  (0.4ms) ROLLBACK
66
+  (0.2ms) BEGIN
67
+  (0.2ms) SAVEPOINT active_record_1
68
+ SQL (0.6ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
69
+  (0.2ms) RELEASE SAVEPOINT active_record_1
70
+  (0.2ms) SAVEPOINT active_record_1
71
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 3 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
72
+ SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "{\"name\":\"Mr. Blobby\"}"], ["state", "pending"], ["target_id", 3], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
73
+  (0.3ms) RELEASE SAVEPOINT active_record_1
74
+  (0.2ms) SAVEPOINT active_record_1
75
+  (0.5ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 3 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
76
+ SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "{\"name\":\"Mr. Adams\"}"], ["state", "pending"], ["target_id", 3], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
77
+  (0.2ms) RELEASE SAVEPOINT active_record_1
78
+  (0.2ms) SAVEPOINT active_record_1
79
+  (0.5ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 3 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
80
+ SQL (0.6ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "{\"name\":\"Mrs. James\"}"], ["state", "pending"], ["target_id", 3], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
81
+  (0.2ms) RELEASE SAVEPOINT active_record_1
82
+ Processing by NotifyUser::NotificationsController#index as HTML
83
+ NotifyUser::BaseNotification Load (0.6ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."target_id" = 3 AND "notify_user_notifications"."target_type" = 'User' ORDER BY created_at DESC LIMIT 25 OFFSET 0
84
+ Completed 200 OK in 17.2ms (Views: 15.8ms | ActiveRecord: 0.6ms)
85
+  (0.2ms) ROLLBACK
86
+  (0.1ms) BEGIN
87
+  (0.2ms) SAVEPOINT active_record_1
88
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
89
+  (0.2ms) RELEASE SAVEPOINT active_record_1
90
+  (0.1ms) SAVEPOINT active_record_1
91
+  (0.5ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 4 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
92
+ SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "{\"name\":\"Mr. Blobby\"}"], ["state", "pending"], ["target_id", 4], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
93
+  (0.2ms) RELEASE SAVEPOINT active_record_1
94
+  (0.2ms) SAVEPOINT active_record_1
95
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 4 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
96
+ SQL (0.7ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "{\"name\":\"Mr. Adams\"}"], ["state", "pending"], ["target_id", 4], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
97
+  (0.2ms) RELEASE SAVEPOINT active_record_1
98
+  (0.2ms) SAVEPOINT active_record_1
99
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 4 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
100
+ SQL (1.2ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "{\"name\":\"Mrs. James\"}"], ["state", "pending"], ["target_id", 4], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
101
+  (0.3ms) RELEASE SAVEPOINT active_record_1
102
+ Processing by NotifyUser::NotificationsController#read as HTML
103
+ Parameters: {"id"=>"5"}
104
+ NotifyUser::BaseNotification Load (0.6ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."target_id" = 4 AND "notify_user_notifications"."target_type" = 'User' AND (id = '5') LIMIT 1
105
+  (0.2ms) SAVEPOINT active_record_1
106
+ User Load (0.7ms) SELECT "users".* FROM "users" WHERE "users"."id" = 4 LIMIT 1
107
+  (0.5ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 4 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
108
+  (0.8ms) UPDATE "notify_user_notifications" SET "state" = 'read', "updated_at" = '2015-01-06 04:09:06.193124', "params" = '{"name":"Mr. Blobby"}' WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 5
109
+  (0.2ms) RELEASE SAVEPOINT active_record_1
110
+ Completed 200 OK in 32.0ms (Views: 2.2ms | ActiveRecord: 3.0ms)
111
+ NotifyUser::BaseNotification Load (0.7ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = 5 LIMIT 1
112
+  (0.3ms) ROLLBACK
113
+  (0.3ms) BEGIN
114
+  (0.2ms) SAVEPOINT active_record_1
115
+ SQL (0.6ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
116
+  (0.2ms) RELEASE SAVEPOINT active_record_1
117
+  (0.2ms) SAVEPOINT active_record_1
118
+  (0.8ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 5 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
119
+ SQL (0.4ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "{\"name\":\"Mr. Blobby\"}"], ["state", "pending"], ["target_id", 5], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
120
+  (0.1ms) RELEASE SAVEPOINT active_record_1
121
+  (0.1ms) SAVEPOINT active_record_1
122
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 5 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
123
+ SQL (0.4ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "{\"name\":\"Mr. Adams\"}"], ["state", "pending"], ["target_id", 5], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
124
+  (0.2ms) RELEASE SAVEPOINT active_record_1
125
+  (0.2ms) SAVEPOINT active_record_1
126
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 5 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
127
+ SQL (0.4ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "{\"name\":\"Mrs. James\"}"], ["state", "pending"], ["target_id", 5], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
128
+  (0.2ms) RELEASE SAVEPOINT active_record_1
129
+ Processing by NotifyUser::NotificationsController#read as HTML
130
+ Parameters: {"id"=>"8"}
131
+ NotifyUser::BaseNotification Load (0.6ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."target_id" = 5 AND "notify_user_notifications"."target_type" = 'User' AND (id = '8') LIMIT 1
132
+  (0.2ms) SAVEPOINT active_record_1
133
+ User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = 5 LIMIT 1
134
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 5 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
135
+  (0.5ms) UPDATE "notify_user_notifications" SET "state" = 'read', "updated_at" = '2015-01-06 04:09:06.230444', "params" = '{"name":"Mr. Blobby"}' WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 8
136
+  (0.3ms) RELEASE SAVEPOINT active_record_1
137
+ Completed 200 OK in 8.0ms (Views: 0.4ms | ActiveRecord: 2.5ms)
138
+ Processing by NotifyUser::NotificationsController#read as HTML
139
+ Parameters: {"id"=>"8"}
140
+ NotifyUser::BaseNotification Load (0.7ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."target_id" = 5 AND "notify_user_notifications"."target_type" = 'User' AND (id = '8') LIMIT 1
141
+ Completed 200 OK in 2.2ms (Views: 0.3ms | ActiveRecord: 0.7ms)
142
+  (0.3ms) ROLLBACK
143
+  (0.2ms) BEGIN
144
+  (0.3ms) SAVEPOINT active_record_1
145
+ SQL (0.6ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
146
+  (0.2ms) RELEASE SAVEPOINT active_record_1
147
+  (0.2ms) SAVEPOINT active_record_1
148
+  (0.5ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 6 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
149
+ SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "{\"name\":\"Mr. Blobby\"}"], ["state", "pending"], ["target_id", 6], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
150
+  (0.2ms) RELEASE SAVEPOINT active_record_1
151
+  (0.2ms) SAVEPOINT active_record_1
152
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 6 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
153
+ SQL (0.6ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "{\"name\":\"Mr. Adams\"}"], ["state", "pending"], ["target_id", 6], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
154
+  (0.2ms) RELEASE SAVEPOINT active_record_1
155
+  (0.2ms) SAVEPOINT active_record_1
156
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 6 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
157
+ SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "{\"name\":\"Mrs. James\"}"], ["state", "pending"], ["target_id", 6], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
158
+  (0.3ms) RELEASE SAVEPOINT active_record_1
159
+ Processing by NotifyUser::NotificationsController#mark_all as HTML
160
+ SQL (1.1ms) UPDATE "notify_user_notifications" SET "state" = 'read' WHERE "notify_user_notifications"."target_id" = 6 AND "notify_user_notifications"."target_type" = 'User' AND (state IN ('pending','sent'))
161
+ Redirected to http://test.host/notify_user/notifications
162
+ Completed 302 Found in 3.1ms (ActiveRecord: 1.1ms)
163
+ NotifyUser::BaseNotification Load (0.7ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."target_id" = 6 AND "notify_user_notifications"."target_type" = 'User' AND (state IN ('["pending","sent"]'))
164
+  (0.2ms) ROLLBACK
165
+  (0.1ms) BEGIN
166
+  (0.2ms) SAVEPOINT active_record_1
167
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
168
+  (0.2ms) RELEASE SAVEPOINT active_record_1
169
+  (0.2ms) SAVEPOINT active_record_1
170
+  (0.5ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 7 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
171
+ SQL (0.4ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "{\"name\":\"Mr. Blobby\"}"], ["state", "pending"], ["target_id", 7], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
172
+  (0.2ms) RELEASE SAVEPOINT active_record_1
173
+ Processing by NotifyUser::NotificationsController#mark_read as HTML
174
+ Parameters: {"ids"=>["14"]}
175
+ SQL (0.7ms) UPDATE "notify_user_notifications" SET "state" = 'read' WHERE "notify_user_notifications"."target_id" = 7 AND "notify_user_notifications"."target_type" = 'User' AND (id IN ('14'))
176
+ NotifyUser::BaseNotification Load (0.5ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."target_id" = 7 AND "notify_user_notifications"."target_type" = 'User' AND (id IN ('14'))
177
+ Completed 200 OK in 5.7ms (Views: 2.6ms | ActiveRecord: 1.3ms)
178
+ NewPostNotification Load (0.8ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = $1 LIMIT 1 [["id", 14]]
179
+  (0.3ms) ROLLBACK
180
+  (0.2ms) BEGIN
181
+  (0.2ms) SAVEPOINT active_record_1
182
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
183
+  (0.2ms) RELEASE SAVEPOINT active_record_1
184
+  (0.2ms) SAVEPOINT active_record_1
185
+  (0.7ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 8 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
186
+ SQL (0.4ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "{\"name\":\"Mr. Blobby\"}"], ["state", "pending"], ["target_id", 8], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
187
+  (0.2ms) RELEASE SAVEPOINT active_record_1
188
+ Processing by NotifyUser::NotificationsController#mark_read as HTML
189
+ Parameters: {"ids"=>["15"]}
190
+ SQL (0.5ms) UPDATE "notify_user_notifications" SET "state" = 'read' WHERE "notify_user_notifications"."target_id" = 8 AND "notify_user_notifications"."target_type" = 'User' AND (id IN ('15'))
191
+ NotifyUser::BaseNotification Load (0.4ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."target_id" = 8 AND "notify_user_notifications"."target_type" = 'User' AND (id IN ('15'))
192
+ Completed 200 OK in 4.3ms (Views: 2.3ms | ActiveRecord: 1.0ms)
193
+  (0.3ms) ROLLBACK
194
+  (0.2ms) BEGIN
195
+  (0.2ms) SAVEPOINT active_record_1
196
+ SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
197
+  (0.2ms) RELEASE SAVEPOINT active_record_1
198
+  (0.2ms) SAVEPOINT active_record_1
199
+  (0.5ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 9 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
200
+ SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "{\"name\":\"Mr. Blobby\"}"], ["state", "pending"], ["target_id", 9], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
201
+  (0.2ms) RELEASE SAVEPOINT active_record_1
202
+ NotifyUser::Unsubscribe Load (0.4ms) SELECT "notify_user_unsubscribes".* FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 9 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
203
+ Processing by NotifyUser::NotificationsController#subscriptions as HTML
204
+ Parameters: {"types"=>[{"type"=>"NewPostNotification", "status"=>"0"}]}
205
+  (0.7ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 9 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
206
+  (0.2ms) SAVEPOINT active_record_1
207
+ NotifyUser::Unsubscribe Exists (0.7ms) SELECT 1 AS one FROM "notify_user_unsubscribes" WHERE ("notify_user_unsubscribes"."type" = 'NewPostNotification' AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."target_id" = 9) LIMIT 1
208
+ SQL (1.2ms) INSERT INTO "notify_user_unsubscribes" ("created_at", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["target_id", 9], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
209
+  (0.3ms) RELEASE SAVEPOINT active_record_1
210
+  (0.7ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 9 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
211
+ Completed 200 OK in 28.8ms (Views: 0.4ms | ActiveRecord: 3.7ms)
212
+ NotifyUser::Unsubscribe Load (0.4ms) SELECT "notify_user_unsubscribes".* FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 9 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
213
+  (0.2ms) ROLLBACK
214
+  (0.2ms) BEGIN
215
+  (0.2ms) SAVEPOINT active_record_1
216
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
217
+  (0.2ms) RELEASE SAVEPOINT active_record_1
218
+  (0.3ms) SAVEPOINT active_record_1
219
+  (0.6ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 10 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
220
+ SQL (0.6ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "{\"name\":\"Mr. Blobby\"}"], ["state", "pending"], ["target_id", 10], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
221
+  (0.2ms) RELEASE SAVEPOINT active_record_1
222
+ NotifyUser::Unsubscribe Load (0.4ms) SELECT "notify_user_unsubscribes".* FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 10 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
223
+ Processing by NotifyUser::NotificationsController#subscriptions as HTML
224
+ Parameters: {"types"=>[{"type"=>"NewPostNotification", "status"=>"1"}]}
225
+ NotifyUser::Unsubscribe Load (0.5ms) SELECT "notify_user_unsubscribes".* FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 10 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
226
+  (0.5ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 10 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
227
+ Completed 200 OK in 3.4ms (Views: 0.4ms | ActiveRecord: 1.0ms)
228
+ NotifyUser::Unsubscribe Load (0.6ms) SELECT "notify_user_unsubscribes".* FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 10 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
229
+  (0.2ms) ROLLBACK
230
+  (0.2ms) BEGIN
231
+  (0.2ms) SAVEPOINT active_record_1
232
+ SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
233
+  (0.2ms) RELEASE SAVEPOINT active_record_1
234
+  (0.1ms) SAVEPOINT active_record_1
235
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 11 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
236
+ SQL (0.4ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "{\"name\":\"Mr. Blobby\"}"], ["state", "pending"], ["target_id", 11], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
237
+  (0.2ms) RELEASE SAVEPOINT active_record_1
238
+ Processing by NotifyUser::NotificationsController#unsubscribe as HTML
239
+ Parameters: {"type"=>"NewPostNotification"}
240
+  (0.3ms) SAVEPOINT active_record_1
241
+ NotifyUser::Unsubscribe Exists (0.5ms) SELECT 1 AS one FROM "notify_user_unsubscribes" WHERE ("notify_user_unsubscribes"."type" = 'NewPostNotification' AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."target_id" = 11) LIMIT 1
242
+ SQL (0.7ms) INSERT INTO "notify_user_unsubscribes" ("created_at", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["target_id", 11], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
243
+  (0.2ms) RELEASE SAVEPOINT active_record_1
244
+ Redirected to http://test.host/notify_user/notifications/unsubscribe
245
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 11 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
246
+ Completed 302 Found in 7.1ms (ActiveRecord: 2.1ms)
247
+ NotifyUser::Unsubscribe Load (0.9ms) SELECT "notify_user_unsubscribes".* FROM "notify_user_unsubscribes" ORDER BY "notify_user_unsubscribes"."id" DESC LIMIT 1
248
+  (0.3ms) ROLLBACK
249
+  (0.2ms) BEGIN
250
+  (0.2ms) SAVEPOINT active_record_1
251
+ SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
252
+  (0.2ms) RELEASE SAVEPOINT active_record_1
253
+  (0.2ms) SAVEPOINT active_record_1
254
+  (0.6ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 12 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
255
+ SQL (0.4ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "{\"name\":\"Mr. Blobby\"}"], ["state", "pending"], ["target_id", 12], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
256
+  (0.2ms) RELEASE SAVEPOINT active_record_1
257
+  (0.2ms) SAVEPOINT active_record_1
258
+ NotifyUser::Unsubscribe Exists (0.4ms) SELECT 1 AS one FROM "notify_user_unsubscribes" WHERE ("notify_user_unsubscribes"."type" = 'NewPostNotification' AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."target_id" = 12) LIMIT 1
259
+ SQL (0.5ms) INSERT INTO "notify_user_unsubscribes" ("created_at", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["target_id", 12], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
260
+  (0.2ms) RELEASE SAVEPOINT active_record_1
261
+ Processing by NotifyUser::NotificationsController#subscribe as HTML
262
+ Parameters: {"type"=>"NewPostNotification"}
263
+ NotifyUser::Unsubscribe Load (0.5ms) SELECT "notify_user_unsubscribes".* FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 12 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
264
+  (0.1ms) SAVEPOINT active_record_1
265
+ SQL (0.7ms) DELETE FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."id" = $1 [["id", 3]]
266
+  (0.2ms) RELEASE SAVEPOINT active_record_1
267
+ Redirected to http://test.host/notify_user/notifications/unsubscribe
268
+ Completed 302 Found in 4.5ms (ActiveRecord: 1.5ms)
269
+ NotifyUser::Unsubscribe Load (0.3ms) SELECT "notify_user_unsubscribes".* FROM "notify_user_unsubscribes"
270
+  (0.2ms) ROLLBACK
271
+  (0.1ms) BEGIN
272
+  (0.2ms) SAVEPOINT active_record_1
273
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
274
+  (0.2ms) RELEASE SAVEPOINT active_record_1
275
+  (0.3ms) SAVEPOINT active_record_1
276
+  (0.9ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 13 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
277
+ SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "{\"name\":\"Mr. Blobby\"}"], ["state", "pending"], ["target_id", 13], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
278
+  (0.2ms) RELEASE SAVEPOINT active_record_1
279
+ NotifyUser::UserHash Load (0.7ms) SELECT "notify_user_user_hashes".* FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."target_id" = 13 AND "notify_user_user_hashes"."target_type" = 'User' AND "notify_user_user_hashes"."type" = 'NewPostNotification' AND "notify_user_user_hashes"."active" = 't' LIMIT 1
280
+  (0.3ms) SAVEPOINT active_record_1
281
+ NotifyUser::UserHash Exists (0.5ms) SELECT 1 AS one FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."token" = '8r6km98pm_YIP71uH3_hVwuZqUKZElXbAqwJ00ATrhGw' LIMIT 1
282
+ SQL (1.3ms) INSERT INTO "notify_user_user_hashes" ("active", "created_at", "target_id", "target_type", "token", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", true], ["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["target_id", 13], ["target_type", "User"], ["token", "8r6km98pm_YIP71uH3_hVwuZqUKZElXbAqwJ00ATrhGw"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
283
+  (0.2ms) RELEASE SAVEPOINT active_record_1
284
+ Processing by NotifyUser::NotificationsController#unauth_unsubscribe as HTML
285
+ Parameters: {"type"=>"NewPostNotification", "token"=>"8r6km98pm_YIP71uH3_hVwuZqUKZElXbAqwJ00ATrhGw"}
286
+ NotifyUser::UserHash Exists (0.5ms) SELECT 1 AS one FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."token" = '8r6km98pm_YIP71uH3_hVwuZqUKZElXbAqwJ00ATrhGw' AND "notify_user_user_hashes"."type" = 'NewPostNotification' AND "notify_user_user_hashes"."active" = 't' LIMIT 1
287
+ NotifyUser::UserHash Load (0.5ms) SELECT "notify_user_user_hashes".* FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."token" = '8r6km98pm_YIP71uH3_hVwuZqUKZElXbAqwJ00ATrhGw' AND "notify_user_user_hashes"."type" = 'NewPostNotification' LIMIT 1
288
+ User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."id" = 13 LIMIT 1
289
+  (0.2ms) SAVEPOINT active_record_1
290
+ NotifyUser::Unsubscribe Exists (0.5ms) SELECT 1 AS one FROM "notify_user_unsubscribes" WHERE ("notify_user_unsubscribes"."type" = 'NewPostNotification' AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."target_id" = 13) LIMIT 1
291
+ SQL (0.5ms) INSERT INTO "notify_user_unsubscribes" ("created_at", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["target_id", 13], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
292
+  (0.2ms) RELEASE SAVEPOINT active_record_1
293
+  (0.2ms) SAVEPOINT active_record_1
294
+  (0.4ms) UPDATE "notify_user_user_hashes" SET "active" = 'f', "updated_at" = '2015-01-06 04:09:06.445842' WHERE "notify_user_user_hashes"."id" = 1
295
+  (0.2ms) RELEASE SAVEPOINT active_record_1
296
+ Completed 200 OK in 11.1ms (Views: 0.4ms | ActiveRecord: 3.6ms)
297
+ NotifyUser::UserHash Load (0.5ms) SELECT "notify_user_user_hashes".* FROM "notify_user_user_hashes" ORDER BY "notify_user_user_hashes"."id" DESC LIMIT 1
298
+  (0.2ms) ROLLBACK
299
+  (0.2ms) BEGIN
300
+ NotifyUser::UserHash Load (1.0ms) SELECT "notify_user_user_hashes".* FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."target_id" IS NULL AND "notify_user_user_hashes"."target_type" = 'User' AND "notify_user_user_hashes"."type" = 'NewPostNotification' AND "notify_user_user_hashes"."active" = 't' LIMIT 1
301
+  (0.4ms) SAVEPOINT active_record_1
302
+  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1
303
+ NotifyUser::UserHash Load (0.6ms) SELECT "notify_user_user_hashes".* FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."target_id" IS NULL AND "notify_user_user_hashes"."target_type" = 'User' AND "notify_user_user_hashes"."type" = 'NewPostNotification' AND "notify_user_user_hashes"."active" = 't' LIMIT 1
304
+  (0.2ms) SAVEPOINT active_record_1
305
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
306
+  (0.2ms) ROLLBACK
307
+  (0.2ms) BEGIN
308
+ NotifyUser::UserHash Load (0.6ms) SELECT "notify_user_user_hashes".* FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."target_id" IS NULL AND "notify_user_user_hashes"."target_type" = 'User' AND "notify_user_user_hashes"."type" = 'NewPostNotification' AND "notify_user_user_hashes"."active" = 't' LIMIT 1
309
+  (0.2ms) SAVEPOINT active_record_1
310
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
311
+ NotifyUser::UserHash Load (0.7ms) SELECT "notify_user_user_hashes".* FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."target_id" IS NULL AND "notify_user_user_hashes"."target_type" = 'User' AND "notify_user_user_hashes"."type" = 'NewPostNotification' AND "notify_user_user_hashes"."active" = 't' LIMIT 1
312
+  (0.2ms) SAVEPOINT active_record_1
313
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
314
+  (0.2ms) ROLLBACK
315
+  (0.2ms) BEGIN
316
+ NotifyUser::UserHash Load (0.6ms) SELECT "notify_user_user_hashes".* FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."target_id" IS NULL AND "notify_user_user_hashes"."target_type" = 'User' AND "notify_user_user_hashes"."type" = 'NewPostNotification' AND "notify_user_user_hashes"."active" = 't' LIMIT 1
317
+  (0.2ms) SAVEPOINT active_record_1
318
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
319
+ NotifyUser::UserHash Load (0.5ms) SELECT "notify_user_user_hashes".* FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."target_id" IS NULL AND "notify_user_user_hashes"."target_type" = 'User' AND "notify_user_user_hashes"."type" = 'NewPostNotification' AND "notify_user_user_hashes"."active" = 't' LIMIT 1
320
+  (0.2ms) SAVEPOINT active_record_1
321
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
322
+  (0.2ms) ROLLBACK
323
+  (0.2ms) BEGIN
324
+  (0.2ms) SAVEPOINT active_record_1
325
+ SQL (0.6ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
326
+  (0.4ms) RELEASE SAVEPOINT active_record_1
327
+  (0.2ms) SAVEPOINT active_record_1
328
+  (0.5ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 14 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
329
+ SQL (0.4ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "null"], ["state", "pending"], ["target_id", 14], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
330
+  (0.2ms) RELEASE SAVEPOINT active_record_1
331
+  (0.5ms) SELECT COUNT(*) FROM "notify_user_notifications" WHERE "notify_user_notifications"."target_id" = 14 AND "notify_user_notifications"."target_type" = 'User' AND (state IN ('sent','pending'))
332
+  (0.3ms) ROLLBACK
333
+  (0.2ms) BEGIN
334
+  (0.2ms) SAVEPOINT active_record_1
335
+ SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
336
+  (0.2ms) RELEASE SAVEPOINT active_record_1
337
+  (0.2ms) SAVEPOINT active_record_1
338
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 15 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
339
+ SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "null"], ["state", "pending"], ["target_id", 15], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
340
+  (0.2ms) RELEASE SAVEPOINT active_record_1
341
+  (0.2ms) ROLLBACK
342
+  (0.1ms) BEGIN
343
+  (0.2ms) SAVEPOINT active_record_1
344
+ SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
345
+  (0.2ms) RELEASE SAVEPOINT active_record_1
346
+  (0.2ms) SAVEPOINT active_record_1
347
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 16 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
348
+ SQL (0.4ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "null"], ["state", "pending"], ["target_id", 16], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
349
+  (0.2ms) RELEASE SAVEPOINT active_record_1
350
+  (0.2ms) ROLLBACK
351
+  (0.2ms) BEGIN
352
+  (0.1ms) SAVEPOINT active_record_1
353
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
354
+  (0.2ms) RELEASE SAVEPOINT active_record_1
355
+  (0.3ms) SAVEPOINT active_record_1
356
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 17 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
357
+ SQL (0.4ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "null"], ["state", "pending"], ["target_id", 17], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
358
+  (0.2ms) RELEASE SAVEPOINT active_record_1
359
+  (0.2ms) SAVEPOINT active_record_1
360
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 17 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
361
+  (0.6ms) UPDATE "notify_user_notifications" SET "params" = '{"listing_id":1}', "updated_at" = '2015-01-06 04:09:06.584584' WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 24
362
+  (0.2ms) RELEASE SAVEPOINT active_record_1
363
+ NewPostNotification Load (0.5ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" IN ('NewPostNotification') ORDER BY "notify_user_notifications"."id" DESC LIMIT 1
364
+  (0.2ms) ROLLBACK
365
+  (0.2ms) BEGIN
366
+  (0.2ms) SAVEPOINT active_record_1
367
+ SQL (0.6ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
368
+  (0.2ms) RELEASE SAVEPOINT active_record_1
369
+  (0.1ms) SAVEPOINT active_record_1
370
+  (0.5ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 18 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
371
+ SQL (0.7ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "null"], ["state", "pending"], ["target_id", 18], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
372
+  (0.2ms) RELEASE SAVEPOINT active_record_1
373
+  (0.2ms) SAVEPOINT active_record_1
374
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 18 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
375
+  (0.4ms) UPDATE "notify_user_notifications" SET "params" = '{"listing_id":1}', "updated_at" = '2015-01-06 04:09:06.598888' WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 25
376
+  (0.2ms) RELEASE SAVEPOINT active_record_1
377
+ NewPostNotification Load (0.5ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" IN ('NewPostNotification') ORDER BY "notify_user_notifications"."id" DESC LIMIT 1
378
+  (0.2ms) ROLLBACK
379
+  (0.1ms) BEGIN
380
+  (0.2ms) SAVEPOINT active_record_1
381
+ SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
382
+  (0.2ms) RELEASE SAVEPOINT active_record_1
383
+  (0.2ms) SAVEPOINT active_record_1
384
+  (0.6ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 19 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
385
+ SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "null"], ["state", "pending"], ["target_id", 19], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
386
+  (0.2ms) RELEASE SAVEPOINT active_record_1
387
+  (0.2ms) SAVEPOINT active_record_1
388
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 19 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
389
+  (0.5ms) UPDATE "notify_user_notifications" SET "params" = '{"listing_id":1}', "updated_at" = '2015-01-06 04:09:06.611365' WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 26
390
+  (0.2ms) RELEASE SAVEPOINT active_record_1
391
+ NewPostNotification Load (0.5ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" IN ('NewPostNotification') ORDER BY "notify_user_notifications"."id" DESC LIMIT 1
392
+  (0.2ms) ROLLBACK
393
+  (0.2ms) BEGIN
394
+  (0.2ms) SAVEPOINT active_record_1
395
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
396
+  (0.2ms) RELEASE SAVEPOINT active_record_1
397
+  (0.1ms) SAVEPOINT active_record_1
398
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 20 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
399
+ SQL (0.4ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "null"], ["state", "pending"], ["target_id", 20], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
400
+  (0.2ms) RELEASE SAVEPOINT active_record_1
401
+  (0.2ms) SAVEPOINT active_record_1
402
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 20 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
403
+  (0.5ms) UPDATE "notify_user_notifications" SET "params" = '{"listing_id":1}', "updated_at" = '2015-01-06 04:09:06.623490' WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 27
404
+  (0.2ms) RELEASE SAVEPOINT active_record_1
405
+ NewPostNotification Load (0.4ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" IN ('NewPostNotification') ORDER BY "notify_user_notifications"."id" DESC LIMIT 1
406
+  (0.2ms) ROLLBACK
407
+  (0.1ms) BEGIN
408
+  (0.2ms) SAVEPOINT active_record_1
409
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
410
+  (0.2ms) RELEASE SAVEPOINT active_record_1
411
+  (0.2ms) SAVEPOINT active_record_1
412
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 21 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
413
+ SQL (0.4ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "null"], ["state", "pending"], ["target_id", 21], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
414
+  (0.2ms) RELEASE SAVEPOINT active_record_1
415
+  (0.1ms) SAVEPOINT active_record_1
416
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 21 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
417
+  (0.5ms) UPDATE "notify_user_notifications" SET "updated_at" = '2015-01-06 04:09:06.636063', "params" = 'null' WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 28
418
+  (0.2ms) RELEASE SAVEPOINT active_record_1
419
+  (0.2ms) ROLLBACK
420
+  (0.2ms) BEGIN
421
+  (0.2ms) SAVEPOINT active_record_1
422
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
423
+  (0.2ms) RELEASE SAVEPOINT active_record_1
424
+  (0.2ms) SAVEPOINT active_record_1
425
+  (0.7ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 22 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
426
+ SQL (0.7ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "null"], ["state", "pending"], ["target_id", 22], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
427
+  (0.2ms) RELEASE SAVEPOINT active_record_1
428
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 22 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
429
+  (0.2ms) SAVEPOINT active_record_1
430
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 22 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
431
+  (0.5ms) UPDATE "notify_user_notifications" SET "state" = 'sent', "updated_at" = '2015-01-06 04:09:06.650535', "params" = 'null' WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 29
432
+  (0.2ms) RELEASE SAVEPOINT active_record_1
433
+  (0.6ms) SELECT COUNT(*) FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."type" = 'NewPostNotification' AND "notify_user_notifications"."target_id" = 22 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending' AND (id != 29)
434
+ NewPostNotification Load (0.6ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = $1 LIMIT 1 [["id", 29]]
435
+ User Load (0.6ms) SELECT "users".* FROM "users" WHERE "users"."id" = 22 LIMIT 1
436
+ NewPostNotification Load (0.6ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."type" = 'NewPostNotification' AND "notify_user_notifications"."target_id" = 22 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending'
437
+  (0.3ms) ROLLBACK
438
+  (0.2ms) BEGIN
439
+  (0.2ms) SAVEPOINT active_record_1
440
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
441
+  (0.2ms) RELEASE SAVEPOINT active_record_1
442
+  (0.2ms) SAVEPOINT active_record_1
443
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 23 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
444
+ SQL (0.4ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "null"], ["state", "pending"], ["target_id", 23], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
445
+  (0.2ms) RELEASE SAVEPOINT active_record_1
446
+  (0.2ms) SAVEPOINT active_record_1
447
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 23 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
448
+ SQL (0.4ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "null"], ["state", "pending"], ["target_id", 23], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
449
+  (0.3ms) RELEASE SAVEPOINT active_record_1
450
+  (0.6ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 23 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
451
+  (0.2ms) SAVEPOINT active_record_1
452
+  (0.5ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 23 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
453
+  (0.6ms) UPDATE "notify_user_notifications" SET "state" = 'sent', "updated_at" = '2015-01-06 04:09:06.676601', "params" = 'null' WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 31
454
+  (0.2ms) RELEASE SAVEPOINT active_record_1
455
+  (0.6ms) SELECT COUNT(*) FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."type" = 'NewPostNotification' AND "notify_user_notifications"."target_id" = 23 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending' AND (id != 31)
456
+  (0.2ms) ROLLBACK
457
+  (0.1ms) BEGIN
458
+  (0.2ms) SAVEPOINT active_record_1
459
+ SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
460
+  (0.2ms) RELEASE SAVEPOINT active_record_1
461
+  (0.1ms) SAVEPOINT active_record_1
462
+  (0.6ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 24 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
463
+ SQL (0.6ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "null"], ["state", "pending"], ["target_id", 24], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
464
+  (0.2ms) RELEASE SAVEPOINT active_record_1
465
+  (0.6ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 24 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
466
+  (0.2ms) SAVEPOINT active_record_1
467
+  (0.5ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 24 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
468
+  (0.9ms) UPDATE "notify_user_notifications" SET "state" = 'sent', "updated_at" = '2015-01-06 04:09:06.693451', "params" = 'null' WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 32
469
+  (0.3ms) RELEASE SAVEPOINT active_record_1
470
+ NewPostNotification Load (0.9ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 32 LIMIT 1
471
+ User Load (0.8ms) SELECT "users".* FROM "users" WHERE "users"."id" = 24 LIMIT 1
472
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 24 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'action_mailer'
473
+ NotifyUser::UserHash Load (0.7ms) SELECT "notify_user_user_hashes".* FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."target_id" = 24 AND "notify_user_user_hashes"."target_type" = 'User' AND "notify_user_user_hashes"."type" = 'NewPostNotification' AND "notify_user_user_hashes"."active" = 't' LIMIT 1
474
+  (0.2ms) SAVEPOINT active_record_1
475
+ NotifyUser::UserHash Exists (0.4ms) SELECT 1 AS one FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."token" = 'ALutk4xEuqkbjwqQKhOvUwrKLyk5pwXdhZRB3eGGZ5-Q' LIMIT 1
476
+ SQL (0.5ms) INSERT INTO "notify_user_user_hashes" ("active", "created_at", "target_id", "target_type", "token", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", true], ["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["target_id", 24], ["target_type", "User"], ["token", "ALutk4xEuqkbjwqQKhOvUwrKLyk5pwXdhZRB3eGGZ5-Q"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
477
+  (0.2ms) RELEASE SAVEPOINT active_record_1
478
+
479
+ Sent mail to user@example.com (20.0ms)
480
+ Date: Tue, 06 Jan 2015 15:09:06 +1100
481
+ From: please-change-me-at-config-initializers-notify-user@example.com
482
+ To: user@example.com
483
+ Message-ID: <54ab5fe2b1995_a2bb3fcf55865bf019645@wp.local.mail>
484
+ Subject: New Notification
485
+ Mime-Version: 1.0
486
+ Content-Type: text/html;
487
+ charset=UTF-8
488
+ Content-Transfer-Encoding: quoted-printable
489
+
490
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/h=
491
+ tml4/strict.dtd">
492
+ <html>
493
+ <head>
494
+ <meta content=3D"text/html; charset=3Dutf-8" http-equiv=3D"Content-Type=
495
+ "/>
496
+ <title></title>
497
+ </head>
498
+
499
+ <body marginheight=3D"0" topmargin=3D"0" marginwidth=3D"0" leftmargin=3D"=
500
+ 0" style=3D"margin: 0px; -webkit-font-smoothing: antialiased; text-render=
501
+ ing: optimizeLegibility;">
502
+ <div style=3D"width: 100%; height: 70px; margin: 0; padding: 0;">
503
+ <div style=3D"width: 600px; margin: 0 auto; padding: 15px 0;">
504
+ Logo
505
+ </div>
506
+ </div>
507
+ <div style=3D"width: 100%; background-color: #fff; margin: 0; padding: 0;=
508
+ ">
509
+ <div style=3D"width: 500px; margin: 0 auto; padding: 40px 0; ">
510
+ New Post Notification happened.
511
+
512
+ </div>
513
+ </div>
514
+ <div style=3D"width: 100%; min-height: 80px; margin: 0; padding: 0;">
515
+ <div style=3D"width: 600px; margin: 0 auto; padding: 0;">
516
+ <p style=3D"text-align: center;">
517
+ <a href=3D"http://localhost:5000/notify_user/notifications/unauth=
518
+ _unsubscribe?token=3DALutk4xEuqkbjwqQKhOvUwrKLyk5pwXdhZRB3eGGZ5-Q&amp;typ=
519
+ e=3DNewPostNotification">Unsubscribe</a>
520
+ </p>
521
+ <p style=3D"text-align: center;">
522
+ This is the default generated layout. A privacy declaration could g=
523
+ o here.
524
+ </p>
525
+ <p style=3D"text-align: center; margin-bottom: 0px;">
526
+ =C2=A9 MyCompany Pty Ltd
527
+ </p>
528
+ <p style=3D"text-align: center; margin-top: 0px; padding-top: 0px;">
529
+ ABN 123 456 789
530
+ </p>
531
+ </div>
532
+ </div>
533
+ </body>
534
+ </html>=
535
+
536
+  (0.3ms) ROLLBACK
537
+  (0.2ms) BEGIN
538
+  (0.2ms) SAVEPOINT active_record_1
539
+ SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
540
+  (0.3ms) RELEASE SAVEPOINT active_record_1
541
+  (0.3ms) SAVEPOINT active_record_1
542
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 25 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
543
+ SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "null"], ["state", "pending"], ["target_id", 25], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
544
+  (0.2ms) RELEASE SAVEPOINT active_record_1
545
+  (0.2ms) SAVEPOINT active_record_1
546
+  (0.5ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 25 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
547
+  (0.7ms) UPDATE "notify_user_notifications" SET "updated_at" = '2015-01-06 04:09:06.749755', "params" = 'null' WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 33
548
+  (0.2ms) RELEASE SAVEPOINT active_record_1
549
+  (0.3ms) ROLLBACK
550
+  (0.1ms) BEGIN
551
+  (0.2ms) SAVEPOINT active_record_1
552
+ SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
553
+  (0.2ms) RELEASE SAVEPOINT active_record_1
554
+  (0.2ms) SAVEPOINT active_record_1
555
+  (0.5ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 26 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
556
+ SQL (0.4ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "null"], ["state", "pending"], ["target_id", 26], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
557
+  (0.2ms) RELEASE SAVEPOINT active_record_1
558
+  (0.5ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 26 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
559
+  (0.2ms) SAVEPOINT active_record_1
560
+  (0.6ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 26 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
561
+  (0.5ms) UPDATE "notify_user_notifications" SET "state" = 'sent', "updated_at" = '2015-01-06 04:09:06.764344', "params" = 'null' WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 34
562
+  (0.2ms) RELEASE SAVEPOINT active_record_1
563
+ NewPostNotification Load (0.6ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 34 LIMIT 1
564
+ User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = 26 LIMIT 1
565
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 26 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'action_mailer'
566
+ NotifyUser::UserHash Load (0.6ms) SELECT "notify_user_user_hashes".* FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."target_id" = 26 AND "notify_user_user_hashes"."target_type" = 'User' AND "notify_user_user_hashes"."type" = 'NewPostNotification' AND "notify_user_user_hashes"."active" = 't' LIMIT 1
567
+  (0.2ms) SAVEPOINT active_record_1
568
+ NotifyUser::UserHash Exists (0.4ms) SELECT 1 AS one FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."token" = 'SX0CcN9otl8401RTgUb00gUxDdviS6JYFwEAT4aQhfNg' LIMIT 1
569
+ SQL (0.5ms) INSERT INTO "notify_user_user_hashes" ("active", "created_at", "target_id", "target_type", "token", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", true], ["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["target_id", 26], ["target_type", "User"], ["token", "SX0CcN9otl8401RTgUb00gUxDdviS6JYFwEAT4aQhfNg"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
570
+  (0.2ms) RELEASE SAVEPOINT active_record_1
571
+
572
+ Sent mail to user@example.com (5.4ms)
573
+ Date: Tue, 06 Jan 2015 15:09:06 +1100
574
+ From: please-change-me-at-config-initializers-notify-user@example.com
575
+ To: user@example.com
576
+ Message-ID: <54ab5fe2bf1f2_a2bb3fcf55865bf01975b@wp.local.mail>
577
+ Subject: New Notification
578
+ Mime-Version: 1.0
579
+ Content-Type: text/html;
580
+ charset=UTF-8
581
+ Content-Transfer-Encoding: quoted-printable
582
+
583
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/h=
584
+ tml4/strict.dtd">
585
+ <html>
586
+ <head>
587
+ <meta content=3D"text/html; charset=3Dutf-8" http-equiv=3D"Content-Type=
588
+ "/>
589
+ <title></title>
590
+ </head>
591
+
592
+ <body marginheight=3D"0" topmargin=3D"0" marginwidth=3D"0" leftmargin=3D"=
593
+ 0" style=3D"margin: 0px; -webkit-font-smoothing: antialiased; text-render=
594
+ ing: optimizeLegibility;">
595
+ <div style=3D"width: 100%; height: 70px; margin: 0; padding: 0;">
596
+ <div style=3D"width: 600px; margin: 0 auto; padding: 15px 0;">
597
+ Logo
598
+ </div>
599
+ </div>
600
+ <div style=3D"width: 100%; background-color: #fff; margin: 0; padding: 0;=
601
+ ">
602
+ <div style=3D"width: 500px; margin: 0 auto; padding: 40px 0; ">
603
+ New Post Notification happened.
604
+
605
+ </div>
606
+ </div>
607
+ <div style=3D"width: 100%; min-height: 80px; margin: 0; padding: 0;">
608
+ <div style=3D"width: 600px; margin: 0 auto; padding: 0;">
609
+ <p style=3D"text-align: center;">
610
+ <a href=3D"http://localhost:5000/notify_user/notifications/unauth=
611
+ _unsubscribe?token=3DSX0CcN9otl8401RTgUb00gUxDdviS6JYFwEAT4aQhfNg&amp;typ=
612
+ e=3DNewPostNotification">Unsubscribe</a>
613
+ </p>
614
+ <p style=3D"text-align: center;">
615
+ This is the default generated layout. A privacy declaration could g=
616
+ o here.
617
+ </p>
618
+ <p style=3D"text-align: center; margin-bottom: 0px;">
619
+ =C2=A9 MyCompany Pty Ltd
620
+ </p>
621
+ <p style=3D"text-align: center; margin-top: 0px; padding-top: 0px;">
622
+ ABN 123 456 789
623
+ </p>
624
+ </div>
625
+ </div>
626
+ </body>
627
+ </html>=
628
+
629
+  (0.2ms) ROLLBACK
630
+  (0.5ms) BEGIN
631
+  (0.2ms) SAVEPOINT active_record_1
632
+ SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
633
+  (0.2ms) RELEASE SAVEPOINT active_record_1
634
+  (0.2ms) SAVEPOINT active_record_1
635
+  (0.6ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 27 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
636
+ SQL (0.7ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "null"], ["state", "pending"], ["target_id", 27], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
637
+  (0.2ms) RELEASE SAVEPOINT active_record_1
638
+ NewPostNotification Load (0.5ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 35 LIMIT 1
639
+ User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."id" = 27 LIMIT 1
640
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 27 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'action_mailer'
641
+  (0.2ms) ROLLBACK
642
+  (0.2ms) BEGIN
643
+  (0.2ms) SAVEPOINT active_record_1
644
+ SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
645
+  (0.2ms) RELEASE SAVEPOINT active_record_1
646
+  (0.2ms) SAVEPOINT active_record_1
647
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 28 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
648
+ SQL (0.4ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "null"], ["state", "pending"], ["target_id", 28], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
649
+  (0.2ms) RELEASE SAVEPOINT active_record_1
650
+ NewPostNotification Load (0.4ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = $1 LIMIT 1 [["id", 36]]
651
+ User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."id" = 28 LIMIT 1
652
+ NewPostNotification Load (0.4ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."type" = 'NewPostNotification' AND "notify_user_notifications"."target_id" = 28 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending'
653
+  (0.2ms) SAVEPOINT active_record_1
654
+ User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = 28 LIMIT 1
655
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 28 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
656
+  (0.4ms) UPDATE "notify_user_notifications" SET "state" = 'sent', "updated_at" = '2015-01-06 04:09:06.817299', "params" = 'null' WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 36
657
+  (0.2ms) RELEASE SAVEPOINT active_record_1
658
+  (0.2ms) ROLLBACK
659
+  (0.2ms) BEGIN
660
+  (0.2ms) SAVEPOINT active_record_1
661
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
662
+  (0.2ms) RELEASE SAVEPOINT active_record_1
663
+  (0.2ms) SAVEPOINT active_record_1
664
+  (0.5ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 29 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
665
+ SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "null"], ["state", "pending"], ["target_id", 29], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
666
+  (0.2ms) RELEASE SAVEPOINT active_record_1
667
+  (0.2ms) SAVEPOINT active_record_1
668
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 29 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
669
+ SQL (0.4ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "null"], ["state", "pending"], ["target_id", 29], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
670
+  (0.2ms) RELEASE SAVEPOINT active_record_1
671
+ NewPostNotification Load (0.4ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = $1 LIMIT 1 [["id", 38]]
672
+ User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = 29 LIMIT 1
673
+ NewPostNotification Load (0.5ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."type" = 'NewPostNotification' AND "notify_user_notifications"."target_id" = 29 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending'
674
+  (0.2ms) SAVEPOINT active_record_1
675
+ User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = 29 LIMIT 1
676
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 29 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
677
+  (0.4ms) UPDATE "notify_user_notifications" SET "state" = 'sent', "updated_at" = '2015-01-06 04:09:06.838474', "params" = 'null' WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 37
678
+  (0.2ms) RELEASE SAVEPOINT active_record_1
679
+  (0.2ms) SAVEPOINT active_record_1
680
+ User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."id" = 29 LIMIT 1
681
+  (0.6ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 29 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
682
+  (0.7ms) UPDATE "notify_user_notifications" SET "state" = 'sent', "updated_at" = '2015-01-06 04:09:06.844022', "params" = 'null' WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 38
683
+  (0.2ms) RELEASE SAVEPOINT active_record_1
684
+  (0.2ms) ROLLBACK
685
+  (0.2ms) BEGIN
686
+  (0.2ms) SAVEPOINT active_record_1
687
+ SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
688
+  (0.2ms) RELEASE SAVEPOINT active_record_1
689
+  (0.2ms) SAVEPOINT active_record_1
690
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 30 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
691
+ SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "null"], ["state", "pending"], ["target_id", 30], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
692
+  (0.2ms) RELEASE SAVEPOINT active_record_1
693
+  (0.2ms) SAVEPOINT active_record_1
694
+  (0.6ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 30 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
695
+  (0.5ms) UPDATE "notify_user_notifications" SET "updated_at" = '2015-01-06 04:09:06.857204', "params" = 'null' WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 39
696
+  (0.1ms) RELEASE SAVEPOINT active_record_1
697
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 30 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
698
+  (0.2ms) SAVEPOINT active_record_1
699
+  (0.5ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 30 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
700
+  (0.4ms) UPDATE "notify_user_notifications" SET "state" = 'sent', "updated_at" = '2015-01-06 04:09:06.861888', "params" = 'null' WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 39
701
+  (0.2ms) RELEASE SAVEPOINT active_record_1
702
+ NewPostNotification Load (0.6ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 39 LIMIT 1
703
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 30 LIMIT 1
704
+  (0.5ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 30 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'action_mailer'
705
+ NewPostNotification Load (0.4ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 39 LIMIT 1
706
+ User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = 30 LIMIT 1
707
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 30 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'apns'
708
+  (0.2ms) ROLLBACK
709
+  (0.1ms) BEGIN
710
+  (0.2ms) SAVEPOINT active_record_1
711
+ SQL (0.6ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
712
+  (0.2ms) RELEASE SAVEPOINT active_record_1
713
+  (0.2ms) SAVEPOINT active_record_1
714
+ NotifyUser::Unsubscribe Exists (0.4ms) SELECT 1 AS one FROM "notify_user_unsubscribes" WHERE ("notify_user_unsubscribes"."type" = 'NewPostNotification' AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."target_id" = 31) LIMIT 1
715
+ SQL (0.4ms) INSERT INTO "notify_user_unsubscribes" ("created_at", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["target_id", 31], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
716
+  (0.2ms) RELEASE SAVEPOINT active_record_1
717
+  (0.2ms) SAVEPOINT active_record_1
718
+  (0.6ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 31 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
719
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
720
+  (0.2ms) SAVEPOINT active_record_1
721
+  (0.5ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 31 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
722
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
723
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 31 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
724
+  (0.2ms) ROLLBACK
725
+  (0.2ms) BEGIN
726
+  (0.2ms) SAVEPOINT active_record_1
727
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
728
+  (0.2ms) RELEASE SAVEPOINT active_record_1
729
+  (0.2ms) SAVEPOINT active_record_1
730
+ NotifyUser::Unsubscribe Exists (0.5ms) SELECT 1 AS one FROM "notify_user_unsubscribes" WHERE ("notify_user_unsubscribes"."type" = 'action_mailer' AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."target_id" = 32) LIMIT 1
731
+ SQL (0.5ms) INSERT INTO "notify_user_unsubscribes" ("created_at", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["target_id", 32], ["target_type", "User"], ["type", "action_mailer"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
732
+  (0.2ms) RELEASE SAVEPOINT active_record_1
733
+  (0.2ms) SAVEPOINT active_record_1
734
+ NotifyUser::Unsubscribe Exists (0.9ms) SELECT 1 AS one FROM "notify_user_unsubscribes" WHERE ("notify_user_unsubscribes"."type" = 'action_mailer' AND "notify_user_unsubscribes"."id" != 6 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."target_id" = 32) LIMIT 1
735
+  (0.3ms) RELEASE SAVEPOINT active_record_1
736
+  (0.2ms) SAVEPOINT active_record_1
737
+  (0.5ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 32 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
738
+ SQL (0.6ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "null"], ["state", "pending"], ["target_id", 32], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
739
+  (0.2ms) RELEASE SAVEPOINT active_record_1
740
+  (0.1ms) SAVEPOINT active_record_1
741
+  (0.5ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 32 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
742
+  (0.6ms) UPDATE "notify_user_notifications" SET "updated_at" = '2015-01-06 04:09:06.904971', "params" = 'null' WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 40
743
+  (0.2ms) RELEASE SAVEPOINT active_record_1
744
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 32 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
745
+  (0.2ms) SAVEPOINT active_record_1
746
+  (0.5ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 32 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
747
+  (0.5ms) UPDATE "notify_user_notifications" SET "state" = 'sent', "updated_at" = '2015-01-06 04:09:06.910025', "params" = 'null' WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 40
748
+  (0.2ms) RELEASE SAVEPOINT active_record_1
749
+ NewPostNotification Load (0.5ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 40 LIMIT 1
750
+ User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = 32 LIMIT 1
751
+  (0.5ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 32 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'action_mailer'
752
+ NewPostNotification Load (0.5ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 40 LIMIT 1
753
+ User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."id" = 32 LIMIT 1
754
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 32 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'apns'
755
+  (0.2ms) ROLLBACK
756
+  (0.1ms) BEGIN
757
+  (0.2ms) SAVEPOINT active_record_1
758
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
759
+  (0.2ms) RELEASE SAVEPOINT active_record_1
760
+  (0.2ms) SAVEPOINT active_record_1
761
+  (0.5ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 33 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
762
+ SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "null"], ["state", "pending"], ["target_id", 33], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
763
+  (0.2ms) RELEASE SAVEPOINT active_record_1
764
+ NotifyUser::UserHash Load (0.5ms) SELECT "notify_user_user_hashes".* FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."target_id" = 33 AND "notify_user_user_hashes"."target_type" = 'User' AND "notify_user_user_hashes"."type" = 'NewPostNotification' AND "notify_user_user_hashes"."active" = 't' LIMIT 1
765
+  (0.2ms) SAVEPOINT active_record_1
766
+ NotifyUser::UserHash Exists (0.4ms) SELECT 1 AS one FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."token" = 'Da9qkh9qu06UCun4ldLmwArRWU7356hBpWiykUkWz1Qg' LIMIT 1
767
+ SQL (0.5ms) INSERT INTO "notify_user_user_hashes" ("active", "created_at", "target_id", "target_type", "token", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", true], ["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["target_id", 33], ["target_type", "User"], ["token", "Da9qkh9qu06UCun4ldLmwArRWU7356hBpWiykUkWz1Qg"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
768
+  (0.2ms) RELEASE SAVEPOINT active_record_1
769
+  (0.2ms) ROLLBACK
770
+  (0.2ms) BEGIN
771
+  (0.2ms) SAVEPOINT active_record_1
772
+ SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
773
+  (0.2ms) RELEASE SAVEPOINT active_record_1
774
+  (0.2ms) SAVEPOINT active_record_1
775
+  (0.6ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 34 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
776
+ SQL (0.6ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "null"], ["state", "pending"], ["target_id", 34], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
777
+  (0.3ms) RELEASE SAVEPOINT active_record_1
778
+ NotifyUser::UserHash Load (0.7ms) SELECT "notify_user_user_hashes".* FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."target_id" = 34 AND "notify_user_user_hashes"."target_type" = 'User' AND "notify_user_user_hashes"."type" = 'NewPostNotification' AND "notify_user_user_hashes"."active" = 't' LIMIT 1
779
+  (0.2ms) SAVEPOINT active_record_1
780
+ NotifyUser::UserHash Exists (0.5ms) SELECT 1 AS one FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."token" = 'yoH7FI95IaKEzTP1rCAQBAhRum7_I5PkJ0kSdqc4sFEQ' LIMIT 1
781
+ SQL (0.7ms) INSERT INTO "notify_user_user_hashes" ("active", "created_at", "target_id", "target_type", "token", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", true], ["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["target_id", 34], ["target_type", "User"], ["token", "yoH7FI95IaKEzTP1rCAQBAhRum7_I5PkJ0kSdqc4sFEQ"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
782
+  (0.2ms) RELEASE SAVEPOINT active_record_1
783
+ NotifyUser::UserHash Load (0.6ms) SELECT "notify_user_user_hashes".* FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."target_id" = 34 AND "notify_user_user_hashes"."target_type" = 'User' AND "notify_user_user_hashes"."type" = 'NewPostNotification' AND "notify_user_user_hashes"."active" = 't' LIMIT 1
784
+  (0.2ms) ROLLBACK
785
+  (0.2ms) BEGIN
786
+  (0.2ms) SAVEPOINT active_record_1
787
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
788
+  (0.2ms) RELEASE SAVEPOINT active_record_1
789
+  (0.2ms) SAVEPOINT active_record_1
790
+  (0.5ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 35 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
791
+ SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["params", "null"], ["state", "pending"], ["target_id", 35], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
792
+  (0.2ms) RELEASE SAVEPOINT active_record_1
793
+ NotifyUser::UserHash Load (0.5ms) SELECT "notify_user_user_hashes".* FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."target_id" = 35 AND "notify_user_user_hashes"."target_type" = 'User' AND "notify_user_user_hashes"."type" = 'NewPostNotification' AND "notify_user_user_hashes"."active" = 't' LIMIT 1
794
+  (0.2ms) SAVEPOINT active_record_1
795
+ NotifyUser::UserHash Exists (0.4ms) SELECT 1 AS one FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."token" = '7uuvVT-xpiPPs9QvRf87GgnNUK62Oi_gtjQ-NxNTJLXQ' LIMIT 1
796
+ SQL (0.5ms) INSERT INTO "notify_user_user_hashes" ("active", "created_at", "target_id", "target_type", "token", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", true], ["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["target_id", 35], ["target_type", "User"], ["token", "7uuvVT-xpiPPs9QvRf87GgnNUK62Oi_gtjQ-NxNTJLXQ"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
797
+  (0.2ms) RELEASE SAVEPOINT active_record_1
798
+  (0.2ms) SAVEPOINT active_record_1
799
+  (0.4ms) UPDATE "notify_user_user_hashes" SET "active" = 'f', "updated_at" = '2015-01-06 04:09:06.964718' WHERE "notify_user_user_hashes"."id" = 6
800
+  (0.2ms) RELEASE SAVEPOINT active_record_1
801
+ NotifyUser::UserHash Load (0.5ms) SELECT "notify_user_user_hashes".* FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."target_id" = 35 AND "notify_user_user_hashes"."target_type" = 'User' AND "notify_user_user_hashes"."type" = 'NewPostNotification' AND "notify_user_user_hashes"."active" = 't' LIMIT 1
802
+  (0.2ms) SAVEPOINT active_record_1
803
+ NotifyUser::UserHash Exists (0.4ms) SELECT 1 AS one FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."token" = 'aHGDmoh-oCE8P5LjgP78LQJEKpCTBy-83fJnhLCLNKaw' LIMIT 1
804
+ SQL (0.6ms) INSERT INTO "notify_user_user_hashes" ("active", "created_at", "target_id", "target_type", "token", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", true], ["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["target_id", 35], ["target_type", "User"], ["token", "aHGDmoh-oCE8P5LjgP78LQJEKpCTBy-83fJnhLCLNKaw"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
805
+  (0.2ms) RELEASE SAVEPOINT active_record_1
806
+  (0.2ms) ROLLBACK
807
+  (0.2ms) BEGIN
808
+  (0.2ms) SAVEPOINT active_record_1
809
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
810
+  (0.2ms) RELEASE SAVEPOINT active_record_1
811
+  (0.2ms) SAVEPOINT active_record_1
812
+ NotifyUser::Unsubscribe Exists (0.4ms) SELECT 1 AS one FROM "notify_user_unsubscribes" WHERE ("notify_user_unsubscribes"."type" = 'NewPostNotification' AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."target_id" = 36) LIMIT 1
813
+ SQL (0.4ms) INSERT INTO "notify_user_unsubscribes" ("created_at", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["target_id", 36], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
814
+  (0.2ms) RELEASE SAVEPOINT active_record_1
815
+  (0.1ms) SAVEPOINT active_record_1
816
+ NotifyUser::Unsubscribe Exists (0.5ms) SELECT 1 AS one FROM "notify_user_unsubscribes" WHERE ("notify_user_unsubscribes"."type" = 'NewPostNotification' AND "notify_user_unsubscribes"."id" != 7 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."target_id" = 36) LIMIT 1
817
+  (0.2ms) RELEASE SAVEPOINT active_record_1
818
+  (0.2ms) SAVEPOINT active_record_1
819
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 36 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
820
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
821
+  (0.2ms) ROLLBACK
822
+  (0.2ms) BEGIN
823
+  (0.1ms) SAVEPOINT active_record_1
824
+ SQL (0.6ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
825
+  (0.2ms) RELEASE SAVEPOINT active_record_1
826
+  (0.2ms) SAVEPOINT active_record_1
827
+ NotifyUser::Unsubscribe Exists (0.4ms) SELECT 1 AS one FROM "notify_user_unsubscribes" WHERE ("notify_user_unsubscribes"."type" = 'NewPostNotification' AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."target_id" = 37) LIMIT 1
828
+ SQL (0.5ms) INSERT INTO "notify_user_unsubscribes" ("created_at", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00], ["target_id", 37], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:06 UTC +00:00]]
829
+  (0.2ms) RELEASE SAVEPOINT active_record_1
830
+  (0.1ms) SAVEPOINT active_record_1
831
+ NotifyUser::Unsubscribe Exists (0.5ms) SELECT 1 AS one FROM "notify_user_unsubscribes" WHERE ("notify_user_unsubscribes"."type" = 'NewPostNotification' AND "notify_user_unsubscribes"."id" != 8 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."target_id" = 37) LIMIT 1
832
+  (0.3ms) RELEASE SAVEPOINT active_record_1
833
+  (0.3ms) SAVEPOINT active_record_1
834
+  (0.6ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 37 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
835
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
836
+  (0.3ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 37 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
837
+  (0.1ms) ROLLBACK
838
+  (0.1ms) BEGIN
839
+  (0.2ms) SAVEPOINT active_record_1
840
+ SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:07 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:07 UTC +00:00]]
841
+  (0.2ms) RELEASE SAVEPOINT active_record_1
842
+  (0.2ms) SAVEPOINT active_record_1
843
+ NotifyUser::Unsubscribe Exists (0.5ms) SELECT 1 AS one FROM "notify_user_unsubscribes" WHERE ("notify_user_unsubscribes"."type" = 'NewPostNotification' AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."target_id" = 38) LIMIT 1
844
+ SQL (0.5ms) INSERT INTO "notify_user_unsubscribes" ("created_at", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:07 UTC +00:00], ["target_id", 38], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:07 UTC +00:00]]
845
+  (0.2ms) RELEASE SAVEPOINT active_record_1
846
+  (0.1ms) SAVEPOINT active_record_1
847
+ NotifyUser::Unsubscribe Exists (0.6ms) SELECT 1 AS one FROM "notify_user_unsubscribes" WHERE ("notify_user_unsubscribes"."type" = 'NewPostNotification' AND "notify_user_unsubscribes"."id" != 9 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."target_id" = 38) LIMIT 1
848
+  (0.2ms) RELEASE SAVEPOINT active_record_1
849
+  (0.1ms) SAVEPOINT active_record_1
850
+ NotifyUser::Unsubscribe Exists (0.5ms) SELECT 1 AS one FROM "notify_user_unsubscribes" WHERE ("notify_user_unsubscribes"."type" = 'NewPostNotification' AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."target_id" = 38) LIMIT 1
851
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
852
+  (0.5ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 38 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
853
+ NotifyUser::Unsubscribe Load (0.4ms) SELECT "notify_user_unsubscribes".* FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 38 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
854
+  (0.2ms) SAVEPOINT active_record_1
855
+ SQL (0.5ms) DELETE FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."id" = $1 [["id", 9]]
856
+  (0.3ms) RELEASE SAVEPOINT active_record_1
857
+ NotifyUser::Unsubscribe Load (0.6ms) SELECT "notify_user_unsubscribes".* FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 38 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
858
+  (0.3ms) ROLLBACK
859
+  (0.1ms) BEGIN
860
+  (0.2ms) SAVEPOINT active_record_1
861
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:07 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:07 UTC +00:00]]
862
+  (0.2ms) RELEASE SAVEPOINT active_record_1
863
+  (0.2ms) SAVEPOINT active_record_1
864
+  (0.4ms) SELECT COUNT(*) FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 39 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
865
+ SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:07 UTC +00:00], ["params", "{\"name\":\"Mr. Blobby\"}"], ["state", "pending"], ["target_id", 39], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:07 UTC +00:00]]
866
+  (0.2ms) RELEASE SAVEPOINT active_record_1
867
+  (0.3ms) ROLLBACK
868
+  (0.2ms) BEGIN
869
+  (0.2ms) SAVEPOINT active_record_1
870
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:07 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:07 UTC +00:00]]
871
+  (0.2ms) RELEASE SAVEPOINT active_record_1
872
+  (0.1ms) SAVEPOINT active_record_1
873
+ NotifyUser::UserHash Exists (0.4ms) SELECT 1 AS one FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."token" = 'QnqGE29ZCFpTiKdylEe_xwtA5dWVkIULNDjc1fvNlDig' LIMIT 1
874
+ SQL (0.4ms) INSERT INTO "notify_user_user_hashes" ("active", "created_at", "target_id", "target_type", "token", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", true], ["created_at", Tue, 06 Jan 2015 04:09:07 UTC +00:00], ["target_id", 40], ["target_type", "User"], ["token", "QnqGE29ZCFpTiKdylEe_xwtA5dWVkIULNDjc1fvNlDig"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:07 UTC +00:00]]
875
+  (0.2ms) RELEASE SAVEPOINT active_record_1
876
+  (0.2ms) SAVEPOINT active_record_1
877
+  (0.2ms) RELEASE SAVEPOINT active_record_1
878
+ NotifyUser::UserHash Exists (0.5ms) SELECT 1 AS one FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."token" = 'QnqGE29ZCFpTiKdylEe_xwtA5dWVkIULNDjc1fvNlDig' AND "notify_user_user_hashes"."type" = 'NewPostNotification' AND "notify_user_user_hashes"."active" = 't' LIMIT 1
879
+  (0.2ms) ROLLBACK
880
+  (0.2ms) BEGIN
881
+  (0.1ms) SAVEPOINT active_record_1
882
+ SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:07 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:07 UTC +00:00]]
883
+  (0.2ms) RELEASE SAVEPOINT active_record_1
884
+  (0.2ms) SAVEPOINT active_record_1
885
+ NotifyUser::UserHash Exists (9.6ms) SELECT 1 AS one FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."token" = '86MO4k9pdhU0vFQ9LKkdVwrjsWUjx_2Q6jlfePaoTe5Q' LIMIT 1
886
+ SQL (0.5ms) INSERT INTO "notify_user_user_hashes" ("active", "created_at", "target_id", "target_type", "token", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", true], ["created_at", Tue, 06 Jan 2015 04:09:07 UTC +00:00], ["target_id", 41], ["target_type", "User"], ["token", "86MO4k9pdhU0vFQ9LKkdVwrjsWUjx_2Q6jlfePaoTe5Q"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:07 UTC +00:00]]
887
+  (0.2ms) RELEASE SAVEPOINT active_record_1
888
+  (0.2ms) SAVEPOINT active_record_1
889
+  (0.2ms) RELEASE SAVEPOINT active_record_1
890
+  (0.2ms) SAVEPOINT active_record_1
891
+  (0.6ms) UPDATE "notify_user_user_hashes" SET "active" = 'f', "updated_at" = '2015-01-06 04:09:07.055904' WHERE "notify_user_user_hashes"."id" = 9
892
+  (0.2ms) RELEASE SAVEPOINT active_record_1
893
+ NotifyUser::UserHash Exists (0.5ms) SELECT 1 AS one FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."token" = '86MO4k9pdhU0vFQ9LKkdVwrjsWUjx_2Q6jlfePaoTe5Q' AND "notify_user_user_hashes"."type" = 'NewPostNotification' AND "notify_user_user_hashes"."active" = 't' LIMIT 1
894
+  (0.3ms) ROLLBACK
895
+  (0.3ms) BEGIN
896
+  (0.2ms) SAVEPOINT active_record_1
897
+ SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:07 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:07 UTC +00:00]]
898
+  (0.2ms) RELEASE SAVEPOINT active_record_1
899
+  (0.2ms) SAVEPOINT active_record_1
900
+ NotifyUser::UserHash Exists (0.3ms) SELECT 1 AS one FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."token" = 'W3Uj_nFKnllsyANx2wOMTQ1HsN93Cl9BatmQo6rAozjg' LIMIT 1
901
+ SQL (0.4ms) INSERT INTO "notify_user_user_hashes" ("active", "created_at", "target_id", "target_type", "token", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", true], ["created_at", Tue, 06 Jan 2015 04:09:07 UTC +00:00], ["target_id", 42], ["target_type", "User"], ["token", "W3Uj_nFKnllsyANx2wOMTQ1HsN93Cl9BatmQo6rAozjg"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:07 UTC +00:00]]
902
+  (0.2ms) RELEASE SAVEPOINT active_record_1
903
+  (0.2ms) SAVEPOINT active_record_1
904
+  (0.2ms) RELEASE SAVEPOINT active_record_1
905
+  (0.2ms) SAVEPOINT active_record_1
906
+  (0.6ms) UPDATE "notify_user_user_hashes" SET "active" = 'f', "updated_at" = '2015-01-06 04:09:07.068096' WHERE "notify_user_user_hashes"."id" = 10
907
+  (0.2ms) RELEASE SAVEPOINT active_record_1
908
+  (0.2ms) ROLLBACK
909
+  (0.2ms) BEGIN
910
+  (0.2ms) SAVEPOINT active_record_1
911
+ SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Tue, 06 Jan 2015 04:09:07 UTC +00:00], ["email", "user@example.com"], ["updated_at", Tue, 06 Jan 2015 04:09:07 UTC +00:00]]
912
+  (0.2ms) RELEASE SAVEPOINT active_record_1
913
+  (0.2ms) SAVEPOINT active_record_1
914
+ NotifyUser::UserHash Exists (0.5ms) SELECT 1 AS one FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."token" = 'L50-z0BzqAdpwPMy814XqQ8YK3lmlNP3PO7plmdsZecw' LIMIT 1
915
+ SQL (0.5ms) INSERT INTO "notify_user_user_hashes" ("active", "created_at", "target_id", "target_type", "token", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["active", true], ["created_at", Tue, 06 Jan 2015 04:09:07 UTC +00:00], ["target_id", 43], ["target_type", "User"], ["token", "L50-z0BzqAdpwPMy814XqQ8YK3lmlNP3PO7plmdsZecw"], ["type", "NewPostNotification"], ["updated_at", Tue, 06 Jan 2015 04:09:07 UTC +00:00]]
916
+  (0.2ms) RELEASE SAVEPOINT active_record_1
917
+  (0.1ms) SAVEPOINT active_record_1
918
+  (0.1ms) RELEASE SAVEPOINT active_record_1
919
+  (0.2ms) ROLLBACK
920
+  (0.2ms) BEGIN
921
+  (0.2ms) ROLLBACK
922
+  (0.2ms) BEGIN
923
+  (0.2ms) ROLLBACK
924
+  (0.1ms) BEGIN
925
+  (0.2ms) ROLLBACK
926
+  (0.1ms) BEGIN
927
+  (0.1ms) ROLLBACK
928
+  (0.1ms) BEGIN
929
+  (0.1ms) ROLLBACK
930
+  (0.1ms) BEGIN
931
+  (0.1ms) ROLLBACK
932
+  (0.1ms) BEGIN
933
+  (0.2ms) ROLLBACK