wobapphelpers 4.1.2 → 4.2.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.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/README.md +1 -1
  4. data/lib/generators/templates/erb/scaffold/_form.html.erb +12 -20
  5. data/lib/generators/templates/erb/scaffold/index.html.erb +43 -24
  6. data/lib/generators/templates/erb/scaffold/show.html.erb +20 -13
  7. data/lib/wobapphelpers/helpers/icon_helper.rb +1 -0
  8. data/lib/wobapphelpers/version.rb +2 -2
  9. data/test/dummy/app/controllers/application_controller.rb +1 -1
  10. data/test/dummy/config/application.rb +0 -2
  11. data/test/dummy/config/boot.rb +2 -4
  12. data/test/dummy/config/environment.rb +1 -1
  13. data/test/dummy/config/environments/development.rb +50 -11
  14. data/test/dummy/config/environments/production.rb +64 -27
  15. data/test/dummy/config/environments/test.rb +28 -14
  16. data/test/dummy/config/initializers/application_controller_renderer.rb +8 -0
  17. data/test/dummy/config/initializers/backtrace_silencers.rb +4 -3
  18. data/test/dummy/config/initializers/content_security_policy.rb +28 -0
  19. data/test/dummy/config/initializers/cookies_serializer.rb +3 -1
  20. data/test/dummy/config/initializers/filter_parameter_logging.rb +3 -1
  21. data/test/dummy/config/initializers/new_framework_defaults_6_1.rb +63 -0
  22. data/test/dummy/config/initializers/permissions_policy.rb +11 -0
  23. data/test/dummy/config/initializers/wrap_parameters.rb +2 -2
  24. data/test/dummy/config/puma.rb +43 -0
  25. data/test/dummy/db/migrate/20201224095623_add_service_name_to_active_storage_blobs.active_storage.rb +18 -0
  26. data/test/dummy/db/migrate/20201224095624_create_active_storage_variant_records.active_storage.rb +12 -0
  27. metadata +17 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df7c5424fa0826e39dd85f4f4e0e9ba738f4712db237a2b5b8373d34b5f5285e
4
- data.tar.gz: d4841615915834333aa3ed44f0f550482cd50ac6c6c194bab9346fa7a80712df
3
+ metadata.gz: b461d0fd48b611986501332be4b0867efd73430b40a7ad2ca8093c459e917d76
4
+ data.tar.gz: 642ee767f5d72db56976c34a53f27a152108dde5f41846b4851891d7e81238a0
5
5
  SHA512:
6
- metadata.gz: 670963ebb79163383d2f6c39ab47d6ef811bb35663440d3677e1b854729e27514ec6bdc0ab9e27a7e828ca26a4614542c86c59fd0633265cc31d06e531cf3620
7
- data.tar.gz: c7b647442b09ae16373becf5d72b55196feec5e5e75a28f4938154836b3e614cc59f597856f958e3d6dd55896fd696caf3c895d3cc6db21e35672ed368fb9d83
6
+ metadata.gz: c763a9d9103fbfc9f5bd378b7738319a59d8532036d003bb4ffc694f0d285cda136f83187121cafebc5b3fc4aad2459647db84e35f623ad48c9a0e40453ebfad
7
+ data.tar.gz: 1914eb04aec1dc9237fecaf44360eded2cab93d53bb19947fcc78cd156e8b30ed052947da52557bebd66d5999312bc450327fc935aea6ae9fa90437e5aac75fc
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2014-2020 Wolfgang Barth
3
+ Copyright (c) 2014-2021 Wolfgang Barth
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -156,7 +156,7 @@ other variable names you have to use :add_breadcrumbs_for, i.e.
156
156
  Licence
157
157
  -------
158
158
 
159
- Wobapphelpers Copyright (C) 2014-2020 Wolfgang Barth
159
+ Wobapphelpers Copyright (C) 2014-2021 Wolfgang Barth
160
160
 
161
161
  MIT License, see [LICENSE](LICENSE)
162
162
 
@@ -1,26 +1,18 @@
1
- <%%= simple_form_for(@<%= singular_table_name %>,
2
- html: { class: 'form-horizontal well' },
3
- wrapper: :horizontal_form,
4
- wrapper_mappings: {
5
- check_boxes: :horizontal_radio_and_checkboxes,
6
- radio_buttons: :horizontal_radio_and_checkboxes,
7
- file: :horizontal_file_input,
8
- boolean: :horizontal_boolean
9
- }) do |f| %>
1
+ <div class="container">
2
+ <%%= simple_form_for(@<%= singular_table_name %>,
3
+ html: { class: 'form-horizontal card' }) do |f| %>
10
4
 
