weeler 1.6.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +5 -5
  2. data/.travis.yml +2 -10
  3. data/CHANGELOG.md +12 -0
  4. data/README.md +9 -21
  5. data/Rakefile +4 -4
  6. data/app/assets/javascripts/weeler/init.js +34 -0
  7. data/app/controllers/weeler/settings_controller.rb +1 -1
  8. data/app/controllers/weeler/translations_controller.rb +1 -1
  9. data/app/views/kaminari/weeler/_first_page.html.haml +3 -0
  10. data/app/views/kaminari/weeler/_gap.html.haml +2 -0
  11. data/app/views/kaminari/weeler/_last_page.html.haml +3 -0
  12. data/app/views/kaminari/weeler/_next_page.html.haml +3 -0
  13. data/app/views/kaminari/weeler/_page.html.haml +2 -0
  14. data/app/views/kaminari/weeler/_paginator.html.haml +11 -0
  15. data/app/views/kaminari/weeler/_prev_page.html.haml +3 -0
  16. data/lib/i18n/backend/weeler.rb +1 -1
  17. data/lib/weeler/action_controller/acts/restful.rb +1 -1
  18. data/lib/weeler/engine.rb +0 -2
  19. data/lib/weeler/version.rb +2 -2
  20. data/spec/controllers/translations_controller_spec.rb +8 -8
  21. data/spec/dummy/.ruby-version +1 -0
  22. data/spec/dummy/Rakefile +2 -2
  23. data/spec/dummy/app/assets/config/manifest.js +3 -0
  24. data/spec/dummy/app/assets/stylesheets/application.css +6 -4
  25. data/spec/dummy/app/channels/application_cable/channel.rb +4 -0
  26. data/spec/dummy/app/channels/application_cable/connection.rb +4 -0
  27. data/spec/dummy/app/controllers/application_controller.rb +0 -3
  28. data/spec/dummy/app/{assets/javascripts → javascript/packs}/application.js +5 -3
  29. data/spec/dummy/app/jobs/application_job.rb +7 -0
  30. data/spec/dummy/app/mailers/application_mailer.rb +4 -0
  31. data/spec/dummy/app/models/application_record.rb +3 -0
  32. data/spec/dummy/app/models/post.rb +1 -1
  33. data/spec/dummy/app/views/layouts/application.html.erb +9 -9
  34. data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
  35. data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
  36. data/spec/dummy/bin/rails +1 -1
  37. data/spec/dummy/bin/setup +33 -0
  38. data/spec/dummy/config.ru +2 -1
  39. data/spec/dummy/config/application.rb +19 -13
  40. data/spec/dummy/config/boot.rb +3 -3
  41. data/spec/dummy/config/cable.yml +10 -0
  42. data/spec/dummy/config/environment.rb +2 -2
  43. data/spec/dummy/config/environments/development.rb +38 -5
  44. data/spec/dummy/config/environments/production.rb +64 -32
  45. data/spec/dummy/config/environments/test.rb +20 -8
  46. data/spec/dummy/config/initializers/application_controller_renderer.rb +8 -0
  47. data/spec/dummy/config/initializers/assets.rb +12 -0
  48. data/spec/dummy/config/initializers/content_security_policy.rb +28 -0
  49. data/spec/dummy/config/initializers/cookies_serializer.rb +5 -0
  50. data/spec/dummy/config/initializers/mime_types.rb +0 -1
  51. data/spec/dummy/config/initializers/wrap_parameters.rb +2 -2
  52. data/spec/dummy/config/puma.rb +38 -0
  53. data/spec/dummy/config/spring.rb +6 -0
  54. data/spec/dummy/config/storage.yml +34 -0
  55. data/spec/dummy/db/migrate/20140123083704_create_weeler_seos.rb +1 -1
  56. data/spec/dummy/db/migrate/20140123083705_create_weeler_settings.rb +1 -1
  57. data/spec/dummy/db/migrate/20140123083706_create_weeler_translations.rb +1 -1
  58. data/spec/dummy/db/migrate/20140123083707_translate_weeler_seos.rb +1 -1
  59. data/spec/dummy/db/migrate/20140718103237_create_posts.rb +1 -1
  60. data/spec/dummy/db/migrate/20140726151210_create_translations.rb +1 -1
  61. data/spec/dummy/db/migrate/20160330161101_create_weeler_locks.rb +1 -1
  62. data/spec/dummy/db/migrate/20160330192005_create_weeler_translation_stats.rb +1 -1
  63. data/spec/dummy/db/schema.rb +56 -64
  64. data/spec/dummy/{app/mailers/.keep → db/test.sqlite3} +0 -0
  65. data/spec/dummy/log/development.log +0 -1020
  66. data/spec/dummy/public/404.html +24 -15
  67. data/spec/dummy/public/422.html +24 -15
  68. data/spec/dummy/public/500.html +23 -14
  69. data/spec/dummy/{app/models/.keep → public/apple-touch-icon-precomposed.png} +0 -0
  70. data/spec/dummy/public/apple-touch-icon.png +0 -0
  71. data/spec/dummy/storage/.keep +0 -0
  72. data/spec/factories/dummy_posts.rb +3 -3
  73. data/spec/factories/translations.rb +4 -4
  74. data/spec/spec_helper.rb +6 -4
  75. data/spec/weeler/action_controller/acts/restful_spec.rb +5 -4
  76. data/spec/weeler/i18n/backend/weeler_spec.rb +7 -7
  77. data/spec/weeler/i18n/humanize_missing_translations_spec.rb +14 -11
  78. data/weeler.gemspec +17 -12
  79. metadata +97 -58
  80. data/app/assets/javascripts/weeler/init.js.coffee +0 -26
  81. data/app/views/kaminari/weeler/_first_page.html.erb +0 -13
  82. data/app/views/kaminari/weeler/_gap.html.erb +0 -8
  83. data/app/views/kaminari/weeler/_last_page.html.erb +0 -13
  84. data/app/views/kaminari/weeler/_next_page.html.erb +0 -14
  85. data/app/views/kaminari/weeler/_page.html.erb +0 -12
  86. data/app/views/kaminari/weeler/_paginator.html.erb +0 -23
  87. data/app/views/kaminari/weeler/_prev_page.html.erb +0 -13
  88. data/lib/weeler/action_view/helpers/form_helper.rb +0 -13
  89. data/lib/weeler/action_view/helpers/image_form_helper.rb +0 -83
  90. data/spec/dummy/README.rdoc +0 -28
  91. data/spec/dummy/bin/bundle +0 -3
  92. data/spec/dummy/config/initializers/secret_token.rb +0 -12
  93. data/spec/dummy/config/initializers/session_store.rb +0 -3
  94. data/spec/dummy/log/production.log +0 -4
  95. data/spec/weeler/action_view/helpers/form_helper_spec.rb +0 -35
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: fea4149ae99f131b04cd70cd590aa35ac208faa4
4
- data.tar.gz: 3b2531ec56b936aaf6bdee72f6527feb551a2500
2
+ SHA256:
3
+ metadata.gz: f2174e5387e4473742f03bcb7d8676524c0909bf8ad711bb4a61b722c1d75834
4
+ data.tar.gz: 3c4250a6a160bf9cb62da039fc29e8d372d968ad05e02400ee1162bad4f61327
5
5
  SHA512:
