hertz 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +17 -12
  3. data/app/models/hertz/notification.rb +1 -1
  4. data/config/routes.rb +2 -0
  5. data/db/migrate/20160415174901_create_hertz_notifications.rb +2 -0
  6. data/db/migrate/20160627084018_create_hertz_notification_deliveries.rb +2 -0
  7. data/db/migrate/20160628084342_rename_notification_deliveries_to_deliveries.rb +2 -0
  8. data/db/migrate/20200112143142_convert_notification_meta_to_jsonb.rb +14 -0
  9. data/lib/hertz/notifiable.rb +8 -8
  10. data/lib/hertz/version.rb +1 -1
  11. data/spec/examples.txt +21 -0
  12. data/spec/hertz/notifiable_spec.rb +1 -1
  13. data/spec/hertz/notification_deliverer_spec.rb +8 -12
  14. data/spec/{dummy/public/favicon.ico → internal/app/assets/config/manifest.js} +0 -0
  15. data/spec/{dummy → internal}/app/models/test_notification.rb +2 -0
  16. data/spec/{dummy → internal}/app/models/user.rb +2 -0
  17. data/spec/internal/config/database.yml +3 -0
  18. data/spec/internal/config/routes.rb +5 -0
  19. data/spec/internal/db/schema.rb +7 -0
  20. data/spec/internal/log/test.log +2425 -0
  21. data/spec/internal/public/favicon.ico +0 -0
  22. data/spec/models/hertz/notification_spec.rb +26 -5
  23. data/spec/spec_helper.rb +13 -0
  24. data/spec/support/database_cleaner.rb +4 -3
  25. data/spec/support/factory_bot.rb +2 -0
  26. data/spec/support/faker.rb +2 -0
  27. metadata +59 -107
  28. data/spec/dummy/README.rdoc +0 -28
  29. data/spec/dummy/Rakefile +0 -6
  30. data/spec/dummy/app/assets/javascripts/application.js +0 -13
  31. data/spec/dummy/app/assets/stylesheets/application.css +0 -15
  32. data/spec/dummy/app/controllers/application_controller.rb +0 -5
  33. data/spec/dummy/app/helpers/application_helper.rb +0 -2
  34. data/spec/dummy/app/views/hertz/notification_mailer/test_notification.html.erb +0 -1
  35. data/spec/dummy/app/views/layouts/application.html.erb +0 -14
  36. data/spec/dummy/bin/bundle +0 -3
  37. data/spec/dummy/bin/rails +0 -4
  38. data/spec/dummy/bin/rake +0 -4
  39. data/spec/dummy/bin/setup +0 -29
  40. data/spec/dummy/config.ru +0 -4
  41. data/spec/dummy/config/application.rb +0 -22
  42. data/spec/dummy/config/boot.rb +0 -5
  43. data/spec/dummy/config/database.example.yml +0 -19
  44. data/spec/dummy/config/database.travis.yml +0 -4
  45. data/spec/dummy/config/environment.rb +0 -5
  46. data/spec/dummy/config/environments/development.rb +0 -41
  47. data/spec/dummy/config/environments/production.rb +0 -79
  48. data/spec/dummy/config/environments/test.rb +0 -42
  49. data/spec/dummy/config/initializers/assets.rb +0 -11
  50. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
  51. data/spec/dummy/config/initializers/cookies_serializer.rb +0 -3
  52. data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  53. data/spec/dummy/config/initializers/hertz.rb +0 -2
  54. data/spec/dummy/config/initializers/inflections.rb +0 -16
  55. data/spec/dummy/config/initializers/mime_types.rb +0 -4
  56. data/spec/dummy/config/initializers/session_store.rb +0 -3
  57. data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
  58. data/spec/dummy/config/locales/en.yml +0 -23
  59. data/spec/dummy/config/routes.rb +0 -4
  60. data/spec/dummy/config/secrets.yml +0 -22
  61. data/spec/dummy/db/migrate/20160415175358_create_hertz_notifications.hertz.rb +0 -15
  62. data/spec/dummy/db/migrate/20160415175837_create_users.rb +0 -8
  63. data/spec/dummy/db/migrate/20160418122437_add_email_to_users.rb +0 -5
  64. data/spec/dummy/db/migrate/20160508094342_remove_email_from_users.rb +0 -5
  65. data/spec/dummy/db/migrate/20160627084119_create_hertz_notification_deliveries.hertz.rb +0 -13
  66. data/spec/dummy/db/migrate/20160628084413_rename_notification_deliveries_to_deliveries.hertz.rb +0 -6
  67. data/spec/dummy/db/schema.rb +0 -44
  68. data/spec/dummy/public/404.html +0 -67
  69. data/spec/dummy/public/422.html +0 -67
  70. data/spec/dummy/public/500.html +0 -66
  71. data/spec/rails_helper.rb +0 -21