11
- <fieldset>
12
- <%%= form_legend %>
13
-
14
- <div class="form-inputs">
15
- <%- attributes.each do |attribute| -%>
16
- <%%= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %><% (attribute.field_type == :date_select) ? ', as: :string' : '' %>
17
- %>
18
- <%- end -%>
5
+ <div class="card-header">
6
+ <%%= form_legend %>
19
7
  </div>
8
+ <div class="card-body">
9
+ <%- attributes.each do |attribute| -%>
10
+ <%%= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %><% (attribute.field_type == :date_select) ? ', as: :string' : '' %>
11
+ %>
12
+ <%- end -%>
20
13
 
21
- <div class="col-sm-9 col-sm-offset-3">
22
14
  <%%= f.button :submit, class: 'btn btn-primary' %>
23
15
  <%%= cancel_button %>
24
16
  </div>
25
- </fieldset>
26
- <%% end %>
17
+ <%% end %>
18
+ </div>
@@ -1,30 +1,49 @@
1
- <h1><%%= t('controller.<%= plural_table_name %>') %></h1>
1
+ <%% content_for :head do %>
2
+ <meta name="turbolinks-cache-control" content="no-cache">
3
+ <%% end %>
2
4
 
3
- <table id="dataTable" class="table table-bordered table-striped dataTable">
4
- <thead>
5
- <tr>
6
- <% attributes.each do |attribute| -%>
7
- <th><%%= t('attributes.<%= attribute.name %>') %></th>
8
- <% end -%>
9
- <th></th>
10
- </tr>
11
- </thead>
12
- <tbody>
5
+ <h1><%%= t('controller.<%= plural_table_name %>') %></h1>
13
6
 
14
- <%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| %>
15
- <%%= content_tag_for(:tr, <%= singular_table_name %>) do %>
16
- <% attributes.each do |attribute| -%>
17
- <td><%%= <%= singular_table_name %>.<%= attribute.name %> %></td>
18
- <% end -%>
19
- <td class="nowrap">
20
- <%%= show_link <%= singular_table_name %> %>
21
- <%%= edit_link <%= singular_table_name %> %>
22
- <%%= delete_link <%= singular_table_name %> %>
23
- </td>
7
+ <div data-controller="datatables">
8
+ <%%= content_tag :table, role: :datatable,
9
+ id: "<%= plural_table_name + "_table" %>",
10
+ class: "table table-bordered table-responsive-xl",
11
+ data: {
12
+ 'datatables-target': 'datatable',
13
+ order: [[0, 'desc']].to_json
14
+ } do %>
15
+ <thead>
16
+ <tr class="search">
17
+ <% attributes.each do |attribute| -%>
18
+ <th><%%= t('attributes.<%= attribute.name %>') %></th>
19
+ <% end -%>
20
+ <th class="nosort"><%%= t('daisy.action') %></th>
21
+ </tr>
22
+ </thead>
23
+ <tfoot>
24
+ <tr>
25
+ <% attributes.each do |attribute| -%>
26
+ <th></th>
27
+ <% end -%>
28
+ <th></th>
29
+ </tr>
30
+ </tfoot>
31
+ <tbody>
32
+ <%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| %>
33
+ <%%= content_tag_for(:tr, <%= singular_table_name %>) do %>
34
+ <% attributes.each do |attribute| -%>
35
+ <td><%%= <%= singular_table_name %>.<%= attribute.name %> %></td>
36
+ <% end -%>
37
+ <td class="text-nowrap">
38
+ <%%= show_link <%= singular_table_name %> %>
39
+ <%%= edit_link <%= singular_table_name %> %>
40
+ <%%= delete_link <%= singular_table_name %> %>
41
+ </td>
42
+ <%% end %>
43
+ <%% end %>
44
+ </tbody>
24
45
  <%% end %>
25
- <%% end %>
26
- </tbody>
27
- </table>
46
+ </div>
28
47
 
29
48
  <br />
30
49
 
@@ -1,15 +1,22 @@
1
- <table class="table table-bordered table-hover autowidth">
2
- <% attributes.each do |attribute| %>
3
- <tr>
4
- <th><%%= t('attributes.<%= attribute.name %>')%>:</th>
5
- <td><%%= @<%= singular_table_name %>.<%= attribute.name %> %></td>
6
- </tr>
7
- <% end -%>
8
- </table>
1
+ <div class="card">
2
+ <div class="card-header">
3
+ <h4><%%= t('activerecord.models.<%= singular_table_name %>') %></h4>
4
+ </div>
5
+ <div class="card-body">
6
+ <table class="table table-bordered table-hover autowidth">
7
+ <% attributes.each do |attribute| %>
8
+ <tr>
9
+ <th><%%= t('attributes.<%= attribute.name %>')%>:</th>
10
+ <td><%%= @<%= singular_table_name %>.<%= attribute.name %> %></td>
11
+ </tr>
12
+ <% end -%>
13
+ </table>
9
14
 
