hertz 0.1.0 → 1.0.0
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.
- checksums.yaml +4 -4
- data/README.md +14 -43
- data/lib/generators/hertz/templates/initializer.rb +0 -2
- data/lib/hertz/version.rb +1 -1
- data/lib/hertz.rb +0 -8
- data/spec/dummy/app/models/test_notification.rb +0 -5
- data/spec/dummy/config/database.yml +1 -10
- data/spec/dummy/config/initializers/hertz.rb +0 -2
- data/spec/dummy/db/migrate/20160508094342_remove_email_from_users.rb +5 -0
- data/spec/dummy/db/schema.rb +1 -2
- data/spec/dummy/log/development.log +28 -112
- data/spec/dummy/log/test.log +311 -2543
- data/spec/examples.txt +11 -13
- data/spec/factories/users.rb +0 -1
- data/spec/{lib/hertz → hertz}/notifiable_spec.rb +0 -0
- data/spec/{lib/hertz → hertz}/notification_deliverer_spec.rb +1 -1
- metadata +43 -51
- data/app/mailers/hertz/notification_mailer.rb +0 -24
- data/lib/hertz/courier/base.rb +0 -10
- data/lib/hertz/courier/email.rb +0 -10
- data/lib/tasks/hertz_tasks.rake +0 -4
- data/spec/dummy/app/mailers/application_mailer.rb +0 -2
- data/spec/lib/hertz/courier/email_spec.rb +0 -26
- data/spec/mailers/notification_mailer_spec.rb +0 -13
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 2eef5fc7cb19de80f84d964b0f2d6a537b9abd5b
         | 
| 4 | 
            +
              data.tar.gz: 670e53a7387981df2a9bec8983f8e10b4660050a
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 59110519a6b34162d8a194bb4f17dec3c5eb1607c79d211f3ed3c0cb329a9c59a805424bbf9515dbc57e8cc7ae8149182414049a8aab58be7b393da6b66cbdf9
         | 
| 7 | 
            +
              data.tar.gz: ae85c1e2303752f2f8414028cbb386894c8f84f41f82cf68177a8a854a908b69650d8563a964b25dd98b7cf0b305e172a5323370eff0eae988b2b9aa75cff360
         | 
    
        data/README.md
    CHANGED
    
    | @@ -1,9 +1,10 @@ | |
| 1 1 | 
             
            # Hertz
         | 
