timeful 0.0.1

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 (84) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +112 -0
  4. data/Rakefile +31 -0
  5. data/app/jobs/timeful/deliver_activity_to_subscribers_job.rb +15 -0
  6. data/app/models/timeful/activity.rb +34 -0
  7. data/app/models/timeful/application_record.rb +6 -0
  8. data/app/models/timeful/feed_item.rb +13 -0
  9. data/config/routes.rb +2 -0
  10. data/db/migrate/20160927141608_create_timeful_activities.rb +16 -0
  11. data/db/migrate/20160927154912_create_timeful_feed_items.rb +15 -0
  12. data/lib/generators/timeful/install_generator.rb +10 -0
  13. data/lib/timeful.rb +28 -0
  14. data/lib/timeful/engine.rb +6 -0
  15. data/lib/timeful/model/actor.rb +35 -0
  16. data/lib/timeful/model/subscriber.rb +21 -0
  17. data/lib/timeful/relation_proxy.rb +26 -0
  18. data/lib/timeful/version.rb +4 -0
  19. data/spec/dummy/README.rdoc +28 -0
  20. data/spec/dummy/Rakefile +6 -0
  21. data/spec/dummy/app/activities/post_activity.rb +5 -0
  22. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  23. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  24. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  25. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  26. data/spec/dummy/app/models/application_record.rb +3 -0
  27. data/spec/dummy/app/models/post.rb +2 -0
  28. data/spec/dummy/app/models/user.rb +4 -0
  29. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  30. data/spec/dummy/bin/bundle +3 -0
  31. data/spec/dummy/bin/rails +4 -0
  32. data/spec/dummy/bin/rake +4 -0
  33. data/spec/dummy/bin/setup +29 -0
  34. data/spec/dummy/config.ru +4 -0
  35. data/spec/dummy/config/application.rb +22 -0
  36. data/spec/dummy/config/boot.rb +5 -0
  37. data/spec/dummy/config/database.example.yml +19 -0
  38. data/spec/dummy/config/database.yml +19 -0
  39. data/spec/dummy/config/environment.rb +5 -0
  40. data/spec/dummy/config/environments/development.rb +41 -0
  41. data/spec/dummy/config/environments/production.rb +79 -0
  42. data/spec/dummy/config/environments/test.rb +42 -0
  43. data/spec/dummy/config/initializers/assets.rb +11 -0
  44. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  45. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  46. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  47. data/spec/dummy/config/initializers/inflections.rb +16 -0
  48. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  49. data/spec/dummy/config/initializers/session_store.rb +3 -0
  50. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  51. data/spec/dummy/config/locales/en.yml +23 -0
  52. data/spec/dummy/config/routes.rb +3 -0
  53. data/spec/dummy/config/secrets.yml +22 -0
  54. data/spec/dummy/db/migrate/20160927141815_create_timeful_activities.timeful.rb +17 -0
  55. data/spec/dummy/db/migrate/20160927155215_create_timeful_feed_items.timeful.rb +16 -0
  56. data/spec/dummy/db/migrate/20160927160026_create_users.rb +8 -0
  57. data/spec/dummy/db/migrate/20160927160031_create_posts.rb +8 -0
  58. data/spec/dummy/db/schema.rb +50 -0
  59. data/spec/dummy/log/development.log +361 -0
  60. data/spec/dummy/log/test.log +3554 -0
  61. data/spec/dummy/public/404.html +67 -0
  62. data/spec/dummy/public/422.html +67 -0
  63. data/spec/dummy/public/500.html +66 -0
  64. data/spec/dummy/public/favicon.ico +0 -0
  65. data/spec/examples.txt +12 -0
  66. data/spec/factories/posts.rb +5 -0
  67. data/spec/factories/timeful/activities.rb +8 -0
  68. data/spec/factories/timeful/feed_items.rb +7 -0
  69. data/spec/factories/users.rb +5 -0
  70. data/spec/jobs/timeful/deliver_activity_to_subscribers_job_spec.rb +17 -0
  71. data/spec/models/timeful/activity_spec.rb +8 -0
  72. data/spec/models/timeful/feed_item_spec.rb +8 -0
  73. data/spec/rails_helper.rb +21 -0
  74. data/spec/spec_helper.rb +73 -0
  75. data/spec/support/active_job.rb +3 -0
  76. data/spec/support/database_cleaner.rb +19 -0
  77. data/spec/support/factory_girl.rb +5 -0
  78. data/spec/support/faker.rb +1 -0
  79. data/spec/support/shoulda.rb +8 -0
  80. data/spec/timeful/model/actor_spec.rb +20 -0
  81. data/spec/timeful/model/subscriber_spec.rb +17 -0
  82. data/spec/timeful/relation_proxy_spec.rb +34 -0
  83. data/spec/timeful/timeful_spec.rb +12 -0
  84. metadata +337 -0
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Rails.application.config.session_store :cookie_store, key: '_dummy_session'
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
9
+ end
10
+
11
+ # To enable root element in JSON for ActiveRecord objects.
12
+ # ActiveSupport.on_load(:active_record) do
13
+ # self.include_root_in_json = true
14
+ # end
@@ -0,0 +1,23 @@
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # To learn more, please read the Rails Internationalization guide
20
+ # available at http://guides.rubyonrails.org/i18n.html.
21
+
22
+ en:
23
+ hello: "Hello world"
@@ -0,0 +1,3 @@
1
+ Rails.application.routes.draw do
2
+ mount Timeful::Engine => "/timeful"
3
+ end
@@ -0,0 +1,22 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ # You can use `rake secret` to generate a secure secret key.
9
+
10
+ # Make sure the secrets in this file are kept private
11
+ # if you're sharing your code publicly.
12
+
13
+ development:
14
+ secret_key_base: 07d03430e50ca1fda90b6d01a9209579593d38ffc1e7d0398d46391439fc6ecfa41f3300a2271d09e8ae902e66f8ae3b0087513d3e8191f704040b0012a28c54
15
+
16
+ test:
17
+ secret_key_base: 62d389f62253060992c3b2a10126fa1fe0fe198663f30f51ca1f894928bb27accf504a3caff3b2741bbcb3ef6778c6e56743c318df2c3ec8750bd5398cab370b
18
+
19
+ # Do not keep production secrets in the repository,
20
+ # instead read values from the environment.
21
+ production:
22
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
@@ -0,0 +1,17 @@
1
+ # This migration comes from timeful (originally 20160927141608)
2
+ class CreateTimefulActivities < ActiveRecord::Migration[5.0]
3
+ def change
4
+ create_table :timeful_activities do |t|
5
+ t.string :type, null: false
6
+ t.string :object_type, null: false
7
+ t.integer :object_id, null: false
8
+ t.string :actor_type, null: false
9
+ t.integer :actor_id, null: false
10
+
11
+ t.timestamps null: false
12
+
13
+ t.index [:object_type, :object_id]
14
+ t.index [:actor_type, :actor_id]
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,16 @@
1
+ # This migration comes from timeful (originally 20160927154912)
2
+ class CreateTimefulFeedItems < ActiveRecord::Migration[5.0]
3
+ def change
4
+ create_table :timeful_feed_items do |t|
5
+ t.string :feedable_type, null: false
6
+ t.integer :feedable_id, null: false
7
+ t.integer :activity_id, null: false
8
+
9
+ t.timestamps null: false
10
+
11
+ t.foreign_key :timeful_activities, column: :activity_id, on_delete: :cascade
12
+
13
+ t.index [:feedable_type, :feedable_id]
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,8 @@
1
+ class CreateUsers < ActiveRecord::Migration[5.0]
2
+ def change
3
+ create_table :users do |t|
4
+
5
+ t.timestamps
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ class CreatePosts < ActiveRecord::Migration[5.0]
2
+ def change
3
+ create_table :posts do |t|
4
+
5
+ t.timestamps
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,50 @@
1
+ # This file is auto-generated from the current state of the database. Instead
2
+ # of editing this file, please use the migrations feature of Active Record to
3
+ # incrementally modify your database, and then regenerate this schema definition.
4
+ #
5
+ # Note that this schema.rb definition is the authoritative source for your
6
+ # database schema. If you need to create the application database on another
7
+ # system, you should be using db:schema:load, not running all the migrations
8
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
9
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
10
+ #
11
+ # It's strongly recommended that you check this file into your version control system.
12
+
13
+ ActiveRecord::Schema.define(version: 20160927160031) do
14
+
15
+ # These are extensions that must be enabled in order to support this database
16
+ enable_extension "plpgsql"
17
+
18
+ create_table "posts", force: :cascade do |t|
19
+ t.datetime "created_at", null: false
20
+ t.datetime "updated_at", null: false
21
+ end
22
+
23
+ create_table "timeful_activities", force: :cascade do |t|
24
+ t.string "type", null: false
25
+ t.string "object_type", null: false
26
+ t.integer "object_id", null: false
27
+ t.string "actor_type", null: false
28
+ t.integer "actor_id", null: false
29
+ t.datetime "created_at", null: false
30
+ t.datetime "updated_at", null: false
31
+ t.index ["actor_type", "actor_id"], name: "index_timeful_activities_on_actor_type_and_actor_id", using: :btree
32
+ t.index ["object_type", "object_id"], name: "index_timeful_activities_on_object_type_and_object_id", using: :btree
33
+ end
34
+
35
+ create_table "timeful_feed_items", force: :cascade do |t|
36
+ t.string "feedable_type", null: false
37
+ t.integer "feedable_id", null: false
38
+ t.integer "activity_id", null: false
39
+ t.datetime "created_at", null: false
40
+ t.datetime "updated_at", null: false
41
+ t.index ["feedable_type", "feedable_id"], name: "index_timeful_feed_items_on_feedable_type_and_feedable_id", using: :btree
42
+ end
43
+
44
+ create_table "users", force: :cascade do |t|
45
+ t.datetime "created_at", null: false
46
+ t.datetime "updated_at", null: false
47
+ end
48
+
49
+ add_foreign_key "timeful_feed_items", "timeful_activities", column: "activity_id", on_delete: :cascade
50
+ end
@@ -0,0 +1,361 @@
1
+ SQL (0.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
2
+ SQL (31.9ms) CREATE EXTENSION IF NOT EXISTS "hstore"
3
+  (21.0ms) CREATE TABLE "hertz_notifications" ("id" serial primary key, "type" character varying NOT NULL, "receiver_type" character varying NOT NULL, "receiver_id" integer NOT NULL, "meta" hstore DEFAULT '' NOT NULL, "read_at" timestamp, "created_at" timestamp NOT NULL) 
4
+  (6.6ms) CREATE TABLE "users" ("id" serial primary key, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "email" character varying NOT NULL)
5
+  (7.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
6
+  (8.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
7
+  (0.7ms) SELECT version FROM "schema_migrations"
8
+  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20160418122437')
9
+  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20160415175837')
10
+  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20160415175358')
11
+ SQL (0.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
12
+ SQL (24.4ms) CREATE EXTENSION IF NOT EXISTS "hstore"
13
+  (16.8ms) CREATE TABLE "hertz_notifications" ("id" serial primary key, "type" character varying NOT NULL, "receiver_type" character varying NOT NULL, "receiver_id" integer NOT NULL, "meta" hstore DEFAULT '' NOT NULL, "read_at" timestamp, "created_at" timestamp NOT NULL) 
14
+  (10.0ms) CREATE TABLE "users" ("id" serial primary key, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "email" character varying NOT NULL)
15
+  (9.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
16
+  (13.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
17
+  (1.0ms) SELECT version FROM "schema_migrations"
18
+  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES ('20160418122437')
19
+  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES ('20160415175837')
20
+  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES ('20160415175358')
21
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
22
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
23
+ Migrating to RemoveEmailFromUsers (20160508094342)
24
+  (0.4ms) BEGIN
25
+  (0.8ms) ALTER TABLE "users" DROP "email"
26
+ SQL (0.5ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20160508094342"]]
27
+  (2.8ms) COMMIT
28
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
29
+  (2.8ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
30
+ FROM pg_constraint c
31
+ JOIN pg_class t1 ON c.conrelid = t1.oid
32
+ JOIN pg_class t2 ON c.confrelid = t2.oid
33
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
34
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
35
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
36
+ WHERE c.contype = 'f'
37
+ AND t1.relname = 'hertz_notifications'
38
+ AND t3.nspname = ANY (current_schemas(false))
39
+ ORDER BY c.conname
40
+ 
41
+  (2.5ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
42
+ FROM pg_constraint c
43
+ JOIN pg_class t1 ON c.conrelid = t1.oid
44
+ JOIN pg_class t2 ON c.confrelid = t2.oid
45
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
46
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
47
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
48
+ WHERE c.contype = 'f'
49
+ AND t1.relname = 'users'
50
+ AND t3.nspname = ANY (current_schemas(false))
51
+ ORDER BY c.conname
52
+
53
+ ActiveRecord::SchemaMigration Load (2.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
54
+ Migrating to CreateHertzNotificationDeliveries (20160627084119)
55
+  (0.3ms) BEGIN
56
+  (52.1ms) CREATE TABLE "hertz_notification_deliveries" ("id" serial primary key, "notification_id" integer NOT NULL, "courier" character varying NOT NULL, "created_at" timestamp NOT NULL) 
57
+  (11.6ms) CREATE INDEX "index_hertz_notification_deliveries_on_notification_id" ON "hertz_notification_deliveries" ("notification_id")
58
+  (1.1ms) ROLLBACK
59
+ ActiveRecord::SchemaMigration Load (0.7ms) SELECT "schema_migrations".* FROM "schema_migrations"
60
+ Migrating to CreateHertzNotificationDeliveries (20160627084119)
61
+  (0.3ms) BEGIN
62
+  (7.8ms) CREATE TABLE "hertz_notification_deliveries" ("id" serial primary key, "notification_id" integer NOT NULL, "courier" character varying NOT NULL, "created_at" timestamp NOT NULL) 
63
+  (2.1ms) CREATE INDEX "index_hertz_notification_deliveries_on_notification_id" ON "hertz_notification_deliveries" ("notification_id")
64
+  (0.9ms) ROLLBACK
65
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
66
+ Migrating to CreateHertzNotificationDeliveries (20160627084119)
67
+  (0.4ms) BEGIN
68
+  (7.3ms) CREATE TABLE "hertz_notification_deliveries" ("id" serial primary key, "notification_id" integer NOT NULL, "courier" character varying NOT NULL, "created_at" timestamp NOT NULL) 
69
+  (3.6ms) CREATE INDEX "index_hertz_notification_deliveries_on_notification_id" ON "hertz_notification_deliveries" ("notification_id")
70
+  (5.1ms) CREATE UNIQUE INDEX "index_hertz_notification_deliveries_on_notification_and_courier" ON "hertz_notification_deliveries" ("notification_id", "courier")
71
+  (1.8ms) ALTER TABLE "hertz_notification_deliveries" ADD CONSTRAINT "fk_rails_68c880ead4"
72
+ FOREIGN KEY ("notification_id")
73
+ REFERENCES "notifications" ("id")
74
+ ON DELETE CASCADE
75
+  (0.4ms) ROLLBACK
76
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
77
+ Migrating to CreateHertzNotificationDeliveries (20160627084119)
78
+  (0.3ms) BEGIN
79
+  (6.5ms) CREATE TABLE "hertz_notification_deliveries" ("id" serial primary key, "hertz_notification_id" integer NOT NULL, "courier" character varying NOT NULL, "created_at" timestamp NOT NULL) 
80
+  (3.8ms) CREATE INDEX "index_hertz_notification_deliveries_on_hertz_notification_id" ON "hertz_notification_deliveries" ("hertz_notification_id")
81
+  (2.0ms) CREATE UNIQUE INDEX "index_hertz_notification_deliveries_on_notification_and_courier" ON "hertz_notification_deliveries" ("notification_id", "courier")
82
+  (0.2ms) ROLLBACK
83
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
84
+ Migrating to CreateHertzNotificationDeliveries (20160627084119)
85
+  (0.3ms) BEGIN
86
+  (7.2ms) CREATE TABLE "hertz_notification_deliveries" ("id" serial primary key, "notification_id" integer NOT NULL, "courier" character varying NOT NULL, "created_at" timestamp NOT NULL) 
87
+  (4.2ms) CREATE INDEX "index_hertz_notification_deliveries_on_notification_id" ON "hertz_notification_deliveries" ("notification_id")
88
+  (5.3ms) CREATE UNIQUE INDEX "index_hertz_notification_deliveries_on_notification_and_courier" ON "hertz_notification_deliveries" ("notification_id", "courier")
89
+  (1.3ms) ALTER TABLE "hertz_notification_deliveries" ADD CONSTRAINT "fk_rails_a16c02eed0"
90
+ FOREIGN KEY ("hertz_notification_id")
91
+ REFERENCES "hertz_notifications" ("id")
92
+ ON DELETE CASCADE
93
+  (0.1ms) ROLLBACK
94
+ ActiveRecord::SchemaMigration Load (0.7ms) SELECT "schema_migrations".* FROM "schema_migrations"
95
+ Migrating to CreateHertzNotificationDeliveries (20160627084119)
96
+  (0.3ms) BEGIN
97
+  (7.5ms) CREATE TABLE "hertz_notification_deliveries" ("id" serial primary key, "notification_id" integer NOT NULL, "courier" character varying NOT NULL, "created_at" timestamp NOT NULL) 
98
+  (4.7ms) CREATE INDEX "index_hertz_notification_deliveries_on_notification_id" ON "hertz_notification_deliveries" ("notification_id")
99
+  (2.8ms) CREATE UNIQUE INDEX "index_hertz_notification_deliveries_on_notification_and_courier" ON "hertz_notification_deliveries" ("notification_id", "courier")
100
+  (23.4ms) ALTER TABLE "hertz_notification_deliveries" ADD CONSTRAINT "fk_rails_68c880ead4"
101
+ FOREIGN KEY ("notification_id")
102
+ REFERENCES "hertz_notifications" ("id")
103
+ ON DELETE CASCADE
104
+ SQL (2.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20160627084119"]]
105
+  (5.6ms) COMMIT
106
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
107
+  (4.6ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
108
+ FROM pg_constraint c
109
+ JOIN pg_class t1 ON c.conrelid = t1.oid
110
+ JOIN pg_class t2 ON c.confrelid = t2.oid
111
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
112
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
113
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
114
+ WHERE c.contype = 'f'
115
+ AND t1.relname = 'hertz_notification_deliveries'
116
+ AND t3.nspname = ANY (current_schemas(false))
117
+ ORDER BY c.conname
118
+
119
+  (3.5ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
120
+ FROM pg_constraint c
121
+ JOIN pg_class t1 ON c.conrelid = t1.oid
122
+ JOIN pg_class t2 ON c.confrelid = t2.oid
123
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
124
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
125
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
126
+ WHERE c.contype = 'f'
127
+ AND t1.relname = 'hertz_notifications'
128
+ AND t3.nspname = ANY (current_schemas(false))
129
+ ORDER BY c.conname
130
+ 
131
+  (4.7ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
132
+ FROM pg_constraint c
133
+ JOIN pg_class t1 ON c.conrelid = t1.oid
134
+ JOIN pg_class t2 ON c.confrelid = t2.oid
135
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
136
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
137
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
138
+ WHERE c.contype = 'f'
139
+ AND t1.relname = 'users'
140
+ AND t3.nspname = ANY (current_schemas(false))
141
+ ORDER BY c.conname
142
+
143
+ ActiveRecord::SchemaMigration Load (1.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
144
+ Migrating to RenameNotificationDeliveriesToDeliveries (20160628084413)
145
+  (0.2ms) BEGIN
146
+  (2.8ms) ALTER TABLE "hertz_notification_deliveries" RENAME TO "hertz_deliveries"
147
+  (0.4ms) ALTER TABLE "public"."hertz_notification_deliveries_id_seq" RENAME TO "hertz_deliveries_id_seq"
148
+  (4.9ms) ALTER INDEX "hertz_notification_deliveries_pkey" RENAME TO "hertz_deliveries_pkey"
149
+  (0.3ms) ALTER INDEX "index_hertz_notification_deliveries_on_notification_id" RENAME TO "index_hertz_deliveries_on_notification_id"
150
+ SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20160628084413"]]
151
+  (8.3ms) COMMIT
152
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
153
+  (8.0ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
154
+ FROM pg_constraint c
155
+ JOIN pg_class t1 ON c.conrelid = t1.oid
156
+ JOIN pg_class t2 ON c.confrelid = t2.oid
157
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
158
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
159
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
160
+ WHERE c.contype = 'f'
161
+ AND t1.relname = 'hertz_deliveries'
162
+ AND t3.nspname = ANY (current_schemas(false))
163
+ ORDER BY c.conname
164
+
165
+  (2.2ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
166
+ FROM pg_constraint c
167
+ JOIN pg_class t1 ON c.conrelid = t1.oid
168
+ JOIN pg_class t2 ON c.confrelid = t2.oid
169
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
170
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
171
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
172
+ WHERE c.contype = 'f'
173
+ AND t1.relname = 'hertz_notifications'
174
+ AND t3.nspname = ANY (current_schemas(false))
175
+ ORDER BY c.conname
176
+ 
177
+  (2.3ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
178
+ FROM pg_constraint c
179
+ JOIN pg_class t1 ON c.conrelid = t1.oid
180
+ JOIN pg_class t2 ON c.confrelid = t2.oid
181
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
182
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
183
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
184
+ WHERE c.contype = 'f'
185
+ AND t1.relname = 'users'
186
+ AND t3.nspname = ANY (current_schemas(false))
187
+ ORDER BY c.conname
188
+
189
+  (9.7ms) CREATE TABLE "schema_migrations" ("version" character varying PRIMARY KEY)
190
+  (8.0ms) CREATE TABLE "ar_internal_metadata" ("key" character varying PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
191
+  (0.5ms) SELECT pg_try_advisory_lock(339456620476877820);
192
+ ActiveRecord::SchemaMigration Load (1.0ms) SELECT "schema_migrations".* FROM "schema_migrations"
193
+ ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", :environment], ["LIMIT", 1]]
194
+  (0.5ms) BEGIN
195
+ SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", 2016-09-27 12:47:17 UTC], ["updated_at", 2016-09-27 12:47:17 UTC]]
196
+  (1.5ms) COMMIT
197
+  (0.5ms) SELECT pg_advisory_unlock(339456620476877820)
198
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
199
+  (0.4ms) SELECT pg_try_advisory_lock(339456620476877820);
200
+ ActiveRecord::SchemaMigration Load (1.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
201
+ Migrating to CreateTimefulActivities (20160927141815)
202
+  (0.6ms) BEGIN
203
+  (27.6ms) CREATE TABLE "timeful_activities" ("id" serial primary key, "type" character varying NOT NULL, "object_type" character varying NOT NULL, "object_id" integer NOT NULL, "actor_type" character varying NOT NULL, "actor_id" integer NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
204
+ SQL (1.7ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20160927141815"]]
205
+  (3.0ms) COMMIT
206
+ ActiveRecord::InternalMetadata Load (0.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", :environment], ["LIMIT", 1]]
207
+  (0.3ms) BEGIN
208
+  (0.5ms) COMMIT
209
+  (0.7ms) SELECT pg_advisory_unlock(339456620476877820)
210
+ ActiveRecord::SchemaMigration Load (2.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
211
+  (2.6ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
212
+ FROM pg_constraint c
213
+ JOIN pg_class t1 ON c.conrelid = t1.oid
214
+ JOIN pg_class t2 ON c.confrelid = t2.oid
215
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
216
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
217
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
218
+ WHERE c.contype = 'f'
219
+ AND t1.relname = 'timeful_activities'
220
+ AND t3.nspname = ANY (current_schemas(false))
221
+ ORDER BY c.conname
222
+ 
223
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
224
+  (0.4ms) SELECT pg_try_advisory_lock(339456620476877820);
225
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
226
+ Migrating to CreateTimefulActivities (20160927141815)
227
+  (0.4ms) BEGIN
228
+  (1.3ms) DROP TABLE "timeful_activities"
229
+ SQL (0.7ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20160927141815"]]
230
+  (3.3ms) COMMIT
231
+  (2.0ms) SELECT pg_advisory_unlock(339456620476877820)
232
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
233
+  (0.5ms) SELECT pg_try_advisory_lock(339456620476877820);
234
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
235
+ Migrating to CreateTimefulActivities (20160927141815)
236
+  (0.5ms) BEGIN
237
+  (8.0ms) CREATE TABLE "timeful_activities" ("id" serial primary key, "type" character varying NOT NULL, "object_type" character varying NOT NULL, "object_id" integer NOT NULL, "actor_type" character varying NOT NULL, "actor_id" integer NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
238
+  (3.1ms) CREATE INDEX "index_timeful_activities_on_object_type_and_object_id" ON "timeful_activities" ("object_type", "object_id")
239
+  (6.5ms) CREATE INDEX "index_timeful_activities_on_actor_type_and_actor_id" ON "timeful_activities" ("actor_type", "actor_id")
240
+ SQL (3.0ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20160927141815"]]
241
+  (1.9ms) COMMIT
242
+ Migrating to CreateTimefulFeedItems (20160927155215)
243
+  (0.4ms) BEGIN
244
+  (6.7ms) CREATE TABLE "timeful_feed_items" ("id" serial primary key, "feedable_type" character varying NOT NULL, "feedable_id" integer NOT NULL, "activity_id" integer NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, CONSTRAINT "fk_rails_9d539205d7"
245
+ FOREIGN KEY ("timeful_activity_id")
246
+ REFERENCES "timeful_activities" ("id")
247
+ ON DELETE CASCADE)
248
+  (0.2ms) ROLLBACK
249
+  (0.3ms) SELECT pg_advisory_unlock(339456620476877820)
250
+  (0.5ms) SELECT pg_try_advisory_lock(339456620476877820);
251
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
252
+ Migrating to CreateTimefulFeedItems (20160927155215)
253
+  (0.4ms) BEGIN
254
+  (217.9ms) CREATE TABLE "timeful_feed_items" ("id" serial primary key, "feedable_type" character varying NOT NULL, "feedable_id" integer NOT NULL, "activity_id" integer NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, CONSTRAINT "fk_rails_9bc442415c"
255
+ FOREIGN KEY ("activity_id")
256
+ REFERENCES "timeful_activities" ("id")
257
+ ON DELETE CASCADE)
258
+  (7.5ms) CREATE INDEX "index_timeful_feed_items_on_feedable_type_and_feedable_id" ON "timeful_feed_items" ("feedable_type", "feedable_id")
259
+ SQL (0.6ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20160927155215"]]
260
+  (1.6ms) COMMIT
261
+ ActiveRecord::InternalMetadata Load (0.4ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", :environment], ["LIMIT", 1]]
262
+  (0.2ms) BEGIN
263
+  (0.5ms) COMMIT
264
+  (0.4ms) SELECT pg_advisory_unlock(339456620476877820)
265
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
266
+  (2.3ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
267
+ FROM pg_constraint c
268
+ JOIN pg_class t1 ON c.conrelid = t1.oid
269
+ JOIN pg_class t2 ON c.confrelid = t2.oid
270
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
271
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
272
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
273
+ WHERE c.contype = 'f'
274
+ AND t1.relname = 'timeful_activities'
275
+ AND t3.nspname = ANY (current_schemas(false))
276
+ ORDER BY c.conname
277
+ 
278
+  (3.1ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
279
+ FROM pg_constraint c
280
+ JOIN pg_class t1 ON c.conrelid = t1.oid
281
+ JOIN pg_class t2 ON c.confrelid = t2.oid
282
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
283
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
284
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
285
+ WHERE c.contype = 'f'
286
+ AND t1.relname = 'timeful_feed_items'
287
+ AND t3.nspname = ANY (current_schemas(false))
288
+ ORDER BY c.conname
289
+ 
290
+  (0.2ms) SELECT pg_try_advisory_lock(339456620476877820);
291
+ ActiveRecord::SchemaMigration Load (0.8ms) SELECT "schema_migrations".* FROM "schema_migrations"
292
+ Migrating to CreateUsers (20160927160026)
293
+  (0.2ms) BEGIN
294
+  (205.7ms) CREATE TABLE "users" ("id" serial primary key, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
295
+ SQL (7.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20160927160026"]]
296
+  (5.8ms) COMMIT
297
+ Migrating to CreatePosts (20160927160031)
298
+  (1.3ms) BEGIN
299
+  (4.2ms) CREATE TABLE "posts" ("id" serial primary key, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
300
+ SQL (0.6ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20160927160031"]]
301
+  (2.3ms) COMMIT
302
+ ActiveRecord::InternalMetadata Load (2.0ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", :environment], ["LIMIT", 1]]
303
+  (2.8ms) BEGIN
304
+  (2.0ms) COMMIT
305
+  (0.6ms) SELECT pg_advisory_unlock(339456620476877820)
306
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
307
+  (2.6ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
308
+ FROM pg_constraint c
309
+ JOIN pg_class t1 ON c.conrelid = t1.oid
310
+ JOIN pg_class t2 ON c.confrelid = t2.oid
311
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
312
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
313
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
314
+ WHERE c.contype = 'f'
315
+ AND t1.relname = 'posts'
316
+ AND t3.nspname = ANY (current_schemas(false))
317
+ ORDER BY c.conname
318
+ 
319
+  (2.3ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
320
+ FROM pg_constraint c
321
+ JOIN pg_class t1 ON c.conrelid = t1.oid
322
+ JOIN pg_class t2 ON c.confrelid = t2.oid
323
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
324
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
325
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
326
+ WHERE c.contype = 'f'
327
+ AND t1.relname = 'timeful_activities'
328
+ AND t3.nspname = ANY (current_schemas(false))
329
+ ORDER BY c.conname
330
+ 
331
+  (2.5ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
332
+ FROM pg_constraint c
333
+ JOIN pg_class t1 ON c.conrelid = t1.oid
334
+ JOIN pg_class t2 ON c.confrelid = t2.oid
335
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
336
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
337
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
338
+ WHERE c.contype = 'f'
339
+ AND t1.relname = 'timeful_feed_items'
340
+ AND t3.nspname = ANY (current_schemas(false))
341
+ ORDER BY c.conname
342
+ 
343
+  (2.0ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
344
+ FROM pg_constraint c
345
+ JOIN pg_class t1 ON c.conrelid = t1.oid
346
+ JOIN pg_class t2 ON c.confrelid = t2.oid
347
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
348
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
349
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
350
+ WHERE c.contype = 'f'
351
+ AND t1.relname = 'users'
352
+ AND t3.nspname = ANY (current_schemas(false))
353
+ ORDER BY c.conname
354
+ 
355
+ User Load (0.7ms) SELECT "users".* FROM "users"
356
+ User Load (0.8ms) SELECT "users".* FROM "users"
357
+ User Load (0.6ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT $1 [["LIMIT", 1]]
358
+  (0.3ms) BEGIN
359
+ SQL (0.6ms) INSERT INTO "users" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", 2016-09-27 21:06:53 UTC], ["updated_at", 2016-09-27 21:06:53 UTC]]
360
+  (1.2ms) COMMIT
361
+ Timeful::FeedItem Load (0.8ms) SELECT "timeful_feed_items".* FROM "timeful_feed_items" WHERE "timeful_feed_items"."feedable_id" = $1 AND "timeful_feed_items"."feedable_type" = $2 ORDER BY "timeful_feed_items"."created_at" DESC [["feedable_id", 1], ["feedable_type", "User"]]