10
- <div role="toolbar">
11
- <%%= back_link %>
12
- <%%= edit_link(@<%= singular_table_name %>) %>
13
- <%%= delete_link(@<%= singular_table_name %>) %>
14
- <%%= new_link <%= class_name %> %>
15
+ <div role="toolbar">
16
+ <%%= back_link %>
17
+ <%%= edit_link(@<%= singular_table_name %>) %>
18
+ <%%= delete_link(@<%= singular_table_name %>) %>
19
+ <%%= new_link <%= class_name %> %>
20
+ </div>
21
+ </div>
15
22
  </div>
@@ -23,6 +23,7 @@ module Wobapphelpers
23
23
  show: 'eye',
24
24
  star: 'star',
25
25
  up: 'arrow-up',
26
+ link: 'link',
26
27
  }
27
28
 
28
29
  def icon(what)
@@ -1,4 +1,4 @@
1
1
  module Wobapphelpers
2
- VERSION = "4.1.2".freeze
3
- RELEASEDATE = "2020-10-03".freeze
2
+ VERSION = "4.2.0".freeze
3
+ RELEASEDATE = "2021-05-15".freeze
4
4
  end
@@ -13,7 +13,7 @@ class ApplicationController < ActionController::Base
13
13
  helper_method :current_user
14
14
 
15
15
  def current_user
16
- @current_user = User.new
16
+ @current_user = Minitest::Mock.new
17
17
  end
18
18
 
19
19
  end
@@ -26,8 +26,6 @@ module Dummy
26
26
  g.stylesheets false
27
27
  g.javascripts false
28
28
  end
29
-
30
- config.active_record.sqlite3.represent_boolean_as_integer = true
31
29
  end
32
30
  end
33
31
 
@@ -1,5 +1,3 @@
1
- # Set up gems listed in the Gemfile.
2
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
1
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
3
2
 
4
- require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
5
- $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
3
+ require "bundler/setup" # Set up gems listed in the Gemfile.
@@ -1,5 +1,5 @@
1
1
  # Load the Rails application.
2
- require File.expand_path('../application', __FILE__)
2
+ require_relative "application"
3
3
 
4
4
  # Initialize the Rails application.
5
5
  Rails.application.initialize!
@@ -1,37 +1,76 @@
1
+ require "active_support/core_ext/integer/time"
2
+
1
3
  Rails.application.configure do
2
4
  # Settings specified here will take precedence over those in config/application.rb.
3
5
 
4
- # In the development environment your application's code is reloaded on
5
- # every request. This slows down response time but is perfect for development
6
+ # In the development environment your application's code is reloaded any time
7
+ # it changes. This slows down response time but is perfect for development
6
8
  # since you don't have to restart the web server when you make code changes.
7
9
  config.cache_classes = false
8
10
 
9
11
  # Do not eager load code on boot.
10
12
  config.eager_load = false
11
13
 
12
- # Show full error reports and disable caching.
13
- config.consider_all_requests_local = true
14
- config.action_controller.perform_caching = false
14
+ # Show full error reports.
15
+ config.consider_all_requests_local = true
16
+
17
+ # Enable/disable caching. By default caching is disabled.
18
+ # Run rails dev:cache to toggle caching.
19
+ if Rails.root.join('tmp', 'caching-dev.txt').exist?
20
+ config.action_controller.perform_caching = true
21
+ config.action_controller.enable_fragment_cache_logging = true
22
+
23
+ config.cache_store = :memory_store
24
+ config.public_file_server.headers = {
25
+ 'Cache-Control' => "public, max-age=#{2.days.to_i}"
26
+ }
27
+ else
28
+ config.action_controller.perform_caching = false
29
+
30
+ config.cache_store = :null_store
31
+ end
32
+
33
+ # Store uploaded files on the local file system (see config/storage.yml for options).
34
+ config.active_storage.service = :local
15
35
 
16
36
  # Don't care if the mailer can't send.
17
37
  config.action_mailer.raise_delivery_errors = false
18
38
 
39
+ config.action_mailer.perform_caching = false
40
+
19
41
  # Print deprecation notices to the Rails logger.
20
42
  config.active_support.deprecation = :log
21
43
 
44
+ # Raise exceptions for disallowed deprecations.
45
+ config.active_support.disallowed_deprecation = :raise
46
+
47
+ # Tell Active Support which deprecation messages to disallow.
48
+ config.active_support.disallowed_deprecation_warnings = []
49
+
22
50
  # Raise an error on page load if there are pending migrations.
23
51
  config.active_record.migration_error = :page_load
24
52
 
53
+ # Highlight code that triggered database queries in logs.
54
+ config.active_record.verbose_query_logs = true
55
+
25
56
  # Debug mode disables concatenation and preprocessing of assets.
26
57
  # This option may cause significant delays in view rendering with a large
27
58
  # number of complex assets.
28
59
  config.assets.debug = true
29
60
 