@@ -1,5 +0,0 @@
1
- class RemoveEmailFromUsers < ActiveRecord::Migration
2
- def change
3
- remove_column :users, :email, :string
4
- end
5
- end
@@ -1,13 +0,0 @@
1
- # This migration comes from hertz (originally 20160627084018)
2
- class CreateHertzNotificationDeliveries < ActiveRecord::Migration
3
- def change
4
- create_table :hertz_notification_deliveries do |t|
5
- t.integer :notification_id, null: false
6
- t.index :notification_id
7
- t.foreign_key :hertz_notifications, column: :notification_id, on_delete: :cascade
8
- t.string :courier, null: false
9
- t.datetime :created_at, null: false
10
- t.index [:notification_id, :courier], unique: true, name: 'index_hertz_notification_deliveries_on_notification_and_courier'
11
- end
12
- end
13
- end
@@ -1,6 +0,0 @@
1
- # This migration comes from hertz (originally 20160628084342)
2
- class RenameNotificationDeliveriesToDeliveries < ActiveRecord::Migration
3
- def change
4
- rename_table :hertz_notification_deliveries, :hertz_deliveries
5
- end
6
- end
@@ -1,44 +0,0 @@
1
- # encoding: UTF-8
2
- # This file is auto-generated from the current state of the database. Instead
3
- # of editing this file, please use the migrations feature of Active Record to
4
- # incrementally modify your database, and then regenerate this schema definition.
5
- #
6
- # Note that this schema.rb definition is the authoritative source for your
7
- # database schema. If you need to create the application database on another
8
- # system, you should be using db:schema:load, not running all the migrations
9
- # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
- # you'll amass, the slower it'll run and the greater likelihood for issues).
11
- #
12
- # It's strongly recommended that you check this file into your version control system.
13
-
14
- ActiveRecord::Schema.define(version: 20160628084413) do
15
-
16
- # These are extensions that must be enabled in order to support this database
17
- enable_extension "plpgsql"
18
- enable_extension "hstore"
19
-
20
- create_table "hertz_deliveries", force: :cascade do |t|
21
- t.integer "notification_id", null: false
22
- t.string "courier", null: false
23
- t.datetime "created_at", null: false
24
- end
25
-
26
- add_index "hertz_deliveries", ["notification_id", "courier"], name: "index_hertz_notification_deliveries_on_notification_and_courier", unique: true, using: :btree
27
- add_index "hertz_deliveries", ["notification_id"], name: "index_hertz_deliveries_on_notification_id", using: :btree
28
-
29
- create_table "hertz_notifications", force: :cascade do |t|
30
- t.string "type", null: false
31
- t.string "receiver_type", null: false
32
- t.integer "receiver_id", null: false
33
- t.hstore "meta", default: {}, null: false
34
- t.datetime "read_at"
35
- t.datetime "created_at", null: false
36
- end
37
-
38
- create_table "users", force: :cascade do |t|
39
- t.datetime "created_at", null: false
40
- t.datetime "updated_at", null: false
41
- end
42
-
43
- add_foreign_key "hertz_deliveries", "hertz_notifications", column: "notification_id", on_delete: :cascade
44
- end
@@ -1,67 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The page you were looking for doesn't exist (404)</title>
5
- <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <style>
7
- body {
8
- background-color: #EFEFEF;
9
- color: #2E2F30;
10
- text-align: center;
11
- font-family: arial, sans-serif;
12
- margin: 0;
13
- }
14
-
15
- div.dialog {
16
- width: 95%;
17
- max-width: 33em;
18
- margin: 4em auto 0;
19
- }
20
-
21
- div.dialog > div {
22
- border: 1px solid #CCC;
23
- border-right-color: #999;
24
- border-left-color: #999;
25
- border-bottom-color: #BBB;
26
- border-top: #B00100 solid 4px;
27
- border-top-left-radius: 9px;
28
- border-top-right-radius: 9px;
29
- background-color: white;
30
- padding: 7px 12% 0;
31
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
- }
33
-
34
- h1 {
35
- font-size: 100%;
36
- color: #730E15;
37
- line-height: 1.5em;
38
- }
39
-
40
- div.dialog > p {
41
- margin: 0 0 1em;
42
- padding: 1em;
43
- background-color: #F7F7F7;
44
- border: 1px solid #CCC;
45
- border-right-color: #999;
46
- border-left-color: #999;
47
- border-bottom-color: #999;
48
- border-bottom-left-radius: 4px;
49
- border-bottom-right-radius: 4px;
50
- border-top-color: #DADADA;
51
- color: #666;
52
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
- }
54
- </style>
55
- </head>
56
-
57
- <body>
58
- <!-- This file lives in public/404.html -->
59
- <div class="dialog">
60
- <div>
61
- <h1>The page you were looking for doesn't exist.</h1>
62
- <p>You may have mistyped the address or the page may have moved.</p>
63
- </div>
64
- <p>If you are the application owner check the logs for more information.</p>
65
- </div>
66
- </body>
67
- </html>
@@ -1,67 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The change you wanted was rejected (422)</title>
5
- <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <style>
7
- body {
8
- background-color: #EFEFEF;
9
- color: #2E2F30;
10
- text-align: center;
11
- font-family: arial, sans-serif;
12
- margin: 0;
13
- }
14
-
15
- div.dialog {
16
- width: 95%;
17
- max-width: 33em;
18
- margin: 4em auto 0;
19
- }
20
-
21
- div.dialog > div {
22
- border: 1px solid #CCC;
23
- border-right-color: #999;
24
- border-left-color: #999;
25
- border-bottom-color: #BBB;
26
- border-top: #B00100 solid 4px;
27
- border-top-left-radius: 9px;
28
- border-top-right-radius: 9px;
29
- background-color: white;
30
- padding: 7px 12% 0;
31
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
- }
33
-
34
- h1 {
35
- font-size: 100%;
36
- color: #730E15;
37
- line-height: 1.5em;
38
- }
39
-
40
- div.dialog > p {
41
- margin: 0 0 1em;
42
- padding: 1em;
43
- background-color: #F7F7F7;
44
- border: 1px solid #CCC;
45
- border-right-color: #999;
46
- border-left-color: #999;
47
- border-bottom-color: #999;
48
- border-bottom-left-radius: 4px;
49
- border-bottom-right-radius: 4px;
50
- border-top-color: #DADADA;
51
- color: #666;
52
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
- }
54
- </style>
55
- </head>
56
-
57
- <body>
58
- <!-- This file lives in public/422.html -->
59
- <div class="dialog">
60
- <div>
61
- <h1>The change you wanted was rejected.</h1>
62
- <p>Maybe you tried to change something you didn't have access to.</p>
63
- </div>
64
- <p>If you are the application owner check the logs for more information.</p>
65
- </div>
66
- </body>
67
- </html>
@@ -1,66 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>We're sorry, but something went wrong (500)</title>
5
- <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <style>
7
- body {
8
- background-color: #EFEFEF;
9
- color: #2E2F30;
10
- text-align: center;
11
- font-family: arial, sans-serif;
12
- margin: 0;
13
- }
14
-
15
- div.dialog {
16
- width: 95%;
17
- max-width: 33em;
18
- margin: 4em auto 0;
19
- }
20
-
21
- div.dialog > div {
22
- border: 1px solid #CCC;
23
- border-right-color: #999;
24
- border-left-color: #999;
25
- border-bottom-color: #BBB;
26
- border-top: #B00100 solid 4px;
27
- border-top-left-radius: 9px;
28
- border-top-right-radius: 9px;
29
- background-color: white;
30
- padding: 7px 12% 0;
31
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
- }
33
-
34
- h1 {
35
- font-size: 100%;
36
- color: #730E15;
37
- line-height: 1.5em;
38
- }
39
-
40
- div.dialog > p {
41
- margin: 0 0 1em;
42
- padding: 1em;
43
- background-color: #F7F7F7;
44
- border: 1px solid #CCC;
45
- border-right-color: #999;
46
- border-left-color: #999;
47
- border-bottom-color: #999;
48
- border-bottom-left-radius: 4px;
49
- border-bottom-right-radius: 4px;
50
- border-top-color: #DADADA;
51
- color: #666;
52
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
- }
54
- </style>
55
- </head>
56
-
57
- <body>
58
- <!-- This file lives in public/500.html -->
59
- <div class="dialog">
60
- <div>
61
- <h1>We're sorry, but something went wrong.</h1>
62
- </div>
63
- <p>If you are the application owner check the logs for more information.</p>
64
- </div>
65
- </body>
66
- </html>
@@ -1,21 +0,0 @@
1
- ENV['RAILS_ENV'] ||= 'test'
2
-
3
- ENGINE_ROOT = File.join(File.dirname(__FILE__), '../')
4
-
5
- # Load environment.rb from the dummy app.
6
- require File.expand_path('../dummy/config/environment', __FILE__)
7
-
8
- abort("The Rails environment is running in production mode!") if Rails.env.production?
9
- require 'spec_helper'
10
- require 'rspec/rails'
11
-
12
- # Load RSpec helpers.
13
- Dir[File.join(ENGINE_ROOT, 'spec/support/**/*.rb')].each { |f| require f }
14
-
15
- # Load migrations from the dummy app.
16
- ActiveRecord::Migrator.migrations_paths = File.join(ENGINE_ROOT, 'spec/dummy/db/migrate')
17
- ActiveRecord::Migration.maintain_test_schema!
18
-
19
- RSpec.configure do |config|
20
- config.infer_spec_type_from_file_location!
21
- end