pubsub_notifier 0.1.1 → 0.1.2

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 (219) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +9 -3
  3. data/lib/generators/rails/templates/notifier.tt +2 -1
  4. data/lib/generators/rspec/notifier_generator.rb +1 -1
  5. data/lib/pubsub_notifier/proxy.rb +1 -1
  6. data/lib/pubsub_notifier/version.rb +1 -1
  7. data/spec/integration_spec.rb +15 -0
  8. data/spec/lib/acts_as_notifier_spec.rb +38 -0
  9. data/spec/lib/base_spec.rb +55 -0
  10. data/spec/lib/broadcasters/active_job_broadcaster_spec.rb +33 -0
  11. data/spec/lib/broadcasters_spec.rb +21 -0
  12. data/spec/lib/client_spec.rb +33 -0
  13. data/spec/lib/config_spec.rb +7 -0
  14. data/spec/lib/proxy_spec.rb +60 -0
  15. data/spec/lib/pubsub_spec.rb +14 -0
  16. data/spec/lib/slack_client_spec.rb +22 -0
  17. data/spec/pubsub_notifier_spec.rb +38 -20
  18. data/spec/rails/rails-4.2.9/README.rdoc +28 -0
  19. data/spec/rails/rails-4.2.9/Rakefile +6 -0
  20. data/spec/rails/rails-4.2.9/app/assets/javascripts/application.js +16 -0
  21. data/spec/rails/rails-4.2.9/app/assets/stylesheets/application.css +15 -0
  22. data/spec/rails/rails-4.2.9/app/controllers/application_controller.rb +5 -0
  23. data/spec/rails/rails-4.2.9/app/helpers/application_helper.rb +2 -0
  24. data/spec/rails/rails-4.2.9/app/mailers/application_mailer.rb +4 -0
  25. data/spec/rails/rails-4.2.9/app/mailers/post_mailer.rb +13 -0
  26. data/spec/rails/rails-4.2.9/app/mailers/user_mailer.rb +13 -0
  27. data/spec/rails/rails-4.2.9/app/models/post.rb +6 -0
  28. data/spec/rails/rails-4.2.9/app/models/register.rb +9 -0
  29. data/spec/rails/rails-4.2.9/app/models/user.rb +6 -0
  30. data/spec/{support → rails/rails-4.2.9/app}/notifiers/application_notifier.rb +0 -0
  31. data/spec/rails/rails-4.2.9/app/notifiers/post_notifier.rb +12 -0
  32. data/spec/rails/rails-4.2.9/app/notifiers/user_notifier.rb +12 -0
  33. data/spec/rails/rails-4.2.9/app/views/layouts/application.html.erb +14 -0
  34. data/spec/rails/rails-4.2.9/app/views/layouts/mailer.html.erb +5 -0
  35. data/spec/rails/rails-4.2.9/app/views/layouts/mailer.text.erb +1 -0
  36. data/spec/rails/rails-4.2.9/app/views/post_mailer/failure.html.erb +5 -0
  37. data/spec/rails/rails-4.2.9/app/views/post_mailer/failure.text.erb +3 -0
  38. data/spec/rails/rails-4.2.9/app/views/user_mailer/success.html.erb +5 -0
  39. data/spec/rails/rails-4.2.9/app/views/user_mailer/success.text.erb +3 -0
  40. data/spec/rails/rails-4.2.9/bin/bundle +3 -0
  41. data/spec/rails/rails-4.2.9/bin/rails +4 -0
  42. data/spec/rails/rails-4.2.9/bin/rake +4 -0
  43. data/spec/rails/rails-4.2.9/bin/setup +29 -0
  44. data/spec/rails/rails-4.2.9/config.ru +4 -0
  45. data/spec/rails/rails-4.2.9/config/application.rb +35 -0
  46. data/spec/rails/rails-4.2.9/config/boot.rb +3 -0
  47. data/spec/rails/rails-4.2.9/config/database.yml +25 -0
  48. data/spec/rails/rails-4.2.9/config/environment.rb +8 -0
  49. data/spec/rails/rails-4.2.9/config/environments/development.rb +28 -0
  50. data/spec/rails/rails-4.2.9/config/environments/production.rb +67 -0
  51. data/spec/rails/rails-4.2.9/config/environments/test.rb +43 -0
  52. data/spec/rails/rails-4.2.9/config/initializers/backtrace_silencers.rb +7 -0
  53. data/spec/rails/rails-4.2.9/config/initializers/cookies_serializer.rb +3 -0
  54. data/spec/rails/rails-4.2.9/config/initializers/filter_parameter_logging.rb +4 -0
  55. data/spec/rails/rails-4.2.9/config/initializers/inflections.rb +16 -0
  56. data/spec/rails/rails-4.2.9/config/initializers/mime_types.rb +4 -0
  57. data/spec/rails/rails-4.2.9/config/initializers/pubsub_notifier.rb +10 -0
  58. data/spec/rails/rails-4.2.9/config/initializers/session_store.rb +3 -0
  59. data/spec/rails/rails-4.2.9/config/initializers/to_time_preserves_timezone.rb +10 -0
  60. data/spec/rails/rails-4.2.9/config/initializers/wrap_parameters.rb +14 -0
  61. data/spec/rails/rails-4.2.9/config/locales/en.yml +23 -0
  62. data/spec/rails/rails-4.2.9/config/routes.rb +56 -0
  63. data/spec/rails/rails-4.2.9/config/secrets.yml +22 -0
  64. data/spec/rails/rails-4.2.9/db/migrate/20170714092725_create_users.rb +9 -0
  65. data/spec/rails/rails-4.2.9/db/migrate/20170714092727_create_posts.rb +9 -0
  66. data/spec/rails/rails-4.2.9/db/schema.rb +28 -0
  67. data/spec/rails/rails-4.2.9/db/seeds.rb +7 -0
  68. data/spec/rails/rails-4.2.9/db/test.sqlite3 +0 -0
  69. data/spec/rails/rails-4.2.9/log/test.log +272 -0
  70. data/spec/rails/rails-4.2.9/public/404.html +67 -0
  71. data/spec/rails/rails-4.2.9/public/422.html +67 -0
  72. data/spec/rails/rails-4.2.9/public/500.html +66 -0
  73. data/spec/rails/rails-4.2.9/public/favicon.ico +0 -0
  74. data/spec/rails/rails-4.2.9/public/robots.txt +5 -0
  75. data/spec/rails/rails-5.0.4/README.md +24 -0
  76. data/spec/rails/rails-5.0.4/Rakefile +6 -0
  77. data/spec/rails/rails-5.0.4/app/assets/config/manifest.js +3 -0
  78. data/spec/rails/rails-5.0.4/app/assets/javascripts/application.js +15 -0
  79. data/spec/rails/rails-5.0.4/app/assets/javascripts/cable.js +13 -0
  80. data/spec/rails/rails-5.0.4/app/assets/stylesheets/application.css +15 -0
  81. data/spec/rails/rails-5.0.4/app/channels/application_cable/channel.rb +4 -0
  82. data/spec/rails/rails-5.0.4/app/channels/application_cable/connection.rb +4 -0
  83. data/spec/rails/rails-5.0.4/app/controllers/application_controller.rb +3 -0
  84. data/spec/rails/rails-5.0.4/app/helpers/application_helper.rb +2 -0
  85. data/spec/rails/rails-5.0.4/app/jobs/application_job.rb +2 -0
  86. data/spec/rails/rails-5.0.4/app/mailers/application_mailer.rb +4 -0
  87. data/spec/rails/rails-5.0.4/app/mailers/post_mailer.rb +14 -0
  88. data/spec/rails/rails-5.0.4/app/mailers/user_mailer.rb +14 -0
  89. data/spec/rails/rails-5.0.4/app/models/application_record.rb +3 -0
  90. data/spec/rails/rails-5.0.4/app/models/post.rb +6 -0
  91. data/spec/rails/rails-5.0.4/app/models/register.rb +9 -0
  92. data/spec/rails/rails-5.0.4/app/models/user.rb +6 -0
  93. data/spec/rails/rails-5.0.4/app/notifiers/application_notifier.rb +2 -0
  94. data/spec/rails/rails-5.0.4/app/notifiers/post_notifier.rb +12 -0
  95. data/spec/rails/rails-5.0.4/app/notifiers/user_notifier.rb +12 -0
  96. data/spec/rails/rails-5.0.4/app/views/layouts/application.html.erb +14 -0
  97. data/spec/rails/rails-5.0.4/app/views/layouts/mailer.html.erb +13 -0
  98. data/spec/rails/rails-5.0.4/app/views/layouts/mailer.text.erb +1 -0
  99. data/spec/rails/rails-5.0.4/app/views/post_mailer/failure.html.erb +5 -0
  100. data/spec/rails/rails-5.0.4/app/views/post_mailer/failure.text.erb +3 -0
  101. data/spec/rails/rails-5.0.4/app/views/user_mailer/success.html.erb +5 -0
  102. data/spec/rails/rails-5.0.4/app/views/user_mailer/success.text.erb +3 -0
  103. data/spec/rails/rails-5.0.4/bin/bundle +3 -0
  104. data/spec/rails/rails-5.0.4/bin/rails +4 -0
  105. data/spec/rails/rails-5.0.4/bin/rake +4 -0
  106. data/spec/rails/rails-5.0.4/bin/setup +34 -0
  107. data/spec/rails/rails-5.0.4/bin/update +29 -0
  108. data/spec/rails/rails-5.0.4/config.ru +5 -0
  109. data/spec/rails/rails-5.0.4/config/application.rb +25 -0
  110. data/spec/rails/rails-5.0.4/config/boot.rb +3 -0
  111. data/spec/rails/rails-5.0.4/config/cable.yml +9 -0
  112. data/spec/rails/rails-5.0.4/config/database.yml +25 -0
  113. data/spec/rails/rails-5.0.4/config/environment.rb +8 -0
  114. data/spec/rails/rails-5.0.4/config/environments/development.rb +47 -0
  115. data/spec/rails/rails-5.0.4/config/environments/production.rb +78 -0
  116. data/spec/rails/rails-5.0.4/config/environments/test.rb +43 -0
  117. data/spec/rails/rails-5.0.4/config/initializers/application_controller_renderer.rb +6 -0
  118. data/spec/rails/rails-5.0.4/config/initializers/backtrace_silencers.rb +7 -0
  119. data/spec/rails/rails-5.0.4/config/initializers/cookies_serializer.rb +5 -0
  120. data/spec/rails/rails-5.0.4/config/initializers/filter_parameter_logging.rb +4 -0
  121. data/spec/rails/rails-5.0.4/config/initializers/inflections.rb +16 -0
  122. data/spec/rails/rails-5.0.4/config/initializers/mime_types.rb +4 -0
  123. data/spec/rails/rails-5.0.4/config/initializers/new_framework_defaults.rb +26 -0
  124. data/spec/rails/rails-5.0.4/config/initializers/pubsub_notifier.rb +10 -0
  125. data/spec/rails/rails-5.0.4/config/initializers/session_store.rb +3 -0
  126. data/spec/rails/rails-5.0.4/config/initializers/wrap_parameters.rb +14 -0
  127. data/spec/rails/rails-5.0.4/config/locales/en.yml +23 -0
  128. data/spec/rails/rails-5.0.4/config/puma.rb +47 -0
  129. data/spec/rails/rails-5.0.4/config/routes.rb +3 -0
  130. data/spec/rails/rails-5.0.4/config/secrets.yml +22 -0
  131. data/spec/rails/rails-5.0.4/db/migrate/20170714092740_create_users.rb +9 -0
  132. data/spec/rails/rails-5.0.4/db/migrate/20170714092741_create_posts.rb +9 -0
  133. data/spec/rails/rails-5.0.4/db/schema.rb +27 -0
  134. data/spec/rails/rails-5.0.4/db/seeds.rb +7 -0
  135. data/spec/rails/rails-5.0.4/db/test.sqlite3 +0 -0
  136. data/spec/rails/rails-5.0.4/log/test.log +723 -0
  137. data/spec/rails/rails-5.0.4/public/404.html +67 -0
  138. data/spec/rails/rails-5.0.4/public/422.html +67 -0
  139. data/spec/rails/rails-5.0.4/public/500.html +66 -0
  140. data/spec/rails/rails-5.0.4/public/apple-touch-icon-precomposed.png +0 -0
  141. data/spec/rails/rails-5.0.4/public/apple-touch-icon.png +0 -0
  142. data/spec/rails/rails-5.0.4/public/favicon.ico +0 -0
  143. data/spec/rails/rails-5.0.4/public/robots.txt +5 -0
  144. data/spec/rails/rails-5.1.2/README.md +24 -0
  145. data/spec/rails/rails-5.1.2/Rakefile +6 -0
  146. data/spec/rails/rails-5.1.2/app/assets/config/manifest.js +3 -0
  147. data/spec/rails/rails-5.1.2/app/assets/javascripts/application.js +15 -0
  148. data/spec/rails/rails-5.1.2/app/assets/javascripts/cable.js +13 -0
  149. data/spec/rails/rails-5.1.2/app/assets/stylesheets/application.css +15 -0
  150. data/spec/rails/rails-5.1.2/app/channels/application_cable/channel.rb +4 -0
  151. data/spec/rails/rails-5.1.2/app/channels/application_cable/connection.rb +4 -0
  152. data/spec/rails/rails-5.1.2/app/controllers/application_controller.rb +3 -0
  153. data/spec/rails/rails-5.1.2/app/helpers/application_helper.rb +2 -0
  154. data/spec/rails/rails-5.1.2/app/jobs/application_job.rb +2 -0
  155. data/spec/rails/rails-5.1.2/app/mailers/application_mailer.rb +4 -0
  156. data/spec/rails/rails-5.1.2/app/mailers/post_mailer.rb +14 -0
  157. data/spec/rails/rails-5.1.2/app/mailers/user_mailer.rb +14 -0
  158. data/spec/rails/rails-5.1.2/app/models/application_record.rb +3 -0
  159. data/spec/rails/rails-5.1.2/app/models/post.rb +6 -0
  160. data/spec/rails/rails-5.1.2/app/models/register.rb +9 -0
  161. data/spec/rails/rails-5.1.2/app/models/user.rb +6 -0
  162. data/spec/rails/rails-5.1.2/app/notifiers/application_notifier.rb +2 -0
  163. data/spec/rails/rails-5.1.2/app/notifiers/post_notifier.rb +12 -0
  164. data/spec/rails/rails-5.1.2/app/notifiers/user_notifier.rb +12 -0
  165. data/spec/rails/rails-5.1.2/app/views/layouts/application.html.erb +14 -0
  166. data/spec/rails/rails-5.1.2/app/views/layouts/mailer.html.erb +13 -0
  167. data/spec/rails/rails-5.1.2/app/views/layouts/mailer.text.erb +1 -0
  168. data/spec/rails/rails-5.1.2/app/views/post_mailer/failure.html.erb +5 -0
  169. data/spec/rails/rails-5.1.2/app/views/post_mailer/failure.text.erb +3 -0
  170. data/spec/rails/rails-5.1.2/app/views/user_mailer/success.html.erb +5 -0
  171. data/spec/rails/rails-5.1.2/app/views/user_mailer/success.text.erb +3 -0
  172. data/spec/rails/rails-5.1.2/bin/bundle +3 -0
  173. data/spec/rails/rails-5.1.2/bin/rails +4 -0
  174. data/spec/rails/rails-5.1.2/bin/rake +4 -0
  175. data/spec/rails/rails-5.1.2/bin/setup +38 -0
  176. data/spec/rails/rails-5.1.2/bin/update +29 -0
  177. data/spec/rails/rails-5.1.2/bin/yarn +11 -0
  178. data/spec/rails/rails-5.1.2/config.ru +5 -0
  179. data/spec/rails/rails-5.1.2/config/application.rb +31 -0
  180. data/spec/rails/rails-5.1.2/config/boot.rb +3 -0
  181. data/spec/rails/rails-5.1.2/config/cable.yml +10 -0
  182. data/spec/rails/rails-5.1.2/config/database.yml +25 -0
  183. data/spec/rails/rails-5.1.2/config/environment.rb +8 -0
  184. data/spec/rails/rails-5.1.2/config/environments/development.rb +47 -0
  185. data/spec/rails/rails-5.1.2/config/environments/production.rb +83 -0
  186. data/spec/rails/rails-5.1.2/config/environments/test.rb +43 -0
  187. data/spec/rails/rails-5.1.2/config/initializers/application_controller_renderer.rb +6 -0
  188. data/spec/rails/rails-5.1.2/config/initializers/backtrace_silencers.rb +7 -0
  189. data/spec/rails/rails-5.1.2/config/initializers/cookies_serializer.rb +5 -0
  190. data/spec/rails/rails-5.1.2/config/initializers/filter_parameter_logging.rb +4 -0
  191. data/spec/rails/rails-5.1.2/config/initializers/inflections.rb +16 -0
  192. data/spec/rails/rails-5.1.2/config/initializers/mime_types.rb +4 -0
  193. data/spec/rails/rails-5.1.2/config/initializers/pubsub_notifier.rb +10 -0
  194. data/spec/rails/rails-5.1.2/config/initializers/wrap_parameters.rb +14 -0
  195. data/spec/rails/rails-5.1.2/config/locales/en.yml +33 -0
  196. data/spec/rails/rails-5.1.2/config/puma.rb +56 -0
  197. data/spec/rails/rails-5.1.2/config/routes.rb +3 -0
  198. data/spec/rails/rails-5.1.2/config/secrets.yml +32 -0
  199. data/spec/rails/rails-5.1.2/db/migrate/20170714092754_create_users.rb +9 -0
  200. data/spec/rails/rails-5.1.2/db/migrate/20170714092755_create_posts.rb +9 -0
  201. data/spec/rails/rails-5.1.2/db/schema.rb +27 -0
  202. data/spec/rails/rails-5.1.2/db/seeds.rb +7 -0
  203. data/spec/rails/rails-5.1.2/db/test.sqlite3 +0 -0
  204. data/spec/rails/rails-5.1.2/log/test.log +917 -0
  205. data/spec/rails/rails-5.1.2/package.json +5 -0
  206. data/spec/rails/rails-5.1.2/public/404.html +67 -0
  207. data/spec/rails/rails-5.1.2/public/422.html +67 -0
  208. data/spec/rails/rails-5.1.2/public/500.html +66 -0
  209. data/spec/rails/rails-5.1.2/public/apple-touch-icon-precomposed.png +0 -0
  210. data/spec/rails/rails-5.1.2/public/apple-touch-icon.png +0 -0
  211. data/spec/rails/rails-5.1.2/public/favicon.ico +0 -0
  212. data/spec/rails/rails-5.1.2/public/robots.txt +1 -0
  213. data/spec/spec_helper.rb +43 -7
  214. data/spec/support/rails_template.rb +57 -0
  215. metadata +413 -11
  216. data/spec/support/models/member.rb +0 -6
  217. data/spec/support/models/user.rb +0 -6
  218. data/spec/support/notifiers/admin_notifier.rb +0 -13
  219. data/spec/support/notifiers/user_notifier.rb +0 -13