30
- # Adds additional error checking when serving assets at runtime.
31
- # Checks for improperly declared sprockets dependencies.
32
- # Raises helpful error messages.
33
- config.assets.raise_runtime_errors = true
61
+ # Suppress logger output for asset requests.
62
+ config.assets.quiet = true
63
+
64
+ # Raises error for missing translations.
65
+ # config.i18n.raise_on_missing_translations = true
66
+
67
+ # Annotate rendered view with file names.
68
+ # config.action_view.annotate_rendered_view_with_filenames = true
69
+
70
+ # Use an evented file watcher to asynchronously detect changes in source code,
71
+ # routes, locales, etc. This feature depends on the listen gem.
72
+ config.file_watcher = ActiveSupport::EventedFileUpdateChecker
34
73
 
35
- # Raises error for missing translations
36
- # config.action_view.raise_on_missing_translations = true
74
+ # Uncomment if you wish to allow Action Cable access from any origin.
75
+ # config.action_cable.disable_request_forgery_protection = true
37
76
  end
@@ -1,3 +1,5 @@
1
+ require "active_support/core_ext/integer/time"
2
+
1
3
  Rails.application.configure do
2
4
  # Settings specified here will take precedence over those in config/application.rb.
3
5
 
@@ -14,52 +16,53 @@ Rails.application.configure do
14
16
  config.consider_all_requests_local = false
15
17
  config.action_controller.perform_caching = true
16
18
 
17
- # Enable Rack::Cache to put a simple HTTP cache in front of your application
18
- # Add `rack-cache` to your Gemfile before enabling this.
19
- # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
20
- # config.action_dispatch.rack_cache = true
19
+ # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
20
+ # or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
21
+ # config.require_master_key = true
21
22
 
22
- # Disable Rails's static asset server (Apache or nginx will already do this).
23
- config.serve_static_assets = false
23
+ # Disable serving static files from the `/public` folder by default since
24
+ # Apache or NGINX already handles this.
25
+ config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
24
26
 
25
- # Compress JavaScripts and CSS.
26
- config.assets.js_compressor = :uglifier
27
+ # Compress CSS using a preprocessor.
27
28
  # config.assets.css_compressor = :sass
28
29
 
29
30
  # Do not fallback to assets pipeline if a precompiled asset is missed.
30
31
  config.assets.compile = false
31
32
 
32
- # Generate digests for assets URLs.
33
- config.assets.digest = true
34
-
35
- # Version of your assets, change this if you want to expire all your assets.
36
- config.assets.version = '1.0'
33
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
34
+ # config.asset_host = 'http://assets.example.com'
37
35
 
38
36
  # Specifies the header that your server uses for sending files.
39
- # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
40
- # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
37
+ # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
38
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
39
+
40
+ # Store uploaded files on the local file system (see config/storage.yml for options).
41
+ config.active_storage.service = :local
42
+
43
+ # Mount Action Cable outside main process or domain.
44
+ # config.action_cable.mount_path = nil
45
+ # config.action_cable.url = 'wss://example.com/cable'
46
+ # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
41
47
 
42
48
  # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
43
49
  # config.force_ssl = true
44
50
 
45
- # Set to :debug to see everything in the log.
51
+ # Include generic and useful information about system operation, but avoid logging too much
52
+ # information to avoid inadvertent exposure of personally identifiable information (PII).
46
53
  config.log_level = :info
47
54
 
48
55
  # Prepend all log lines with the following tags.
49
- # config.log_tags = [ :subdomain, :uuid ]
50
-
51
- # Use a different logger for distributed setups.
52
- # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
56
+ config.log_tags = [ :request_id ]
53
57
 
54
58
  # Use a different cache store in production.
55
59
  # config.cache_store = :mem_cache_store
56
60
 
57
- # Enable serving of images, stylesheets, and JavaScripts from an asset server.
58
- # config.action_controller.asset_host = "http://assets.example.com"
61
+ # Use a real queuing backend for Active Job (and separate queues per environment).
62
+ # config.active_job.queue_adapter = :resque
63
+ # config.active_job.queue_name_prefix = "dummy_production"
59
64
 
60
- # Precompile additional assets.
61
- # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
62
- # config.assets.precompile += %w( search.js )
65
+ config.action_mailer.perform_caching = false
63
66
 
64
67
  # Ignore bad email addresses and do not raise email delivery errors.
65
68
  # Set this to true and configure the email server for immediate delivery to raise delivery errors.
@@ -72,12 +75,46 @@ Rails.application.configure do
72
75
  # Send deprecation notices to registered listeners.
73
76
  config.active_support.deprecation = :notify
74
77
 
75
- # Disable automatic flushing of the log to improve performance.
76
- # config.autoflush_log = false
78
+ # Log disallowed deprecations.
79
+ config.active_support.disallowed_deprecation = :log
80
+
81
+ # Tell Active Support which deprecation messages to disallow.
82
+ config.active_support.disallowed_deprecation_warnings = []
77
83
 