6
- metadata.gz: 1550cb9a66e8ac1a3ba2db906ec69a08110e8147c4133beebfe604fc0617f83b49ecd915fa9a733f42147057e0598fda485ac0d5e994568697d812d4f8faa553
7
- data.tar.gz: da420f6968da1ea6749ca05df0649244938c1f8f7bbb83f8e9b78634efaaf23d6dcd0b84e95718170e4fab6da1c9edd6be8d996ce3c1415ccb0a3d2e2d4f579d
6
+ metadata.gz: '05382816c8433c45a716d23bccf68821c1d7872fb464ed353b291e0873e90cd6a5ee2be5a011112ed7674be33c205772de5849b3d72c095e626ebd924ee0b5d3'
7
+ data.tar.gz: 8ad0ed75b237f4bf39bbc47eaa4189100f9f6db5ee02342cf81fcbe8eafd52f70feeba24cb2ce45026f61f42f939eea66f231a88a72a882b3a18e840017eda82
@@ -7,16 +7,8 @@ sudo: false
7
7
  before_script:
8
8
  - psql -c 'create database travis_ci_test;' -U postgres
9
9
  rvm:
10
- - "2.2.2"
11
- - "2.2.3"
12
- - "2.2.4"
13
- - "2.2.5"
14
- - "2.2.6"
15
- - "2.3.0"
16
- - "2.3.1"
17
- - "2.3.2"
18
- - "2.3.3"
19
- - "2.4.0"
10
+ - "2.6.0"
11
+ - "2.7.0"
20
12
  # uncomment this line if your project needs to run something other than `rake`:
