notify_user 0.0.1 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. checksums.yaml +7 -0
  2. data/app/assets/javascripts/notify_user/notification.js +7 -0
  3. data/app/assets/stylesheets/notify_user/notify_user.css +50 -0
  4. data/app/controllers/notify_user/base_notifications_controller.rb +144 -0
  5. data/app/controllers/notify_user/notifications_controller.rb +7 -32
  6. data/app/helpers/notify_user/application_helper.rb +9 -0
  7. data/app/mailers/notify_user/notification_mailer.rb +2 -0
  8. data/app/models/notify_user/apns.rb +37 -0
  9. data/app/models/notify_user/base_notification.rb +136 -32
  10. data/app/models/notify_user/unsubscribe.rb +55 -0
  11. data/app/models/notify_user/user_hash.rb +36 -0
  12. data/app/serializers/notify_user/notification_serializer.rb +2 -2
  13. data/app/views/notify_user/action_mailer/aggregate_notification.html.erb +2 -1
  14. data/app/views/notify_user/action_mailer/notification.html.erb +1 -1
  15. data/app/views/notify_user/base_notifications/index.html.erb +20 -0
  16. data/app/views/notify_user/base_notifications/unsubscribe.html.erb +19 -0
  17. data/config/routes.rb +8 -0
  18. data/lib/generators/notify_user/install/install_generator.rb +20 -3
  19. data/lib/generators/notify_user/install/templates/{migration.rb → create_notify_user_notifications.rb} +1 -1
  20. data/lib/generators/notify_user/install/templates/create_notify_user_unsubscribes.rb +10 -0
  21. data/lib/generators/notify_user/install/templates/create_notify_user_user_hashes.rb +12 -0
  22. data/lib/generators/notify_user/install/templates/initializer.rb +2 -0
  23. data/lib/generators/notify_user/install/templates/notifications_controller.rb +9 -0
  24. data/lib/generators/notify_user/json_update/USAGE +5 -0
  25. data/lib/generators/notify_user/json_update/json_update_generator.rb +36 -0
  26. data/lib/generators/notify_user/json_update/templates/add_json_column_to_notifications.rb +9 -0
  27. data/lib/generators/notify_user/json_update/templates/move_params_to_json.rb +8 -0
  28. data/lib/generators/notify_user/notification/notification_generator.rb +2 -0
  29. data/lib/generators/notify_user/notification/templates/email_layout_template.html.erb.erb +6 -0
  30. data/lib/generators/notify_user/notification/templates/notification.rb.erb +2 -1
  31. data/lib/notify_user.rb +4 -1
  32. data/lib/notify_user/channels/action_mailer/action_mailer_channel.rb +2 -1
  33. data/lib/notify_user/channels/apns/apns_channel.rb +17 -0
  34. data/lib/notify_user/engine.rb +2 -0
  35. data/lib/notify_user/railtie.rb +10 -0
  36. data/lib/notify_user/version.rb +1 -1
  37. data/lib/tasks/notify_user.rake +15 -0
  38. data/spec/controllers/notify_user/notifications_controller_spec.rb +89 -1
  39. data/spec/dummy/rails-4.0.2/Gemfile +2 -2
  40. data/spec/dummy/rails-4.0.2/app/controllers/notify_user/notifications_controller.rb +9 -0
  41. data/spec/dummy/rails-4.0.2/app/notifications/new_post_notification.rb +2 -1
  42. data/spec/dummy/rails-4.0.2/app/views/notify_user/layouts/action_mailer.html.erb +6 -0
  43. data/spec/dummy/rails-4.0.2/config/database.yml +42 -13
  44. data/spec/dummy/rails-4.0.2/config/database2.yml +57 -0
  45. data/spec/dummy/rails-4.0.2/config/initializers/notify_user.rb +2 -0
  46. data/spec/dummy/rails-4.0.2/config/initializers/secret_token.rb +1 -1
  47. data/spec/dummy/rails-4.0.2/db/migrate/{20140105070446_create_users.rb → 20140428015529_create_users.rb} +0 -0
  48. data/spec/dummy/rails-4.0.2/db/migrate/{20140105070448_create_notify_user_notifications.rb → 20140428015531189189694000_create_notify_user_notifications.rb} +1 -1
  49. data/spec/dummy/rails-4.0.2/db/migrate/20140428015531190190743000_create_notify_user_unsubscribes.rb +10 -0
  50. data/spec/dummy/rails-4.0.2/db/migrate/20140428015531191191953000_create_notify_user_user_hashes.rb +12 -0
  51. data/spec/dummy/rails-4.0.2/db/schema.rb +23 -2
  52. data/spec/dummy/rails-4.0.2/log/test.log +787 -1414
  53. data/spec/dummy/rails-4.0.2/tmp/cache/assets/test/sprockets/13195a56ea8581e42f709ea01ea4604f +0 -0
  54. data/{app/assets/stylesheets/notify_user/application.css → spec/dummy/rails-4.0.2/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705} +0 -0
  55. data/spec/dummy/rails-4.0.2/tmp/cache/assets/test/sprockets/148f39f7dc2ea6cb194598111dbd4598 +0 -0
  56. data/spec/dummy/rails-4.0.2/tmp/cache/assets/test/sprockets/1d6bc1877ba2bbb89f393e10e8303d39 +0 -0
  57. data/spec/dummy/rails-4.0.2/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  58. data/spec/dummy/rails-4.0.2/tmp/cache/assets/test/sprockets/311d2b645a860b78f79ff156f12092ce +0 -0
  59. data/spec/dummy/rails-4.0.2/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  60. data/spec/dummy/rails-4.0.2/tmp/cache/assets/test/sprockets/39651f0f2ac78423732234ebf092c632 +0 -0
  61. data/spec/dummy/rails-4.0.2/tmp/cache/assets/test/sprockets/5c85b1b5ac27b699c5f800c4e7ec82fb +0 -0
  62. data/spec/dummy/rails-4.0.2/tmp/cache/assets/test/sprockets/68752c7ddc300bee3e9823db8befc306 +0 -0
  63. data/spec/dummy/rails-4.0.2/tmp/cache/assets/test/sprockets/6961013077b8573ed19d1e33abb8ebc5 +0 -0
  64. data/spec/dummy/rails-4.0.2/tmp/cache/assets/test/sprockets/7a316b3629b980c6d3a28924cb5fbbd8 +0 -0
  65. data/spec/dummy/rails-4.0.2/tmp/cache/assets/test/sprockets/8698d6fed0ef2f173a377160752b959f +0 -0
  66. data/spec/dummy/rails-4.0.2/tmp/cache/assets/test/sprockets/8bab520aad78da438df1c428288cf229 +0 -0
  67. data/spec/dummy/rails-4.0.2/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  68. data/spec/dummy/rails-4.0.2/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  69. data/spec/dummy/rails-4.0.2/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  70. data/spec/dummy/rails-4.0.2/tmp/cache/assets/test/sprockets/fa138a16887e031c0ae1b4caccfb4c05 +0 -0
  71. data/spec/mailers/notify_user/notification_mailer_spec.rb +1 -0
  72. data/spec/models/notify_user/notification_spec.rb +122 -1
  73. data/spec/models/notify_user/unsubscribe_spec.rb +40 -0
  74. data/spec/models/notify_user/user_hash_spec.rb +35 -0
  75. data/spec/spec_helper.rb +5 -0
  76. data/spec/support/database.yml +21 -0
  77. data/spec/support/rails_template.rb +9 -0
  78. metadata +196 -65
  79. data/spec/dummy/rails-4.0.2/db/test.sqlite3 +0 -0
@@ -1,3 +1,3 @@
1
1
  module NotifyUser
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -0,0 +1,15 @@
1
+ namespace :notify_user do
2
+
3
+ desc "move params hash to json"
4
+ task :move_params_to_json => :environment do
5
+ notifications = NotifyUser::BaseNotification.all
6
+
7
+ notifications.each do |notification|
8
+ notification.json = notification.params.to_json
9
+ notification.save
10
+ end
11
+
12
+ puts "Moved params to json"
13
+
14
+ end
15
+ end
@@ -26,12 +26,46 @@ describe NotifyUser::NotificationsController do
26
26
  end
27
27
 
28
28
  it "returns a message from a rendered template" do
29
- get :index
29
+ get :index, :format => :json
30
30
  json[:notifications][0][:message].should include "New Post Notification happened with"
31
31
  json[:notifications][0][:message].should include notification.params[:name]
32
32
  end
33
33
  end
34
34
 
35
+ describe "GET web Index notifications" do
36
+ render_views
37
+
38
+ let(:notification) { NotifyUser.send_notification('new_post_notification').to(user).with(name: "Mr. Blobby") }
39
+ let(:notification1) { NotifyUser.send_notification('new_post_notification').to(user).with(name: "Mr. Adams") }
40
+ let(:notification2) { NotifyUser.send_notification('new_post_notification').to(user).with(name: "Mrs. James") }
41
+
42
+ before :each do
43
+ notification.save
44
+ notification1.save
45
+ notification2.save
46
+ end
47
+
48
+ it "returns a list of notifications" do
49
+ NotifyUser::BaseNotification.any_instance.stub(:message).and_return("Mr. Blobby")
50
+ get :index
51
+ response.body.should have_content("Mr. Blobby")
52
+ end
53
+
54
+ it "reading a notification marks it as read and takes to redirect action" do
55
+ get :read, :id => notification.id
56
+ @notification = NotifyUser::BaseNotification.where(id: notification.id).first
57
+ @notification.state.should eq "read"
58
+ response.body.should have_content("set redirect logic")
59
+ end
60
+
61
+ it "marks all unread messages as read" do
62
+ get :mark_all
63
+ notifications = NotifyUser::BaseNotification.for_target(user).where('state IN (?)', '["pending","sent"]')
64
+ notifications.length.should eq 0
65
+ end
66
+
67
+ end
68
+
35
69
  describe "PUT notifications/mark_read.json" do
36
70
  let(:notification) { NotifyUser.send_notification('new_post_notification').to(user).with(name: "Mr. Blobby") }
37
71
 
@@ -51,4 +85,58 @@ describe NotifyUser::NotificationsController do
51
85
  end
52
86
  end
53
87
 
88
+ describe "unsubscribing and subscribing" do
89
+ let(:notification) { NotifyUser.send_notification('new_post_notification').to(user).with(name: "Mr. Blobby") }
90
+
91
+ before :each do
92
+ notification.save
93
+ end
94
+
95
+ xit "endpoint for toggling subscriptions statuses" do
96
+ # NotifyUser::Unsubscribe.has_unsubscribed_from(user, 'NewPostNotification').should eq []
97
+ put :subscriptions, :types => ['NewPostNotification']
98
+ NotifyUser::Unsubscribe.has_unsubscribed_from(user, 'NewPostNotification').should_not eq []
99
+ end
100
+
101
+ it "endpoint for updating notification subscription statuses" do
102
+ NotifyUser::Unsubscribe.has_unsubscribed_from(user, 'NewPostNotification').should eq []
103
+ put :subscriptions, :types => [{
104
+ type: 'NewPostNotification',
105
+ status: '0'
106
+ }]
107
+ NotifyUser::Unsubscribe.has_unsubscribed_from(user, 'NewPostNotification').should_not eq []
108
+ end
109
+
110
+ it "endpoint for updating notification subscription statuses passing 1 does nothing" do
111
+ NotifyUser::Unsubscribe.has_unsubscribed_from(user, 'NewPostNotification').should eq []
112
+ put :subscriptions, :types => [{
113
+ type: 'NewPostNotification',
114
+ status: '1'
115
+ }]
116
+ NotifyUser::Unsubscribe.has_unsubscribed_from(user, 'NewPostNotification').should eq []
117
+ end
118
+
119
+ it "unsubscribing from notification type" do
120
+ get :unsubscribe, :type => "NewPostNotification"
121
+ NotifyUser::Unsubscribe.last.type.should eq "NewPostNotification"
122
+ end
123
+
124
+ it "subscribing deletes the unsubscribe object" do
125
+ #lack of unsubscribe object implies the user is subscribed
126
+ NotifyUser::Unsubscribe.create(target: user, type: "NewPostNotification")
127
+ get :subscribe, :type => "NewPostNotification"
128
+ NotifyUser::Unsubscribe.all.should eq []
129
+
130
+ end
131
+
132
+ it "verifies user token before unsubscribe then deactivates that token" do
133
+ user_hash = notification.generate_unsubscribe_hash
134
+ get :unauth_unsubscribe, :type => "NewPostNotification", :token => user_hash.token
135
+
136
+ user_hash = NotifyUser::UserHash.last
137
+ user_hash.active.should eq false
138
+ end
139
+
140
+ end
141
+
54
142
  end
@@ -3,8 +3,8 @@ source 'https://rubygems.org'
3
3
  # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
4
4
  gem 'rails', '4.0.2'
5
5
 
6
- # Use sqlite3 as the database for Active Record
7
- gem 'sqlite3'
6
+ # Use postgresql as the database for Active Record
7
+ gem 'pg'
8
8
 
9
9
  # Use SCSS for stylesheets
10
10
  gem 'sass-rails', '~> 4.0.0'
@@ -0,0 +1,9 @@
1
+ class NotifyUser::NotificationsController < NotifyUser::BaseNotificationsController
2
+ def redirect_logic(notification)
3
+ render :text => "set redirect logic in notify_user/notifications_controller.rb"
4
+ # notification redirect logic goes here
5
+ # class_name = notification.params[:type].capitalize.constantize
6
+ # object = class_name.find(@notification.params[:id])
7
+ # redirect_to property_url(object)
8
+ end
9
+ end
@@ -4,7 +4,8 @@ class NewPostNotification < NotifyUser::BaseNotification
4
4
  subject: "Rails402: You have a new Newpostnotification notification.",
5
5
  aggregate: {
6
6
  subject: "Rails402: You have new Newpostnotification notifications."
7
- }
7
+ }
8
8
 
9
+ @@description = "please override this type description"
9
10
  @@aggregate_per = 10.minutes
10
11
  end
@@ -18,6 +18,12 @@
18
18
  </div>
19
19
  <div style="width: 100%; min-height: 80px; margin: 0; padding: 0;">
20
20
  <div style="width: 600px; margin: 0 auto; padding: 0;">
21
+ <% if is_unsubscribeable? @notification %>
22
+ <p style="text-align: center;">
23
+ <%= unsubscribe_link(@notification, "Unsubscribe") %>
24
+ </p>
25
+ <%
26
+ end %>
21
27
  <p style="text-align: center;">
22
28
  This is the default generated layout. A privacy declaration could go here.
23
29
  </p>
@@ -1,25 +1,54 @@
1
- # SQLite version 3.x
2
- # gem install sqlite3
1
+ # PostgreSQL. Versions 8.2 and up are supported.
2
+ #
3
+ # Install the pg driver:
4
+ # gem install pg
5
+ # On OS X with Homebrew:
6
+ # gem install pg -- --with-pg-config=/usr/local/bin/pg_config
7
+ # On OS X with MacPorts:
8
+ # gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config
9
+ # On Windows:
10
+ # gem install pg
11
+ # Choose the win32 build.
12
+ # Install PostgreSQL and put its /bin directory on your path.
13
+ #
14
+ # Configure Using Gemfile
15
+ # gem 'pg'
3
16
  #
4
- # Ensure the SQLite 3 gem is defined in your Gemfile
5
- # gem 'sqlite3'
6
17
  development:
7
- adapter: sqlite3
8
- database: db/development.sqlite3
18
+ adapter: postgresql
19
+ encoding: unicode
20
+ database: rails-4_0_2_development
9
21
  pool: 5
10
- timeout: 5000
22
+
23
+ # Connect on a TCP socket. Omitted by default since the client uses a
24
+ # domain socket that doesn't need configuration. Windows does not have
25
+ # domain sockets, so uncomment these lines.
26
+ #host: localhost
27
+
28
+ # The TCP port the server listens on. Defaults to 5432.
29
+ # If your server runs on a different port number, change accordingly.
30
+ #port: 5432
31
+
32
+ # Schema search path. The server defaults to $user,public
33
+ #schema_search_path: myapp,sharedapp,public
34
+
35
+ # Minimum log levels, in increasing order:
36
+ # debug5, debug4, debug3, debug2, debug1,
37
+ # log, notice, warning, error, fatal, and panic
38
+ # Defaults to warning.
39
+ #min_messages: notice
11
40
 
12
41
  # Warning: The database defined as "test" will be erased and
13
42
  # re-generated from your development database when you run "rake".
14
43
  # Do not set this db to the same as development or production.
15
44
  test:
16
- adapter: sqlite3
17
- database: db/test.sqlite3
45
+ adapter: postgresql
46
+ encoding: unicode
47
+ database: rails-4_0_2_test
18
48
  pool: 5
19
- timeout: 5000
20
49
 
21
50
  production:
22
- adapter: sqlite3
23
- database: db/production.sqlite3
51
+ adapter: postgresql
52
+ encoding: unicode
53
+ database: rails-4_0_2_production
24
54
  pool: 5
25
- timeout: 5000
@@ -0,0 +1,57 @@
1
+ # PostgreSQL. Versions 8.2 and up are supported.
2
+ #
3
+ # Install the pg driver:
4
+ # gem install pg
5
+ # On OS X with Homebrew:
6
+ # gem install pg -- --with-pg-config=/usr/local/bin/pg_config
7
+ # On OS X with MacPorts:
8
+ # gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config
9
+ # On Windows:
10
+ # gem install pg
11
+ # Choose the win32 build.
12
+ # Install PostgreSQL and put its /bin directory on your path.
13
+ #
14
+ # Configure Using Gemfile
15
+ # gem 'pg'
16
+ #
17
+ development:
18
+ adapter: postgresql
19
+ encoding: unicode
20
+ database: rails-4_0_2_development
21
+ pool: 5
22
+ password:
23
+
24
+ # Connect on a TCP socket. Omitted by default since the client uses a
25
+ # domain socket that doesn't need configuration. Windows does not have
26
+ # domain sockets, so uncomment these lines.
27
+ #host: localhost
28
+
29
+ # The TCP port the server listens on. Defaults to 5432.
30
+ # If your server runs on a different port number, change accordingly.
31
+ #port: 5432
32
+
33
+ # Schema search path. The server defaults to $user,public
34
+ #schema_search_path: myapp,sharedapp,public
35
+
36
+ # Minimum log levels, in increasing order:
37
+ # debug5, debug4, debug3, debug2, debug1,
38
+ # log, notice, warning, error, fatal, and panic
39
+ # Defaults to warning.
40
+ #min_messages: notice
41
+
42
+ # Warning: The database defined as "test" will be erased and
43
+ # re-generated from your development database when you run "rake".
44
+ # Do not set this db to the same as development or production.
45
+ test:
46
+ adapter: postgresql
47
+ encoding: unicode
48
+ database: rails-4_0_2_test
49
+ pool: 5
50
+ password:
51
+
52
+ production:
53
+ adapter: postgresql
54
+ encoding: unicode
55
+ database: rails-4_0_2_production
56
+ pool: 5
57
+ password:
@@ -9,4 +9,6 @@ NotifyUser.setup do |config|
9
9
  # NotifyUser will call this within NotificationsController to return the current logged in user.
10
10
  config.current_user_method = :current_user
11
11
 
12
+ # Override the default notification type
13
+ config.unsubscribable_notifications = ['NewPostNotification']
12
14
  end
@@ -9,4 +9,4 @@
9
9
 
10
10
  # Make sure your secret_key_base is kept private
11
11
  # if you're sharing your code publicly.
12
- Rails402::Application.config.secret_key_base = '021f371d4117b6d72fd53a8ccf152ab28c1238e749fbd3ad3d80b3c5d0ec09f0cdfae782950af846db2b53f0e54a063e84c32e96998688f507c139f98e3d6bab'
12
+ Rails402::Application.config.secret_key_base = '465f947d799056a01ee40200c89105d0564deb9563d487a774b2ff7dfc6cf4fde48bbcb7043f6dfa15e22f238ccd68d06e52b36ea233d9e22885f5f6d6811f2e'
@@ -4,7 +4,7 @@ class CreateNotifyUserNotifications < ActiveRecord::Migration
4
4
  t.string :type
5
5
  t.integer :target_id
6
6
  t.string :target_type
7
- t.text :params
7
+ t.json :params
8
8
  t.string :state
9
9
 
10
10
  t.timestamps
@@ -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
@@ -11,18 +11,39 @@
11
11
  #
12
12
  # It's strongly recommended that you check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(version: 20140105070448) do
14
+ ActiveRecord::Schema.define(version: 20140428015531191191953000) do
15
+
16
+ # These are extensions that must be enabled in order to support this database
17
+ enable_extension "plpgsql"
15
18
 
16
19
  create_table "notify_user_notifications", force: true do |t|
17
20
  t.string "type"
18
21
  t.integer "target_id"
19
22
  t.string "target_type"
20
- t.text "params"
23
+ t.json "params"
21
24
  t.string "state"
22
25
  t.datetime "created_at"
23
26
  t.datetime "updated_at"
24
27
  end
25
28
 