78
84
  # Use default logging formatter so that PID and timestamp are not suppressed.
79
85
  config.log_formatter = ::Logger::Formatter.new
80
86
 
87
+ # Use a different logger for distributed setups.
88
+ # require "syslog/logger"
89
+ # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
90
+
91
+ if ENV["RAILS_LOG_TO_STDOUT"].present?
92
+ logger = ActiveSupport::Logger.new(STDOUT)
93
+ logger.formatter = config.log_formatter
94
+ config.logger = ActiveSupport::TaggedLogging.new(logger)
95
+ end
96
+
81
97
  # Do not dump schema after migrations.
82
98
  config.active_record.dump_schema_after_migration = false
99
+
100
+ # Inserts middleware to perform automatic connection switching.
101
+ # The `database_selector` hash is used to pass options to the DatabaseSelector
102
+ # middleware. The `delay` is used to determine how long to wait after a write
103
+ # to send a subsequent read to the primary.
104
+ #
105
+ # The `database_resolver` class is used by the middleware to determine which
106
+ # database is appropriate to use based on the time delay.
107
+ #
108
+ # The `database_resolver_context` class is used by the middleware to set
109
+ # timestamps for the last write to the primary. The resolver uses the context
110
+ # class timestamps to determine how long to wait before reading from the
111
+ # replica.
112
+ #
113
+ # By default Rails will store a last write timestamp in the session. The
114
+ # DatabaseSelector middleware is designed as such you can define your own
115
+ # strategy for connection switching and pass that into the middleware through
116
+ # these configuration options.
117
+ # config.active_record.database_selector = { delay: 2.seconds }
118
+ # config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver
119
+ # config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session
83
120
  end
@@ -1,10 +1,13 @@
1
+ require "active_support/core_ext/integer/time"
2
+
3
+ # The test environment is used exclusively to run your application's
4
+ # test suite. You never need to work with it otherwise. Remember that
5
+ # your test database is "scratch space" for the test suite and is wiped
6
+ # and recreated between test runs. Don't rely on the data there!
7
+
1
8
  Rails.application.configure do
2
9
  # Settings specified here will take precedence over those in config/application.rb.
3
10
 
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
11
  config.cache_classes = true
9
12
 
10
13
  # Do not eager load code on boot. This avoids loading your whole application
@@ -12,13 +15,16 @@ Rails.application.configure do
12
15
  # preloads Rails for running tests, you may have to set it to true.
13
16
  config.eager_load = false
14
17
 
15
- # Configure static asset server for tests with Cache-Control for performance.
16
- # config.serve_static_assets = true
17
- config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
18
+ # Configure public file server for tests with Cache-Control for performance.
19
+ config.public_file_server.enabled = true
20
+ config.public_file_server.headers = {
21
+ 'Cache-Control' => "public, max-age=#{1.hour.to_i}"
22
+ }
18
23
 
19
24
  # Show full error reports and disable caching.
20
25
  config.consider_all_requests_local = true
21
26
  config.action_controller.perform_caching = false
27
+ config.cache_store = :null_store
22
28
 
23
29
  # Raise exceptions instead of rendering exception templates.
24
30
  config.action_dispatch.show_exceptions = false
@@ -26,6 +32,11 @@ Rails.application.configure do
26
32
  # Disable request forgery protection in test environment.
27
33
  config.action_controller.allow_forgery_protection = false
28
34
 
35
+ # Store uploaded files on the local file system in a temporary directory.
36
+ config.active_storage.service = :test
37
+
38
+ config.action_mailer.perform_caching = false
39
+
29
40
  # Tell Action Mailer not to deliver emails to the real world.
30
41
  # The :test delivery method accumulates sent emails in the
31
42
  # ActionMailer::Base.deliveries array.
@@ -34,12 +45,15 @@ Rails.application.configure do
34
45
  # Print deprecation notices to the stderr.
35
46
  config.active_support.deprecation = :stderr
36
47
 
37
- # Raises error for missing translations
38
- # config.action_view.raise_on_missing_translations = true
48
+ # Raise exceptions for disallowed deprecations.
49
+ config.active_support.disallowed_deprecation = :raise
39
50
 
40
- # -- Rails 4.2
41
- config.active_support.test_order = :sorted
42
- # config.serve_static_files = true
43
- # -- rails 5.0
44
- config.public_file_server.enabled = true
51
+ # Tell Active Support which deprecation messages to disallow.
52
+ config.active_support.disallowed_deprecation_warnings = []
53
+
54
+ # Raises error for missing translations.
55
+ # config.i18n.raise_on_missing_translations = true
56
+
57
+ # Annotate rendered view with file names.
58
+ # config.action_view.annotate_rendered_view_with_filenames = true
45
59
  end
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # ActiveSupport::Reloader.to_prepare do
4
+ # ApplicationController.renderer.defaults.merge!(
5
+ # http_host: 'example.org',
6
+ # https: false
7
+ # )
8
+ # end
@@ -1,7 +1,8 @@
1
1
  # Be sure to restart your server when you modify this file.