21
13
  script:
22
14
  - RAILS_ENV=test bundle exec rake db:migrate --trace
@@ -1,3 +1,15 @@
1
+ ## 2.0.0
2
+
3
+ ### Features & Enhancements
4
+
5
+ * Add Rails 6.0 support
6
+ * Add Ruby 2.6 - 2.7 support (drop other rubys)
7
+ * Removed 'image_upload_field' helper
8
+
9
+ ### Contributors
10
+
11
+ * Arturs Braucs
12
+
1
13
  ## 1.6.0
2
14
 
3
15
  ### Features & Enhancements
data/README.md CHANGED
@@ -7,12 +7,20 @@
7
7
 
8
8
  ## Installation
9
9
 
10
+ ### Rails 6.0
11
+
12
+ 2.0.0 version only supports Rails 6.0 and ruby 2.5 or higher version. In Gemfile include:
13
+
14
+ ```ruby
15
+ gem 'weeler', '~> 2.0'
16
+ ```
17
+
10
18
  ### Rails 5.0
11
19
 
12
20
  1.6.0 version only supports Rails 5.0 and ruby 2.2.2 and higher version. In Gemfile include:
13
21
 
14
22
  ```ruby
15
- gem 'weeler'
23
+ gem 'weeler', '~> 1.6'
16
24
  ```
17
25
 
18
26
  ### Rails 4.2
@@ -155,26 +163,6 @@ Also you can override all standart restful action view and implement, if you nee
155
163
 
156
164
  Weeler have default views for index, new, edit actions. You should override <tt>_form.html.haml</tt> partial.
157
165
 
158
- ### View helper image_upload_field :
159
-
160
- Weeler action view helper method.
161
- It creates file upload field with info and preview for image.
162
-
163
- e.g.
164
-
165
- <%= f.image_upload_field :image, size_info: "270x294" %>
166
-
167
- It creates:
168
-
169
- <div class="col-lg-10 col-md-10">
170
- <label class="col-lg-2 col-md-2 control-label" for="object_image">Image</label><div class="col-lg-5 col-md-5"><div class="row"><div class="col-lg-12 col-md-12"><input class="form-control" id="object_image" name="object[image]" type="file"></div></div><div class="row"><div class="col-lg-12 col-md-12">Size should be 270x294</div></div></div><div class="col-lg-5 col-md-5"><div class="row"><div class="col-lg-12 col-md-12"><img alt="Name" src="/images/name.jpg" style="height: 80px;"></div></div></div>
171
- </div>
172
-
173
- If you use another image handler than Paperclip, you can also pass <tt>image_url_method</tt> for image preview.
174
-
175
- Also with remove_image action in controller and route for that,
176
- it removes only image from object.
177
-
178
166
  ## Contributing
179
167
 
180
168
  1. Fork it
data/Rakefile CHANGED
@@ -1,5 +1,5 @@
1
- Bundler::GemHelper.install_tasks
2
- APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
3
- load 'rails/tasks/engine.rake'
1
+ require 'bundler/gem_tasks'
2
+ # require 'spec/dummy/tasks'
4
3
 
5
- require "bundler/gem_tasks"
4
+ APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
5
+ load 'rails/tasks/engine.rake'
@@ -0,0 +1,34 @@
1
+ //= require jquery
2
+ //= require jquery.turbolinks
3
+ //= require jquery-ui
4
+ //= require jquery_ujs
5
+ //= require turbolinks
6
+ //= require ./vendor/moment
7
+ //= require_tree ./vendor
8
+ //= require_tree ./lib
9
+ //= require weeler/app
10
+ //= require_self
11
+
12
+ (function() {
13
+ var app;
14
+
15
+ app = {
16
+ boot: function() {
17
+ $('.weeler-file-inputs').bootstrapFileInput();
18
+ sortable.init();
19
+ flash.init();
20
+ $('[data-provide="rowlink"],[data-provides="rowlink"]').each(function() {
21
+ return $(this).rowlink($(this).data());
22
+ });
23
+ $('.datepicker').datetimepicker({
24
+ format: 'DD/MM/YYYY'
25
+ });
26
+ return $('.datetimepicker').datetimepicker();
27
+ }
28
+ };
29
+
30
+ $(document).ready(function() {
31
+ return app.boot();
32
+ });
33
+
34
+ }).call(this);
@@ -6,7 +6,7 @@ class Weeler::SettingsController < Weeler::ConfigurationController
6
6
 