@@ -0,0 +1,43 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+ config.action_mailer.default_url_options = { :host => 'example.com' }
10
+
11
+ # Do not eager load code on boot. This avoids loading your whole application
12
+ # just for the purpose of running a single test. If you are using a tool that
13
+ # preloads Rails for running tests, you may have to set it to true.
14
+ config.eager_load = false
15
+
16
+ # Configure static file server for tests with Cache-Control for performance.
17
+ config.serve_static_files = true
18
+ config.static_cache_control = 'public, max-age=3600'
19
+
20
+ # Show full error reports and disable caching.
21
+ config.consider_all_requests_local = true
22
+ config.action_controller.perform_caching = false
23
+
24
+ # Raise exceptions instead of rendering exception templates.
25
+ config.action_dispatch.show_exceptions = false
26
+
27
+ # Disable request forgery protection in test environment.
28
+ config.action_controller.allow_forgery_protection = false
29
+
30
+ # Tell Action Mailer not to deliver emails to the real world.
31
+ # The :test delivery method accumulates sent emails in the
32
+ # ActionMailer::Base.deliveries array.
33
+ config.action_mailer.delivery_method = :test
34
+
35
+ # Randomize the order test cases are executed.
36
+ config.active_support.test_order = :random
37
+
38
+ # Print deprecation notices to the stderr.
39
+ config.active_support.deprecation = :stderr
40
+
41
+ # Raises error for missing translations
42
+ # config.action_view.raise_on_missing_translations = true
43
+ end
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure sensitive parameters which will be filtered from the log file.
4
+ Rails.application.config.filter_parameters += [:password]
@@ -0,0 +1,16 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format. Inflections
4
+ # are locale specific, and you may define rules for as many different
5
+ # locales as you wish. All of these examples are active by default:
6
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
7
+ # inflect.plural /^(ox)$/i, '\1en'
8
+ # inflect.singular /^(ox)en/i, '\1'
9
+ # inflect.irregular 'person', 'people'
10
+ # inflect.uncountable %w( fish sheep )
11
+ # end
12
+
13
+ # These inflection rules are supported but not enabled by default:
14
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
15
+ # inflect.acronym 'RESTful'
16
+ # end
@@ -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,10 @@
1
+ PubsubNotifier.config.logger = Rails.logger
2
+
3
+ require "pubsub_notifier/slack_client"
4
+
5
+ PubsubNotifier::SlackClient.configure do |config|
6
+ config.default_channel = ENV["SLACK_DEFAULT_CHANNEL"]
7
+ config.default_username = ENV["SLACK_DEFAULT_USERNAME"]
8
+ config.default_icon_emoji = ENV["SLACK_DEFAULT_ICON_EMOJI"]
9
+ config.webhook_url = ENV["SLACK_WEBHOOK_URL"]
10
+ end
@@ -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: '_rails-4_2_9_session'
@@ -0,0 +1,10 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Preserve the timezone of the receiver when calling to `to_time`.
4
+ # Ruby 2.4 will change the behavior of `to_time` to preserve the timezone
5
+ # when converting to an instance of `Time` instead of the previous behavior
6
+ # of converting to the local system timezone.
7
+ #
8
+ # Rails 5.0 introduced this config option so that apps made with earlier
9
+ # versions of Rails are not affected when upgrading.
10
+ ActiveSupport.to_time_preserves_timezone = true
@@ -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,56 @@
1
+ Rails.application.routes.draw do
2
+ # The priority is based upon order of creation: first created -> highest priority.
3
+ # See how all your routes lay out with "rake routes".
4
+
5
+ # You can have the root of your site routed with "root"
6
+ # root 'welcome#index'
7
+
8
+ # Example of regular route:
9
+ # get 'products/:id' => 'catalog#view'
10
+
11
+ # Example of named route that can be invoked with purchase_url(id: product.id)
12
+ # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
13
+
14
+ # Example resource route (maps HTTP verbs to controller actions automatically):
15
+ # resources :products
16
+
17
+ # Example resource route with options:
18
+ # resources :products do
19
+ # member do
20
+ # get 'short'
21
+ # post 'toggle'
22
+ # end
23
+ #
24
+ # collection do
25
+ # get 'sold'
26
+ # end
27
+ # end
28
+
29
+ # Example resource route with sub-resources:
30
+ # resources :products do
31
+ # resources :comments, :sales
32
+ # resource :seller
33
+ # end
34
+
35
+ # Example resource route with more complex sub-resources:
36
+ # resources :products do
37
+ # resources :comments
38
+ # resources :sales do
39
+ # get 'recent', on: :collection
40
+ # end
41
+ # end
42
+
43
+ # Example resource route with concerns:
44
+ # concern :toggleable do
45
+ # post 'toggle'
46
+ # end
47
+ # resources :posts, concerns: :toggleable
48
+ # resources :photos, concerns: :toggleable
49
+
50
+ # Example resource route within a namespace:
51
+ # namespace :admin do
52
+ # # Directs /admin/products/* to Admin::ProductsController
53
+ # # (app/controllers/admin/products_controller.rb)
54
+ # resources :products
55
+ # end
56
+ 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: b6c51f9cc64b341cf56c4f940fab1759bb9bac6d1c0ecba483855c951548916cc1cbf7bf022eeb2b41b30cdd4fc8db5b35aee3b3bfa110c202231c7c6bbb0fcc
15
+
16
+ test:
17
+ secret_key_base: 141806e4d3e1f7859ed8e076c39aa53c62da87e8fad0343b82d3c08a416f48c91938690f85adb3508faa094446e9773e851cc646e554aed0f28071a08eb88c2d
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,9 @@
1
+ class CreateUsers < ActiveRecord::Migration
2
+ def change
3
+ create_table :users do |t|
4
+ t.string :name
5
+
6
+ t.timestamps null: false
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class CreatePosts < ActiveRecord::Migration
2
+ def change
3
+ create_table :posts do |t|
4
+ t.string :name
5
+
6
+ t.timestamps null: false
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,28 @@
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: 20170714092727) do
15
+
16
+ create_table "posts", force: :cascade do |t|
17
+ t.string "name"
18
+ t.datetime "created_at", null: false
19
+ t.datetime "updated_at", null: false
20
+ end
21
+
22
+ create_table "users", force: :cascade do |t|
23
+ t.string "name"
24
+ t.datetime "created_at", null: false
25
+ t.datetime "updated_at", null: false
26
+ end
27
+
28
+ end
@@ -0,0 +1,7 @@
1
+ # This file should contain all the record creation needed to seed the database with its default values.
2
+ # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
3
+ #
4
+ # Examples:
5
+ #
6
+ # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
7
+ # Mayor.create(name: 'Emanuel', city: cities.first)
@@ -0,0 +1,272 @@
1
+  (0.9ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
2
+  (0.1ms) select sqlite_version(*)
3
+  (0.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
4
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5
+ Migrating to CreateUsers (20170714092725)
6
+  (0.0ms) begin transaction
7
+  (0.3ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
8
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20170714092725"]]
9
+  (0.5ms) commit transaction
10
+ Migrating to CreatePosts (20170714092727)
11
+  (0.0ms) begin transaction
12
+  (0.2ms) CREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
13
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20170714092727"]]
14
+  (0.4ms) commit transaction
15
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
16
+  (0.4ms) begin transaction
17
+  (0.0ms) SAVEPOINT active_record_1
18
+ SQL (0.4ms) INSERT INTO "users" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "name1"], ["created_at", "2017-07-14 09:27:30.289122"], ["updated_at", "2017-07-14 09:27:30.289122"]]
19
+  (0.0ms) RELEASE SAVEPOINT active_record_1
20
+ [PubsubNotifier::Client::LoggerClient#notify_failure] UserNotifier#failure called with User.
21
+ [PubsubNotifier::Client::LoggerClient#notify_failure] PostNotifier#failure called with User.
22
+  (2.0ms) rollback transaction
23
+  (0.0ms) begin transaction
24
+  (0.0ms) SAVEPOINT active_record_1
25
+ SQL (0.2ms) INSERT INTO "users" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "name2"], ["created_at", "2017-07-14 09:27:30.295712"], ["updated_at", "2017-07-14 09:27:30.295712"]]
26
+  (0.0ms) RELEASE SAVEPOINT active_record_1
27
+ [PubsubNotifier::Client::LoggerClient#notify_success] UserNotifier#success called with User.
28
+ [PubsubNotifier::Client::LoggerClient#notify_success] PostNotifier#success called with User.
29
+  (0.2ms) rollback transaction
30
+  (0.4ms) begin transaction
31
+  (0.0ms) SAVEPOINT active_record_1
32
+ SQL (0.4ms) INSERT INTO "users" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "name1"], ["created_at", "2017-07-14 09:29:18.969431"], ["updated_at", "2017-07-14 09:29:18.969431"]]
33
+  (0.0ms) RELEASE SAVEPOINT active_record_1
34
+ [PubsubNotifier::Client::LoggerClient#notify_failure] UserNotifier#failure called with User.
35
+ [PubsubNotifier::Client::LoggerClient#notify_failure] PostNotifier#failure called with User.
36
+  (2.0ms) rollback transaction
37
+  (0.0ms) begin transaction
38
+  (0.1ms) SAVEPOINT active_record_1
39
+ SQL (0.2ms) INSERT INTO "users" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "name2"], ["created_at", "2017-07-14 09:29:18.977207"], ["updated_at", "2017-07-14 09:29:18.977207"]]
40
+  (0.0ms) RELEASE SAVEPOINT active_record_1
41
+ [PubsubNotifier::Client::LoggerClient#notify_success] UserNotifier#success called with User.
42
+ [PubsubNotifier::Client::LoggerClient#notify_success] PostNotifier#success called with User.
43
+  (0.3ms) rollback transaction
44
+  (0.0ms) begin transaction
45
+  (0.0ms) rollback transaction
46
+  (0.0ms) begin transaction
47
+  (0.0ms) rollback transaction
48
+  (0.0ms) begin transaction
49
+  (0.0ms) rollback transaction
50
+  (0.0ms) begin transaction
51
+ #<ActiveJob::SerializationError: ActiveJob::SerializationError>
52
+  (0.0ms) rollback transaction
53
+  (0.0ms) begin transaction
54
+ [PubsubNotifier::Client::LoggerClient#notify_failure] message
55
+  (0.0ms) rollback transaction
56
+  (0.0ms) begin transaction
57
+ [PubsubNotifier::Client::LoggerClient#notify_success] message
58
+  (0.0ms) rollback transaction
59
+  (0.0ms) begin transaction
60
+  (0.0ms) rollback transaction
61
+  (0.0ms) begin transaction
62
+  (0.0ms) rollback transaction
63
+  (0.0ms) begin transaction
64
+  (0.0ms) rollback transaction
65
+  (0.0ms) begin transaction
66
+  (0.0ms) rollback transaction
67
+  (0.0ms) begin transaction
68
+  (0.0ms) rollback transaction
69
+  (0.0ms) begin transaction
70
+  (0.0ms) rollback transaction
71
+  (0.0ms) begin transaction
72
+  (0.0ms) rollback transaction
73
+  (0.0ms) begin transaction
74
+  (0.0ms) rollback transaction
75
+  (0.0ms) begin transaction
76
+  (0.0ms) rollback transaction
77
+  (0.0ms) begin transaction
78
+  (0.0ms) rollback transaction
79
+  (0.0ms) begin transaction
80
+  (0.0ms) rollback transaction
81
+  (0.0ms) begin transaction
82
+  (0.0ms) rollback transaction
83
+  (0.0ms) begin transaction
84
+  (0.0ms) rollback transaction
85
+  (0.0ms) begin transaction
86
+  (0.0ms) rollback transaction
87
+  (0.0ms) begin transaction
88
+  (0.0ms) rollback transaction
89
+  (0.0ms) begin transaction
90
+  (0.0ms) rollback transaction
91
+  (0.0ms) begin transaction
92
+  (0.0ms) rollback transaction
93
+  (0.0ms) begin transaction
94
+  (0.0ms) rollback transaction
95
+  (0.0ms) begin transaction
96
+  (0.0ms) rollback transaction
97
+  (0.1ms) begin transaction
98
+  (0.0ms) rollback transaction
99
+  (0.0ms) begin transaction
100
+  (0.0ms) rollback transaction
101
+  (0.0ms) begin transaction
102
+  (0.0ms) rollback transaction
103
+  (0.0ms) begin transaction
104
+  (0.0ms) rollback transaction
105
+  (0.1ms) begin transaction
106
+  (0.0ms) rollback transaction
107
+  (0.0ms) begin transaction
108
+  (0.0ms) rollback transaction
109
+  (0.0ms) begin transaction
110
+  (0.0ms) rollback transaction
111
+  (0.4ms) begin transaction
112
+ [PubsubNotifier::Client::LoggerClient#notify_failure] message
113
+  (0.0ms) rollback transaction
114
+  (0.0ms) begin transaction
115
+ [PubsubNotifier::Client::LoggerClient#notify_success] message
116
+  (0.0ms) rollback transaction
117
+  (0.0ms) begin transaction
118
+  (0.0ms) rollback transaction
119
+  (0.0ms) begin transaction
120
+  (0.0ms) rollback transaction
121
+  (0.0ms) begin transaction
122
+  (0.0ms) rollback transaction
123
+  (0.0ms) begin transaction
124
+  (0.0ms) rollback transaction
125
+  (0.0ms) begin transaction
126
+  (0.0ms) rollback transaction
127
+  (0.0ms) begin transaction
128
+  (0.0ms) rollback transaction
129
+  (0.0ms) begin transaction
130
+  (0.0ms) rollback transaction
131
+  (0.0ms) begin transaction
132
+  (0.0ms) rollback transaction
133
+  (0.0ms) begin transaction
134
+  (0.0ms) rollback transaction
135
+  (0.0ms) begin transaction
136
+  (0.1ms) rollback transaction
137
+  (0.0ms) begin transaction
138
+  (0.1ms) rollback transaction
139
+  (0.0ms) begin transaction
140
+  (0.0ms) rollback transaction
141
+  (0.0ms) begin transaction
142
+  (0.0ms) rollback transaction
143
+  (0.0ms) begin transaction
144
+  (0.0ms) rollback transaction
145
+  (0.0ms) begin transaction
146
+  (0.0ms) rollback transaction
147
+  (0.0ms) begin transaction
148
+  (0.0ms) rollback transaction
149
+  (0.0ms) begin transaction
150
+  (0.0ms) rollback transaction
151
+  (0.0ms) begin transaction
152
+  (0.0ms) rollback transaction
153
+  (0.0ms) begin transaction
154
+  (0.0ms) rollback transaction
155
+  (0.0ms) begin transaction
156
+  (0.0ms) rollback transaction
157
+  (0.0ms) begin transaction
158
+  (0.0ms) SAVEPOINT active_record_1
159
+ SQL (0.4ms) INSERT INTO "users" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "name1"], ["created_at", "2017-07-14 09:32:27.574950"], ["updated_at", "2017-07-14 09:32:27.574950"]]
160
+  (0.0ms) RELEASE SAVEPOINT active_record_1
161
+ [PubsubNotifier::Client::LoggerClient#notify_failure] UserNotifier#failure called with User.
162
+ [PubsubNotifier::Client::LoggerClient#notify_failure] PostNotifier#failure called with User.
163
+  (3.1ms) rollback transaction
164
+  (0.1ms) begin transaction
165
+  (0.0ms) SAVEPOINT active_record_1
166
+ SQL (0.2ms) INSERT INTO "users" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "name2"], ["created_at", "2017-07-14 09:32:27.582607"], ["updated_at", "2017-07-14 09:32:27.582607"]]
167
+  (0.0ms) RELEASE SAVEPOINT active_record_1
168
+ [PubsubNotifier::Client::LoggerClient#notify_success] UserNotifier#success called with User.
169
+ [PubsubNotifier::Client::LoggerClient#notify_success] PostNotifier#success called with User.
170
+  (0.3ms) rollback transaction
171
+  (0.0ms) begin transaction
172
+  (0.0ms) rollback transaction
173
+  (0.0ms) begin transaction
174
+  (0.0ms) rollback transaction
175
+  (0.0ms) begin transaction
176
+  (0.0ms) rollback transaction
177
+  (0.0ms) begin transaction
178
+  (0.0ms) rollback transaction
179
+  (0.0ms) begin transaction
180
+  (0.0ms) rollback transaction
181
+  (0.0ms) begin transaction
182
+  (0.0ms) rollback transaction
183
+  (0.0ms) begin transaction
184
+  (0.0ms) rollback transaction
185
+  (0.0ms) begin transaction
186
+  (0.0ms) rollback transaction
187
+  (0.0ms) begin transaction
188
+  (0.0ms) rollback transaction
189
+  (0.0ms) begin transaction
190
+ #<ActiveJob::SerializationError: ActiveJob::SerializationError>
191
+  (0.0ms) rollback transaction
192
+  (0.4ms) begin transaction
193
+  (0.0ms) rollback transaction
194
+  (0.0ms) begin transaction
195
+  (0.0ms) rollback transaction
196
+  (0.1ms) begin transaction
197
+  (0.0ms) rollback transaction
198
+  (0.0ms) begin transaction
199
+ [PubsubNotifier::Client::LoggerClient#notify_success] message
200
+  (0.0ms) rollback transaction
201
+  (0.0ms) begin transaction
202
+ [PubsubNotifier::Client::LoggerClient#notify_failure] message
203
+  (0.0ms) rollback transaction
204
+  (0.0ms) begin transaction
205
+  (0.0ms) rollback transaction
206
+  (0.0ms) begin transaction
207
+  (0.0ms) rollback transaction
208
+  (0.0ms) begin transaction
209
+  (0.0ms) rollback transaction
210
+  (0.0ms) begin transaction
211
+  (0.0ms) rollback transaction
212
+  (0.0ms) begin transaction
213
+  (0.0ms) rollback transaction
214
+  (0.0ms) begin transaction
215
+  (0.0ms) rollback transaction
216
+  (0.0ms) begin transaction
217
+ #<ActiveJob::SerializationError: ActiveJob::SerializationError>
218
+  (0.0ms) rollback transaction
219
+  (0.1ms) begin transaction
220
+  (0.0ms) rollback transaction
221
+  (0.0ms) begin transaction
222
+  (0.0ms) rollback transaction
223
+  (0.1ms) begin transaction
224
+  (0.0ms) rollback transaction
225
+  (0.0ms) begin transaction
226
+  (0.0ms) rollback transaction
227
+  (0.0ms) begin transaction
228
+  (0.0ms) rollback transaction
229
+  (0.0ms) begin transaction
230
+  (0.0ms) rollback transaction
231
+  (0.0ms) begin transaction
232
+  (0.1ms) rollback transaction
233
+  (0.1ms) begin transaction
234
+  (0.0ms) rollback transaction
235
+  (0.0ms) begin transaction
236
+  (0.1ms) rollback transaction
237
+  (0.0ms) begin transaction
238
+  (0.0ms) rollback transaction
239
+  (0.0ms) begin transaction
240
+  (0.0ms) rollback transaction
241
+  (0.0ms) begin transaction
242
+  (0.0ms) rollback transaction
243
+  (0.0ms) begin transaction
244
+  (0.0ms) rollback transaction
245
+  (0.0ms) begin transaction
246
+  (0.0ms) rollback transaction
247
+  (0.0ms) begin transaction
248
+  (0.0ms) rollback transaction
249
+  (0.0ms) begin transaction
250
+  (0.0ms) rollback transaction
251
+  (0.0ms) begin transaction
252
+  (0.0ms) rollback transaction
253
+  (0.0ms) begin transaction
254
+  (0.0ms) rollback transaction
255
+  (0.0ms) begin transaction
256
+  (0.0ms) rollback transaction
257
+  (0.0ms) begin transaction
258
+  (0.0ms) rollback transaction
259
+  (0.0ms) begin transaction
260
+  (0.1ms) SAVEPOINT active_record_1
261
+ SQL (0.5ms) INSERT INTO "users" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "name1"], ["created_at", "2017-07-14 09:41:37.770951"], ["updated_at", "2017-07-14 09:41:37.770951"]]
262
+  (0.0ms) RELEASE SAVEPOINT active_record_1
263
+ [PubsubNotifier::Client::LoggerClient#notify_success] UserNotifier#success called with User.
264
+ [PubsubNotifier::Client::LoggerClient#notify_success] PostNotifier#success called with User.
265
+  (2.1ms) rollback transaction
266
+  (0.1ms) begin transaction
267
+  (0.0ms) SAVEPOINT active_record_1
268
+ SQL (0.2ms) INSERT INTO "users" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "name2"], ["created_at", "2017-07-14 09:41:37.777991"], ["updated_at", "2017-07-14 09:41:37.777991"]]
269
+  (0.0ms) RELEASE SAVEPOINT active_record_1
270
+ [PubsubNotifier::Client::LoggerClient#notify_failure] UserNotifier#failure called with User.
271
+ [PubsubNotifier::Client::LoggerClient#notify_failure] PostNotifier#failure called with User.
272
+  (0.5ms) rollback transaction