2
2
 
3
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/ }
4
+ # Rails.backtrace_cleaner.add_silencer { |line| /my_noisy_library/.match?(line) }
5
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!
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code
7
+ # by setting BACKTRACE=1 before calling your invocation, like "BACKTRACE=1 ./bin/rails runner 'MyClass.perform'".
8
+ Rails.backtrace_cleaner.remove_silencers! if ENV["BACKTRACE"]
@@ -0,0 +1,28 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Define an application-wide content security policy
4
+ # For further information see the following documentation
5
+ # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
6
+
7
+ # Rails.application.config.content_security_policy do |policy|
8
+ # policy.default_src :self, :https
9
+ # policy.font_src :self, :https, :data
10
+ # policy.img_src :self, :https, :data
11
+ # policy.object_src :none
12
+ # policy.script_src :self, :https
13
+ # policy.style_src :self, :https
14
+
15
+ # # Specify URI for violation reports
16
+ # # policy.report_uri "/csp-violation-report-endpoint"
17
+ # end
18
+
19
+ # If you are using UJS then enable automatic nonce generation
20
+ # Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) }
21
+
22
+ # Set the nonce only to specific directives
23
+ # Rails.application.config.content_security_policy_nonce_directives = %w(script-src)
24
+
25
+ # Report CSP violations to a specified URI
26
+ # For further information see the following documentation:
27
+ # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
28
+ # Rails.application.config.content_security_policy_report_only = true
@@ -1,3 +1,5 @@
1
1
  # Be sure to restart your server when you modify this file.
2
2
 
3
- Rails.application.config.action_dispatch.cookies_serializer = :json
3
+ # Specify a serializer for the signed and encrypted cookie jars.
4
+ # Valid options are :json, :marshal, and :hybrid.
5
+ Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -1,4 +1,6 @@
1
1
  # Be sure to restart your server when you modify this file.
2
2
 
3
3
  # Configure sensitive parameters which will be filtered from the log file.
4
- Rails.application.config.filter_parameters += [:password]
4
+ Rails.application.config.filter_parameters += [
5
+ :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
6
+ ]
@@ -0,0 +1,63 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file contains migration options to ease your Rails 6.1 upgrade.
4
+ #
5
+ # Once upgraded flip defaults one by one to migrate to the new default.
6
+ #
7
+ # Read the Guide for Upgrading Ruby on Rails for more info on each option.
8
+
9
+ # Support for inversing belongs_to -> has_many Active Record associations.
10
+ # Rails.application.config.active_record.has_many_inversing = true
11
+
12
+ # Track Active Storage variants in the database.
13
+ # Rails.application.config.active_storage.track_variants = true
14
+
15
+ # Apply random variation to the delay when retrying failed jobs.
16
+ # Rails.application.config.active_job.retry_jitter = 0.15
17
+
18
+ # Stop executing `after_enqueue`/`after_perform` callbacks if
19
+ # `before_enqueue`/`before_perform` respectively halts with `throw :abort`.
20
+ # Rails.application.config.active_job.skip_after_callbacks_if_terminated = true
21
+
22
+ # Specify cookies SameSite protection level: either :none, :lax, or :strict.
23
+ #
24
+ # This change is not backwards compatible with earlier Rails versions.
25
+ # It's best enabled when your entire app is migrated and stable on 6.1.
26
+ # Rails.application.config.action_dispatch.cookies_same_site_protection = :lax
27
+
28
+ # Generate CSRF tokens that are encoded in URL-safe Base64.
29
+ #
30
+ # This change is not backwards compatible with earlier Rails versions.
31
+ # It's best enabled when your entire app is migrated and stable on 6.1.
32
+ # Rails.application.config.action_controller.urlsafe_csrf_tokens = true
33
+
34
+ # Specify whether `ActiveSupport::TimeZone.utc_to_local` returns a time with an
35
+ # UTC offset or a UTC time.
36
+ # ActiveSupport.utc_to_local_returns_utc_offset_times = true
37
+
38
+ # Change the default HTTP status code to `308` when redirecting non-GET/HEAD
39
+ # requests to HTTPS in `ActionDispatch::SSL` middleware.
40
+ # Rails.application.config.action_dispatch.ssl_default_redirect_status = 308
41
+
42
+ # Use new connection handling API. For most applications this won't have any
43
+ # effect. For applications using multiple databases, this new API provides
44
+ # support for granular connection swapping.
45
+ # Rails.application.config.active_record.legacy_connection_handling = false
46
+
47
+ # Make `form_with` generate non-remote forms by default.
48
+ # Rails.application.config.action_view.form_with_generates_remote_forms = false
49
+
50
+ # Set the default queue name for the analysis job to the queue adapter default.
51
+ # Rails.application.config.active_storage.queues.analysis = nil
52
+
53
+ # Set the default queue name for the purge job to the queue adapter default.
54
+ # Rails.application.config.active_storage.queues.purge = nil
55
+
56
+ # Set the default queue name for the incineration job to the queue adapter default.
57
+ # Rails.application.config.action_mailbox.queues.incineration = nil
58
+
59
+ # Set the default queue name for the routing job to the queue adapter default.
60
+ # Rails.application.config.action_mailbox.queues.routing = nil
61
+
62
+ # Set the default queue name for the mail deliver job to the queue adapter default.
63
+ # Rails.application.config.action_mailer.deliver_later_queue_name = nil
@@ -0,0 +1,11 @@
1
+ # Define an application-wide HTTP permissions policy. For further
2
+ # information see https://developers.google.com/web/updates/2018/06/feature-policy
3
+ #
4
+ # Rails.application.config.permissions_policy do |f|
5
+ # f.camera :none
6
+ # f.gyroscope :none
7
+ # f.microphone :none
8
+ # f.usb :none
9
+ # f.fullscreen :self
10
+ # f.payment :self, "https://secure.example.com"
11
+ # end
@@ -5,10 +5,10 @@
5
5
 