| 2 2 |  | 
| 3 | 
            +
            [](https://badge.fury.io/rb/hertz)
         | 
| 3 4 | 
             
            [](https://gemnasium.com/github.com/alessandro1997/hertz)
         | 
| 4 5 | 
             
            [](https://codeclimate.com/github/alessandro1997/hertz)
         | 
| 5 6 |  | 
| 6 | 
            -
            Hertz is a Ruby on Rails engine for sending in-app  | 
| 7 | 
            +
            Hertz is a Ruby on Rails engine for sending in-app notifications to your users.
         | 
| 7 8 |  | 
| 8 9 | 
             
            ## Installation
         | 
| 9 10 |  | 
| @@ -133,49 +134,12 @@ notification.mark_as_read | |
| 133 134 | 
             
            notification.mark_as_unread
         | 
| 134 135 | 
             
            ```
         | 
| 135 136 |  | 
| 136 | 
            -
            ##  | 
| 137 | 
            +
            ## Other couriers
         | 
| 137 138 |  | 
| 138 | 
            -
             | 
| 139 | 
            -
             | 
| 140 | 
            -
             | 
| 141 | 
            -
             | 
| 142 | 
            -
             | 
| 143 | 
            -
            ```ruby
         | 
| 144 | 
            -
            class CommentNotification < Hertz::Notification
         | 
| 145 | 
            -
              deliver_by :email
         | 
| 146 | 
            -
            end
         | 
| 147 | 
            -
            ```
         | 
| 148 | 
            -
             | 
| 149 | 
            -
            You will also need to expose the `hertz_email` method in your receiver class:
         | 
| 150 | 
            -
             | 
| 151 | 
            -
            ```ruby
         | 
| 152 | 
            -
            class User < ActiveRecord::Base
         | 
| 153 | 
            -
              def hertz_email
         | 
| 154 | 
            -
                email
         | 
| 155 | 
            -
              end
         | 
| 156 | 
            -
            end
         | 
| 157 | 
            -
            ```
         | 
| 158 | 
            -
             | 
| 159 | 
            -
            And the `email_subject` method in your notification class:
         | 
| 160 | 
            -
             | 
| 161 | 
            -
            ```ruby
         | 
| 162 | 
            -
            class CommentNotification < Hertz::Notification
         | 
| 163 | 
            -
              def email_subject
         | 
| 164 | 
            -
                'You have a new comment!'
         | 
| 165 | 
            -
              end
         | 
| 166 | 
            -
            end
         | 
| 167 | 
            -
            ```
         | 
| 168 | 
            -
             | 
| 169 | 
            -
            Finally, you should create a template for every notification you send by email.
         | 
| 170 | 
            -
            For `CommentNotification` you'd create a template at
         | 
| 171 | 
            -
            `app/views/hertz/notification_mailer/comment_notification.html.erb`:
         | 
| 172 | 
            -
             | 
| 173 | 
            -
            ```erb
         | 
| 174 | 
            -
            <p>Hey <%= @notification.receiver.hertz_email %>,</p>
         | 
| 175 | 
            -
            <p>you've got a new comment!</p>
         | 
| 176 | 
            -
            ```
         | 
| 177 | 
            -
             | 
| 178 | 
            -
            As you can see, templates have access to the `@notification` instance variable.
         | 
| 139 | 
            +
            - [hertz-courier-twilio](https://github.com/alessandro1997/hertz-courier-twilio):
         | 
| 140 | 
            +
              delivers notifications by SMS with the Twilio API.
         | 
| 141 | 
            +
            - [hertz-courier-email](https://github.com/alessandro1997/hertz-courier-email):
         | 
| 142 | 
            +
              delivers notifications by email with ActionMailer.
         | 
| 179 143 |  | 
| 180 144 | 
             
            ## Contributing
         | 
| 181 145 |  | 
| @@ -186,3 +150,10 @@ https://github.com/alessandro1997/hertz. | |
| 186 150 |  | 
| 187 151 | 
             
            The gem is available as open source under the terms of the
         | 
| 188 152 | 
             
            [MIT License](http://opensource.org/licenses/MIT).
         | 
| 153 | 
            +
             | 
| 154 | 
            +
            ## To do
         | 
| 155 | 
            +
             | 
| 156 | 
            +
            - [ ] Test `Hertz.configure`
         | 
| 157 | 
            +
            - [ ] Allow setting common couriers for all notifications
         | 
| 158 | 
            +
            - [ ] Validate couriers when calling `Hertz::Notifiable.deliver_by`
         | 
| 159 | 
            +
            - [ ] Extract `Hertz::Courier::Email` into a separate gem
         | 
    
        data/lib/hertz/version.rb
    CHANGED
    
    
    
        data/lib/hertz.rb
    CHANGED
    
    | @@ -3,17 +3,9 @@ require 'hertz/engine' | |
| 3 3 |  | 
| 4 4 | 
             
            require 'hertz/notifiable'
         | 
| 5 5 | 
             
            require 'hertz/notification_deliverer'
         | 
| 6 | 
            -
            require 'hertz/courier/base'
         | 
| 7 | 
            -
            require 'hertz/courier/email'
         | 
| 8 6 |  | 
| 9 7 | 
             
            module Hertz
         | 
| 10 | 
            -
              mattr_writer :base_mailer
         | 
| 11 | 
            -
             | 
| 12 8 | 
             
              def self.configure(&block)
         | 
| 13 9 | 
             
                block.call(self)
         | 
| 14 10 | 
             
              end
         | 
| 15 | 
            -
             | 
| 16 | 
            -
              def self.base_mailer
         | 
| 17 | 
            -
                (@@base_mailer || '::ApplicationMailer').constantize
         | 
| 18 | 
            -
              end
         | 
| 19 11 | 
             
            end
         | 
| @@ -1,14 +1,8 @@ | |
| 1 | 
            -
            # SQLite version 3.x
         | 
| 2 | 
            -
            #   gem install sqlite3
         | 
| 3 | 
            -
            #
         | 
| 4 | 
            -
            #   Ensure the SQLite 3 gem is defined in your Gemfile
         | 
| 5 | 
            -
            #   gem 'sqlite3'
         | 
| 6 | 
            -
            #
         | 
| 7 1 | 
             
            default: &default
         | 
| 8 2 | 
             
              adapter: postgresql
         | 
| 9 3 | 
             
              host: localhost
         | 
| 10 4 | 
             
              username: postgres
         | 
| 11 | 
            -
              password:  | 
| 5 | 
            +
              password: postgres
         | 
| 12 6 | 
             
              pool: 5
         | 
| 13 7 | 
             
              timeout: 5000
         | 
| 14 8 |  | 
| @@ -16,9 +10,6 @@ development: | |
| 16 10 | 
             
              <<: *default
         | 
| 17 11 | 
             
              database: hertz_development
         | 
| 18 12 |  | 
| 19 | 
            -
            # Warning: The database defined as "test" will be erased and
         | 
| 20 | 
            -
            # re-generated from your development database when you run "rake".
         | 
| 21 | 
            -
            # Do not set this db to the same as development or production.
         | 
| 22 13 | 
             
            test:
         | 
| 23 14 | 
             
              <<: *default
         | 
| 24 15 | 
             
              database: hertz_test
         | 
    
        data/spec/dummy/db/schema.rb
    CHANGED
    
    | @@ -11,7 +11,7 @@ | |
| 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:  | 
| 14 | 
            +
            ActiveRecord::Schema.define(version: 20160508094342) do
         | 
| 15 15 |  | 
| 16 16 | 
             
              # These are extensions that must be enabled in order to support this database
         | 
| 17 17 | 
             
              enable_extension "plpgsql"
         | 
| @@ -29,7 +29,6 @@ ActiveRecord::Schema.define(version: 20160418122437) do | |
| 29 29 | 
             
              create_table "users", force: :cascade do |t|
         | 
| 30 30 | 
             
                t.datetime "created_at", null: false
         | 
| 31 31 | 
             
                t.datetime "updated_at", null: false
         | 
| 32 | 
            -
                t.string   "email",      null: false
         | 
| 33 32 | 
             
              end
         | 
| 34 33 |  | 
| 35 34 | 
             
            end
         | 
| @@ -1,103 +1,32 @@ | |
| 1 | 
            -
              [1m[ | 
| 2 | 
            -
              [1m[ | 
| 1 | 
            +
              [1m[36mSQL (0.3ms)[0m  [1mCREATE EXTENSION IF NOT EXISTS "plpgsql"[0m
         | 
| 2 | 
            +
              [1m[35mSQL (31.9ms)[0m  CREATE EXTENSION IF NOT EXISTS "hstore"
         | 
| 3 | 
            +
              [1m[36m (21.0ms)[0m  [1mCREATE 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) [0m
         | 
| 4 | 
            +
              [1m[35m (6.6ms)[0m  CREATE TABLE "users" ("id" serial primary key, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "email" character varying NOT NULL) 
         | 
| 5 | 
            +
              [1m[36m (7.9ms)[0m  [1mCREATE TABLE "schema_migrations" ("version" character varying NOT NULL) [0m
         | 
| 6 | 
            +
              [1m[35m (8.2ms)[0m  CREATE UNIQUE INDEX  "unique_schema_migrations" ON "schema_migrations"  ("version")
         | 
| 7 | 
            +
              [1m[36m (0.7ms)[0m  [1mSELECT version FROM "schema_migrations"[0m
         | 
| 8 | 
            +
              [1m[35m (1.6ms)[0m  INSERT INTO "schema_migrations" (version) VALUES ('20160418122437')
         | 
| 9 | 
            +
              [1m[36m (1.4ms)[0m  [1mINSERT INTO "schema_migrations" (version) VALUES ('20160415175837')[0m
         | 
| 10 | 
            +
              [1m[35m (1.8ms)[0m  INSERT INTO "schema_migrations" (version) VALUES ('20160415175358')
         | 
| 11 | 
            +
              [1m[36mSQL (0.5ms)[0m  [1mCREATE EXTENSION IF NOT EXISTS "plpgsql"[0m
         | 
| 12 | 
            +
              [1m[35mSQL (24.4ms)[0m  CREATE EXTENSION IF NOT EXISTS "hstore"
         | 
| 13 | 
            +
              [1m[36m (16.8ms)[0m  [1mCREATE 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) [0m
         | 
| 14 | 
            +
              [1m[35m (10.0ms)[0m  CREATE TABLE "users" ("id" serial primary key, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "email" character varying NOT NULL) 
         | 
| 15 | 
            +
              [1m[36m (9.3ms)[0m  [1mCREATE TABLE "schema_migrations" ("version" character varying NOT NULL) [0m
         | 
| 16 | 
            +
              [1m[35m (13.5ms)[0m  CREATE UNIQUE INDEX  "unique_schema_migrations" ON "schema_migrations"  ("version")
         | 
| 17 | 
            +
              [1m[36m (1.0ms)[0m  [1mSELECT version FROM "schema_migrations"[0m
         | 
| 18 | 
            +
              [1m[35m (1.2ms)[0m  INSERT INTO "schema_migrations" (version) VALUES ('20160418122437')
         | 
| 19 | 
            +
              [1m[36m (1.1ms)[0m  [1mINSERT INTO "schema_migrations" (version) VALUES ('20160415175837')[0m
         | 
| 20 | 
            +
              [1m[35m (1.2ms)[0m  INSERT INTO "schema_migrations" (version) VALUES ('20160415175358')
         | 
| 3 21 | 
             
              [1m[36mActiveRecord::SchemaMigration Load (0.4ms)[0m  [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
         | 
| 4 | 
            -
              [1m[ | 
| 5 | 
            -
             | 
| 6 | 
            -
              [1m[35m (0. | 
| 7 | 
            -
              [1m[ | 
| 8 | 
            -
              [1m[ | 
| 9 | 
            -
              [1m[36m (2. | 
| 10 | 
            -
              [1m[35m (0.3ms)[0m  SELECT version FROM "schema_migrations"
         | 
| 11 | 
            -
              [1m[36m (0.5ms)[0m  [1mINSERT INTO "schema_migrations" (version) VALUES ('0')[0m
         | 
| 12 | 
            -
              [1m[35mActiveRecord::SchemaMigration Load (0.5ms)[0m  SELECT "schema_migrations".* FROM "schema_migrations"
         | 
| 13 | 
            -
              [1m[36mActiveRecord::SchemaMigration Load (0.5ms)[0m  [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
         | 
| 14 | 
            -
            Migrating to CreateHertzNotifications (20160415175229)
         | 
| 15 | 
            -
              [1m[35m (0.3ms)[0m  BEGIN
         | 
| 16 | 
            -
              [1m[36m (6.6ms)[0m  [1mCREATE TABLE "hertz_notifications" ("id" serial primary key, "type" character varying NOT NULL, "receiver_type" character varying NOT NULL, "receiver_id" integer NOT NULL, "meta" json NOT NULL, "read_at" timestamp, "created_at" timestamp NOT NULL) [0m
         | 
| 17 | 
            -
              [1m[35mSQL (0.4ms)[0m  INSERT INTO "schema_migrations" ("version") VALUES ($1)  [["version", "20160415175229"]]
         | 
| 18 | 
            -
              [1m[36m (1.3ms)[0m  [1mCOMMIT[0m
         | 
| 19 | 
            -
              [1m[35mActiveRecord::SchemaMigration Load (1.1ms)[0m  SELECT "schema_migrations".* FROM "schema_migrations"
         | 
| 20 | 
            -
              [1m[36m (5.1ms)[0m  [1mSELECT 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
         | 
| 21 | 
            -
            FROM pg_constraint c
         | 
| 22 | 
            -
            JOIN pg_class t1 ON c.conrelid = t1.oid
         | 
| 23 | 
            -
            JOIN pg_class t2 ON c.confrelid = t2.oid
         | 
| 24 | 
            -
            JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
         | 
| 25 | 
            -
            JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
         | 
| 26 | 
            -
            JOIN pg_namespace t3 ON c.connamespace = t3.oid
         | 
| 27 | 
            -
            WHERE c.contype = 'f'
         | 
| 28 | 
            -
              AND t1.relname = 'hertz_notifications'
         | 
| 29 | 
            -
              AND t3.nspname = ANY (current_schemas(false))
         | 
| 30 | 
            -
            ORDER BY c.conname
         | 
| 31 | 
            -
            [0m
         | 
| 32 | 
            -
              [1m[36mActiveRecord::SchemaMigration Load (0.5ms)[0m  [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
         | 
| 22 | 
            +
              [1m[36mActiveRecord::SchemaMigration Load (0.6ms)[0m  [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
         | 
| 23 | 
            +
            Migrating to RemoveEmailFromUsers (20160508094342)
         | 
| 24 | 
            +
              [1m[35m (0.4ms)[0m  BEGIN
         | 
| 25 | 
            +
              [1m[36m (0.8ms)[0m  [1mALTER TABLE "users" DROP "email"[0m
         | 
| 26 | 
            +
              [1m[35mSQL (0.5ms)[0m  INSERT INTO "schema_migrations" ("version") VALUES ($1)  [["version", "20160508094342"]]
         | 
| 27 | 
            +
              [1m[36m (2.8ms)[0m  [1mCOMMIT[0m
         | 
| 33 28 | 
             
              [1m[35mActiveRecord::SchemaMigration Load (0.3ms)[0m  SELECT "schema_migrations".* FROM "schema_migrations"
         | 
| 34 | 
            -
             | 
| 35 | 
            -
              [1m[36m (0.2ms)[0m  [1mBEGIN[0m
         | 
| 36 | 
            -
              [1m[35m (1.6ms)[0m  DROP TABLE "hertz_notifications"
         | 
| 37 | 
            -
              [1m[36mSQL (0.5ms)[0m  [1mDELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1[0m  [["version", "20160415175229"]]
         | 
| 38 | 
            -
              [1m[35m (1.2ms)[0m  COMMIT
         | 
| 39 | 
            -
              [1m[36mActiveRecord::SchemaMigration Load (0.7ms)[0m  [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
         | 
| 40 | 
            -
              [1m[36mActiveRecord::SchemaMigration Load (0.5ms)[0m  [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
         | 
| 41 | 
            -
            Migrating to CreateHertzNotifications (20160415175358)
         | 
| 42 | 
            -
              [1m[35m (0.2ms)[0m  BEGIN
         | 
| 43 | 
            -
              [1m[36mSQL (19.0ms)[0m  [1mCREATE EXTENSION IF NOT EXISTS "hstore"[0m
         | 
| 44 | 
            -
              [1m[35m (9.6ms)[0m  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) 
         | 
| 45 | 
            -
              [1m[36mSQL (0.5ms)[0m  [1mINSERT INTO "schema_migrations" ("version") VALUES ($1)[0m  [["version", "20160415175358"]]
         | 
| 46 | 
            -
              [1m[35m (3.4ms)[0m  COMMIT
         | 
| 47 | 
            -
              [1m[36mActiveRecord::SchemaMigration Load (0.5ms)[0m  [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
         | 
| 48 | 
            -
              [1m[35m (2.0ms)[0m  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
         | 
| 49 | 
            -
            FROM pg_constraint c
         | 
| 50 | 
            -
            JOIN pg_class t1 ON c.conrelid = t1.oid
         | 
| 51 | 
            -
            JOIN pg_class t2 ON c.confrelid = t2.oid
         | 
| 52 | 
            -
            JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
         | 
| 53 | 
            -
            JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
         | 
| 54 | 
            -
            JOIN pg_namespace t3 ON c.connamespace = t3.oid
         | 
| 55 | 
            -
            WHERE c.contype = 'f'
         | 
| 56 | 
            -
              AND t1.relname = 'hertz_notifications'
         | 
| 57 | 
            -
              AND t3.nspname = ANY (current_schemas(false))
         | 
| 58 | 
            -
            ORDER BY c.conname
         | 
| 59 | 
            -
             | 
| 60 | 
            -
              [1m[36mActiveRecord::SchemaMigration Load (0.8ms)[0m  [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
         | 
| 61 | 
            -
            Migrating to CreateUsers (20160415175837)
         | 
| 62 | 
            -
              [1m[35m (0.2ms)[0m  BEGIN
         | 
| 63 | 
            -
              [1m[36m (3.4ms)[0m  [1mCREATE TABLE "users" ("id" serial primary key, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) [0m
         | 
| 64 | 
            -
              [1m[35mSQL (0.6ms)[0m  INSERT INTO "schema_migrations" ("version") VALUES ($1)  [["version", "20160415175837"]]
         | 
| 65 | 
            -
              [1m[36m (1.8ms)[0m  [1mCOMMIT[0m
         | 
| 66 | 
            -
              [1m[35mActiveRecord::SchemaMigration Load (0.7ms)[0m  SELECT "schema_migrations".* FROM "schema_migrations"
         | 
| 67 | 
            -
              [1m[36m (2.1ms)[0m  [1mSELECT 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
         | 
| 68 | 
            -
            FROM pg_constraint c
         | 
| 69 | 
            -
            JOIN pg_class t1 ON c.conrelid = t1.oid
         | 
| 70 | 
            -
            JOIN pg_class t2 ON c.confrelid = t2.oid
         | 
| 71 | 
            -
            JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
         | 
| 72 | 
            -
            JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
         | 
| 73 | 
            -
            JOIN pg_namespace t3 ON c.connamespace = t3.oid
         | 
| 74 | 
            -
            WHERE c.contype = 'f'
         | 
| 75 | 
            -
              AND t1.relname = 'hertz_notifications'
         | 
| 76 | 
            -
              AND t3.nspname = ANY (current_schemas(false))
         | 
| 77 | 
            -
            ORDER BY c.conname
         | 
| 78 | 
            -
            [0m
         | 
| 79 | 
            -
              [1m[35m (4.0ms)[0m  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
         | 
| 80 | 
            -
            FROM pg_constraint c
         | 
| 81 | 
            -
            JOIN pg_class t1 ON c.conrelid = t1.oid
         | 
| 82 | 
            -
            JOIN pg_class t2 ON c.confrelid = t2.oid
         | 
| 83 | 
            -
            JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
         | 
| 84 | 
            -
            JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
         | 
| 85 | 
            -
            JOIN pg_namespace t3 ON c.connamespace = t3.oid
         | 
| 86 | 
            -
            WHERE c.contype = 'f'
         | 
| 87 | 
            -
              AND t1.relname = 'users'
         | 
| 88 | 
            -
              AND t3.nspname = ANY (current_schemas(false))
         | 
| 89 | 
            -
            ORDER BY c.conname
         | 
| 90 | 
            -
             | 
| 91 | 
            -
             | 
| 92 | 
            -
            Hertz::NotificationMailer#notification_email: processed outbound mail in 5.9ms
         | 
| 93 | 
            -
              [1m[36mActiveRecord::SchemaMigration Load (2.7ms)[0m  [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
         | 
| 94 | 
            -
            Migrating to AddEmailToUsers (20160418122437)
         | 
| 95 | 
            -
              [1m[35m (0.6ms)[0m  BEGIN
         | 
| 96 | 
            -
              [1m[36m (25.4ms)[0m  [1mALTER TABLE "users" ADD "email" character varying NOT NULL[0m
         | 
| 97 | 
            -
              [1m[35mSQL (4.6ms)[0m  INSERT INTO "schema_migrations" ("version") VALUES ($1)  [["version", "20160418122437"]]
         | 
| 98 | 
            -
              [1m[36m (5.0ms)[0m  [1mCOMMIT[0m
         | 
| 99 | 
            -
              [1m[35mActiveRecord::SchemaMigration Load (0.4ms)[0m  SELECT "schema_migrations".* FROM "schema_migrations"
         | 
| 100 | 
            -
              [1m[36m (9.6ms)[0m  [1mSELECT 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
         | 
| 29 | 
            +
              [1m[36m (2.8ms)[0m  [1mSELECT 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
         | 
| 101 30 | 
             
            FROM pg_constraint c
         | 
| 102 31 | 
             
            JOIN pg_class t1 ON c.conrelid = t1.oid
         | 
| 103 32 | 
             
            JOIN pg_class t2 ON c.confrelid = t2.oid
         | 
| @@ -109,7 +38,7 @@ WHERE c.contype = 'f' | |
| 109 38 | 
             
              AND t3.nspname = ANY (current_schemas(false))
         | 
| 110 39 | 
             
            ORDER BY c.conname
         | 
| 111 40 | 
             
            [0m
         | 
| 112 | 
            -
              [1m[35m ( | 
| 41 | 
            +
              [1m[35m (2.5ms)[0m  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
         | 
| 113 42 | 
             
            FROM pg_constraint c
         | 
| 114 43 | 
             
            JOIN pg_class t1 ON c.conrelid = t1.oid
         | 
| 115 44 | 
             
            JOIN pg_class t2 ON c.confrelid = t2.oid
         | 
| @@ -121,16 +50,3 @@ WHERE c.contype = 'f' | |
| 121 50 | 
             
              AND t3.nspname = ANY (current_schemas(false))
         | 
| 122 51 | 
             
            ORDER BY c.conname
         | 
| 123 52 |  | 
| 124 | 
            -
              [1m[36m (1.0ms)[0m  [1mBEGIN[0m
         | 
| 125 | 
            -
              [1m[35mSQL (2.1ms)[0m  INSERT INTO "users" ("email", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"  [["email", "foo@bar.com"], ["created_at", "2016-04-18 15:52:39.396262"], ["updated_at", "2016-04-18 15:52:39.396262"]]
         | 
| 126 | 
            -
              [1m[36m (1.4ms)[0m  [1mCOMMIT[0m
         | 
| 127 | 
            -
              [1m[35m (0.8ms)[0m  BEGIN
         | 
| 128 | 
            -
              [1m[36mSQL (1.9ms)[0m  [1mINSERT INTO "hertz_notifications" ("receiver_id", "receiver_type", "meta", "created_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m  [["receiver_id", 1], ["receiver_type", "User"], ["meta", "\"foo\"=>\"bar\""], ["created_at", "2016-04-18 15:52:39.426606"]]
         | 
| 129 | 
            -
              [1m[35m (0.2ms)[0m  ROLLBACK
         | 
| 130 | 
            -
              [1m[36m (0.3ms)[0m  [1mBEGIN[0m
         | 
| 131 | 
            -
              [1m[35mSQL (0.4ms)[0m  INSERT INTO "users" ("email", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id"  [["email", "foo@bar.com"], ["created_at", "2016-04-18 15:52:50.303993"], ["updated_at", "2016-04-18 15:52:50.303993"]]
         | 
| 132 | 
            -
              [1m[36m (0.7ms)[0m  [1mCOMMIT[0m
         | 
| 133 | 
            -
              [1m[35m (0.2ms)[0m  BEGIN
         | 
| 134 | 
            -
              [1m[36mSQL (0.9ms)[0m  [1mINSERT INTO "hertz_notifications" ("type", "receiver_id", "receiver_type", "meta", "created_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m  [["type", "Hertz::Notification"], ["receiver_id", 2], ["receiver_type", "User"], ["meta", "\"foo\"=>\"bar\""], ["created_at", "2016-04-18 15:52:50.307752"]]
         | 
| 135 | 
            -
              [1m[35m (0.5ms)[0m  COMMIT
         | 
| 136 | 
            -
              [1m[36mHertz::Notification Load (0.9ms)[0m  [1mSELECT  "hertz_notifications".* FROM "hertz_notifications"  ORDER BY "hertz_notifications"."id" DESC LIMIT 1[0m
         |