29
+ create_table "notify_user_unsubscribes", force: true do |t|
30
+ t.string "type"
31
+ t.integer "target_id"
32
+ t.string "target_type"
33
+ t.datetime "created_at"
34
+ t.datetime "updated_at"
35
+ end
36
+
37
+ create_table "notify_user_user_hashes", force: true do |t|
38
+ t.string "type"
39
+ t.integer "target_id"
40
+ t.string "target_type"
41
+ t.string "token"
42
+ t.boolean "active", default: true
43
+ t.datetime "created_at"
44
+ t.datetime "updated_at"
45
+ end
46
+
26
47
  create_table "users", force: true do |t|
27
48
  t.string "email"
28
49
  t.datetime "created_at"
@@ -1,391 +1,466 @@
1
-  (7.9ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
2
-  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
3
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
4
- Migrating to CreateUsers (20140105070446)
5
-  (0.0ms) begin transaction
6
-  (0.3ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255), "created_at" datetime, "updated_at" datetime) 
7
- SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140105070446"]]
8
-  (0.7ms) commit transaction
9
- Migrating to CreateNotifyUserNotifications (20140105070448)
10
-  (0.0ms) begin transaction
11
-  (0.3ms) CREATE TABLE "notify_user_notifications" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar(255), "target_id" integer, "target_type" varchar(255), "params" text, "state" varchar(255), "created_at" datetime, "updated_at" datetime) 
12
- SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140105070448"]]
13
-  (0.6ms) commit transaction
14
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
15
-  (8.4ms) CREATE TABLE "notify_user_notifications" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar(255), "target_id" integer, "target_type" varchar(255), "params" text, "state" varchar(255), "created_at" datetime, "updated_at" datetime) 
16
-  (0.9ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255), "created_at" datetime, "updated_at" datetime)
17
-  (0.9ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
18
-  (1.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
19
-  (0.1ms) SELECT version FROM "schema_migrations"
20
-  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140105070448')
21
-  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES ('20140105070446')
22
-  (0.5ms) begin transaction
23
-  (0.1ms) SAVEPOINT active_record_1
24
- SQL (2.9ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00]]
1
+  (3.6ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL) 
2
+  (2.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
3
+ ActiveRecord::SchemaMigration Load (0.7ms) SELECT "schema_migrations".* FROM "schema_migrations"
4
+ Migrating to CreateUsers (20140428015529)
5
+  (0.2ms) BEGIN
6
+  (5.8ms) CREATE TABLE "users" ("id" serial primary key, "email" character varying(255), "created_at" timestamp, "updated_at" timestamp) 
7
+ SQL (1.4ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140428015529"]]
8
+  (0.6ms) COMMIT
9
+ Migrating to CreateNotifyUserNotifications (20140428015531189189694000)
10
+  (0.4ms) BEGIN
11
+  (4.9ms) 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, "updated_at" timestamp) 
12
+ SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140428015531189189694000"]]
13
+  (0.6ms) COMMIT
14
+ Migrating to CreateNotifyUserUnsubscribes (20140428015531190190743000)
15
+  (0.4ms) BEGIN
16
+  (7.0ms) CREATE TABLE "notify_user_unsubscribes" ("id" serial primary key, "type" character varying(255), "target_id" integer, "target_type" character varying(255), "created_at" timestamp, "updated_at" timestamp) 
17
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140428015531190190743000"]]
18
+  (0.5ms) COMMIT
19
+ Migrating to CreateNotifyUserUserHashes (20140428015531191191953000)
20
+  (0.3ms) BEGIN
21
+  (5.9ms) 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, "updated_at" timestamp) 
22
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140428015531191191953000"]]
23
+  (0.5ms) COMMIT
24
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
25
+  (124.4ms) DROP DATABASE IF EXISTS "rails-4_0_2_test"
26
+  (258.4ms) CREATE DATABASE "rails-4_0_2_test" ENCODING = 'unicode'
27
+ SQL (2.1ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
28
+  (10.7ms) 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, "updated_at" timestamp)
29
+  (6.0ms) CREATE TABLE "notify_user_unsubscribes" ("id" serial primary key, "type" character varying(255), "target_id" integer, "target_type" character varying(255), "created_at" timestamp, "updated_at" timestamp) 
30
+  (6.2ms) 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, "updated_at" timestamp)
31
+  (4.4ms) CREATE TABLE "users" ("id" serial primary key, "email" character varying(255), "created_at" timestamp, "updated_at" timestamp) 
32
+  (1.4ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)
33
+  (1.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
34
+  (0.6ms) SELECT version FROM "schema_migrations"
35
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140428015531191191953000')
36
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140428015529')
37
+  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140428015531189189694000')
38
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140428015531190190743000')
39
+  (0.2ms) BEGIN
40
+  (0.2ms) SAVEPOINT active_record_1
41
+ SQL (6.6ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:41 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:41 UTC +00:00]]
25
42
   (0.1ms) RELEASE SAVEPOINT active_record_1
26
43
  Processing by NotifyUser::NotificationsController#index as HTML
27
- NotifyUser::BaseNotification Load (0.2ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' ORDER BY created_at DESC LIMIT 25 OFFSET 0
28
- Completed 200 OK in 6ms (Views: 3.1ms | ActiveRecord: 0.5ms)
29
-  (0.4ms) rollback transaction
30
-  (0.2ms) begin transaction
44
+ Rendered /Users/william/Papercloud/notify_user/app/views/notify_user/base_notifications/index.html.erb within layouts/application (0.3ms)
45
+ Completed 200 OK in 14ms (Views: 11.4ms | ActiveRecord: 0.0ms)
46
+  (0.3ms) ROLLBACK
47
+  (0.1ms) BEGIN
48
+  (0.1ms) SAVEPOINT active_record_1
49
+ SQL (0.6ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:41 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:41 UTC +00:00]]
50
+  (0.2ms) RELEASE SAVEPOINT active_record_1
51
+  (0.2ms) SAVEPOINT active_record_1
52
+  (1.0ms) 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'
53
+ SQL (1.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", Mon, 28 Apr 2014 01:55:42 UTC +00:00], ["params", {:name=>"Mr. Blobby"}], ["state", "pending"], ["target_id", 2], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:42 UTC +00:00]]
54
+  (0.3ms) RELEASE SAVEPOINT active_record_1
55
+ Processing by NotifyUser::NotificationsController#index as JSON
56
+  (0.8ms) SELECT COUNT(*) FROM "notify_user_notifications" WHERE "notify_user_notifications"."target_id" = 2 AND "notify_user_notifications"."target_type" = 'User'
57
+ NotifyUser::BaseNotification Load (1.2ms) 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
58
+ Completed 200 OK in 19ms (Views: 10.7ms | ActiveRecord: 2.0ms)
59
+  (0.2ms) ROLLBACK
60
+  (0.1ms) BEGIN
31
61
   (0.1ms) SAVEPOINT active_record_1
32
- SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00]]
62
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:42 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:42 UTC +00:00]]
33
63
   (0.1ms) RELEASE SAVEPOINT active_record_1
34
64
   (0.1ms) SAVEPOINT active_record_1
35
- SQL (1.1ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00], ["params", "---\n:name: Mr. Blobby\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00]]
36
-  (0.1ms) RELEASE SAVEPOINT active_record_1
65
+  (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'
66
+ 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", Mon, 28 Apr 2014 01:55:42 UTC +00:00], ["params", {:name=>"Mr. Blobby"}], ["state", "pending"], ["target_id", 3], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:42 UTC +00:00]]
67
+  (0.1ms) RELEASE SAVEPOINT active_record_1
68
+  (0.1ms) SAVEPOINT active_record_1
69
+  (0.6ms) 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'
70
+ 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", Mon, 28 Apr 2014 01:55:42 UTC +00:00], ["params", {:name=>"Mr. Adams"}], ["state", "pending"], ["target_id", 3], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:42 UTC +00:00]]
71
+  (0.1ms) RELEASE SAVEPOINT active_record_1
72
+  (0.1ms) SAVEPOINT active_record_1
73
+  (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'
74
+ 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", Mon, 28 Apr 2014 01:55:42 UTC +00:00], ["params", {:name=>"Mrs. James"}], ["state", "pending"], ["target_id", 3], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:42 UTC +00:00]]
75
+  (0.1ms) RELEASE SAVEPOINT active_record_1
37
76
  Processing by NotifyUser::NotificationsController#index as HTML
38
- NotifyUser::BaseNotification Load (0.2ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' ORDER BY created_at DESC LIMIT 25 OFFSET 0
39
- Completed 200 OK in 10ms (Views: 9.0ms | ActiveRecord: 0.2ms)
40
-  (0.4ms) rollback transaction
41
-  (0.1ms) begin transaction
42
-  (0.0ms) SAVEPOINT active_record_1
43
- SQL (0.3ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00]]
44
-  (0.0ms) RELEASE SAVEPOINT active_record_1
45
-  (0.0ms) SAVEPOINT active_record_1
46
- SQL (0.4ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00], ["params", "---\n:name: Mr. Blobby\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00]]
47
-  (0.0ms) RELEASE SAVEPOINT active_record_1
77
+ NotifyUser::BaseNotification Load (0.8ms) 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
78
+ Completed 200 OK in 721ms (Views: 719.5ms | ActiveRecord: 0.8ms)
79
+  (0.4ms) ROLLBACK
80
+  (0.1ms) BEGIN
81
+  (0.2ms) SAVEPOINT active_record_1
82
+ SQL (0.7ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:42 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:42 UTC +00:00]]
83
+  (0.1ms) RELEASE SAVEPOINT active_record_1
84
+  (0.1ms) SAVEPOINT active_record_1
85
+  (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'
86
+ 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", Mon, 28 Apr 2014 01:55:42 UTC +00:00], ["params", {:name=>"Mr. Blobby"}], ["state", "pending"], ["target_id", 4], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:42 UTC +00:00]]
87
+  (0.1ms) RELEASE SAVEPOINT active_record_1
88
+  (0.2ms) SAVEPOINT active_record_1
89
+  (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'
90
+ 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", Mon, 28 Apr 2014 01:55:42 UTC +00:00], ["params", {:name=>"Mr. Adams"}], ["state", "pending"], ["target_id", 4], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:42 UTC +00:00]]
91
+  (0.2ms) RELEASE SAVEPOINT active_record_1
92
+  (0.1ms) SAVEPOINT active_record_1
93
+  (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'
94
+ 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", Mon, 28 Apr 2014 01:55:42 UTC +00:00], ["params", {:name=>"Mrs. James"}], ["state", "pending"], ["target_id", 4], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:42 UTC +00:00]]
95
+  (0.1ms) RELEASE SAVEPOINT active_record_1
96
+ Processing by NotifyUser::NotificationsController#read as HTML
97
+ Parameters: {"id"=>"5"}
98
+ NotifyUser::BaseNotification Load (1.1ms) 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') ORDER BY "notify_user_notifications"."id" ASC LIMIT 1
99
+  (0.2ms) SAVEPOINT active_record_1
100
+ User Load (1.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id", 4]]
101
+  (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'
102
+ SQL (2.3ms) UPDATE "notify_user_notifications" SET "state" = $1, "updated_at" = $2 WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 5 [["state", "read"], ["updated_at", Mon, 28 Apr 2014 01:55:42 UTC +00:00]]
103
+  (0.2ms) RELEASE SAVEPOINT active_record_1
104
+ Completed 200 OK in 28ms (Views: 2.2ms | ActiveRecord: 5.6ms)
105
+ NotifyUser::BaseNotification Load (0.5ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = 5 ORDER BY "notify_user_notifications"."id" ASC LIMIT 1
106
+  (0.2ms) ROLLBACK
107
+  (0.2ms) BEGIN
108
+  (0.2ms) SAVEPOINT active_record_1
109
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:42 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:42 UTC +00:00]]
110
+  (0.2ms) RELEASE SAVEPOINT active_record_1
111
+  (0.1ms) SAVEPOINT active_record_1
112
+  (0.5ms) 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'
113
+ 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", Mon, 28 Apr 2014 01:55:42 UTC +00:00], ["params", {:name=>"Mr. Blobby"}], ["state", "pending"], ["target_id", 5], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:42 UTC +00:00]]
114
+  (0.3ms) RELEASE SAVEPOINT active_record_1
115
+  (0.2ms) SAVEPOINT active_record_1
116
+  (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'
117
+ 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", Mon, 28 Apr 2014 01:55:42 UTC +00:00], ["params", {:name=>"Mr. Adams"}], ["state", "pending"], ["target_id", 5], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:42 UTC +00:00]]
118
+  (0.2ms) RELEASE SAVEPOINT active_record_1
119
+  (0.1ms) SAVEPOINT active_record_1
120
+  (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'
121
+ 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", Mon, 28 Apr 2014 01:55:42 UTC +00:00], ["params", {:name=>"Mrs. James"}], ["state", "pending"], ["target_id", 5], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:42 UTC +00:00]]
122
+  (0.2ms) RELEASE SAVEPOINT active_record_1
123
+ Processing by NotifyUser::NotificationsController#mark_all as HTML
124
+ SQL (1.0ms) UPDATE "notify_user_notifications" SET "state" = 'read' WHERE "notify_user_notifications"."target_id" = 5 AND "notify_user_notifications"."target_type" = 'User' AND (state IN ('pending','sent'))
125
+ Redirected to http://test.host/notify_user/notifications
126
+ Completed 302 Found in 4ms (ActiveRecord: 1.0ms)
127
+ 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 (state IN ('["pending","sent"]'))
128
+  (0.2ms) ROLLBACK
129
+  (0.2ms) BEGIN
130
+  (0.2ms) SAVEPOINT active_record_1
131
+ SQL (0.8ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:42 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:42 UTC +00:00]]
132
+  (0.2ms) RELEASE SAVEPOINT active_record_1
133
+  (0.1ms) SAVEPOINT active_record_1
134
+  (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'
135
+ SQL (1.0ms) 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", Mon, 28 Apr 2014 01:55:42 UTC +00:00], ["params", {:name=>"Mr. Blobby"}], ["state", "pending"], ["target_id", 6], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:42 UTC +00:00]]
136
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48
137
  Processing by NotifyUser::NotificationsController#mark_read as HTML
49
- Parameters: {"ids"=>["1"]}
50
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "state" = 'read' WHERE "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND (id IN ('1'))
51
- NotifyUser::BaseNotification Load (0.3ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND (id IN ('1'))
52
- Completed 200 OK in 4ms (Views: 2.1ms | ActiveRecord: 0.5ms)
53
- NewPostNotification Load (0.2ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = ? LIMIT 1 [["id", 1]]
54
-  (0.4ms) rollback transaction
55
-  (0.1ms) begin transaction
138
+ Parameters: {"ids"=>["11"]}
139
+ SQL (0.7ms) UPDATE "notify_user_notifications" SET "state" = 'read' WHERE "notify_user_notifications"."target_id" = 6 AND "notify_user_notifications"."target_type" = 'User' AND (id IN ('11'))
140
+ NotifyUser::BaseNotification Load (0.6ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."target_id" = 6 AND "notify_user_notifications"."target_type" = 'User' AND (id IN ('11'))
141
+ Completed 200 OK in 6ms (Views: 2.8ms | ActiveRecord: 1.3ms)
142
+ NewPostNotification Load (1.0ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = $1 LIMIT 1 [["id", 11]]
143
+  (0.3ms) ROLLBACK
144
+  (0.2ms) BEGIN
145
+  (0.2ms) SAVEPOINT active_record_1
146
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:42 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:42 UTC +00:00]]
147
+  (0.2ms) RELEASE SAVEPOINT active_record_1
148
+  (0.2ms) SAVEPOINT active_record_1
149
+  (0.4ms) 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'
150
+ 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", Mon, 28 Apr 2014 01:55:42 UTC +00:00], ["params", {:name=>"Mr. Blobby"}], ["state", "pending"], ["target_id", 7], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:42 UTC +00:00]]
151
+  (0.2ms) RELEASE SAVEPOINT active_record_1
152
+ Processing by NotifyUser::NotificationsController#mark_read as HTML
153
+ Parameters: {"ids"=>["12"]}
154
+ SQL (0.6ms) UPDATE "notify_user_notifications" SET "state" = 'read' WHERE "notify_user_notifications"."target_id" = 7 AND "notify_user_notifications"."target_type" = 'User' AND (id IN ('12'))
155
+ 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 ('12'))
156
+ Completed 200 OK in 6ms (Views: 3.0ms | ActiveRecord: 1.2ms)
157
+  (0.2ms) ROLLBACK
158
+  (0.2ms) BEGIN
159
+  (0.2ms) SAVEPOINT active_record_1
160
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:42 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:42 UTC +00:00]]
161
+  (0.2ms) RELEASE SAVEPOINT active_record_1
162
+  (0.1ms) SAVEPOINT active_record_1
163
+  (0.4ms) 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'
164
+ SQL (0.8ms) 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", Mon, 28 Apr 2014 01:55:42 UTC +00:00], ["params", {:name=>"Mr. Blobby"}], ["state", "pending"], ["target_id", 8], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:42 UTC +00:00]]
165
+  (0.2ms) RELEASE SAVEPOINT active_record_1
166
+ NotifyUser::Unsubscribe Load (0.5ms) SELECT "notify_user_unsubscribes".* FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 8 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
167
+ Processing by NotifyUser::NotificationsController#subscriptions as HTML
168
+ Parameters: {"types"=>[{"type"=>"NewPostNotification", "status"=>"0"}]}
169
+  (0.5ms) 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'
170
+  (0.2ms) SAVEPOINT active_record_1
171
+ NotifyUser::Unsubscribe Exists (0.6ms) 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" = 8) LIMIT 1
172
+ SQL (1.8ms) INSERT INTO "notify_user_unsubscribes" ("created_at", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:42 UTC +00:00], ["target_id", 8], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:42 UTC +00:00]]
173
+  (0.2ms) RELEASE SAVEPOINT active_record_1
174
+  (0.5ms) 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" = 'action_mailer'
175
+  (0.4ms) 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'
176
+ Completed 200 OK in 33ms (Views: 0.3ms | ActiveRecord: 4.1ms)
177
+ NotifyUser::Unsubscribe Load (0.5ms) SELECT "notify_user_unsubscribes".* FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 8 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
178
+  (0.2ms) ROLLBACK
179
+  (0.1ms) BEGIN
180
+  (0.1ms) SAVEPOINT active_record_1
181
+ SQL (0.7ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:42 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:42 UTC +00:00]]
182
+  (0.1ms) RELEASE SAVEPOINT active_record_1
183
+  (0.1ms) SAVEPOINT active_record_1
184
+  (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'
185
+ SQL (0.8ms) 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", Mon, 28 Apr 2014 01:55:42 UTC +00:00], ["params", {:name=>"Mr. Blobby"}], ["state", "pending"], ["target_id", 9], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:42 UTC +00:00]]
186
+  (0.2ms) RELEASE SAVEPOINT active_record_1
187
+ NotifyUser::Unsubscribe Load (0.5ms) 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'
188
+ Processing by NotifyUser::NotificationsController#subscriptions as HTML
189
+ Parameters: {"types"=>[{"type"=>"NewPostNotification", "status"=>"1"}]}
190
+ NotifyUser::Unsubscribe Load (0.5ms) 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'
191
+  (0.4ms) 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" = 'action_mailer'
192
+  (0.3ms) 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'
193
+ Completed 200 OK in 4ms (Views: 0.4ms | ActiveRecord: 1.1ms)
194
+ NotifyUser::Unsubscribe Load (0.3ms) 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'
195
+  (0.1ms) ROLLBACK
196
+  (0.2ms) BEGIN
56
197
   (0.1ms) SAVEPOINT active_record_1
57
- SQL (0.3ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00]]
58
-  (0.0ms) RELEASE SAVEPOINT active_record_1
198
+ SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:42 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:42 UTC +00:00]]
199
+  (0.1ms) RELEASE SAVEPOINT active_record_1
59
200
   (0.1ms) SAVEPOINT active_record_1
60
- SQL (0.4ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00], ["params", "---\n:name: Mr. Blobby\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00]]
61
-  (0.0ms) RELEASE SAVEPOINT active_record_1
62
- Processing by NotifyUser::NotificationsController#mark_read as HTML
63
- Parameters: {"ids"=>["1"]}
64
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "state" = 'read' WHERE "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND (id IN ('1'))
65
- NotifyUser::BaseNotification Load (0.2ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND (id IN ('1'))
66
- Completed 200 OK in 4ms (Views: 1.9ms | ActiveRecord: 0.4ms)
67
-  (0.4ms) rollback transaction
68
-  (0.0ms) begin transaction
69
-  (0.1ms) rollback transaction
70
-  (0.1ms) begin transaction
71
-  (0.1ms) rollback transaction
72
-  (0.0ms) begin transaction
73
-  (0.1ms) rollback transaction
74
-  (0.0ms) begin transaction
75
-  (0.0ms) SAVEPOINT active_record_1
76
- SQL (0.3ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00]]
77
-  (0.0ms) RELEASE SAVEPOINT active_record_1
78
-  (0.0ms) SAVEPOINT active_record_1
79
- SQL (0.4ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00]]
80
-  (0.1ms) RELEASE SAVEPOINT active_record_1
201
+  (0.4ms) 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'
202
+ 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", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["params", {:name=>"Mr. Blobby"}], ["state", "pending"], ["target_id", 10], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
203
+  (0.3ms) RELEASE SAVEPOINT active_record_1
204
+ Processing by NotifyUser::NotificationsController#unsubscribe as HTML
205
+ Parameters: {"type"=>"NewPostNotification"}
206
+  (0.2ms) SAVEPOINT active_record_1
207
+ 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" = 10) LIMIT 1
208
+ SQL (0.6ms) INSERT INTO "notify_user_unsubscribes" ("created_at", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["target_id", 10], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
209
+  (0.2ms) RELEASE SAVEPOINT active_record_1
210
+ Redirected to http://test.host/notify_user/notifications/unsubscribe
211
+ Completed 302 Found in 5ms (ActiveRecord: 1.3ms)
212
+ NotifyUser::Unsubscribe Load (0.5ms) SELECT "notify_user_unsubscribes".* FROM "notify_user_unsubscribes" ORDER BY "notify_user_unsubscribes"."id" DESC LIMIT 1
213
+  (0.1ms) ROLLBACK
214
+  (0.1ms) BEGIN
81
215
   (0.1ms) SAVEPOINT active_record_1
82
-  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
83
-  (0.5ms) rollback transaction
84
-  (0.1ms) begin transaction
85
-  (0.0ms) SAVEPOINT active_record_1
86
- SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00]]
87
-  (0.0ms) RELEASE SAVEPOINT active_record_1
88
-  (0.0ms) SAVEPOINT active_record_1
89
- SQL (0.4ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00]]
90
-  (0.0ms) RELEASE SAVEPOINT active_record_1
91
-  (0.0ms) SAVEPOINT active_record_1
92
- SQL (0.3ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00], ["params", "--- {}\n"]]
93
-  (0.0ms) RELEASE SAVEPOINT active_record_1
94
-  (0.1ms) 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" = 1 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending' AND (id != 1)
95
- NotifyUser::BaseNotification Load (0.2ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = ? LIMIT 1 [["id", 1]]
96
- User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
97
- NotifyUser::BaseNotification Load (0.2ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" = 'NewPostNotification' AND "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending'
216
+ SQL (0.6ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
217
+  (0.3ms) RELEASE SAVEPOINT active_record_1
218
+  (0.3ms) SAVEPOINT active_record_1
219
+  (0.5ms) 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'
220
+ 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", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["params", {:name=>"Mr. Blobby"}], ["state", "pending"], ["target_id", 11], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
221
+  (0.1ms) RELEASE SAVEPOINT active_record_1
98
222
   (0.1ms) SAVEPOINT active_record_1
99
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
100
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "state" = ?, "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["state", "sent"], ["updated_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00], ["params", "--- {}\n"]]
101
-  (0.0ms) RELEASE SAVEPOINT active_record_1
102
-  (0.0ms) SAVEPOINT active_record_1
103
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00], ["params", "--- {}\n"]]
104
-  (0.1ms) RELEASE SAVEPOINT active_record_1
105
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = 1 ORDER BY "notify_user_notifications"."id" ASC LIMIT 1
106
-  (0.3ms) rollback transaction
107
-  (0.0ms) begin transaction
108
-  (0.0ms) SAVEPOINT active_record_1
109
- SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00]]
110
-  (0.1ms) RELEASE SAVEPOINT active_record_1
223
+ 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" = 11) LIMIT 1
224
+ 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", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["target_id", 11], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
225
+  (0.1ms) RELEASE SAVEPOINT active_record_1
226
+ Processing by NotifyUser::NotificationsController#subscribe as HTML
227
+ Parameters: {"type"=>"NewPostNotification"}
228
+ NotifyUser::Unsubscribe Load (0.5ms) SELECT "notify_user_unsubscribes".* FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 11 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
111
229
   (0.1ms) SAVEPOINT active_record_1