6
6
  # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
7
  ActiveSupport.on_load(:action_controller) do
8
- wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
8
+ wrap_parameters format: [:json]
9
9
  end
10
10
 
11
11
  # To enable root element in JSON for ActiveRecord objects.
12
12
  # ActiveSupport.on_load(:active_record) do
13
- # self.include_root_in_json = true
13
+ # self.include_root_in_json = true
14
14
  # end
@@ -0,0 +1,43 @@
1
+ # Puma can serve each request in a thread from an internal thread pool.
2
+ # The `threads` method setting takes two numbers: a minimum and maximum.
3
+ # Any libraries that use thread pools should be configured to match
4
+ # the maximum value specified for Puma. Default is set to 5 threads for minimum
5
+ # and maximum; this matches the default thread size of Active Record.
6
+ #
7
+ max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
8
+ min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
9
+ threads min_threads_count, max_threads_count
10
+
11
+ # Specifies the `worker_timeout` threshold that Puma will use to wait before
12
+ # terminating a worker in development environments.
13
+ #
14
+ worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development"
15
+
16
+ # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
17
+ #
18
+ port ENV.fetch("PORT") { 3000 }
19
+
20
+ # Specifies the `environment` that Puma will run in.
21
+ #
22
+ environment ENV.fetch("RAILS_ENV") { "development" }
23
+
24
+ # Specifies the `pidfile` that Puma will use.
25
+ pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
26
+
27
+ # Specifies the number of `workers` to boot in clustered mode.
28
+ # Workers are forked web server processes. If using threads and workers together
29
+ # the concurrency of the application would be max `threads` * `workers`.
30
+ # Workers do not work on JRuby or Windows (both of which do not support
31
+ # processes).
32
+ #
33
+ # workers ENV.fetch("WEB_CONCURRENCY") { 2 }
34
+
35
+ # Use the `preload_app!` method when specifying a `workers` number.
36
+ # This directive tells Puma to first boot the application and load code
37
+ # before forking the application. This takes advantage of Copy On Write
38
+ # process behavior so workers use less memory.
39
+ #
40
+ # preload_app!
41
+
42
+ # Allow puma to be restarted by `rails restart` command.
43
+ plugin :tmp_restart
@@ -0,0 +1,18 @@
1
+ # This migration comes from active_storage (originally 20190112182829)
2
+ class AddServiceNameToActiveStorageBlobs < ActiveRecord::Migration[6.0]
3
+ def up
4
+ unless column_exists?(:active_storage_blobs, :service_name)
5
+ add_column :active_storage_blobs, :service_name, :string
6
+
7
+ if configured_service = ActiveStorage::Blob.service.name
8
+ ActiveStorage::Blob.unscoped.update_all(service_name: configured_service)
9
+ end
10
+
11
+ change_column :active_storage_blobs, :service_name, :string, null: false
12
+ end
13
+ end
14
+
15
+ def down
16
+ remove_column :active_storage_blobs, :service_name
17
+ end
18
+ end
@@ -0,0 +1,12 @@
1
+ # This migration comes from active_storage (originally 20191206030411)
2
+ class CreateActiveStorageVariantRecords < ActiveRecord::Migration[6.0]
3
+ def change
4
+ create_table :active_storage_variant_records do |t|
5
+ t.belongs_to :blob, null: false, index: false
6
+ t.string :variation_digest, null: false
7
+
8
+ t.index %i[ blob_id variation_digest ], name: "index_active_storage_variant_records_uniqueness", unique: true
9
+ t.foreign_key :active_storage_blobs, column: :blob_id
10
+ end
11
+ end
12
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wobapphelpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.2
4
+ version: 4.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wolfgang Barth
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-03 00:00:00.000000000 Z
11
+ date: 2021-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sassc-rails
@@ -337,20 +337,27 @@ files:
337
337
  - test/dummy/config/environments/development.rb