7
7
  def update
8
8
  @setting = Settings.unscoped.find(params[:id])
9
- if @setting.update_attributes(setting_params)
9
+ if @setting.update(setting_params)
10
10
  redirect_to weeler_settings_path, flash: {success: "Setting updated."}
11
11
  else
12
12
  flash.now[:error] = "Errors in updating."
@@ -30,7 +30,7 @@ module Weeler
30
30
  def update
31
31
  @translation = I18n::Backend::Weeler::Translation.find(params[:id])
32
32
 
33
- if @translation.update_attributes(translation_params)
33
+ if @translation.update(translation_params)
34
34
  Settings.i18n_updated_at = Time.now
35
35
 
36
36
  redirect_to ({ action: :edit, id: @translation }), flash: { success: "Translation updated." }
@@ -0,0 +1,3 @@
1
+ - unless current_page.first?
2
+ %li.first
3
+ = link_to "<<", url, {:remote => remote}
@@ -0,0 +1,2 @@
1
+ %li.page.gap.disabled
2
+ %a{:href => "javascript:void(0)"} ...
@@ -0,0 +1,3 @@
1
+ - unless current_page.last?
2
+ %li.last
3
+ = link_to ">>", url, {:remote => remote}
@@ -0,0 +1,3 @@
1
+ - unless current_page.last?
2
+ %li.next
3
+ = link_to ">", url, :remote => remote, :rel => 'next'
@@ -0,0 +1,2 @@
1
+ %li{:class => "page#{' active' if page.current?}"}
2
+ = link_to page, (page.current? ? 'javascript:void(0)' : url), opts = {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil}
@@ -0,0 +1,11 @@
1
+ = paginator.render do
2
+ %ul.pagination.pagination-lg.col-lg-12.col-md-12
3
+ = first_page_tag unless current_page.first?
4
+ = prev_page_tag unless current_page.first?
5
+ - each_page do |page|
6
+ - if page.left_outer? || page.right_outer? || page.inside_window?
7
+ = page_tag page
8
+ - elsif !page.was_truncated?
9
+ = gap_tag
10
+ = next_page_tag unless current_page.last?
11
+ = last_page_tag unless current_page.last?
@@ -0,0 +1,3 @@
1
+ - unless current_page.first?
2
+ %li.prev
3
+ = link_to "<", url, :remote => remote, :rel => 'prev'
@@ -118,7 +118,7 @@ module I18n
118
118
  translation = result.first
119
119
  if translation.value.blank?
120
120
  fallback_value = fallback_backend_translation locale, key
121
- translation.update_attributes value: fallback_value if fallback_value.present?
121
+ translation.update value: fallback_value if fallback_value.present?
122
122
  end
123
123
  return translation.value
124
124
  else
@@ -90,7 +90,7 @@ module Weeler
90
90
  end
91
91
 
92
92
  def update
93
- if @item.update_attributes(items_params)
93
+ if @item.update(items_params)
94
94
  after_update_action
95
95
  else
96
96
  render :action => 'edit'
@@ -1,6 +1,5 @@
1
1
  require "weeler/action_controller/acts/restful"
2
2
  require "weeler/action_dispatch/routing/mapper"
3
- require "weeler/action_view/helpers/form_helper"
4
3
  require "weeler/action_view/helpers/translation_helper"
5
4
 
6
5
  module Weeler
@@ -16,7 +15,6 @@ module Weeler
16
15
  ::ActionDispatch::Routing::Mapper.send(:include, Weeler::ActionDispatch::Routing::Mapper)
17
16
  ::ActionController::Base.send(:include, Weeler::ActionController::Acts::Restful)