112
- SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00]]
230
+ SQL (0.6ms) DELETE FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."id" = $1 [["id", 3]]
231
+  (0.1ms) RELEASE SAVEPOINT active_record_1
232
+ Redirected to http://test.host/notify_user/notifications/unsubscribe
233
+ Completed 302 Found in 4ms (ActiveRecord: 1.3ms)
234
+ NotifyUser::Unsubscribe Load (0.3ms) SELECT "notify_user_unsubscribes".* FROM "notify_user_unsubscribes"
235
+  (0.1ms) ROLLBACK
236
+  (0.1ms) BEGIN
237
+  (0.2ms) SAVEPOINT active_record_1
238
+ SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
113
239
   (0.1ms) RELEASE SAVEPOINT active_record_1
114
-  (0.0ms) SAVEPOINT active_record_1
115
- SQL (0.1ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00], ["params", "--- {}\n"]]
116
-  (0.0ms) RELEASE SAVEPOINT active_record_1
117
-  (0.1ms) 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" = 1 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending' AND (id != 1)
118
240
   (0.1ms) SAVEPOINT active_record_1
119
- SQL (0.2ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00]]
241
+  (0.4ms) 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'
242
+ 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", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["params", {:name=>"Mr. Blobby"}], ["state", "pending"], ["target_id", 12], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
243
+  (0.1ms) RELEASE SAVEPOINT active_record_1
244
+ NotifyUser::UserHash Load (0.8ms) SELECT "notify_user_user_hashes".* FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."target_id" = 12 AND "notify_user_user_hashes"."target_type" = 'User' AND "notify_user_user_hashes"."type" = 'NewPostNotification' AND "notify_user_user_hashes"."active" = 't' ORDER BY "notify_user_user_hashes"."id" ASC LIMIT 1
245
+  (0.2ms) SAVEPOINT active_record_1
246
+ NotifyUser::UserHash Exists (0.5ms) SELECT 1 AS one FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."token" = 'M4E8ub49WPsPj4o_VQktSgMtaD9RNIgFEOxOqHrkzbcA' LIMIT 1
247
+ SQL (0.9ms) INSERT INTO "notify_user_user_hashes" ("created_at", "target_id", "target_type", "token", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["target_id", 12], ["target_type", "User"], ["token", "M4E8ub49WPsPj4o_VQktSgMtaD9RNIgFEOxOqHrkzbcA"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
120
248
   (0.1ms) RELEASE SAVEPOINT active_record_1
121
-  (0.2ms) 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" = 1 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending' AND (id != 2)
122
-  (0.3ms) rollback transaction
123
-  (0.1ms) begin transaction
124
-  (0.0ms) SAVEPOINT active_record_1
125
- SQL (0.3ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00]]
126
-  (0.0ms) RELEASE SAVEPOINT active_record_1
127
-  (0.0ms) SAVEPOINT active_record_1
128
- SQL (0.3ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00]]
129
-  (0.0ms) RELEASE SAVEPOINT active_record_1
130
-  (0.0ms) SAVEPOINT active_record_1
131
- SQL (0.1ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00]]
132
-  (0.0ms) RELEASE SAVEPOINT active_record_1
133
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = ? LIMIT 1 [["id", 2]]
134
- User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
135
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" = 'NewPostNotification' AND "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending'
136
-  (0.0ms) SAVEPOINT active_record_1
137
- User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
138
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "state" = ?, "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["state", "sent"], ["updated_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00], ["params", "--- {}\n"]]
139
-  (0.0ms) RELEASE SAVEPOINT active_record_1
140
-  (0.0ms) SAVEPOINT active_record_1
141
- User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
142
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "state" = ?, "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 2 [["state", "sent"], ["updated_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00], ["params", "--- {}\n"]]
143
-  (0.0ms) RELEASE SAVEPOINT active_record_1
249
+ Processing by NotifyUser::NotificationsController#unauth_unsubscribe as HTML
250
+ Parameters: {"type"=>"NewPostNotification", "token"=>"M4E8ub49WPsPj4o_VQktSgMtaD9RNIgFEOxOqHrkzbcA"}
251
+ NotifyUser::UserHash Exists (0.5ms) SELECT 1 AS one FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."token" = 'M4E8ub49WPsPj4o_VQktSgMtaD9RNIgFEOxOqHrkzbcA' AND "notify_user_user_hashes"."type" = 'NewPostNotification' AND "notify_user_user_hashes"."active" = 't' LIMIT 1
252
+ NotifyUser::UserHash Load (0.4ms) SELECT "notify_user_user_hashes".* FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."token" = 'M4E8ub49WPsPj4o_VQktSgMtaD9RNIgFEOxOqHrkzbcA' AND "notify_user_user_hashes"."type" = 'NewPostNotification' ORDER BY "notify_user_user_hashes"."id" ASC LIMIT 1
253
+ User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id", 12]]
254
+  (0.2ms) SAVEPOINT active_record_1
255
+ 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
256
+ 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", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["target_id", 12], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
257
+  (0.2ms) RELEASE SAVEPOINT active_record_1
258
+  (0.2ms) SAVEPOINT active_record_1
259
+ SQL (0.7ms) UPDATE "notify_user_user_hashes" SET "active" = $1, "updated_at" = $2 WHERE "notify_user_user_hashes"."id" = 1 [["active", false], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
260
+  (0.2ms) RELEASE SAVEPOINT active_record_1
261
+ Completed 200 OK in 13ms (Views: 0.5ms | ActiveRecord: 3.7ms)
262
+ 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
263
+  (0.2ms) ROLLBACK
264
+  (0.2ms) BEGIN
265
+ 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' ORDER BY "notify_user_user_hashes"."id" ASC LIMIT 1
266
+  (0.2ms) SAVEPOINT active_record_1
267
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
268
+ 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' ORDER BY "notify_user_user_hashes"."id" ASC LIMIT 1
144
269
   (0.1ms) SAVEPOINT active_record_1
145
- SQL (0.1ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00], ["params", "--- {}\n"]]
146
-  (0.0ms) RELEASE SAVEPOINT active_record_1
147
-  (0.0ms) SAVEPOINT active_record_1
148
- SQL (0.1ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 2 [["updated_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00], ["params", "--- {}\n"]]
149
-  (0.0ms) RELEASE SAVEPOINT active_record_1
150
-
151
- Sent mail to user@example.com (7.0ms)
152
- Date: Sun, 05 Jan 2014 18:04:53 +1100
153
- From: please-change-me-at-config-initializers-notify-user@example.com
154
- To: user@example.com
155
- Message-ID: <52c90415e9f5c_68dd8082dbf8634e1@tomass-air-11.mail>
156
- Subject: Rails402: You have new Newpostnotification notifications.
157
- Mime-Version: 1.0
158
- Content-Type: text/html;
159
- charset=UTF-8
160
- Content-Transfer-Encoding: 7bit
161
- layout-name: action_mailer
162
- layout-path: notify_user/layouts
163
-
164
- <div>
165
- New Post Notification happened.
166
- </div>
167
- <div>
168
- New Post Notification happened.
169
- </div>
170
-
171
-  (0.4ms) rollback transaction
172
-  (0.0ms) begin transaction
270
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
271
+  (0.2ms) ROLLBACK
272
+  (0.1ms) BEGIN
273
+ NotifyUser::UserHash Load (0.8ms) 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' ORDER BY "notify_user_user_hashes"."id" ASC LIMIT 1
274
+  (0.2ms) SAVEPOINT active_record_1
275
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
276
+ 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' ORDER BY "notify_user_user_hashes"."id" ASC LIMIT 1
173
277
   (0.1ms) SAVEPOINT active_record_1
174
- SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00]]
175
-  (0.0ms) RELEASE SAVEPOINT active_record_1
176
-  (0.0ms) SAVEPOINT active_record_1
177
- SQL (1.2ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00]]
178
-  (0.1ms) RELEASE SAVEPOINT active_record_1
179
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = ? LIMIT 1 [["id", 1]]
180
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
181
- NotifyUser::BaseNotification Load (0.2ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" = 'NewPostNotification' AND "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending'
278
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
279
+  (0.2ms) ROLLBACK
280
+  (0.1ms) BEGIN
281
+ NotifyUser::UserHash Load (0.8ms) 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' ORDER BY "notify_user_user_hashes"."id" ASC LIMIT 1
282
+  (0.3ms) SAVEPOINT active_record_1
283
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
284
+ 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' ORDER BY "notify_user_user_hashes"."id" ASC LIMIT 1
285
+  (0.1ms) SAVEPOINT active_record_1
286
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
287
+  (0.2ms) ROLLBACK
288
+  (0.2ms) BEGIN
289
+  (0.2ms) SAVEPOINT active_record_1
290
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
291
+  (0.2ms) RELEASE SAVEPOINT active_record_1
292
+  (0.2ms) SAVEPOINT active_record_1
293
+  (0.4ms) 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'
294
+ SQL (1.0ms) INSERT INTO "notify_user_notifications" ("created_at", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["state", "pending"], ["target_id", 13], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
295
+  (0.2ms) RELEASE SAVEPOINT active_record_1
296
+  (0.2ms) ROLLBACK
297
+  (0.2ms) BEGIN
298
+  (0.2ms) SAVEPOINT active_record_1
299
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
300
+  (0.2ms) RELEASE SAVEPOINT active_record_1
301
+  (0.2ms) SAVEPOINT active_record_1
302
+  (0.4ms) 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'
303
+ SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["state", "pending"], ["target_id", 14], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
304
+  (0.2ms) RELEASE SAVEPOINT active_record_1
305
+  (0.2ms) ROLLBACK
306
+  (0.1ms) BEGIN
307
+  (0.1ms) SAVEPOINT active_record_1
308
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
309
+  (0.2ms) RELEASE SAVEPOINT active_record_1
310
+  (0.2ms) SAVEPOINT active_record_1
311
+  (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'
312
+ SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["state", "pending"], ["target_id", 15], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
313
+  (0.2ms) RELEASE SAVEPOINT active_record_1
182
314
   (0.1ms) SAVEPOINT active_record_1
183
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
184
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "state" = ?, "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["state", "sent"], ["updated_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00], ["params", "--- {}\n"]]
315
+  (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'
316
+ SQL (0.8ms) UPDATE "notify_user_notifications" SET "params" = $1, "updated_at" = $2 WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 20 [["params", {"listing_id"=>1}], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
185
317
   (0.1ms) RELEASE SAVEPOINT active_record_1
186
-  (0.0ms) SAVEPOINT active_record_1
187
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 07:04:53 UTC +00:00], ["params", "--- {}\n"]]
188
-  (0.0ms) RELEASE SAVEPOINT active_record_1
189
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = 1 ORDER BY "notify_user_notifications"."id" ASC LIMIT 1
190
- User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
191
-
192
- Sent mail to user@example.com (6.2ms)
193
- Date: Sun, 05 Jan 2014 18:04:53 +1100
194
- From: please-change-me-at-config-initializers-notify-user@example.com
195
- To: user@example.com
196
- Message-ID: <52c90415f1b80_68dd8082dbf8635d@tomass-air-11.mail>
197
- Subject: Rails402: You have a new Newpostnotification notification.
198
- Mime-Version: 1.0
199
- Content-Type: text/html;
200
- charset=UTF-8
201
- Content-Transfer-Encoding: 7bit
202
- layout-name: action_mailer
203
- layout-path: notify_user/layouts
204
-
205
- New Post Notification happened.
206
-  (0.8ms) rollback transaction
207
-  (0.1ms) begin transaction
208
-  (0.0ms) rollback transaction
209
-  (0.0ms) begin transaction
210
-  (0.0ms) rollback transaction
211
-  (0.0ms) begin transaction
212
-  (0.0ms) rollback transaction
213
-  (0.0ms) begin transaction
214
-  (0.0ms) rollback transaction
215
-  (0.0ms) begin transaction
216
-  (0.0ms) rollback transaction
217
-  (0.0ms) begin transaction
218
-  (0.1ms) rollback transaction
219
-  (0.1ms) begin transaction
220
-  (0.0ms) rollback transaction
221
-  (0.4ms) begin transaction
222
- Rendered notify_user/new_post_notification/action_mailer/notification.html.erb (0.3ms)
223
- Rendered /Users/tomas/Work/Papercloud/notify_user/app/views/notify_user/action_mailer/notification.html.erb (1.9ms)
224
- Rendered notify_user/new_post_notification/action_mailer/notification.html.erb (0.0ms)
225
- Rendered /Users/tomas/Work/Papercloud/notify_user/app/views/notify_user/action_mailer/notification.html.erb (0.5ms)
226
-  (0.1ms) rollback transaction
227
-  (0.3ms) begin transaction
228
- Rendered notify_user/new_post_notification/action_mailer/notification.html.erb (0.2ms)
229
- Rendered /Users/tomas/Work/Papercloud/notify_user/app/views/notify_user/action_mailer/notification.html.erb (1.7ms)
230
- Rendered notify_user/new_post_notification/action_mailer/notification.html.erb (0.0ms)
231
- Rendered /Users/tomas/Work/Papercloud/notify_user/app/views/notify_user/action_mailer/notification.html.erb (0.5ms)
232
-  (0.1ms) rollback transaction
233
-  (0.3ms) begin transaction
234
-  (0.1ms) rollback transaction
235
-  (0.3ms) begin transaction
236
- Rendered notify_user/new_post_notification/action_mailer/notification.html.erb (0.3ms)
237
- Rendered /Users/tomas/Work/Papercloud/notify_user/app/views/notify_user/action_mailer/notification.html.erb (1.7ms)
238
- Rendered notify_user/new_post_notification/action_mailer/notification.html.erb (0.0ms)
239
- Rendered /Users/tomas/Work/Papercloud/notify_user/app/views/notify_user/action_mailer/notification.html.erb (0.5ms)
240
-  (0.1ms) rollback transaction
241
-  (0.3ms) begin transaction
242
- Rendered notify_user/new_post_notification/action_mailer/notification.html.erb (0.2ms)
243
- Rendered /Users/tomas/Work/Papercloud/notify_user/app/views/notify_user/action_mailer/notification.html.erb (1.8ms)
244
- Rendered notify_user/new_post_notification/action_mailer/notification.html.erb (0.0ms)
245
- Rendered /Users/tomas/Work/Papercloud/notify_user/app/views/notify_user/action_mailer/notification.html.erb (0.6ms)
246
-  (0.1ms) rollback transaction
247
-  (0.3ms) begin transaction
248
-  (0.1ms) rollback transaction
249
-  (0.2ms) begin transaction
250
- Rendered notify_user/new_post_notification/action_mailer/notification.html.erb (0.2ms)
251
- Rendered /Users/tomas/Work/Papercloud/notify_user/app/views/notify_user/action_mailer/notification.html.erb within notify_user/layouts/action_mailer (1.8ms)
252
- Rendered notify_user/new_post_notification/action_mailer/notification.html.erb (0.0ms)
253
- Rendered /Users/tomas/Work/Papercloud/notify_user/app/views/notify_user/action_mailer/notification.html.erb within notify_user/layouts/action_mailer (0.5ms)
254
-  (0.1ms) rollback transaction
255
-  (0.4ms) begin transaction
318
+ NewPostNotification Load (0.6ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" IN ('NewPostNotification') ORDER BY "notify_user_notifications"."id" DESC LIMIT 1
319
+  (0.2ms) ROLLBACK
320
+  (0.1ms) BEGIN
321
+  (0.2ms) SAVEPOINT active_record_1
322
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
323
+  (0.2ms) RELEASE SAVEPOINT active_record_1
324
+  (0.2ms) SAVEPOINT active_record_1
325
+  (0.6ms) 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'
326
+ SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["state", "pending"], ["target_id", 16], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
327
+  (0.2ms) RELEASE SAVEPOINT active_record_1
256
328
   (0.1ms) SAVEPOINT active_record_1
257
- SQL (5.1ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00]]
258
-  (0.1ms) RELEASE SAVEPOINT active_record_1
259
- Processing by NotifyUser::NotificationsController#index as HTML
260
- NotifyUser::BaseNotification Load (0.2ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' ORDER BY created_at DESC LIMIT 25 OFFSET 0
261
- Completed 200 OK in 5ms (Views: 2.3ms | ActiveRecord: 0.7ms)
262
-  (0.5ms) rollback transaction
263
-  (0.0ms) begin transaction
264
-  (0.0ms) SAVEPOINT active_record_1
265
- SQL (0.3ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00]]
266
-  (0.0ms) RELEASE SAVEPOINT active_record_1
267
-  (0.1ms) SAVEPOINT active_record_1
268
- SQL (1.4ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00], ["params", "---\n:name: Mr. Blobby\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00]]
329
+  (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'
330
+ SQL (1.2ms) UPDATE "notify_user_notifications" SET "params" = $1, "updated_at" = $2 WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 21 [["params", {"listing_id"=>1}], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
331
+  (0.3ms) RELEASE SAVEPOINT active_record_1
332
+ NewPostNotification Load (0.7ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" IN ('NewPostNotification') ORDER BY "notify_user_notifications"."id" DESC LIMIT 1
333
+  (0.2ms) ROLLBACK
334
+  (0.1ms) BEGIN
335
+  (0.2ms) SAVEPOINT active_record_1
336
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
337
+  (0.2ms) RELEASE SAVEPOINT active_record_1
338
+  (0.2ms) SAVEPOINT active_record_1
339
+  (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'
340
+ SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["state", "pending"], ["target_id", 17], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
341
+  (0.2ms) RELEASE SAVEPOINT active_record_1
342
+  (0.1ms) SAVEPOINT active_record_1
343
+  (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'
344
+ SQL (0.9ms) UPDATE "notify_user_notifications" SET "params" = $1, "updated_at" = $2 WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 22 [["params", {:listing_id=>1}], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
269
345
   (0.1ms) RELEASE SAVEPOINT active_record_1
270
- Processing by NotifyUser::NotificationsController#index as HTML
271
- NotifyUser::BaseNotification Load (0.2ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' ORDER BY created_at DESC LIMIT 25 OFFSET 0
272
- Completed 200 OK in 11ms (Views: 9.8ms | ActiveRecord: 0.2ms)
273
-  (0.5ms) rollback transaction
274
-  (0.1ms) begin transaction
346
+ 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
347
+  (0.2ms) ROLLBACK
348
+  (0.1ms) BEGIN
275
349
   (0.1ms) SAVEPOINT active_record_1
276
- SQL (0.3ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00]]
277
-  (0.0ms) RELEASE SAVEPOINT active_record_1
350
+ SQL (0.6ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
351
+  (0.2ms) RELEASE SAVEPOINT active_record_1
352
+  (0.2ms) SAVEPOINT active_record_1
353
+  (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'
354
+ SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["state", "pending"], ["target_id", 18], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
355
+  (0.2ms) RELEASE SAVEPOINT active_record_1
278
356
   (0.1ms) SAVEPOINT active_record_1
279
- SQL (0.3ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00], ["params", "---\n:name: Mr. Blobby\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00]]
280
-  (0.0ms) RELEASE SAVEPOINT active_record_1
281
- Processing by NotifyUser::NotificationsController#mark_read as HTML
282
- Parameters: {"ids"=>["1"]}
283
- SQL (0.1ms) UPDATE "notify_user_notifications" SET "state" = 'read' WHERE "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND (id IN ('1'))
284
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND (id IN ('1'))
285
- Completed 200 OK in 3ms (Views: 1.3ms | ActiveRecord: 0.2ms)
286
- NewPostNotification Load (0.2ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = ? LIMIT 1 [["id", 1]]
287
-  (0.4ms) rollback transaction
288
-  (0.1ms) begin transaction
289
-  (0.0ms) SAVEPOINT active_record_1
290
- SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00]]
291
-  (0.0ms) RELEASE SAVEPOINT active_record_1
292
-  (0.0ms) SAVEPOINT active_record_1
293
- SQL (0.3ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00], ["params", "---\n:name: Mr. Blobby\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00]]
294
-  (0.1ms) RELEASE SAVEPOINT active_record_1
295
- Processing by NotifyUser::NotificationsController#mark_read as HTML
296
- Parameters: {"ids"=>["1"]}
297
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "state" = 'read' WHERE "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND (id IN ('1'))
298
- NotifyUser::BaseNotification Load (0.2ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND (id IN ('1'))
299
- Completed 200 OK in 4ms (Views: 2.4ms | ActiveRecord: 0.4ms)
300
-  (0.5ms) rollback transaction
301
-  (0.1ms) begin transaction
302
-  (0.1ms) rollback transaction
303
-  (0.1ms) begin transaction
304
-  (0.1ms) rollback transaction
305
-  (0.1ms) begin transaction
306
-  (0.1ms) rollback transaction
307
-  (0.1ms) begin transaction
308
-  (0.0ms) SAVEPOINT active_record_1
309
- SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00]]
310
-  (0.0ms) RELEASE SAVEPOINT active_record_1
311
-  (0.0ms) SAVEPOINT active_record_1
312
- SQL (0.3ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00]]
313
-  (0.0ms) RELEASE SAVEPOINT active_record_1
357
+  (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'
358
+ SQL (1.1ms) UPDATE "notify_user_notifications" SET "params" = $1, "updated_at" = $2 WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 23 [["params", {:listing_id=>1}], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
359
+  (0.2ms) RELEASE SAVEPOINT active_record_1
360
+ NewPostNotification Load (0.6ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" IN ('NewPostNotification') ORDER BY "notify_user_notifications"."id" DESC LIMIT 1
361
+  (0.2ms) ROLLBACK
362
+  (0.2ms) BEGIN
363
+  (0.2ms) SAVEPOINT active_record_1
364
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
365
+  (0.2ms) RELEASE SAVEPOINT active_record_1
314
366
   (0.1ms) SAVEPOINT active_record_1
315
-  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
316
-  (0.5ms) rollback transaction
317
-  (0.1ms) begin transaction
367
+  (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'
368
+ SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["state", "pending"], ["target_id", 19], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
369
+  (0.2ms) RELEASE SAVEPOINT active_record_1
370
+  (0.2ms) SAVEPOINT active_record_1
371
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
372
+  (0.2ms) ROLLBACK
373
+  (0.1ms) BEGIN
374
+  (0.1ms) SAVEPOINT active_record_1
375
+ SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
376
+  (0.2ms) RELEASE SAVEPOINT active_record_1
377
+  (0.1ms) SAVEPOINT active_record_1
378
+  (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'
379
+ SQL (0.4ms) INSERT INTO "notify_user_notifications" ("created_at", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["state", "pending"], ["target_id", 20], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
380
+  (0.2ms) RELEASE SAVEPOINT active_record_1
381
+  (0.2ms) SAVEPOINT active_record_1
382
+  (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'
383
+  (0.2ms) RELEASE SAVEPOINT active_record_1
384
+  (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" = 20 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending' AND (id != 25)
385
+ NotifyUser::BaseNotification Load (0.6ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = $1 LIMIT 1 [["id", 25]]
386
+ User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id", 20]]
387
+ NotifyUser::BaseNotification Load (0.4ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" = 'NewPostNotification' AND "notify_user_notifications"."target_id" = 20 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending'
388
+  (0.1ms) SAVEPOINT active_record_1
389
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id", 20]]
390
+  (0.5ms) 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'
391
+ SQL (0.8ms) UPDATE "notify_user_notifications" SET "state" = $1, "updated_at" = $2 WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 25 [["state", "sent"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
392
+  (0.1ms) RELEASE SAVEPOINT active_record_1
393
+  (0.2ms) SAVEPOINT active_record_1
394
+  (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'
395
+  (0.2ms) RELEASE SAVEPOINT active_record_1
396
+ NotifyUser::BaseNotification Load (0.4ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = 25 ORDER BY "notify_user_notifications"."id" ASC LIMIT 1
397
+ User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id", 20]]
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" = 'action_mailer'
399
+ NewPostNotification Load (0.5ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 25 ORDER BY "notify_user_notifications"."id" ASC LIMIT 1
400
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id", 20]]
401
+  (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" = 'apns'
402
+  (0.2ms) ROLLBACK
403
+  (0.2ms) BEGIN
318
404
   (0.1ms) SAVEPOINT active_record_1
319
- SQL (0.3ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00]]
320
-  (0.0ms) RELEASE SAVEPOINT active_record_1
321
-  (0.0ms) SAVEPOINT active_record_1
322
- SQL (0.2ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00]]
323
-  (0.0ms) RELEASE SAVEPOINT active_record_1
324
-  (0.0ms) SAVEPOINT active_record_1
325
- SQL (0.3ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00], ["params", "--- {}\n"]]
405
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
326
406
   (0.1ms) RELEASE SAVEPOINT active_record_1
327
-  (0.3ms) 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" = 1 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending' AND (id != 1)
328
- NotifyUser::BaseNotification Load (0.2ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = ? LIMIT 1 [["id", 1]]
329
- User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
330
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" = 'NewPostNotification' AND "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending'
331
-  (0.0ms) SAVEPOINT active_record_1
332
- User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
333
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "state" = ?, "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["state", "sent"], ["updated_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00], ["params", "--- {}\n"]]
334
-  (0.0ms) RELEASE SAVEPOINT active_record_1
335
-  (0.0ms) SAVEPOINT active_record_1
336
- SQL (0.1ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00], ["params", "--- {}\n"]]
337
-  (0.0ms) RELEASE SAVEPOINT active_record_1
338
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = 1 ORDER BY "notify_user_notifications"."id" ASC LIMIT 1
339
-  (0.5ms) rollback transaction
340
-  (0.0ms) begin transaction
341
407
   (0.1ms) SAVEPOINT active_record_1
342
- SQL (0.3ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00]]
408
+  (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'
409
+ SQL (0.4ms) INSERT INTO "notify_user_notifications" ("created_at", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["state", "pending"], ["target_id", 21], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
410
+  (0.1ms) RELEASE SAVEPOINT active_record_1
411
+  (0.1ms) SAVEPOINT active_record_1
412
+  (0.3ms) 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'
343
413
   (0.1ms) RELEASE SAVEPOINT active_record_1
344
-  (0.0ms) SAVEPOINT active_record_1
345
- SQL (0.4ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00]]
346
-  (0.0ms) RELEASE SAVEPOINT active_record_1
347
-  (0.0ms) SAVEPOINT active_record_1
348
- SQL (0.1ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00], ["params", "--- {}\n"]]
349
-  (0.0ms) RELEASE SAVEPOINT active_record_1
350
-  (0.1ms) 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" = 1 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending' AND (id != 1)
351
-  (0.0ms) SAVEPOINT active_record_1
352
- SQL (0.1ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00]]
353
-  (0.0ms) RELEASE SAVEPOINT active_record_1
354
-  (0.2ms) 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" = 1 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending' AND (id != 2)
355
-  (0.4ms) rollback transaction
356
-  (0.0ms) begin transaction
357
-  (0.0ms) SAVEPOINT active_record_1
358
- SQL (0.3ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00]]
359
-  (0.0ms) RELEASE SAVEPOINT active_record_1
414
+  (0.4ms) 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" = 21 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending' AND (id != 26)
415
+  (0.2ms) SAVEPOINT active_record_1
416
+  (0.6ms) 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
+ SQL (0.7ms) INSERT INTO "notify_user_notifications" ("created_at", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["state", "pending"], ["target_id", 21], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
418
+  (0.1ms) RELEASE SAVEPOINT active_record_1
419
+  (0.5ms) 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" = 21 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending' AND (id != 27)
420
+  (0.2ms) ROLLBACK
421
+  (0.1ms) BEGIN
360
422
   (0.1ms) SAVEPOINT active_record_1
361
- SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00]]
423
+ SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
362
424
   (0.1ms) RELEASE SAVEPOINT active_record_1
363
425
   (0.1ms) SAVEPOINT active_record_1
364
- SQL (0.2ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00]]
365
-  (0.0ms) RELEASE SAVEPOINT active_record_1
366
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = ? LIMIT 1 [["id", 2]]
367
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
368
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" = 'NewPostNotification' AND "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending'
369
-  (0.0ms) SAVEPOINT active_record_1
370
- User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
371
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "state" = ?, "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["state", "sent"], ["updated_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00], ["params", "--- {}\n"]]
372
-  (0.0ms) RELEASE SAVEPOINT active_record_1
373
-  (0.0ms) SAVEPOINT active_record_1
374
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
375
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "state" = ?, "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 2 [["state", "sent"], ["updated_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00], ["params", "--- {}\n"]]
376
-  (0.0ms) RELEASE SAVEPOINT active_record_1
377
-  (0.0ms) SAVEPOINT active_record_1
378
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00], ["params", "--- {}\n"]]
379
-  (0.0ms) RELEASE SAVEPOINT active_record_1
380
-  (0.0ms) SAVEPOINT active_record_1
381
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 2 [["updated_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00], ["params", "--- {}\n"]]
382
-  (0.0ms) RELEASE SAVEPOINT active_record_1
426
+  (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'
427
+ SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["state", "pending"], ["target_id", 22], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
428
+  (0.2ms) RELEASE SAVEPOINT active_record_1
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
+ SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["state", "pending"], ["target_id", 22], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
432
+  (0.2ms) RELEASE SAVEPOINT active_record_1
433
+ NotifyUser::BaseNotification Load (0.5ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = $1 LIMIT 1 [["id", 29]]
434
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id", 22]]
435
+ NotifyUser::BaseNotification Load (0.5ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "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'
436
+  (0.1ms) SAVEPOINT active_record_1
437
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id", 22]]
438
+  (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'
439
+ SQL (0.7ms) UPDATE "notify_user_notifications" SET "state" = $1, "updated_at" = $2 WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 28 [["state", "sent"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
440
+  (0.1ms) RELEASE SAVEPOINT active_record_1
441
+  (0.1ms) SAVEPOINT active_record_1
442
+ User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id", 22]]
443
+  (0.5ms) 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'
444
+ SQL (0.8ms) UPDATE "notify_user_notifications" SET "state" = $1, "updated_at" = $2 WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 29 [["state", "sent"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
445
+  (0.1ms) RELEASE SAVEPOINT active_record_1
446
+  (0.1ms) SAVEPOINT active_record_1
447
+  (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'
448
+  (0.2ms) RELEASE SAVEPOINT active_record_1
449
+  (0.1ms) SAVEPOINT active_record_1
450
+  (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'
451
+  (0.2ms) RELEASE SAVEPOINT active_record_1
452
+  (0.5ms) 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" = 'action_mailer'
453
+ NotifyUser::UserHash Load (0.8ms) SELECT "notify_user_user_hashes".* FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."target_id" = 22 AND "notify_user_user_hashes"."target_type" = 'User' AND "notify_user_user_hashes"."type" = 'NewPostNotification' AND "notify_user_user_hashes"."active" = 't' ORDER BY "notify_user_user_hashes"."id" ASC LIMIT 1
454
+  (0.1ms) SAVEPOINT active_record_1
455
+ NotifyUser::UserHash Exists (0.3ms) SELECT 1 AS one FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."token" = '9tnENa7G-HQVTO3EhTWl7ADiNNKeAMIo5jndQVygrlKQ' LIMIT 1
456
+ SQL (0.5ms) INSERT INTO "notify_user_user_hashes" ("created_at", "target_id", "target_type", "token", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["target_id", 22], ["target_type", "User"], ["token", "9tnENa7G-HQVTO3EhTWl7ADiNNKeAMIo5jndQVygrlKQ"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
457
+  (0.2ms) RELEASE SAVEPOINT active_record_1
383
458
 
384
- Sent mail to user@example.com (8.4ms)
385
- Date: Sun, 05 Jan 2014 18:16:13 +1100
459
+ Sent mail to user@example.com (10.7ms)
460
+ Date: Mon, 28 Apr 2014 11:55:43 +1000
386
461
  From: please-change-me-at-config-initializers-notify-user@example.com
387
462
  To: user@example.com
388
- Message-ID: <52c906bd9e1d1_69db8082dbf848758@tomass-air-11.mail>
463
+ Message-ID: <535db51f6c70a_7503fdda542dbec85a1@wp.local.mail>
389
464
  Subject: Rails402: You have new Newpostnotification notifications.
390
465
  Mime-Version: 1.0
391
466
  Content-Type: text/html;
@@ -412,7 +487,9 @@ ing: optimizeLegibility;">
412
487
  <div style=3D"width: 100%; background-color: #fff; margin: 0; padding: 0;=
413
488
  ">
414
489
  <div style=3D"width: 500px; margin: 0 auto; padding: 40px 0; ">
415
- <div>
490
+ =
491
+
492
+ <div>
416
493
  New Post Notification happened. =
417
494
 
418
495
  </div>
@@ -425,6 +502,11 @@ ing: optimizeLegibility;">
425
502
  </div>
426
503
  <div style=3D"width: 100%; min-height: 80px; margin: 0; padding: 0;">
427
504
  <div style=3D"width: 600px; margin: 0 auto; padding: 0;">
505
+ <p style=3D"text-align: center;">
506
+ <a href=3D"http://localhost:5000/notify_user/notifications/unauth=
507
+ _unsubscribe?token=3D9tnENa7G-HQVTO3EhTWl7ADiNNKeAMIo5jndQVygrlKQ&amp;typ=
508
+ e=3DNewPostNotification">Unsubscribe</a>
509
+ </p>
428
510
  <p style=3D"text-align: center;">
429
511
  This is the default generated layout. A privacy declaration could g=
430
512
  o here.
@@ -440,32 +522,40 @@ o here.
440
522
  </body>
441
523
  </html>=
442
524
 
443
-  (0.4ms) rollback transaction
444
-  (0.1ms) begin transaction
445
-  (0.0ms) SAVEPOINT active_record_1
446
- SQL (0.3ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00]]
447
-  (0.1ms) RELEASE SAVEPOINT active_record_1
525
+  (0.2ms) ROLLBACK
526
+  (0.2ms) BEGIN
448
527
   (0.1ms) SAVEPOINT active_record_1
449
- SQL (0.2ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00]]
450
-  (0.0ms) RELEASE SAVEPOINT active_record_1
451
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = ? LIMIT 1 [["id", 1]]
452
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
453
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" = 'NewPostNotification' AND "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending'
454
-  (0.0ms) SAVEPOINT active_record_1
455
- User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
456
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "state" = ?, "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["state", "sent"], ["updated_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00], ["params", "--- {}\n"]]
528
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
529
+  (0.1ms) RELEASE SAVEPOINT active_record_1
530
+  (0.1ms) SAVEPOINT active_record_1
531
+  (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'
532
+ SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["state", "pending"], ["target_id", 23], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
533
+  (0.2ms) RELEASE SAVEPOINT active_record_1
534
+ NotifyUser::BaseNotification Load (0.4ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = $1 LIMIT 1 [["id", 30]]
535
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id", 23]]
536
+ NotifyUser::BaseNotification Load (0.5ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "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'
537
+  (0.2ms) SAVEPOINT active_record_1
538
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id", 23]]
539
+  (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'
540
+ SQL (0.9ms) UPDATE "notify_user_notifications" SET "state" = $1, "updated_at" = $2 WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 30 [["state", "sent"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
541
+  (0.1ms) RELEASE SAVEPOINT active_record_1
542
+  (0.1ms) SAVEPOINT active_record_1
543
+  (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'
544
+  (0.2ms) RELEASE SAVEPOINT active_record_1
545
+ NotifyUser::BaseNotification Load (0.6ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = 30 ORDER BY "notify_user_notifications"."id" ASC LIMIT 1
546
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id", 23]]
547
+  (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" = 'action_mailer'
548
+ NotifyUser::UserHash Load (0.7ms) SELECT "notify_user_user_hashes".* FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."target_id" = 23 AND "notify_user_user_hashes"."target_type" = 'User' AND "notify_user_user_hashes"."type" = 'NewPostNotification' AND "notify_user_user_hashes"."active" = 't' ORDER BY "notify_user_user_hashes"."id" ASC LIMIT 1
549
+  (0.2ms) SAVEPOINT active_record_1
550
+ NotifyUser::UserHash Exists (0.3ms) SELECT 1 AS one FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."token" = 'zzd6w9ekLF3Wla4MYXDEBgOf4pSB6hIi8Tu7NFXrpxaA' LIMIT 1
551
+ SQL (0.5ms) INSERT INTO "notify_user_user_hashes" ("created_at", "target_id", "target_type", "token", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["target_id", 23], ["target_type", "User"], ["token", "zzd6w9ekLF3Wla4MYXDEBgOf4pSB6hIi8Tu7NFXrpxaA"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
457
552
   (0.1ms) RELEASE SAVEPOINT active_record_1
458
-  (0.0ms) SAVEPOINT active_record_1
459
- SQL (0.1ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 07:16:13 UTC +00:00], ["params", "--- {}\n"]]
460
-  (0.0ms) RELEASE SAVEPOINT active_record_1
461
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = 1 ORDER BY "notify_user_notifications"."id" ASC LIMIT 1
462
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
463
553
 
464
- Sent mail to user@example.com (5.7ms)
465
- Date: Sun, 05 Jan 2014 18:16:13 +1100
554
+ Sent mail to user@example.com (8.7ms)
555
+ Date: Mon, 28 Apr 2014 11:55:43 +1000
466
556
  From: please-change-me-at-config-initializers-notify-user@example.com
467
557
  To: user@example.com
468
- Message-ID: <52c906bda4d58_69db8082dbf8488fe@tomass-air-11.mail>
558
+ Message-ID: <535db51f8774f_7503fdda542dbec8663@wp.local.mail>
469
559
  Subject: Rails402: You have a new Newpostnotification notification.
470
560
  Mime-Version: 1.0
471
561
  Content-Type: text/html;
@@ -493,10 +583,16 @@ ing: optimizeLegibility;">
493
583
  ">
494
584
  <div style=3D"width: 500px; margin: 0 auto; padding: 40px 0; ">
495
585
  New Post Notification happened.
586
+
496
587
  </div>
497
588
  </div>
498
589
  <div style=3D"width: 100%; min-height: 80px; margin: 0; padding: 0;">
499
590
  <div style=3D"width: 600px; margin: 0 auto; padding: 0;">
591
+ <p style=3D"text-align: center;">
592
+ <a href=3D"http://localhost:5000/notify_user/notifications/unauth=
593
+ _unsubscribe?token=3Dzzd6w9ekLF3Wla4MYXDEBgOf4pSB6hIi8Tu7NFXrpxaA&amp;typ=
594
+ e=3DNewPostNotification">Unsubscribe</a>
595
+ </p>
500
596
  <p style=3D"text-align: center;">
501
597
  This is the default generated layout. A privacy declaration could g=
502
598
  o here.
@@ -512,155 +608,76 @@ o here.
512
608
  </body>
513
609
  </html>=
514
610
 
515
-  (0.5ms) rollback transaction
516
-  (0.1ms) begin transaction
517
-  (0.1ms) rollback transaction
518
-  (0.1ms) begin transaction
519
-  (0.1ms) rollback transaction
520
-  (0.1ms) begin transaction
521
-  (0.0ms) rollback transaction
522
-  (0.0ms) begin transaction
523
-  (0.0ms) rollback transaction
524
-  (0.1ms) begin transaction
525
-  (0.0ms) rollback transaction
526
-  (0.0ms) begin transaction
527
-  (0.0ms) rollback transaction
528
-  (0.0ms) begin transaction
529
-  (0.0ms) rollback transaction
530
-  (0.3ms) begin transaction
531
-  (0.1ms) SAVEPOINT active_record_1
532
- SQL (4.8ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00]]
533
-  (0.1ms) RELEASE SAVEPOINT active_record_1
534
- Processing by NotifyUser::NotificationsController#index as HTML
535
- NotifyUser::BaseNotification Load (0.2ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' ORDER BY created_at DESC LIMIT 25 OFFSET 0
536
- Completed 200 OK in 5ms (Views: 2.7ms | ActiveRecord: 0.4ms)
537
-  (0.4ms) rollback transaction
538
-  (0.1ms) begin transaction
611
+  (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" = 'apns'
612
+  (0.2ms) ROLLBACK
613
+  (0.1ms) BEGIN
614
+  (0.2ms) SAVEPOINT active_record_1
615
+ SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
616
+  (0.2ms) RELEASE SAVEPOINT active_record_1
539
617
   (0.1ms) SAVEPOINT active_record_1
540
- SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00]]
541
-  (0.1ms) RELEASE SAVEPOINT active_record_1
542
-  (0.1ms) SAVEPOINT active_record_1
543
- SQL (1.2ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00], ["params", "---\n:name: Mr. Blobby\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00]]
618
+ 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" = 24) LIMIT 1
619
+ 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", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["target_id", 24], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
544
620
   (0.1ms) RELEASE SAVEPOINT active_record_1
545
- Processing by NotifyUser::NotificationsController#index as HTML
546
- NotifyUser::BaseNotification Load (0.4ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' ORDER BY created_at DESC LIMIT 25 OFFSET 0
547
- Completed 200 OK in 11ms (Views: 9.8ms | ActiveRecord: 0.4ms)
548
-  (0.4ms) rollback transaction
549
-  (0.0ms) begin transaction
550
-  (0.0ms) SAVEPOINT active_record_1
551
- SQL (0.3ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00]]
552
-  (0.0ms) RELEASE SAVEPOINT active_record_1
553
-  (0.1ms) SAVEPOINT active_record_1
554
- SQL (0.3ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00], ["params", "---\n:name: Mr. Blobby\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00]]
555
-  (0.0ms) RELEASE SAVEPOINT active_record_1
556
- Processing by NotifyUser::NotificationsController#mark_read as HTML
557
- Parameters: {"ids"=>["1"]}
558
- SQL (0.1ms) UPDATE "notify_user_notifications" SET "state" = 'read' WHERE "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND (id IN ('1'))
559
- NotifyUser::BaseNotification Load (0.2ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND (id IN ('1'))
560
- Completed 200 OK in 3ms (Views: 1.7ms | ActiveRecord: 0.3ms)
561
- NewPostNotification Load (0.2ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = ? LIMIT 1 [["id", 1]]
562
-  (0.4ms) rollback transaction
563
-  (0.1ms) begin transaction
564
-  (0.1ms) SAVEPOINT active_record_1
565
- SQL (0.6ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00]]
566
-  (0.1ms) RELEASE SAVEPOINT active_record_1
567
-  (0.1ms) SAVEPOINT active_record_1
568
- SQL (0.3ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00], ["params", "---\n:name: Mr. Blobby\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00]]
569
-  (0.0ms) RELEASE SAVEPOINT active_record_1
570
- Processing by NotifyUser::NotificationsController#mark_read as HTML
571
- Parameters: {"ids"=>["1"]}
572
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "state" = 'read' WHERE "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND (id IN ('1'))
573
- NotifyUser::BaseNotification Load (0.2ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND (id IN ('1'))
574
- Completed 200 OK in 3ms (Views: 1.9ms | ActiveRecord: 0.3ms)
575
-  (0.4ms) rollback transaction
576
-  (0.1ms) begin transaction
577
-  (0.1ms) rollback transaction
578
-  (0.1ms) begin transaction
579
-  (0.1ms) rollback transaction
580
-  (0.0ms) begin transaction
581
-  (0.1ms) rollback transaction
582
-  (0.0ms) begin transaction
583
-  (0.0ms) SAVEPOINT active_record_1
584
- SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00]]
585
-  (0.0ms) RELEASE SAVEPOINT active_record_1
586
-  (0.0ms) SAVEPOINT active_record_1
587
- SQL (0.4ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00]]
588
-  (0.0ms) RELEASE SAVEPOINT active_record_1
589
-  (0.0ms) SAVEPOINT active_record_1
590
-  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
591
-  (0.4ms) rollback transaction
592
-  (0.1ms) begin transaction
593
621
   (0.1ms) SAVEPOINT active_record_1
594
- SQL (0.3ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00]]
595
-  (0.0ms) RELEASE SAVEPOINT active_record_1
622
+  (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" = 'NewPostNotification'
623
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
624
+ NotifyUser::BaseNotification Load (0.5ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" IS NULL ORDER BY "notify_user_notifications"."id" ASC LIMIT 1
625
+  (0.2ms) ROLLBACK
626
+  (0.2ms) BEGIN
627
+  (0.2ms) SAVEPOINT active_record_1
628
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
629
+  (0.2ms) RELEASE SAVEPOINT active_record_1
596
630
   (0.1ms) SAVEPOINT active_record_1
597
- SQL (0.3ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00]]
598
-  (0.0ms) RELEASE SAVEPOINT active_record_1
631
+  (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'
632
+ SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["state", "pending"], ["target_id", 25], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
633
+  (0.2ms) RELEASE SAVEPOINT active_record_1
634
+ NotifyUser::BaseNotification Load (0.5ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = 31 ORDER BY "notify_user_notifications"."id" ASC LIMIT 1
635
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id", 25]]
636
+  (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" = 'action_mailer'
637
+  (0.2ms) ROLLBACK
638
+  (0.1ms) BEGIN
599
639
   (0.1ms) SAVEPOINT active_record_1
600
- SQL (0.5ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00], ["params", "--- {}\n"]]
601
-  (0.1ms) RELEASE SAVEPOINT active_record_1
602
-  (0.2ms) 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" = 1 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending' AND (id != 1)
603
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = ? LIMIT 1 [["id", 1]]
604
- User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
605
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" = 'NewPostNotification' AND "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending'
606
-  (0.0ms) SAVEPOINT active_record_1
607
- User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
608
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "state" = ?, "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["state", "sent"], ["updated_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00], ["params", "--- {}\n"]]
609
-  (0.0ms) RELEASE SAVEPOINT active_record_1
610
-  (0.0ms) SAVEPOINT active_record_1
611
- SQL (0.1ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00], ["params", "--- {}\n"]]
612
-  (0.1ms) RELEASE SAVEPOINT active_record_1
613
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = 1 ORDER BY "notify_user_notifications"."id" ASC LIMIT 1
614
-  (0.4ms) rollback transaction
615
-  (0.0ms) begin transaction
616
-  (0.0ms) SAVEPOINT active_record_1
617
- SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00]]
618
-  (0.0ms) RELEASE SAVEPOINT active_record_1
619
-  (0.0ms) SAVEPOINT active_record_1
620
- SQL (0.3ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00]]
621
-  (0.1ms) RELEASE SAVEPOINT active_record_1
622
-  (0.0ms) SAVEPOINT active_record_1
623
- SQL (0.1ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00], ["params", "--- {}\n"]]
624
-  (0.0ms) RELEASE SAVEPOINT active_record_1
625
-  (0.2ms) 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" = 1 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending' AND (id != 1)
626
-  (0.1ms) SAVEPOINT active_record_1
627
- SQL (0.2ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00]]
628
-  (0.0ms) RELEASE SAVEPOINT active_record_1
629
-  (0.2ms) 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" = 1 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending' AND (id != 2)
630
-  (0.4ms) rollback transaction
631
-  (0.1ms) begin transaction
632
-  (0.0ms) SAVEPOINT active_record_1
633
- SQL (0.3ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00]]
634
-  (0.0ms) RELEASE SAVEPOINT active_record_1
635
-  (0.0ms) SAVEPOINT active_record_1
636
- SQL (0.3ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00]]
637
-  (0.0ms) RELEASE SAVEPOINT active_record_1
638
-  (0.0ms) SAVEPOINT active_record_1
639
- SQL (0.1ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00]]
640
-  (0.0ms) RELEASE SAVEPOINT active_record_1
641
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = ? LIMIT 1 [["id", 2]]
642
- User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
643
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" = 'NewPostNotification' AND "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending'
644
-  (0.0ms) SAVEPOINT active_record_1
645
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
646
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "state" = ?, "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["state", "sent"], ["updated_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00], ["params", "--- {}\n"]]
640
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
641
+  (0.2ms) RELEASE SAVEPOINT active_record_1
642
+  (0.2ms) SAVEPOINT active_record_1
643
+  (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" = 'NewPostNotification'
644
+ SQL (0.7ms) INSERT INTO "notify_user_notifications" ("created_at", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["state", "pending"], ["target_id", 26], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 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" = 26 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
648
+ SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["state", "pending"], ["target_id", 26], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
649
+  (0.2ms) RELEASE SAVEPOINT active_record_1
650
+ NotifyUser::BaseNotification Load (0.5ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = $1 LIMIT 1 [["id", 33]]
651
+ User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id", 26]]
652
+ NotifyUser::BaseNotification Load (0.7ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" = 'NewPostNotification' AND "notify_user_notifications"."target_id" = 26 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending'
653
+  (0.5ms) SAVEPOINT active_record_1
654
+ User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id", 26]]
655
+  (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'
656
+ SQL (0.8ms) UPDATE "notify_user_notifications" SET "state" = $1, "updated_at" = $2 WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 32 [["state", "sent"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
647
657
   (0.1ms) RELEASE SAVEPOINT active_record_1
648
-  (0.0ms) SAVEPOINT active_record_1
649
- User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
650
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "state" = ?, "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 2 [["state", "sent"], ["updated_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00], ["params", "--- {}\n"]]
651
-  (0.0ms) RELEASE SAVEPOINT active_record_1
652
658
   (0.1ms) SAVEPOINT active_record_1
653
- SQL (0.1ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00], ["params", "--- {}\n"]]
659
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id", 26]]
660
+  (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'
661
+ SQL (0.7ms) UPDATE "notify_user_notifications" SET "state" = $1, "updated_at" = $2 WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 33 [["state", "sent"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
654
662
   (0.1ms) RELEASE SAVEPOINT active_record_1
663
+  (0.2ms) SAVEPOINT active_record_1
664
+  (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'
665
+  (0.2ms) RELEASE SAVEPOINT active_record_1
666
+  (0.2ms) SAVEPOINT active_record_1
667
+  (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'
668
+  (0.2ms) RELEASE SAVEPOINT active_record_1
669
+  (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'
670
+ 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' ORDER BY "notify_user_user_hashes"."id" ASC LIMIT 1
655
671
   (0.1ms) SAVEPOINT active_record_1
656
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 2 [["updated_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00], ["params", "--- {}\n"]]
657
-  (0.1ms) RELEASE SAVEPOINT active_record_1
672
+ NotifyUser::UserHash Exists (0.4ms) SELECT 1 AS one FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."token" = '3pCdVjcojoGfTyuLR6ivYghvUBtCLadek_AsvRbU1ufA' LIMIT 1
673
+ SQL (0.5ms) INSERT INTO "notify_user_user_hashes" ("created_at", "target_id", "target_type", "token", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["target_id", 26], ["target_type", "User"], ["token", "3pCdVjcojoGfTyuLR6ivYghvUBtCLadek_AsvRbU1ufA"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
674
+  (0.2ms) RELEASE SAVEPOINT active_record_1
658
675
 
659
676
  Sent mail to user@example.com (8.5ms)
660
- Date: Sun, 05 Jan 2014 21:46:46 +1100
677
+ Date: Mon, 28 Apr 2014 11:55:43 +1000
661
678
  From: please-change-me-at-config-initializers-notify-user@example.com
662
679
  To: user@example.com
663
- Message-ID: <52c93816e5cb5_743980c1fbe4185b4@Tomass-MacBook-Air-11.local.mail>
680
+ Message-ID: <535db51f9e9e7_7503fdda542dbec872a@wp.local.mail>
664
681
  Subject: Rails402: You have new Newpostnotification notifications.
665
682
  Mime-Version: 1.0
666
683
  Content-Type: text/html;
@@ -687,7 +704,9 @@ ing: optimizeLegibility;">
687
704
  <div style=3D"width: 100%; background-color: #fff; margin: 0; padding: 0;=
688
705
  ">
689
706
  <div style=3D"width: 500px; margin: 0 auto; padding: 40px 0; ">
690
- <div>
707
+ =
708
+
709
+ <div>
691
710
  New Post Notification happened. =
692
711
 
693
712
  </div>
@@ -700,6 +719,11 @@ ing: optimizeLegibility;">
700
719
  </div>
701
720
  <div style=3D"width: 100%; min-height: 80px; margin: 0; padding: 0;">
702
721
  <div style=3D"width: 600px; margin: 0 auto; padding: 0;">
722
+ <p style=3D"text-align: center;">
723
+ <a href=3D"http://localhost:5000/notify_user/notifications/unauth=
724
+ _unsubscribe?token=3D3pCdVjcojoGfTyuLR6ivYghvUBtCLadek_AsvRbU1ufA&amp;typ=
725
+ e=3DNewPostNotification">Unsubscribe</a>
726
+ </p>
703
727
  <p style=3D"text-align: center;">
704
728
  This is the default generated layout. A privacy declaration could g=
705
729
  o here.
@@ -715,32 +739,40 @@ o here.
715
739
  </body>
716
740
  </html>=
717
741
 
718
-  (0.5ms) rollback transaction
719
-  (0.1ms) begin transaction
742
+  (0.2ms) ROLLBACK
743
+  (0.1ms) BEGIN
744
+  (0.2ms) SAVEPOINT active_record_1
745
+ SQL (0.6ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
746
+  (0.2ms) RELEASE SAVEPOINT active_record_1
720
747
   (0.1ms) SAVEPOINT active_record_1
721
- SQL (0.3ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00]]
722
-  (0.0ms) RELEASE SAVEPOINT active_record_1
723
-  (0.0ms) SAVEPOINT active_record_1
724
- SQL (0.3ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00]]
725
-  (0.0ms) RELEASE SAVEPOINT active_record_1
726
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = ? LIMIT 1 [["id", 1]]
727
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
728
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" = 'NewPostNotification' AND "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending'
729
-  (0.1ms) SAVEPOINT active_record_1
730
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
731
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "state" = ?, "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["state", "sent"], ["updated_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00], ["params", "--- {}\n"]]
748
+  (0.5ms) 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'
749
+ SQL (0.4ms) INSERT INTO "notify_user_notifications" ("created_at", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["state", "pending"], ["target_id", 27], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
750
+  (0.1ms) RELEASE SAVEPOINT active_record_1
751
+ NotifyUser::BaseNotification Load (0.5ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = $1 LIMIT 1 [["id", 34]]
752
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id", 27]]
753
+ NotifyUser::BaseNotification Load (0.5ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" = 'NewPostNotification' AND "notify_user_notifications"."target_id" = 27 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending'
754
+  (0.2ms) SAVEPOINT active_record_1
755
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id", 27]]
756
+  (0.5ms) 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'
757
+ SQL (0.7ms) UPDATE "notify_user_notifications" SET "state" = $1, "updated_at" = $2 WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 34 [["state", "sent"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
758
+  (0.1ms) RELEASE SAVEPOINT active_record_1
759
+  (0.1ms) SAVEPOINT active_record_1
760
+  (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" = 'NewPostNotification'
732
761
   (0.1ms) RELEASE SAVEPOINT active_record_1
733
-  (0.0ms) SAVEPOINT active_record_1
734
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00], ["params", "--- {}\n"]]
735
-  (0.0ms) RELEASE SAVEPOINT active_record_1
736
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = 1 ORDER BY "notify_user_notifications"."id" ASC LIMIT 1
737
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
762
+ NotifyUser::BaseNotification Load (0.4ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = 34 ORDER BY "notify_user_notifications"."id" ASC LIMIT 1
763
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id", 27]]
764
+  (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'
765
+ NotifyUser::UserHash Load (0.6ms) SELECT "notify_user_user_hashes".* FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."target_id" = 27 AND "notify_user_user_hashes"."target_type" = 'User' AND "notify_user_user_hashes"."type" = 'NewPostNotification' AND "notify_user_user_hashes"."active" = 't' ORDER BY "notify_user_user_hashes"."id" ASC LIMIT 1
766
+  (0.1ms) SAVEPOINT active_record_1
767
+ NotifyUser::UserHash Exists (0.4ms) SELECT 1 AS one FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."token" = 'dz1Hax8nhBMc9oOPl1tYYg5RiQM7RcMjDJZouSPEy0Rg' LIMIT 1
768
+ SQL (0.5ms) INSERT INTO "notify_user_user_hashes" ("created_at", "target_id", "target_type", "token", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["target_id", 27], ["target_type", "User"], ["token", "dz1Hax8nhBMc9oOPl1tYYg5RiQM7RcMjDJZouSPEy0Rg"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
769
+  (0.2ms) RELEASE SAVEPOINT active_record_1
738
770
 
739
- Sent mail to user@example.com (7.7ms)
740
- Date: Sun, 05 Jan 2014 21:46:46 +1100
771
+ Sent mail to user@example.com (9.5ms)
772
+ Date: Mon, 28 Apr 2014 11:55:43 +1000
741
773
  From: please-change-me-at-config-initializers-notify-user@example.com
742
774
  To: user@example.com
743
- Message-ID: <52c93816ed465_743980c1fbe4186c6@Tomass-MacBook-Air-11.local.mail>
775
+ Message-ID: <535db51faa8cd_7503fdda542dbec884b@wp.local.mail>
744
776
  Subject: Rails402: You have a new Newpostnotification notification.
745
777
  Mime-Version: 1.0
746
778
  Content-Type: text/html;
@@ -768,10 +800,16 @@ ing: optimizeLegibility;">
768
800
  ">
769
801
  <div style=3D"width: 500px; margin: 0 auto; padding: 40px 0; ">
770
802
  New Post Notification happened.
803
+
771
804
  </div>
772
805
  </div>
773
806
  <div style=3D"width: 100%; min-height: 80px; margin: 0; padding: 0;">
774
807
  <div style=3D"width: 600px; margin: 0 auto; padding: 0;">
808
+ <p style=3D"text-align: center;">
809
+ <a href=3D"http://localhost:5000/notify_user/notifications/unauth=
810
+ _unsubscribe?token=3Ddz1Hax8nhBMc9oOPl1tYYg5RiQM7RcMjDJZouSPEy0Rg&amp;typ=
811
+ e=3DNewPostNotification">Unsubscribe</a>
812
+ </p>
775
813
  <p style=3D"text-align: center;">
776
814
  This is the default generated layout. A privacy declaration could g=
777
815
  o here.
@@ -787,915 +825,250 @@ o here.
787
825
  </body>
788
826
  </html>=
789
827
 
790
-  (0.4ms) rollback transaction
791
-  (0.1ms) begin transaction
792
-  (0.0ms) SAVEPOINT active_record_1
793
- SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00]]
794
-  (0.0ms) RELEASE SAVEPOINT active_record_1
795
-  (0.0ms) SAVEPOINT active_record_1
796
- SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00]]
797
-  (0.0ms) RELEASE SAVEPOINT active_record_1
798
-  (0.0ms) SAVEPOINT active_record_1
799
- SQL (0.1ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00], ["params", "--- {}\n"]]
800
-  (0.0ms) RELEASE SAVEPOINT active_record_1
801
-  (0.0ms) SAVEPOINT active_record_1
802
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "state" = ?, "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["state", "sent"], ["updated_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00], ["params", "--- {}\n"]]
828
+  (0.2ms) ROLLBACK
829
+  (0.1ms) BEGIN
830
+  (0.1ms) SAVEPOINT active_record_1
831
+ SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
832
+  (0.2ms) RELEASE SAVEPOINT active_record_1
833
+  (0.1ms) SAVEPOINT active_record_1
834
+  (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'
835
+ SQL (0.4ms) INSERT INTO "notify_user_notifications" ("created_at", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["state", "pending"], ["target_id", 28], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
836
+  (0.2ms) RELEASE SAVEPOINT active_record_1
837
+  (0.1ms) SAVEPOINT active_record_1
838
+  (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'
839
+  (0.2ms) RELEASE SAVEPOINT active_record_1
840
+  (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'
841
+  (0.1ms) SAVEPOINT active_record_1
842
+  (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'
843
+ SQL (0.7ms) UPDATE "notify_user_notifications" SET "state" = $1, "updated_at" = $2 WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 35 [["state", "sent"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
803
844
   (0.1ms) RELEASE SAVEPOINT active_record_1
804
-  (0.0ms) SAVEPOINT active_record_1
805
- SQL (0.4ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 10:46:46 UTC +00:00], ["params", "--- {}\n"]]
806
-  (0.1ms) RELEASE SAVEPOINT active_record_1
807
- NewPostNotification Load (0.2ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 ORDER BY "notify_user_notifications"."id" ASC LIMIT 1
808
-  (0.4ms) rollback transaction
809
-  (0.0ms) begin transaction
810
-  (0.0ms) rollback transaction
811
-  (0.0ms) begin transaction
812
-  (0.0ms) rollback transaction
813
-  (0.0ms) begin transaction
814
-  (0.0ms) rollback transaction
815
-  (0.0ms) begin transaction
816
-  (0.0ms) rollback transaction
817
-  (0.0ms) begin transaction
818
-  (0.0ms) rollback transaction
819
-  (0.0ms) begin transaction
820
-  (0.0ms) rollback transaction
821
-  (0.0ms) begin transaction
822
-  (0.0ms) rollback transaction
823
-  (1.1ms) begin transaction
845
+  (0.1ms) SAVEPOINT active_record_1
846
+  (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'
847
+  (0.2ms) RELEASE SAVEPOINT active_record_1
848
+ NewPostNotification Load (0.4ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 35 ORDER BY "notify_user_notifications"."id" ASC LIMIT 1
849
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id", 28]]
850
+  (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" = 'action_mailer'
851
+  (0.3ms) 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" = 'apns'
852
+  (0.2ms) ROLLBACK
853
+  (0.1ms) BEGIN
824
854
   (0.1ms) SAVEPOINT active_record_1
825
- SQL (4.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00]]
855
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
826
856
   (0.1ms) RELEASE SAVEPOINT active_record_1
827
- Processing by NotifyUser::NotificationsController#index as HTML
828
- NotifyUser::BaseNotification Load (0.3ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' ORDER BY created_at DESC LIMIT 25 OFFSET 0
829
- Completed 200 OK in 7ms (Views: 3.3ms | ActiveRecord: 0.6ms)
830
-  (6.8ms) rollback transaction
831
-  (0.1ms) begin transaction
857
+  (0.1ms) SAVEPOINT active_record_1
858
+ 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" = 29) LIMIT 1
859
+ 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", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["target_id", 29], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
860
+  (0.1ms) RELEASE SAVEPOINT active_record_1
861
+  (0.1ms) SAVEPOINT active_record_1
862
+  (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'
863
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
832
864
   (0.1ms) SAVEPOINT active_record_1
833
- SQL (0.6ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00]]
865
+  (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'
866
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
867
+  (0.3ms) 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'
868
+  (0.2ms) ROLLBACK
869
+  (0.1ms) BEGIN
870
+  (0.1ms) SAVEPOINT active_record_1
871
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
834
872
   (0.2ms) RELEASE SAVEPOINT active_record_1
835
873
   (0.2ms) SAVEPOINT active_record_1
836
- SQL (1.6ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00], ["params", "---\n:name: Mr. Blobby\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00]]
874
+ 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" = 30) LIMIT 1
875
+ 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", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["target_id", 30], ["target_type", "User"], ["type", "action_mailer"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
876
+  (0.1ms) RELEASE SAVEPOINT active_record_1
877
+  (0.1ms) SAVEPOINT active_record_1
878
+  (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'
879
+ SQL (0.4ms) INSERT INTO "notify_user_notifications" ("created_at", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["state", "pending"], ["target_id", 30], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
880
+  (0.1ms) RELEASE SAVEPOINT active_record_1
881
+  (0.1ms) SAVEPOINT active_record_1
882
+  (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'
837
883
   (0.1ms) RELEASE SAVEPOINT active_record_1
838
- Processing by NotifyUser::NotificationsController#index as HTML
839
- NotifyUser::BaseNotification Load (0.2ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' ORDER BY created_at DESC LIMIT 25 OFFSET 0
840
- Completed 200 OK in 17ms (Views: 16.0ms | ActiveRecord: 0.2ms)
841
-  (0.4ms) rollback transaction
842
-  (0.1ms) begin transaction
884
+  (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'
843
885
   (0.1ms) SAVEPOINT active_record_1
844
- SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00]]
886
+  (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'
887
+ SQL (0.6ms) UPDATE "notify_user_notifications" SET "state" = $1, "updated_at" = $2 WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 36 [["state", "sent"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
888
+  (0.1ms) RELEASE SAVEPOINT active_record_1
889
+  (0.1ms) SAVEPOINT active_record_1
890
+  (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'
845
891
   (0.1ms) RELEASE SAVEPOINT active_record_1
892
+ NewPostNotification Load (0.5ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 36 ORDER BY "notify_user_notifications"."id" ASC LIMIT 1
893
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id", 30]]
894
+  (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" = 'action_mailer'
895
+  (0.3ms) 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'
896
+  (0.1ms) ROLLBACK
897
+  (0.1ms) BEGIN
846
898
   (0.1ms) SAVEPOINT active_record_1
847
- SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00], ["params", "---\n:name: Mr. Blobby\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00]]
899
+ SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
848
900
   (0.1ms) RELEASE SAVEPOINT active_record_1
849
- Processing by NotifyUser::NotificationsController#mark_read as HTML
850
- Parameters: {"ids"=>["1"]}
851
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "state" = 'read' WHERE "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND (id IN ('1'))
852
- NotifyUser::BaseNotification Load (0.2ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND (id IN ('1'))
853
- Completed 200 OK in 4ms (Views: 2.2ms | ActiveRecord: 0.4ms)
854
- NewPostNotification Load (0.3ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = ? LIMIT 1 [["id", 1]]
855
-  (0.5ms) rollback transaction
856
-  (0.1ms) begin transaction
857
-  (0.1ms) SAVEPOINT active_record_1
858
- SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00]]
901
+  (0.1ms) SAVEPOINT active_record_1
902
+  (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'
903
+ SQL (0.4ms) INSERT INTO "notify_user_notifications" ("created_at", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["state", "pending"], ["target_id", 31], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
904
+  (0.2ms) RELEASE SAVEPOINT active_record_1
905
+ NotifyUser::UserHash Load (0.7ms) SELECT "notify_user_user_hashes".* FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."target_id" = 31 AND "notify_user_user_hashes"."target_type" = 'User' AND "notify_user_user_hashes"."type" = 'NewPostNotification' AND "notify_user_user_hashes"."active" = 't' ORDER BY "notify_user_user_hashes"."id" ASC LIMIT 1
906
+  (0.2ms) SAVEPOINT active_record_1
907
+ NotifyUser::UserHash Exists (0.4ms) SELECT 1 AS one FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."token" = '49hY-f9bkFaOYZCM3bqlJQ0CjRiRGdJKen05y1a6k6qw' LIMIT 1
908
+ SQL (0.6ms) INSERT INTO "notify_user_user_hashes" ("created_at", "target_id", "target_type", "token", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["target_id", 31], ["target_type", "User"], ["token", "49hY-f9bkFaOYZCM3bqlJQ0CjRiRGdJKen05y1a6k6qw"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
909
+  (0.2ms) RELEASE SAVEPOINT active_record_1
910
+  (0.1ms) ROLLBACK
911
+  (0.2ms) BEGIN
912
+  (0.2ms) SAVEPOINT active_record_1
913
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
914
+  (0.1ms) RELEASE SAVEPOINT active_record_1
915
+  (0.1ms) SAVEPOINT active_record_1
916
+  (0.3ms) 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'
917
+ SQL (0.4ms) INSERT INTO "notify_user_notifications" ("created_at", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["state", "pending"], ["target_id", 32], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
859
918
   (0.1ms) RELEASE SAVEPOINT active_record_1
919
+ NotifyUser::UserHash Load (0.4ms) SELECT "notify_user_user_hashes".* FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."target_id" = 32 AND "notify_user_user_hashes"."target_type" = 'User' AND "notify_user_user_hashes"."type" = 'NewPostNotification' AND "notify_user_user_hashes"."active" = 't' ORDER BY "notify_user_user_hashes"."id" ASC LIMIT 1
920
+  (0.1ms) SAVEPOINT active_record_1
921
+ NotifyUser::UserHash Exists (0.3ms) SELECT 1 AS one FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."token" = '3VI6EOEYwBtFzmJ7Dtq3igo8DYJqrzOFCc4ZW31XBy-g' LIMIT 1
922
+ SQL (0.3ms) INSERT INTO "notify_user_user_hashes" ("created_at", "target_id", "target_type", "token", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["target_id", 32], ["target_type", "User"], ["token", "3VI6EOEYwBtFzmJ7Dtq3igo8DYJqrzOFCc4ZW31XBy-g"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
923
+  (0.3ms) RELEASE SAVEPOINT active_record_1
924
+ NotifyUser::UserHash Load (0.5ms) SELECT "notify_user_user_hashes".* FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."target_id" = 32 AND "notify_user_user_hashes"."target_type" = 'User' AND "notify_user_user_hashes"."type" = 'NewPostNotification' AND "notify_user_user_hashes"."active" = 't' ORDER BY "notify_user_user_hashes"."id" ASC LIMIT 1
925
+  (0.2ms) ROLLBACK
926
+  (0.1ms) BEGIN
860
927
   (0.1ms) SAVEPOINT active_record_1
861
- SQL (0.6ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00], ["params", "---\n:name: Mr. Blobby\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00]]
928
+ SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
862
929
   (0.1ms) RELEASE SAVEPOINT active_record_1
863
- Processing by NotifyUser::NotificationsController#mark_read as HTML
864
- Parameters: {"ids"=>["1"]}
865
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "state" = 'read' WHERE "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND (id IN ('1'))
866
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND (id IN ('1'))
867
- Completed 200 OK in 4ms (Views: 2.0ms | ActiveRecord: 0.3ms)
868
-  (1.3ms) rollback transaction
869
-  (0.1ms) begin transaction
870
-  (0.1ms) rollback transaction
871
-  (0.1ms) begin transaction
872
-  (0.1ms) rollback transaction
873
-  (0.1ms) begin transaction
874
-  (0.1ms) rollback transaction
875
-  (0.1ms) begin transaction
876
930
   (0.1ms) SAVEPOINT active_record_1
877
- SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00]]
931
+  (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'
932
+ SQL (0.4ms) INSERT INTO "notify_user_notifications" ("created_at", "state", "target_id", "target_type", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["state", "pending"], ["target_id", 33], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
933
+  (0.1ms) RELEASE SAVEPOINT active_record_1
934
+ 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' ORDER BY "notify_user_user_hashes"."id" ASC LIMIT 1
935
+  (0.1ms) SAVEPOINT active_record_1
936
+ NotifyUser::UserHash Exists (0.3ms) SELECT 1 AS one FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."token" = '6tZ0vCrcGTmMjLSIRd8EHQUTxezSxgCkR1z2gWhZnlIQ' LIMIT 1
937
+ SQL (0.4ms) INSERT INTO "notify_user_user_hashes" ("created_at", "target_id", "target_type", "token", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["target_id", 33], ["target_type", "User"], ["token", "6tZ0vCrcGTmMjLSIRd8EHQUTxezSxgCkR1z2gWhZnlIQ"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
938
+  (0.2ms) RELEASE SAVEPOINT active_record_1
939
+  (0.1ms) SAVEPOINT active_record_1
940
+ SQL (0.6ms) UPDATE "notify_user_user_hashes" SET "active" = $1, "updated_at" = $2 WHERE "notify_user_user_hashes"."id" = 8 [["active", false], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
941
+  (0.1ms) RELEASE SAVEPOINT active_record_1
942
+ NotifyUser::UserHash Load (0.7ms) 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' ORDER BY "notify_user_user_hashes"."id" ASC LIMIT 1
943
+  (0.1ms) SAVEPOINT active_record_1
944
+ NotifyUser::UserHash Exists (0.3ms) SELECT 1 AS one FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."token" = 'FKuj9ZzD5VBZqG3WJlHw8wLQYnsDvp6azn8fbBbJwiYg' LIMIT 1
945
+ SQL (0.4ms) INSERT INTO "notify_user_user_hashes" ("created_at", "target_id", "target_type", "token", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["target_id", 33], ["target_type", "User"], ["token", "FKuj9ZzD5VBZqG3WJlHw8wLQYnsDvp6azn8fbBbJwiYg"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
878
946
   (0.1ms) RELEASE SAVEPOINT active_record_1
879
-  (0.0ms) SAVEPOINT active_record_1
880
- SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00]]
947
+  (0.1ms) ROLLBACK
948
+  (0.2ms) BEGIN
949
+  (0.2ms) SAVEPOINT active_record_1
950
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
881
951
   (0.1ms) RELEASE SAVEPOINT active_record_1
882
952
   (0.1ms) SAVEPOINT active_record_1
883
-  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
884
-  (6.9ms) rollback transaction
885
-  (0.1ms) begin transaction
953
+ 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" = 34) LIMIT 1
954
+ 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", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["target_id", 34], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
955
+  (0.2ms) RELEASE SAVEPOINT active_record_1
886
956
   (0.1ms) SAVEPOINT active_record_1
887
- SQL (0.7ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00]]
888
-  (0.1ms) RELEASE SAVEPOINT active_record_1
889
-  (0.0ms) SAVEPOINT active_record_1
890
- SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00]]
891
-  (0.1ms) RELEASE SAVEPOINT active_record_1
957
+ NotifyUser::Unsubscribe Exists (0.7ms) 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" = 34) LIMIT 1
958
+  (0.2ms) RELEASE SAVEPOINT active_record_1
959
+  (0.2ms) SAVEPOINT active_record_1
960
+  (0.5ms) 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'
961
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
962
+  (0.2ms) ROLLBACK
963
+  (0.2ms) BEGIN
964
+  (0.2ms) SAVEPOINT active_record_1
965
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
966
+  (0.2ms) RELEASE SAVEPOINT active_record_1
967
+  (0.1ms) SAVEPOINT active_record_1
968
+ 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" = 35) LIMIT 1
969
+ 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", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["target_id", 35], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
970
+  (0.2ms) RELEASE SAVEPOINT active_record_1
971
+  (0.2ms) SAVEPOINT active_record_1
972
+ NotifyUser::Unsubscribe Exists (0.5ms) 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" = 35) LIMIT 1
973
+  (0.3ms) RELEASE SAVEPOINT active_record_1
974
+  (0.3ms) SAVEPOINT active_record_1
975
+ NotifyUser::Unsubscribe Exists (0.5ms) SELECT 1 AS one FROM "notify_user_unsubscribes" WHERE ("notify_user_unsubscribes"."type" = 'UnsubscribableNotification' AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."target_id" = 35) LIMIT 1
976
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
977
+ NotifyUser::Unsubscribe Load (0.5ms) SELECT "notify_user_unsubscribes".* FROM "notify_user_unsubscribes" ORDER BY "notify_user_unsubscribes"."id" DESC LIMIT 1
978
+  (0.2ms) ROLLBACK
979
+  (0.2ms) BEGIN
980
+  (0.2ms) SAVEPOINT active_record_1
981
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
982
+  (0.2ms) RELEASE SAVEPOINT active_record_1
983
+  (0.2ms) SAVEPOINT active_record_1
984
+ 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" = 36) LIMIT 1
985
+ 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", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["target_id", 36], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
986
+  (0.2ms) RELEASE SAVEPOINT active_record_1
987
+  (0.1ms) SAVEPOINT active_record_1
988
+ NotifyUser::Unsubscribe Exists (0.4ms) SELECT 1 AS one FROM "notify_user_unsubscribes" WHERE ("notify_user_unsubscribes"."type" = 'NewPostNotification' AND "notify_user_unsubscribes"."id" != 10 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."target_id" = 36) LIMIT 1
989
+  (0.2ms) RELEASE SAVEPOINT active_record_1
990
+  (0.2ms) SAVEPOINT active_record_1
991
+ 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
992
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
993
+  (0.5ms) 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'
994
+ NotifyUser::Unsubscribe Load (0.4ms) SELECT "notify_user_unsubscribes".* FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 36 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
995
+  (0.2ms) SAVEPOINT active_record_1
996
+ SQL (0.3ms) DELETE FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."id" = $1 [["id", 10]]
997
+  (0.2ms) RELEASE SAVEPOINT active_record_1
998
+ NotifyUser::Unsubscribe Load (0.5ms) SELECT "notify_user_unsubscribes".* FROM "notify_user_unsubscribes" WHERE "notify_user_unsubscribes"."target_id" = 36 AND "notify_user_unsubscribes"."target_type" = 'User' AND "notify_user_unsubscribes"."type" = 'NewPostNotification'
999
+  (0.2ms) ROLLBACK
1000
+  (0.1ms) BEGIN
1001
+  (0.2ms) SAVEPOINT active_record_1
1002
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
1003
+  (0.2ms) RELEASE SAVEPOINT active_record_1
892
1004
   (0.1ms) SAVEPOINT active_record_1
893
- SQL (0.3ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00], ["params", "--- {}\n"]]
894
-  (0.1ms) RELEASE SAVEPOINT active_record_1
895
-  (0.3ms) 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" = 1 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending' AND (id != 1)
896
- NotifyUser::BaseNotification Load (0.2ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = ? LIMIT 1 [["id", 1]]
897
- User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
898
- NotifyUser::BaseNotification Load (0.3ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" = 'NewPostNotification' AND "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending'
1005
+  (0.5ms) 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'
1006
+ SQL (0.9ms) 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", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["params", {:name=>"Mr. Blobby"}], ["state", "pending"], ["target_id", 37], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
1007
+  (0.2ms) RELEASE SAVEPOINT active_record_1
1008
+  (0.2ms) ROLLBACK
1009
+  (0.2ms) BEGIN
1010
+  (0.2ms) SAVEPOINT active_record_1
1011
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
1012
+  (0.2ms) RELEASE SAVEPOINT active_record_1
1013
+  (0.2ms) SAVEPOINT active_record_1
1014
+ NotifyUser::UserHash Exists (0.4ms) SELECT 1 AS one FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."token" = 'EuBzFJ3yNx4i9cDYauEXLw7LhLmqtC-Q8OzhONkeq0RQ' LIMIT 1
1015
+ SQL (0.4ms) INSERT INTO "notify_user_user_hashes" ("created_at", "target_id", "target_type", "token", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["target_id", 38], ["target_type", "User"], ["token", "EuBzFJ3yNx4i9cDYauEXLw7LhLmqtC-Q8OzhONkeq0RQ"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
1016
+  (0.2ms) RELEASE SAVEPOINT active_record_1
899
1017
   (0.1ms) SAVEPOINT active_record_1
900
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
901
- SQL (0.4ms) UPDATE "notify_user_notifications" SET "state" = ?, "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["state", "sent"], ["updated_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00], ["params", "--- {}\n"]]
902
1018
   (0.1ms) RELEASE SAVEPOINT active_record_1
903
-  (0.2ms) SAVEPOINT active_record_1
904
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00], ["params", "--- {}\n"]]
905
-  (0.1ms) RELEASE SAVEPOINT active_record_1
906
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = 1 ORDER BY "notify_user_notifications"."id" ASC LIMIT 1
907
-  (0.4ms) rollback transaction
908
-  (0.1ms) begin transaction
909
-  (0.0ms) SAVEPOINT active_record_1
910
- SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00]]
911
-  (0.1ms) RELEASE SAVEPOINT active_record_1
912
-  (0.0ms) SAVEPOINT active_record_1
913
- SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00]]
1019
+ NotifyUser::UserHash Exists (0.5ms) SELECT 1 AS one FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."token" = 'EuBzFJ3yNx4i9cDYauEXLw7LhLmqtC-Q8OzhONkeq0RQ' AND "notify_user_user_hashes"."type" = 'NewPostNotification' AND "notify_user_user_hashes"."active" = 't' LIMIT 1
1020
+  (0.2ms) ROLLBACK
1021
+  (0.1ms) BEGIN
1022
+  (0.1ms) SAVEPOINT active_record_1
1023
+ SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
1024
+  (0.2ms) RELEASE SAVEPOINT active_record_1
1025
+  (0.1ms) SAVEPOINT active_record_1
1026
+ NotifyUser::UserHash Exists (0.3ms) SELECT 1 AS one FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."token" = 'l3_y0_cAts5KXpFuTAfKbQr0VZViDS2YFU0PWUL-W36A' LIMIT 1
1027
+ SQL (0.6ms) INSERT INTO "notify_user_user_hashes" ("created_at", "target_id", "target_type", "token", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["target_id", 39], ["target_type", "User"], ["token", "l3_y0_cAts5KXpFuTAfKbQr0VZViDS2YFU0PWUL-W36A"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
914
1028
   (0.1ms) RELEASE SAVEPOINT active_record_1
915
-  (0.0ms) SAVEPOINT active_record_1
916
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00], ["params", "--- {}\n"]]
917
-  (0.1ms) RELEASE SAVEPOINT active_record_1
918
-  (0.2ms) 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" = 1 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending' AND (id != 1)
919
1029
   (0.1ms) SAVEPOINT active_record_1
920
- SQL (0.2ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00]]
921
-  (0.1ms) RELEASE SAVEPOINT active_record_1
922
-  (0.3ms) 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" = 1 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending' AND (id != 2)
923
-  (0.4ms) rollback transaction
924
-  (0.1ms) begin transaction
1030
+  (0.2ms) RELEASE SAVEPOINT active_record_1
1031
+  (0.1ms) SAVEPOINT active_record_1
1032
+ SQL (0.7ms) UPDATE "notify_user_user_hashes" SET "active" = $1, "updated_at" = $2 WHERE "notify_user_user_hashes"."id" = 11 [["active", false], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
1033
+  (0.3ms) RELEASE SAVEPOINT active_record_1
1034
+ NotifyUser::UserHash Exists (0.5ms) SELECT 1 AS one FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."token" = 'l3_y0_cAts5KXpFuTAfKbQr0VZViDS2YFU0PWUL-W36A' AND "notify_user_user_hashes"."type" = 'NewPostNotification' AND "notify_user_user_hashes"."active" = 't' LIMIT 1
1035
+  (0.1ms) ROLLBACK
1036
+  (0.1ms) BEGIN
925
1037
   (0.1ms) SAVEPOINT active_record_1
926
- SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00]]
1038
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
927
1039
   (0.1ms) RELEASE SAVEPOINT active_record_1
928
1040
   (0.1ms) SAVEPOINT active_record_1
929
- SQL (0.6ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00]]
1041
+ NotifyUser::UserHash Exists (0.5ms) SELECT 1 AS one FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."token" = 'b9vNh5R1E1f53mhp2l03lwfTf6hOyFURE4VXMXIjn4oQ' LIMIT 1
1042
+ SQL (1.5ms) INSERT INTO "notify_user_user_hashes" ("created_at", "target_id", "target_type", "token", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["target_id", 40], ["target_type", "User"], ["token", "b9vNh5R1E1f53mhp2l03lwfTf6hOyFURE4VXMXIjn4oQ"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
1043
+  (0.4ms) RELEASE SAVEPOINT active_record_1
1044
+  (0.2ms) SAVEPOINT active_record_1
1045
+  (0.2ms) RELEASE SAVEPOINT active_record_1
1046
+  (0.1ms) SAVEPOINT active_record_1
1047
+ SQL (0.8ms) UPDATE "notify_user_user_hashes" SET "active" = $1, "updated_at" = $2 WHERE "notify_user_user_hashes"."id" = 12 [["active", false], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
930
1048
   (0.1ms) RELEASE SAVEPOINT active_record_1
1049
+  (0.2ms) ROLLBACK
1050
+  (0.1ms) BEGIN
931
1051
   (0.1ms) SAVEPOINT active_record_1
932
- SQL (0.3ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00]]
933
-  (0.1ms) RELEASE SAVEPOINT active_record_1
934
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = ? LIMIT 1 [["id", 2]]
935
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
936
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" = 'NewPostNotification' AND "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending'
937
-  (0.3ms) SAVEPOINT active_record_1
938
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
939
- SQL (0.5ms) UPDATE "notify_user_notifications" SET "state" = ?, "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["state", "sent"], ["updated_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00], ["params", "--- {}\n"]]
940
-  (0.2ms) RELEASE SAVEPOINT active_record_1
941
-  (2.1ms) SAVEPOINT active_record_1
942
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
943
- SQL (0.4ms) UPDATE "notify_user_notifications" SET "state" = ?, "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 2 [["state", "sent"], ["updated_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00], ["params", "--- {}\n"]]
944
-  (0.1ms) RELEASE SAVEPOINT active_record_1
945
-  (0.0ms) SAVEPOINT active_record_1
946
- SQL (0.5ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00], ["params", "--- {}\n"]]
1052
+ SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["email", "user@example.com"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
1053
+  (0.2ms) RELEASE SAVEPOINT active_record_1
1054
+  (0.1ms) SAVEPOINT active_record_1
1055
+ NotifyUser::UserHash Exists (0.5ms) SELECT 1 AS one FROM "notify_user_user_hashes" WHERE "notify_user_user_hashes"."token" = '7YqpCDG-rQ9mV__JfpIxkga6J2lXc9Z5FQl7LFdU_sKw' LIMIT 1
1056
+ SQL (0.5ms) INSERT INTO "notify_user_user_hashes" ("created_at", "target_id", "target_type", "token", "type", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00], ["target_id", 41], ["target_type", "User"], ["token", "7YqpCDG-rQ9mV__JfpIxkga6J2lXc9Z5FQl7LFdU_sKw"], ["type", "NewPostNotification"], ["updated_at", Mon, 28 Apr 2014 01:55:43 UTC +00:00]]
947
1057
   (0.1ms) RELEASE SAVEPOINT active_record_1
948
1058
   (0.1ms) SAVEPOINT active_record_1
949
- SQL (0.3ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 2 [["updated_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00], ["params", "--- {}\n"]]
950
-  (0.1ms) RELEASE SAVEPOINT active_record_1
951
-
952
- Sent mail to user@example.com (10.8ms)
953
- Date: Sun, 05 Jan 2014 21:50:55 +1100
954
- From: please-change-me-at-config-initializers-notify-user@example.com
955
- To: user@example.com
956
- Message-ID: <52c9390f9c98d_74b380c2bbec64367@Tomass-MacBook-Air-11.local.mail>
957
- Subject: Rails402: You have new Newpostnotification notifications.
958
- Mime-Version: 1.0
959
- Content-Type: text/html;
960
- charset=UTF-8
961
- Content-Transfer-Encoding: quoted-printable
962
-
963
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/h=
964
- tml4/strict.dtd">
965
- <html>
966
- <head>
967
- <meta content=3D"text/html; charset=3Dutf-8" http-equiv=3D"Content-Type=
968
- "/>
969
- <title></title>
970
- </head>
971
-
972
- <body marginheight=3D"0" topmargin=3D"0" marginwidth=3D"0" leftmargin=3D"=
973
- 0" style=3D"margin: 0px; -webkit-font-smoothing: antialiased; text-render=
974
- ing: optimizeLegibility;">
975
- <div style=3D"width: 100%; height: 70px; margin: 0; padding: 0;">
976
- <div style=3D"width: 600px; margin: 0 auto; padding: 15px 0;">
977
- Logo
978
- </div>
979
- </div>
980
- <div style=3D"width: 100%; background-color: #fff; margin: 0; padding: 0;=
981
- ">
982
- <div style=3D"width: 500px; margin: 0 auto; padding: 40px 0; ">
983
- <div>
984
- New Post Notification happened. =
985
-
986
- </div>
987
- <div>
988
- New Post Notification happened. =
989
-
990
- </div>
991
-
992
- </div>
993
- </div>
994
- <div style=3D"width: 100%; min-height: 80px; margin: 0; padding: 0;">
995
- <div style=3D"width: 600px; margin: 0 auto; padding: 0;">
996
- <p style=3D"text-align: center;">
997
- This is the default generated layout. A privacy declaration could g=
998
- o here.
999
- </p>
1000
- <p style=3D"text-align: center; margin-bottom: 0px;">
1001
- =C2=A9 MyCompany Pty Ltd
1002
- </p>
1003
- <p style=3D"text-align: center; margin-top: 0px; padding-top: 0px;">
1004
- ABN 123 456 789
1005
- </p>
1006
- </div>
1007
- </div>
1008
- </body>
1009
- </html>=
1010
-
1011
-  (0.4ms) rollback transaction
1012
-  (0.1ms) begin transaction
1013
-  (0.1ms) SAVEPOINT active_record_1
1014
- SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00]]
1015
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1016
-  (0.0ms) SAVEPOINT active_record_1
1017
- SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00]]
1018
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1019
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = ? LIMIT 1 [["id", 1]]
1020
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
1021
- NotifyUser::BaseNotification Load (0.7ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" = 'NewPostNotification' AND "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending'
1022
-  (0.1ms) SAVEPOINT active_record_1
1023
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
1024
- SQL (0.3ms) UPDATE "notify_user_notifications" SET "state" = ?, "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["state", "sent"], ["updated_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00], ["params", "--- {}\n"]]
1025
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1026
-  (0.1ms) SAVEPOINT active_record_1
1027
- SQL (0.3ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00], ["params", "--- {}\n"]]
1028
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1029
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = 1 ORDER BY "notify_user_notifications"."id" ASC LIMIT 1
1030
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
1031
-
1032
- Sent mail to user@example.com (8.4ms)
1033
- Date: Sun, 05 Jan 2014 21:50:55 +1100
1034
- From: please-change-me-at-config-initializers-notify-user@example.com
1035
- To: user@example.com
1036
- Message-ID: <52c9390fa861b_74b380c2bbec6444b@Tomass-MacBook-Air-11.local.mail>
1037
- Subject: Rails402: You have a new Newpostnotification notification.
1038
- Mime-Version: 1.0
1039
- Content-Type: text/html;
1040
- charset=UTF-8
1041
- Content-Transfer-Encoding: quoted-printable
1042
-
1043
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/h=
1044
- tml4/strict.dtd">
1045
- <html>
1046
- <head>
1047
- <meta content=3D"text/html; charset=3Dutf-8" http-equiv=3D"Content-Type=
1048
- "/>
1049
- <title></title>
1050
- </head>
1051
-
1052
- <body marginheight=3D"0" topmargin=3D"0" marginwidth=3D"0" leftmargin=3D"=
1053
- 0" style=3D"margin: 0px; -webkit-font-smoothing: antialiased; text-render=
1054
- ing: optimizeLegibility;">
1055
- <div style=3D"width: 100%; height: 70px; margin: 0; padding: 0;">
1056
- <div style=3D"width: 600px; margin: 0 auto; padding: 15px 0;">
1057
- Logo
1058
- </div>
1059
- </div>
1060
- <div style=3D"width: 100%; background-color: #fff; margin: 0; padding: 0;=
1061
- ">
1062
- <div style=3D"width: 500px; margin: 0 auto; padding: 40px 0; ">
1063
- New Post Notification happened.
1064
- </div>
1065
- </div>
1066
- <div style=3D"width: 100%; min-height: 80px; margin: 0; padding: 0;">
1067
- <div style=3D"width: 600px; margin: 0 auto; padding: 0;">
1068
- <p style=3D"text-align: center;">
1069
- This is the default generated layout. A privacy declaration could g=
1070
- o here.
1071
- </p>
1072
- <p style=3D"text-align: center; margin-bottom: 0px;">
1073
- =C2=A9 MyCompany Pty Ltd
1074
- </p>
1075
- <p style=3D"text-align: center; margin-top: 0px; padding-top: 0px;">
1076
- ABN 123 456 789
1077
- </p>
1078
- </div>
1079
- </div>
1080
- </body>
1081
- </html>=
1082
-
1083
-  (0.5ms) rollback transaction
1084
-  (0.1ms) begin transaction
1085
-  (0.1ms) SAVEPOINT active_record_1
1086
- SQL (0.5ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00]]
1087
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1088
-  (0.1ms) SAVEPOINT active_record_1
1089
- SQL (0.6ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00]]
1090
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1091
-  (0.0ms) SAVEPOINT active_record_1
1092
- SQL (0.3ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00], ["params", "--- {}\n"]]
1093
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1094
-  (0.1ms) SAVEPOINT active_record_1
1095
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "state" = ?, "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["state", "sent"], ["updated_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00], ["params", "--- {}\n"]]
1096
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1097
-  (0.0ms) SAVEPOINT active_record_1
1098
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 10:50:55 UTC +00:00], ["params", "--- {}\n"]]
1099
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1100
- NewPostNotification Load (0.2ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 ORDER BY "notify_user_notifications"."id" ASC LIMIT 1
1101
-  (0.5ms) rollback transaction
1102
-  (0.1ms) begin transaction
1103
-  (0.1ms) rollback transaction
1104
-  (0.0ms) begin transaction
1105
-  (0.0ms) rollback transaction
1106
-  (0.0ms) begin transaction
1107
-  (0.0ms) rollback transaction
1108
-  (0.0ms) begin transaction
1109
-  (0.0ms) rollback transaction
1110
-  (0.0ms) begin transaction
1111
-  (0.0ms) rollback transaction
1112
-  (0.0ms) begin transaction
1113
-  (0.0ms) rollback transaction
1114
-  (0.0ms) begin transaction
1115
-  (0.2ms) rollback transaction
1116
-  (0.4ms) begin transaction
1117
-  (0.1ms) SAVEPOINT active_record_1
1118
- SQL (3.8ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00]]
1119
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1120
- Processing by NotifyUser::NotificationsController#index as HTML
1121
- NotifyUser::BaseNotification Load (0.2ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' ORDER BY created_at DESC LIMIT 25 OFFSET 0
1122
- Completed 200 OK in 6ms (Views: 3.1ms | ActiveRecord: 0.4ms)
1123
-  (6.8ms) rollback transaction
1124
-  (0.1ms) begin transaction
1125
-  (0.1ms) SAVEPOINT active_record_1
1126
- SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00]]
1127
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1128
-  (0.1ms) SAVEPOINT active_record_1
1129
- SQL (1.1ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00], ["params", "---\n:name: Mr. Blobby\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00]]
1130
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1131
- Processing by NotifyUser::NotificationsController#index as HTML
1132
- NotifyUser::BaseNotification Load (0.2ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' ORDER BY created_at DESC LIMIT 25 OFFSET 0
1133
- Completed 200 OK in 13ms (Views: 12.0ms | ActiveRecord: 0.2ms)
1134
-  (0.5ms) rollback transaction
1135
-  (0.1ms) begin transaction
1136
-  (0.1ms) SAVEPOINT active_record_1
1137
- SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00]]
1138
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1139
-  (0.1ms) SAVEPOINT active_record_1
1140
- SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00], ["params", "---\n:name: Mr. Blobby\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00]]
1141
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1142
- Processing by NotifyUser::NotificationsController#mark_read as HTML
1143
- Parameters: {"ids"=>["1"]}
1144
- SQL (0.3ms) UPDATE "notify_user_notifications" SET "state" = 'read' WHERE "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND (id IN ('1'))
1145
- NotifyUser::BaseNotification Load (0.2ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND (id IN ('1'))
1146
- Completed 200 OK in 4ms (Views: 2.0ms | ActiveRecord: 0.4ms)
1147
- NewPostNotification Load (0.3ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = ? LIMIT 1 [["id", 1]]
1148
-  (0.5ms) rollback transaction
1149
-  (0.1ms) begin transaction
1150
-  (0.1ms) SAVEPOINT active_record_1
1151
- SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00]]
1152
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1153
-  (0.1ms) SAVEPOINT active_record_1
1154
- SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00], ["params", "---\n:name: Mr. Blobby\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00]]
1155
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1156
- Processing by NotifyUser::NotificationsController#mark_read as HTML
1157
- Parameters: {"ids"=>["1"]}
1158
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "state" = 'read' WHERE "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND (id IN ('1'))
1159
- NotifyUser::BaseNotification Load (0.2ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND (id IN ('1'))
1160
- Completed 200 OK in 6ms (Views: 3.1ms | ActiveRecord: 0.4ms)
1161
-  (0.5ms) rollback transaction
1162
-  (0.1ms) begin transaction
1163
-  (0.1ms) rollback transaction
1164
-  (0.0ms) begin transaction
1165
-  (0.2ms) rollback transaction
1166
-  (0.1ms) begin transaction
1167
-  (0.1ms) rollback transaction
1168
-  (0.1ms) begin transaction
1169
-  (0.1ms) SAVEPOINT active_record_1
1170
- SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00]]
1171
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1172
-  (0.1ms) SAVEPOINT active_record_1
1173
- SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00]]
1174
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1175
-  (0.1ms) SAVEPOINT active_record_1
1176
-  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
1177
-  (0.7ms) rollback transaction
1178
-  (0.1ms) begin transaction
1179
-  (0.1ms) SAVEPOINT active_record_1
1180
- SQL (0.8ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00]]
1181
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1182
-  (0.0ms) SAVEPOINT active_record_1
1183
- SQL (0.4ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00]]
1184
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1185
-  (0.1ms) SAVEPOINT active_record_1
1186
- SQL (0.4ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00], ["params", "--- {}\n"]]
1187
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1188
-  (0.2ms) 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" = 1 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending' AND (id != 1)
1189
- NotifyUser::BaseNotification Load (0.2ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = ? LIMIT 1 [["id", 1]]
1190
- User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
1191
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" = 'NewPostNotification' AND "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending'
1192
-  (0.1ms) SAVEPOINT active_record_1
1193
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
1194
- SQL (0.3ms) UPDATE "notify_user_notifications" SET "state" = ?, "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["state", "sent"], ["updated_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00], ["params", "--- {}\n"]]
1195
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1196
-  (0.0ms) SAVEPOINT active_record_1
1197
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00], ["params", "--- {}\n"]]
1198
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1199
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = 1 ORDER BY "notify_user_notifications"."id" ASC LIMIT 1
1200
-  (0.5ms) rollback transaction
1201
-  (0.1ms) begin transaction
1202
-  (0.1ms) SAVEPOINT active_record_1
1203
- SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00]]
1204
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1205
-  (0.1ms) SAVEPOINT active_record_1
1206
- SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00]]
1207
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1208
-  (0.0ms) SAVEPOINT active_record_1
1209
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00], ["params", "--- {}\n"]]
1210
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1211
-  (0.2ms) 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" = 1 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending' AND (id != 1)
1212
-  (0.1ms) SAVEPOINT active_record_1
1213
- SQL (0.3ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00]]
1214
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1215
-  (0.2ms) 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" = 1 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending' AND (id != 2)
1216
-  (0.4ms) rollback transaction
1217
-  (0.1ms) begin transaction
1218
-  (0.1ms) SAVEPOINT active_record_1
1219
- SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00]]
1220
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1221
-  (0.0ms) SAVEPOINT active_record_1
1222
- SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00]]
1223
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1224
-  (0.0ms) SAVEPOINT active_record_1
1225
- SQL (0.2ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00]]
1226
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1227
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = ? LIMIT 1 [["id", 2]]
1228
- User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
1229
- NotifyUser::BaseNotification Load (0.2ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" = 'NewPostNotification' AND "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending'
1230
-  (0.1ms) SAVEPOINT active_record_1
1231
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
1232
- SQL (0.5ms) UPDATE "notify_user_notifications" SET "state" = ?, "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["state", "sent"], ["updated_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00], ["params", "--- {}\n"]]
1233
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1234
-  (0.0ms) SAVEPOINT active_record_1
1235
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
1236
- SQL (0.3ms) UPDATE "notify_user_notifications" SET "state" = ?, "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 2 [["state", "sent"], ["updated_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00], ["params", "--- {}\n"]]
1237
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1238
-  (0.0ms) SAVEPOINT active_record_1
1239
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00], ["params", "--- {}\n"]]
1240
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1241
-  (0.0ms) SAVEPOINT active_record_1
1242
- SQL (0.3ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 2 [["updated_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00], ["params", "--- {}\n"]]
1243
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1244
-
1245
- Sent mail to user@example.com (11.6ms)
1246
- Date: Sun, 05 Jan 2014 22:08:05 +1100
1247
- From: please-change-me-at-config-initializers-notify-user@example.com
1248
- To: user@example.com
1249
- Message-ID: <52c93d15c2d49_76438082dbf89262c@Tomass-MacBook-Air-11.local.mail>
1250
- Subject: Rails402: You have new Newpostnotification notifications.
1251
- Mime-Version: 1.0
1252
- Content-Type: text/html;
1253
- charset=UTF-8
1254
- Content-Transfer-Encoding: quoted-printable
1255
-
1256
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/h=
1257
- tml4/strict.dtd">
1258
- <html>
1259
- <head>
1260
- <meta content=3D"text/html; charset=3Dutf-8" http-equiv=3D"Content-Type=
1261
- "/>
1262
- <title></title>
1263
- </head>
1264
-
1265
- <body marginheight=3D"0" topmargin=3D"0" marginwidth=3D"0" leftmargin=3D"=
1266
- 0" style=3D"margin: 0px; -webkit-font-smoothing: antialiased; text-render=
1267
- ing: optimizeLegibility;">
1268
- <div style=3D"width: 100%; height: 70px; margin: 0; padding: 0;">
1269
- <div style=3D"width: 600px; margin: 0 auto; padding: 15px 0;">
1270
- Logo
1271
- </div>
1272
- </div>
1273
- <div style=3D"width: 100%; background-color: #fff; margin: 0; padding: 0;=
1274
- ">
1275
- <div style=3D"width: 500px; margin: 0 auto; padding: 40px 0; ">
1276
- <div>
1277
- New Post Notification happened. =
1278
-
1279
- </div>
1280
- <div>
1281
- New Post Notification happened. =
1282
-
1283
- </div>
1284
-
1285
- </div>
1286
- </div>
1287
- <div style=3D"width: 100%; min-height: 80px; margin: 0; padding: 0;">
1288
- <div style=3D"width: 600px; margin: 0 auto; padding: 0;">
1289
- <p style=3D"text-align: center;">
1290
- This is the default generated layout. A privacy declaration could g=
1291
- o here.
1292
- </p>
1293
- <p style=3D"text-align: center; margin-bottom: 0px;">
1294
- =C2=A9 MyCompany Pty Ltd
1295
- </p>
1296
- <p style=3D"text-align: center; margin-top: 0px; padding-top: 0px;">
1297
- ABN 123 456 789
1298
- </p>
1299
- </div>
1300
- </div>
1301
- </body>
1302
- </html>=
1303
-
1304
-  (0.4ms) rollback transaction
1305
-  (0.1ms) begin transaction
1306
-  (0.1ms) SAVEPOINT active_record_1
1307
- SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00]]
1308
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1309
-  (0.1ms) SAVEPOINT active_record_1
1310
- SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00]]
1311
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1312
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = ? LIMIT 1 [["id", 1]]
1313
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
1314
- NotifyUser::BaseNotification Load (0.3ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" = 'NewPostNotification' AND "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending'
1315
-  (0.1ms) SAVEPOINT active_record_1
1316
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
1317
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "state" = ?, "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["state", "sent"], ["updated_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00], ["params", "--- {}\n"]]
1318
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1319
-  (0.0ms) SAVEPOINT active_record_1
1320
- SQL (0.8ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00], ["params", "--- {}\n"]]
1321
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1322
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = 1 ORDER BY "notify_user_notifications"."id" ASC LIMIT 1
1323
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
1324
-
1325
- Sent mail to user@example.com (10.7ms)
1326
- Date: Sun, 05 Jan 2014 22:08:05 +1100
1327
- From: please-change-me-at-config-initializers-notify-user@example.com
1328
- To: user@example.com
1329
- Message-ID: <52c93d15ce74f_76438082dbf892715@Tomass-MacBook-Air-11.local.mail>
1330
- Subject: Rails402: You have a new Newpostnotification notification.
1331
- Mime-Version: 1.0
1332
- Content-Type: text/html;
1333
- charset=UTF-8
1334
- Content-Transfer-Encoding: quoted-printable
1335
-
1336
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/h=
1337
- tml4/strict.dtd">
1338
- <html>
1339
- <head>
1340
- <meta content=3D"text/html; charset=3Dutf-8" http-equiv=3D"Content-Type=
1341
- "/>
1342
- <title></title>
1343
- </head>
1344
-
1345
- <body marginheight=3D"0" topmargin=3D"0" marginwidth=3D"0" leftmargin=3D"=
1346
- 0" style=3D"margin: 0px; -webkit-font-smoothing: antialiased; text-render=
1347
- ing: optimizeLegibility;">
1348
- <div style=3D"width: 100%; height: 70px; margin: 0; padding: 0;">
1349
- <div style=3D"width: 600px; margin: 0 auto; padding: 15px 0;">
1350
- Logo
1351
- </div>
1352
- </div>
1353
- <div style=3D"width: 100%; background-color: #fff; margin: 0; padding: 0;=
1354
- ">
1355
- <div style=3D"width: 500px; margin: 0 auto; padding: 40px 0; ">
1356
- New Post Notification happened.
1357
- </div>
1358
- </div>
1359
- <div style=3D"width: 100%; min-height: 80px; margin: 0; padding: 0;">
1360
- <div style=3D"width: 600px; margin: 0 auto; padding: 0;">
1361
- <p style=3D"text-align: center;">
1362
- This is the default generated layout. A privacy declaration could g=
1363
- o here.
1364
- </p>
1365
- <p style=3D"text-align: center; margin-bottom: 0px;">
1366
- =C2=A9 MyCompany Pty Ltd
1367
- </p>
1368
- <p style=3D"text-align: center; margin-top: 0px; padding-top: 0px;">
1369
- ABN 123 456 789
1370
- </p>
1371
- </div>
1372
- </div>
1373
- </body>
1374
- </html>=
1375
-
1376
-  (0.5ms) rollback transaction
1377
-  (0.1ms) begin transaction
1378
-  (0.1ms) SAVEPOINT active_record_1
1379
- SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00]]
1380
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1381
-  (0.1ms) SAVEPOINT active_record_1
1382
- SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00]]
1383
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1384
-  (0.1ms) SAVEPOINT active_record_1
1385
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00], ["params", "--- {}\n"]]
1386
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1387
-  (0.1ms) SAVEPOINT active_record_1
1388
- SQL (0.3ms) UPDATE "notify_user_notifications" SET "state" = ?, "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["state", "sent"], ["updated_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00], ["params", "--- {}\n"]]
1389
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1390
-  (0.0ms) SAVEPOINT active_record_1
1391
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 11:08:05 UTC +00:00], ["params", "--- {}\n"]]
1392
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1393
- NewPostNotification Load (0.3ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 ORDER BY "notify_user_notifications"."id" ASC LIMIT 1
1394
-  (0.4ms) rollback transaction
1395
-  (0.1ms) begin transaction
1396
-  (0.1ms) rollback transaction
1397
-  (0.1ms) begin transaction
1398
-  (0.1ms) rollback transaction
1399
-  (0.1ms) begin transaction
1400
-  (0.1ms) rollback transaction
1401
-  (0.1ms) begin transaction
1402
-  (0.0ms) rollback transaction
1403
-  (0.0ms) begin transaction
1404
-  (0.0ms) rollback transaction
1405
-  (0.0ms) begin transaction
1406
-  (0.0ms) rollback transaction
1407
-  (0.0ms) begin transaction
1408
-  (0.0ms) rollback transaction
1409
-  (0.3ms) begin transaction
1410
-  (0.1ms) SAVEPOINT active_record_1
1411
- SQL (5.3ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00]]
1412
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1413
- Processing by NotifyUser::NotificationsController#index as HTML
1414
- NotifyUser::BaseNotification Load (0.5ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' ORDER BY created_at DESC LIMIT 25 OFFSET 0
1415
- Completed 200 OK in 7ms (Views: 3.0ms | ActiveRecord: 1.0ms)
1416
-  (0.3ms) rollback transaction
1417
-  (0.1ms) begin transaction
1418
-  (0.0ms) SAVEPOINT active_record_1
1419
- SQL (0.3ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00]]
1420
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1421
-  (0.1ms) SAVEPOINT active_record_1
1422
- SQL (0.9ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00], ["params", "---\n:name: Mr. Blobby\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00]]
1423
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1424
- Processing by NotifyUser::NotificationsController#index as HTML
1425
- NotifyUser::BaseNotification Load (0.2ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' ORDER BY created_at DESC LIMIT 25 OFFSET 0
1426
- Completed 200 OK in 11ms (Views: 10.3ms | ActiveRecord: 0.2ms)
1427
-  (0.6ms) rollback transaction
1428
-  (0.0ms) begin transaction
1429
-  (0.0ms) SAVEPOINT active_record_1
1430
- SQL (0.3ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00]]
1431
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1432
-  (0.0ms) SAVEPOINT active_record_1
1433
- SQL (0.2ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00], ["params", "---\n:name: Mr. Blobby\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00]]
1434
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1435
- Processing by NotifyUser::NotificationsController#mark_read as HTML
1436
- Parameters: {"ids"=>["1"]}
1437
- SQL (0.1ms) UPDATE "notify_user_notifications" SET "state" = 'read' WHERE "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND (id IN ('1'))
1438
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND (id IN ('1'))
1439
- Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.2ms)
1440
- NewPostNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = ? LIMIT 1 [["id", 1]]
1441
-  (0.6ms) rollback transaction
1442
-  (0.1ms) begin transaction
1443
-  (0.0ms) SAVEPOINT active_record_1
1444
- SQL (0.3ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00]]
1445
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1446
-  (0.0ms) SAVEPOINT active_record_1
1447
- SQL (0.3ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00], ["params", "---\n:name: Mr. Blobby\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00]]
1448
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1449
- Processing by NotifyUser::NotificationsController#mark_read as HTML
1450
- Parameters: {"ids"=>["1"]}
1451
- SQL (0.1ms) UPDATE "notify_user_notifications" SET "state" = 'read' WHERE "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND (id IN ('1'))
1452
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND (id IN ('1'))
1453
- Completed 200 OK in 3ms (Views: 1.4ms | ActiveRecord: 0.3ms)
1454
-  (0.4ms) rollback transaction
1455
-  (0.1ms) begin transaction
1456
-  (0.1ms) rollback transaction
1457
-  (0.1ms) begin transaction
1458
-  (0.1ms) rollback transaction
1459
-  (0.1ms) begin transaction
1460
-  (0.1ms) rollback transaction
1461
-  (0.0ms) begin transaction
1462
-  (0.0ms) SAVEPOINT active_record_1
1463
- SQL (0.3ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00]]
1464
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1465
-  (0.1ms) SAVEPOINT active_record_1
1466
- SQL (0.3ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00]]
1467
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1468
-  (0.1ms) SAVEPOINT active_record_1
1469
-  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
1470
-  (0.4ms) rollback transaction
1471
-  (0.1ms) begin transaction
1472
-  (0.0ms) SAVEPOINT active_record_1
1473
- SQL (0.3ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00]]
1474
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1475
-  (0.0ms) SAVEPOINT active_record_1
1476
- SQL (0.3ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00]]
1477
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1478
-  (0.1ms) SAVEPOINT active_record_1
1479
- SQL (0.3ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00], ["params", "--- {}\n"]]
1480
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1481
-  (0.2ms) 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" = 1 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending' AND (id != 1)
1482
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = ? LIMIT 1 [["id", 1]]
1483
- User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
1484
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" = 'NewPostNotification' AND "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending'
1485
-  (0.0ms) SAVEPOINT active_record_1
1486
- User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
1487
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "state" = ?, "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["state", "sent"], ["updated_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00], ["params", "--- {}\n"]]
1488
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1489
-  (0.0ms) SAVEPOINT active_record_1
1490
- SQL (0.1ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00], ["params", "--- {}\n"]]
1491
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1492
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = 1 ORDER BY "notify_user_notifications"."id" ASC LIMIT 1
1493
-  (0.5ms) rollback transaction
1494
-  (0.1ms) begin transaction
1495
-  (0.0ms) SAVEPOINT active_record_1
1496
- SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00]]
1497
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1498
-  (0.1ms) SAVEPOINT active_record_1
1499
- SQL (0.5ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00]]
1500
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1501
-  (0.0ms) SAVEPOINT active_record_1
1502
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00], ["params", "--- {}\n"]]
1503
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1504
-  (0.1ms) 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" = 1 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending' AND (id != 1)
1505
-  (0.0ms) SAVEPOINT active_record_1
1506
- SQL (0.2ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00]]
1507
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1508
-  (0.3ms) 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" = 1 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending' AND (id != 2)
1509
-  (0.6ms) rollback transaction
1510
-  (0.1ms) begin transaction
1511
-  (0.0ms) SAVEPOINT active_record_1
1512
- SQL (0.4ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00]]
1513
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1514
-  (0.0ms) SAVEPOINT active_record_1
1515
- SQL (0.4ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00]]
1516
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1517
-  (0.1ms) SAVEPOINT active_record_1
1518
- SQL (0.2ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00]]
1519
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1520
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = ? LIMIT 1 [["id", 2]]
1521
- User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
1522
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" = 'NewPostNotification' AND "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending'
1523
-  (0.0ms) SAVEPOINT active_record_1
1524
- User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
1525
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "state" = ?, "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["state", "sent"], ["updated_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00], ["params", "--- {}\n"]]
1526
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1527
-  (0.0ms) SAVEPOINT active_record_1
1528
- User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
1529
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "state" = ?, "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 2 [["state", "sent"], ["updated_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00], ["params", "--- {}\n"]]
1530
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1531
-  (0.0ms) SAVEPOINT active_record_1
1532
- SQL (0.1ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00], ["params", "--- {}\n"]]
1533
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1534
-  (0.0ms) SAVEPOINT active_record_1
1535
- SQL (0.1ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 2 [["updated_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00], ["params", "--- {}\n"]]
1536
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1537
-
1538
- Sent mail to user@example.com (9.4ms)
1539
- Date: Mon, 06 Jan 2014 10:30:53 +1100
1540
- From: please-change-me-at-config-initializers-notify-user@example.com
1541
- To: user@example.com
1542
- Message-ID: <52c9eb2d5b986_7d8880c1bbe873f6@Tomass-MacBook-Air-11.local.mail>
1543
- Subject: Rails402: You have new Newpostnotification notifications.
1544
- Mime-Version: 1.0
1545
- Content-Type: text/html;
1546
- charset=UTF-8
1547
- Content-Transfer-Encoding: quoted-printable
1548
-
1549
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/h=
1550
- tml4/strict.dtd">
1551
- <html>
1552
- <head>
1553
- <meta content=3D"text/html; charset=3Dutf-8" http-equiv=3D"Content-Type=
1554
- "/>
1555
- <title></title>
1556
- </head>
1557
-
1558
- <body marginheight=3D"0" topmargin=3D"0" marginwidth=3D"0" leftmargin=3D"=
1559
- 0" style=3D"margin: 0px; -webkit-font-smoothing: antialiased; text-render=
1560
- ing: optimizeLegibility;">
1561
- <div style=3D"width: 100%; height: 70px; margin: 0; padding: 0;">
1562
- <div style=3D"width: 600px; margin: 0 auto; padding: 15px 0;">
1563
- Logo
1564
- </div>
1565
- </div>
1566
- <div style=3D"width: 100%; background-color: #fff; margin: 0; padding: 0;=
1567
- ">
1568
- <div style=3D"width: 500px; margin: 0 auto; padding: 40px 0; ">
1569
- <div>
1570
- New Post Notification happened. =
1571
-
1572
- </div>
1573
- <div>
1574
- New Post Notification happened. =
1575
-
1576
- </div>
1577
-
1578
- </div>
1579
- </div>
1580
- <div style=3D"width: 100%; min-height: 80px; margin: 0; padding: 0;">
1581
- <div style=3D"width: 600px; margin: 0 auto; padding: 0;">
1582
- <p style=3D"text-align: center;">
1583
- This is the default generated layout. A privacy declaration could g=
1584
- o here.
1585
- </p>
1586
- <p style=3D"text-align: center; margin-bottom: 0px;">
1587
- =C2=A9 MyCompany Pty Ltd
1588
- </p>
1589
- <p style=3D"text-align: center; margin-top: 0px; padding-top: 0px;">
1590
- ABN 123 456 789
1591
- </p>
1592
- </div>
1593
- </div>
1594
- </body>
1595
- </html>=
1596
-
1597
-  (0.4ms) rollback transaction
1598
-  (0.1ms) begin transaction
1599
-  (0.0ms) SAVEPOINT active_record_1
1600
- SQL (0.3ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00]]
1601
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1602
-  (0.0ms) SAVEPOINT active_record_1
1603
- SQL (0.2ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00]]
1604
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1605
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = ? LIMIT 1 [["id", 1]]
1606
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
1607
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" = 'NewPostNotification' AND "notify_user_notifications"."target_id" = 1 AND "notify_user_notifications"."target_type" = 'User' AND "notify_user_notifications"."state" = 'pending'
1608
-  (0.0ms) SAVEPOINT active_record_1
1609
- User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
1610
- SQL (0.1ms) UPDATE "notify_user_notifications" SET "state" = ?, "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["state", "sent"], ["updated_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00], ["params", "--- {}\n"]]
1611
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1612
-  (0.0ms) SAVEPOINT active_record_1
1613
- SQL (0.1ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00], ["params", "--- {}\n"]]
1614
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1615
- NotifyUser::BaseNotification Load (0.1ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."id" = 1 ORDER BY "notify_user_notifications"."id" ASC LIMIT 1
1616
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
1617
-
1618
- Sent mail to user@example.com (6.5ms)
1619
- Date: Mon, 06 Jan 2014 10:30:53 +1100
1620
- From: please-change-me-at-config-initializers-notify-user@example.com
1621
- To: user@example.com
1622
- Message-ID: <52c9eb2d62c1f_7d8880c1bbe874a9@Tomass-MacBook-Air-11.local.mail>
1623
- Subject: Rails402: You have a new Newpostnotification notification.
1624
- Mime-Version: 1.0
1625
- Content-Type: text/html;
1626
- charset=UTF-8
1627
- Content-Transfer-Encoding: quoted-printable
1628
-
1629
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/h=
1630
- tml4/strict.dtd">
1631
- <html>
1632
- <head>
1633
- <meta content=3D"text/html; charset=3Dutf-8" http-equiv=3D"Content-Type=
1634
- "/>
1635
- <title></title>
1636
- </head>
1637
-
1638
- <body marginheight=3D"0" topmargin=3D"0" marginwidth=3D"0" leftmargin=3D"=
1639
- 0" style=3D"margin: 0px; -webkit-font-smoothing: antialiased; text-render=
1640
- ing: optimizeLegibility;">
1641
- <div style=3D"width: 100%; height: 70px; margin: 0; padding: 0;">
1642
- <div style=3D"width: 600px; margin: 0 auto; padding: 15px 0;">
1643
- Logo
1644
- </div>
1645
- </div>
1646
- <div style=3D"width: 100%; background-color: #fff; margin: 0; padding: 0;=
1647
- ">
1648
- <div style=3D"width: 500px; margin: 0 auto; padding: 40px 0; ">
1649
- New Post Notification happened.
1650
- </div>
1651
- </div>
1652
- <div style=3D"width: 100%; min-height: 80px; margin: 0; padding: 0;">
1653
- <div style=3D"width: 600px; margin: 0 auto; padding: 0;">
1654
- <p style=3D"text-align: center;">
1655
- This is the default generated layout. A privacy declaration could g=
1656
- o here.
1657
- </p>
1658
- <p style=3D"text-align: center; margin-bottom: 0px;">
1659
- =C2=A9 MyCompany Pty Ltd
1660
- </p>
1661
- <p style=3D"text-align: center; margin-top: 0px; padding-top: 0px;">
1662
- ABN 123 456 789
1663
- </p>
1664
- </div>
1665
- </div>
1666
- </body>
1667
- </html>=
1668
-
1669
-  (0.5ms) rollback transaction
1670
-  (0.1ms) begin transaction
1671
-  (0.1ms) SAVEPOINT active_record_1
1672
- SQL (0.3ms) INSERT INTO "users" ("created_at", "email", "updated_at") VALUES (?, ?, ?) [["created_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00], ["email", "user@example.com"], ["updated_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00]]
1673
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1674
-  (0.1ms) SAVEPOINT active_record_1
1675
- SQL (0.3ms) INSERT INTO "notify_user_notifications" ("created_at", "params", "state", "target_id", "target_type", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00], ["params", "--- {}\n"], ["state", "pending"], ["target_id", 1], ["target_type", "User"], ["type", "NewPostNotification"], ["updated_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00]]
1676
-  (0.1ms) RELEASE SAVEPOINT active_record_1
1677
-  (0.1ms) SAVEPOINT active_record_1
1678
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00], ["params", "--- {}\n"]]
1679
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1680
-  (0.0ms) SAVEPOINT active_record_1
1681
- SQL (0.1ms) UPDATE "notify_user_notifications" SET "state" = ?, "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["state", "sent"], ["updated_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00], ["params", "--- {}\n"]]
1682
-  (0.0ms) RELEASE SAVEPOINT active_record_1
1683
-  (0.1ms) SAVEPOINT active_record_1
1684
- SQL (0.2ms) UPDATE "notify_user_notifications" SET "updated_at" = ?, "params" = ? WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 [["updated_at", Sun, 05 Jan 2014 23:30:53 UTC +00:00], ["params", "--- {}\n"]]
1685
1059
   (0.1ms) RELEASE SAVEPOINT active_record_1