338
338
  - test/dummy/config/environments/production.rb
339
339
  - test/dummy/config/environments/test.rb
340
+ - test/dummy/config/initializers/application_controller_renderer.rb
340
341
  - test/dummy/config/initializers/assets.rb
341
342
  - test/dummy/config/initializers/backtrace_silencers.rb
343
+ - test/dummy/config/initializers/content_security_policy.rb
342
344
  - test/dummy/config/initializers/cookies_serializer.rb
343
345
  - test/dummy/config/initializers/filter_parameter_logging.rb
344
346
  - test/dummy/config/initializers/inflections.rb
345
347
  - test/dummy/config/initializers/mime_types.rb
348
+ - test/dummy/config/initializers/new_framework_defaults_6_1.rb
349
+ - test/dummy/config/initializers/permissions_policy.rb
346
350
  - test/dummy/config/initializers/session_store.rb
347
351
  - test/dummy/config/initializers/simple_form.rb
348
352
  - test/dummy/config/initializers/simple_form_bootstrap.rb
349
353
  - test/dummy/config/initializers/wobapphelpers.rb
350
354
  - test/dummy/config/initializers/wrap_parameters.rb
355
+ - test/dummy/config/puma.rb
351
356
  - test/dummy/config/routes.rb
352
357
  - test/dummy/db/migrate/20140420155942_create_posts.rb
353
358
  - test/dummy/db/migrate/20140516164637_create_blogs.rb
359
+ - test/dummy/db/migrate/20201224095623_add_service_name_to_active_storage_blobs.active_storage.rb
360
+ - test/dummy/db/migrate/20201224095624_create_active_storage_variant_records.active_storage.rb
354
361
  - test/dummy/db/schema.rb
355
362
  - test/dummy/lib/templates/rails/scaffold_controller/controller.rb
356
363
  - test/generators/install_generator_test.rb
@@ -387,7 +394,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
387
394
  - !ruby/object:Gem::Version
388
395
  version: '0'
389
396
  requirements: []
390
- rubygems_version: 3.0.3
397
+ rubygems_version: 3.1.6
391
398
  signing_key:
392
399
  specification_version: 4
393
400
  summary: Rails helpers and more shared between wob's rails applications
@@ -419,24 +426,31 @@ test_files:
419
426
  - test/dummy/app/models/blog.rb
420
427
  - test/dummy/app/models/post.rb
421
428
  - test/dummy/db/schema.rb
429
+ - test/dummy/db/migrate/20201224095623_add_service_name_to_active_storage_blobs.active_storage.rb
422
430
  - test/dummy/db/migrate/20140516164637_create_blogs.rb
431
+ - test/dummy/db/migrate/20201224095624_create_active_storage_variant_records.active_storage.rb
423
432
  - test/dummy/db/migrate/20140420155942_create_posts.rb
424
433
  - test/dummy/config/environment.rb
425
434
  - test/dummy/config/initializers/assets.rb
435
+ - test/dummy/config/initializers/content_security_policy.rb
426
436
  - test/dummy/config/initializers/backtrace_silencers.rb
427
437
  - test/dummy/config/initializers/inflections.rb
428
438
  - test/dummy/config/initializers/mime_types.rb
429
439
  - test/dummy/config/initializers/session_store.rb
430
440
  - test/dummy/config/initializers/cookies_serializer.rb
431
441
  - test/dummy/config/initializers/filter_parameter_logging.rb
442
+ - test/dummy/config/initializers/application_controller_renderer.rb
432
443
  - test/dummy/config/initializers/simple_form.rb
433
444
  - test/dummy/config/initializers/simple_form_bootstrap.rb
445
+ - test/dummy/config/initializers/new_framework_defaults_6_1.rb
434
446
  - test/dummy/config/initializers/wobapphelpers.rb
435
447
  - test/dummy/config/initializers/wrap_parameters.rb
448
+ - test/dummy/config/initializers/permissions_policy.rb
436
449
  - test/dummy/config/boot.rb
437
450
  - test/dummy/config/application.rb
438
451
  - test/dummy/config/environments/development.rb
439
452
  - test/dummy/config/environments/production.rb
440
453
  - test/dummy/config/environments/test.rb
441
454
  - test/dummy/config/routes.rb
455
+ - test/dummy/config/puma.rb
442
456
  - test/dummy/lib/templates/rails/scaffold_controller/controller.rb