18
17
 
19
- ::ActionView::Helpers::FormBuilder.send(:include, Weeler::ActionView::Helpers::FormHelper)
20
18
  ::ActionView::Base.send(:include, Weeler::ActionView::Helpers::TranslationHelper)
21
19
  end
22
20
 
@@ -1,7 +1,7 @@
1
1
  module Weeler
2
2
  module VERSION
3
- MAJOR = 1
4
- MINOR = 6
3
+ MAJOR = 2
4
+ MINOR = 0
5
5
  TINY = 0
6
6
  PRE = nil
7
7
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
@@ -10,8 +10,8 @@ describe Weeler::TranslationsController, type: :controller do
10
10
 
11
11
  describe "GET #index" do
12
12
  before do
13
- FactoryGirl.create(:translation, key: 'foo.bar')
14
- FactoryGirl.create(:translation, key: 'bar.foo')
13
+ FactoryBot.create(:translation, key: 'foo.bar')
14
+ FactoryBot.create(:translation, key: 'bar.foo')
15
15
  end
16
16
 
17
17
  it "list translations" do
@@ -25,7 +25,7 @@ describe Weeler::TranslationsController, type: :controller do
25
25
  expect(I18n.t("title", locale: :en)).to eq("Title")
26
26
  I18n::Backend::Weeler::Translation.delete_all
27
27
 
28
- post :create, params: { i18n_backend_weeler_translation: FactoryGirl.attributes_for(:translation) }
28
+ post :create, params: { i18n_backend_weeler_translation: FactoryBot.attributes_for(:translation) }
29
29
 
30
30
  expect(I18n.t("title", locale: :en)).to eq("This is weeler")
31
31
  end
@@ -44,7 +44,7 @@ describe Weeler::TranslationsController, type: :controller do
44
44
  describe "PUT #update" do
45
45
  it "update translation in DB" do
46
46
  I18n::Backend::Weeler::Translation.delete_all
47
- translation = FactoryGirl.create(:translation, key: 'foo.updated', value: nil)
47
+ translation = FactoryBot.create(:translation, key: 'foo.updated', value: nil)
48
48
 
49
49
  put "update", params: { id: translation.id, i18n_backend_weeler_translation: {value: "Updated weeler!"} }
50
50
  expect(I18n.t("foo.updated", locale: :en)).to eq("Updated weeler!")
@@ -52,7 +52,7 @@ describe Weeler::TranslationsController, type: :controller do
52
52
 
53
53
  it "dont updates if key is empty" do
54
54
  I18n::Backend::Weeler::Translation.delete_all
55
- translation = FactoryGirl.create(:translation, key: 'foo.updated', value: nil)
55
+ translation = FactoryBot.create(:translation, key: 'foo.updated', value: nil)
56
56
 
57
57
  put "update", params: { id: translation.id, i18n_backend_weeler_translation: {value: "Updated weeler!", key: nil} }
58
58
  expect(response).to render_template(:edit)
@@ -68,7 +68,7 @@ describe Weeler::TranslationsController, type: :controller do
68
68
 
69
69
  describe "GET #edit" do
70
70
  it "retern edit translation form" do
71
- translation = FactoryGirl.create(:translation, key: 'foo.updated', value: nil)
71
+ translation = FactoryBot.create(:translation, key: 'foo.updated', value: nil)
72
72
  get "edit", params: { id: translation.id }
73
73
  expect(response).to render_template(:edit)
74
74
  end
@@ -76,7 +76,7 @@ describe Weeler::TranslationsController, type: :controller do
76
76
 
77
77
  describe "DELETE #destroy" do
78
78
  it "destroys translation" do
79
- translation = FactoryGirl.create(:translation, key: 'foo.removing', value: "Bla bla")
79
+ translation = FactoryBot.create(:translation, key: 'foo.removing', value: "Bla bla")
80
80
  delete "destroy", params: { id: translation.id }
81
81
 
82
82
  expect(I18n.t("foo.removing", locale: :en)).to eq("Removing") # Returns empty key
@@ -110,7 +110,7 @@ describe Weeler::TranslationsController, type: :controller do
110
110
  it "retursns translation file" do
111
111
  get "export", format: :xlsx