1686
- NewPostNotification Load (0.2ms) SELECT "notify_user_notifications".* FROM "notify_user_notifications" WHERE "notify_user_notifications"."type" IN ('NewPostNotification') AND "notify_user_notifications"."id" = 1 ORDER BY "notify_user_notifications"."id" ASC LIMIT 1
1687
-  (0.5ms) rollback transaction
1688
-  (0.1ms) begin transaction
1689
-  (0.1ms) rollback transaction
1690
-  (0.1ms) begin transaction
1691
-  (0.1ms) rollback transaction
1692
-  (0.0ms) begin transaction
1693
-  (0.0ms) rollback transaction
1694
-  (0.0ms) begin transaction
1695
-  (0.0ms) rollback transaction
1696
-  (0.0ms) begin transaction
1697
-  (0.0ms) rollback transaction
1698
-  (0.0ms) begin transaction
1699
-  (0.1ms) rollback transaction
1700
-  (0.0ms) begin transaction
1701
-  (0.1ms) rollback transaction
1060
+  (0.1ms) ROLLBACK
1061
+  (0.2ms) BEGIN
1062
+  (0.2ms) ROLLBACK
1063
+  (0.2ms) BEGIN
1064
+  (0.1ms) ROLLBACK
1065
+  (0.1ms) BEGIN
1066
+  (0.1ms) ROLLBACK
1067
+  (0.1ms) BEGIN
1068
+  (0.2ms) ROLLBACK
1069
+  (0.1ms) BEGIN
1070
+  (0.1ms) ROLLBACK
1071
+  (0.1ms) BEGIN
1072
+  (0.1ms) ROLLBACK
1073
+  (0.1ms) BEGIN
1074
+  (0.1ms) ROLLBACK