112
112
  expect(response.headers["Content-Type"]).to eq("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
113
- expect(response.headers["Content-Disposition"]).to eq("attachment; filename=\"translations.xlsx\"")
113
+ expect(response.headers["Content-Disposition"]).to eq("attachment; filename=\"translations.xlsx\"; filename*=UTF-8''translations.xlsx")
114
114
  end
115
115
  end
116
116
 
@@ -0,0 +1 @@
1
+ ruby-2.7.0
@@ -1,6 +1,6 @@
1
1
  # Add your own tasks in files placed in lib/tasks ending in .rake,
2
2
  # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
3
 
4
- require File.expand_path('../config/application', __FILE__)
4
+ require_relative 'config/application'
5
5
 
6
- Dummy::Application.load_tasks
6
+ Rails.application.load_tasks
@@ -0,0 +1,3 @@
1
+ //= link_tree ../images
2
+ //= link_directory ../stylesheets .css
3
+ //= link faker_manifest.js
@@ -3,11 +3,13 @@
3
3
  * listed below.
4
4
  *
5
5
  * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
- * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
7
  *
8
- * You're free to add application-wide styles to this file and they'll appear at the top of the
9
- * compiled file, but it's generally better to create a new file per style scope.
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
+ * files in this directory. Styles in this file should be added after the last require_* statement.
11
+ * It is generally better to create a new file per style scope.
10
12
  *
11
- *= require_self
12
13
  *= require_tree .
14
+ *= require_self
13
15
  */
@@ -0,0 +1,4 @@
1
+ module ApplicationCable
2
+ class Channel < ActionCable::Channel::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module ApplicationCable
2
+ class Connection < ActionCable::Connection::Base
3
+ end
4
+ end
@@ -1,5 +1,2 @@
1
1
  class ApplicationController < ActionController::Base
2
- # Prevent CSRF attacks by raising an exception.
3
- # For APIs, you may want to use :null_session instead.
4
- protect_from_forgery with: :exception
5
2
  end
@@ -2,12 +2,14 @@
2
2
  // listed below.
3
3
  //
4
4
  // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
- // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
5
+ // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
6
  //
7
7
  // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
- // compiled file.
8
+ // compiled file. JavaScript code in this file should be added after the last require_* statement.
9
9
  //
10
- // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
10
+ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
11
  // about supported directives.
12
12
  //
13
+ //= require rails-ujs
14
+ //= require activestorage
13
15
  //= require_tree .
@@ -0,0 +1,7 @@
1
+ class ApplicationJob < ActiveJob::Base
2
+ # Automatically retry jobs that encountered a deadlock
3
+ # retry_on ActiveRecord::Deadlocked
4
+
5
+ # Most jobs are safe to ignore if the underlying records are no longer available
6
+ # discard_on ActiveJob::DeserializationError
7
+ end
@@ -0,0 +1,4 @@
1
+ class ApplicationMailer < ActionMailer::Base
2
+ default from: 'from@example.com'
3
+ layout 'mailer'
4
+ end
@@ -0,0 +1,3 @@
1
+ class ApplicationRecord < ActiveRecord::Base
2
+ self.abstract_class = true
3
+ end
@@ -3,7 +3,7 @@ class Post < ActiveRecord::Base
3
3
  has_many :translations
4
4
  accepts_nested_attributes_for :translations, :allow_destroy => true
5
5
 
6
- Image = Struct.new(:url) do
6
+ Image = Struct.new(:url) do
7
7
  def url(type = nil)
8
8
  type = "original" if type.blank?
9
9
  Rails.root.join("sample/#{type.to_s}.png")
@@ -1,14 +1,14 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
- <head>
4
- <title>Dummy</title>
5
- <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
6
- <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
7
- <%= csrf_meta_tags %>
8
- </head>
9
- <body>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= csrf_meta_tags %>
6
+ <%= csp_meta_tag %>
10
7
 
11
- <%= yield %>
8
+ <%= stylesheet_link_tag 'application', media: 'all' %>
9
+ </head>
12
10
 
13
- </body>
11
+ <body>
12
+ <%= yield %>
13
+ </body>
14
14
  </html>
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
+ <style>
6
+ /* Email styles need to be inline */
7
+ </style>
8
+ </head>
9
+
10
+ <body>
11
+ <%= yield %>
12
+ </body>
13
+ </html>