carrierwave_backgrounder 1.0.2 → 1.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 (42) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby-ci.yml +43 -0
  3. data/.gitignore +2 -0
  4. data/CHANGELOG.md +15 -0
  5. data/README.md +5 -12
  6. data/carrierwave_backgrounder.gemspec +5 -2
  7. data/lib/backgrounder/support/backends.rb +17 -5
  8. data/lib/backgrounder/version.rb +1 -1
  9. data/lib/backgrounder/workers/base.rb +2 -1
  10. data/lib/backgrounder/workers/process_asset_mixin.rb +3 -0
  11. data/lib/carrierwave_backgrounder.rb +7 -13
  12. data/lib/generators/carrierwave_backgrounder/templates/config/initializers/carrierwave_backgrounder.rb +3 -0
  13. data/spec/backgrounder/orm/activemodel_spec.rb +1 -2
  14. data/spec/backgrounder/support/backends_spec.rb +3 -1
  15. data/spec/integrations/process_in_background_spec.rb +29 -0
  16. data/spec/integrations/queue_name_spec.rb +68 -0
  17. data/spec/integrations/store_in_background_spec.rb +34 -0
  18. data/spec/rails_helper.rb +13 -0
  19. data/spec/support/dummy_app/Gemfile +3 -4
  20. data/spec/support/dummy_app/app/jobs/portrait_process_job.rb +5 -0
  21. data/spec/support/dummy_app/app/models/admin.rb +1 -1
  22. data/spec/support/dummy_app/app/models/user.rb +4 -1
  23. data/spec/support/dummy_app/app/uploaders/avatar_uploader.rb +1 -0
  24. data/spec/support/dummy_app/bin/ci +6 -0
  25. data/spec/support/dummy_app/bin/dev +2 -0
  26. data/spec/support/dummy_app/bin/setup +7 -5
  27. data/spec/support/dummy_app/config/application.rb +6 -1
  28. data/spec/support/dummy_app/config/ci.rb +14 -0
  29. data/spec/support/dummy_app/config/environments/development.rb +19 -29
  30. data/spec/support/dummy_app/config/environments/production.rb +35 -54
  31. data/spec/support/dummy_app/config/environments/test.rb +16 -36
  32. data/spec/support/dummy_app/config/initializers/carrierwave_backgrounder.rb +3 -0
  33. data/spec/support/dummy_app/config/initializers/cors.rb +1 -1
  34. data/spec/support/dummy_app/config/initializers/filter_parameter_logging.rb +4 -4
  35. data/spec/support/dummy_app/config/initializers/new_framework_defaults_8_0.rb +30 -0
  36. data/spec/support/dummy_app/config/initializers/new_framework_defaults_8_1.rb +74 -0
  37. data/spec/support/dummy_app/config/puma.rb +42 -0
  38. data/spec/support/dummy_app/db/migrate/20250926184915_add_columns_for_portrait.rb +7 -0
  39. data/spec/support/dummy_app/db/schema.rb +4 -2
  40. data/spec/support/mock_worker.rb +6 -0
  41. metadata +26 -12
  42. data/.travis.yml +0 -20
@@ -3,10 +3,8 @@ require "active_support/core_ext/integer/time"
3
3
  Rails.application.configure do
4
4
  # Settings specified here will take precedence over those in config/application.rb.
5
5
 
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
8
- # since you don't have to restart the web server when you make code changes.
9
- config.cache_classes = false
6
+ # Make code changes take effect immediately without server restart.
7
+ config.enable_reloading = true
10
8
 
11
9
  # Do not eager load code on boot.
12
10
  config.eager_load = false
@@ -14,52 +12,44 @@ Rails.application.configure do
14
12
  # Show full error reports.
15
13
  config.consider_all_requests_local = true
16
14
 
17
- # Enable server timing
15
+ # Enable server timing.
18
16
  config.server_timing = true
19
17
 
20
- # Enable/disable caching. By default caching is disabled.
21
- # Run rails dev:cache to toggle caching.
18
+ # Enable/disable Action Controller caching. By default Action Controller caching is disabled.
19
+ # Run rails dev:cache to toggle Action Controller caching.
22
20
  if Rails.root.join("tmp/caching-dev.txt").exist?
23
- config.cache_store = :memory_store
24
- config.public_file_server.headers = {
25
- "Cache-Control" => "public, max-age=#{2.days.to_i}"
26
- }
21
+ config.public_file_server.headers = { "cache-control" => "public, max-age=#{2.days.to_i}" }
27
22
  else
28
23
  config.action_controller.perform_caching = false
29
-
30
- config.cache_store = :null_store
31
24
  end
32
25
 
33
- # Store uploaded files on the local file system (see config/storage.yml for options).
34
- # config.active_storage.service = :local
35
-
36
- # Don't care if the mailer can't send.
37
- # config.action_mailer.raise_delivery_errors = false
38
-
39
- # config.action_mailer.perform_caching = false
26
+ # Change to :null_store to avoid any caching.
27
+ config.cache_store = :memory_store
40
28
 
41
29
  # Print deprecation notices to the Rails logger.
42
30
  config.active_support.deprecation = :log
43
31
 
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
-
50
32
  # Raise an error on page load if there are pending migrations.
51
33
  config.active_record.migration_error = :page_load
52
34
 
53
35
  # Highlight code that triggered database queries in logs.
54
36
  config.active_record.verbose_query_logs = true
55
37
 
38
+ # Append comments with runtime information tags to SQL queries in logs.
39
+ config.active_record.query_log_tags_enabled = true
40
+
41
+ # Highlight code that enqueued background job in logs.
42
+ config.active_job.verbose_enqueue_logs = true
43
+
44
+ # Highlight code that triggered redirect in logs.
45
+ config.action_dispatch.verbose_redirect_logs = true
56
46
 
57
47
  # Raises error for missing translations.
58
48
  # config.i18n.raise_on_missing_translations = true
59
49
 
60
50
  # Annotate rendered view with file names.
61
- # config.action_view.annotate_rendered_view_with_filenames = true
51
+ config.action_view.annotate_rendered_view_with_filenames = true
62
52
 
63
- # Uncomment if you wish to allow Action Cable access from any origin.
64
- # config.action_cable.disable_request_forgery_protection = true
53
+ # Raise error when a before_action's only/except options reference missing actions.
54
+ config.action_controller.raise_on_missing_callback_actions = true
65
55
  end
@@ -4,83 +4,64 @@ Rails.application.configure do
4
4
  # Settings specified here will take precedence over those in config/application.rb.
5
5
 
6
6
  # Code is not reloaded between requests.
7
- config.cache_classes = true
7
+ config.enable_reloading = false
8
8
 
9
- # Eager load code on boot. This eager loads most of Rails and
10
- # your application in memory, allowing both threaded web servers
11
- # and those relying on copy on write to perform better.
12
- # Rake tasks automatically ignore this option for performance.
9
+ # Eager load code on boot for better performance and memory savings (ignored by Rake tasks).
13
10
  config.eager_load = true
14
11
 
15
- # Full error reports are disabled and caching is turned on.
16
- config.consider_all_requests_local = false
12
+ # Full error reports are disabled.
13
+ config.consider_all_requests_local = false
17
14
 
18
- # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
19
- # or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
20
- # config.require_master_key = true
21
-
22
- # Disable serving static files from the `/public` folder by default since
23
- # Apache or NGINX already handles this.
24
- config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
15
+ # Cache assets for far-future expiry since they are all digest stamped.
16
+ config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" }
25
17
 
26
18
  # Enable serving of images, stylesheets, and JavaScripts from an asset server.
27
19
  # config.asset_host = "http://assets.example.com"
28
20
 
29
- # Specifies the header that your server uses for sending files.
30
- # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
31
- # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX
32
-
33
- # Store uploaded files on the local file system (see config/storage.yml for options).
34
- # config.active_storage.service = :local
35
-
36
- # Mount Action Cable outside main process or domain.
37
- # config.action_cable.mount_path = nil
38
- # config.action_cable.url = "wss://example.com/cable"
39
- # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ]
21
+ # Assume all access to the app is happening through a SSL-terminating reverse proxy.
22
+ # config.assume_ssl = true
40
23
 
41
24
  # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
42
25
  # config.force_ssl = true
43
26
 
44
- # Include generic and useful information about system operation, but avoid logging too much
45
- # information to avoid inadvertent exposure of personally identifiable information (PII).
46
- config.log_level = :info
27
+ # Skip http-to-https redirect for the default health check endpoint.
28
+ # config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } }
47
29
 
48
- # Prepend all log lines with the following tags.
30
+ # Log to STDOUT with the current request id as a default log tag.
49
31
  config.log_tags = [ :request_id ]
32
+ config.logger = ActiveSupport::TaggedLogging.logger(STDOUT)
50
33
 
51
- # Use a different cache store in production.
52
- # config.cache_store = :mem_cache_store
53
-
54
- # Use a real queuing backend for Active Job (and separate queues per environment).
55
- # config.active_job.queue_adapter = :resque
56
- # config.active_job.queue_name_prefix = "dummy_app_production"
57
-
58
- config.action_mailer.perform_caching = false
34
+ # Change to "debug" to log everything (including potentially personally-identifiable information!).
35
+ config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
59
36
 
60
- # Ignore bad email addresses and do not raise email delivery errors.
61
- # Set this to true and configure the email server for immediate delivery to raise delivery errors.
62
- # config.action_mailer.raise_delivery_errors = false
63
-
64
- # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
65
- # the I18n.default_locale when a translation cannot be found).
66
- config.i18n.fallbacks = true
37
+ # Prevent health checks from clogging up the logs.
38
+ config.silence_healthcheck_path = "/up"
67
39
 
68
40
  # Don't log any deprecations.
69
41
  config.active_support.report_deprecations = false
70
42
 
71
- # Use default logging formatter so that PID and timestamp are not suppressed.
72
- config.log_formatter = ::Logger::Formatter.new
43
+ # Replace the default in-process memory cache store with a durable alternative.
44
+ # config.cache_store = :mem_cache_store
73
45
 
74
- # Use a different logger for distributed setups.
75
- # require "syslog/logger"
76
- # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name")
46
+ # Replace the default in-process and non-durable queuing backend for Active Job.
47
+ # config.active_job.queue_adapter = :resque
77
48
 
78
- if ENV["RAILS_LOG_TO_STDOUT"].present?
79
- logger = ActiveSupport::Logger.new(STDOUT)
80
- logger.formatter = config.log_formatter
81
- config.logger = ActiveSupport::TaggedLogging.new(logger)
82
- end
49
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
50
+ # the I18n.default_locale when a translation cannot be found).
51
+ config.i18n.fallbacks = true
83
52
 
84
53
  # Do not dump schema after migrations.
85
54
  config.active_record.dump_schema_after_migration = false
55
+
56
+ # Only use :id for inspections in production.
57
+ config.active_record.attributes_for_inspect = [ :id ]
58
+
59
+ # Enable DNS rebinding protection and other `Host` header attacks.
60
+ # config.hosts = [
61
+ # "example.com", # Allow requests from example.com
62
+ # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
63
+ # ]
64
+ #
65
+ # Skip DNS rebinding protection for the default health check endpoint.
66
+ # config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
86
67
  end
@@ -1,5 +1,3 @@
1
- require "active_support/core_ext/integer/time"
2
-
3
1
  # The test environment is used exclusively to run your application's
4
2
  # test suite. You never need to work with it otherwise. Remember that
5
3
  # your test database is "scratch space" for the test suite and is wiped
@@ -8,56 +6,38 @@ require "active_support/core_ext/integer/time"
8
6
  Rails.application.configure do
9
7
  # Settings specified here will take precedence over those in config/application.rb.
10
8
 
11
- # Turn false under Spring and add config.action_view.cache_template_loading = true.
12
- config.cache_classes = true
9
+ # While tests run files are not watched, reloading is not necessary.
10
+ config.enable_reloading = false
13
11
 
14
- # Eager loading loads your whole application. When running a single test locally,
15
- # this probably isn't necessary. It's a good idea to do in a continuous integration
16
- # system, or in some way before deploying your code.
12
+ # Eager loading loads your entire application. When running a single test locally,
13
+ # this is usually not necessary, and can slow down your test suite. However, it's
14
+ # recommended that you enable it in continuous integration systems to ensure eager
15
+ # loading is working properly before deploying your code.
17
16
  config.eager_load = ENV["CI"].present?
18
17
 
19
- # Configure public file server for tests with Cache-Control for performance.
20
- config.public_file_server.enabled = true
21
- config.public_file_server.headers = {
22
- "Cache-Control" => "public, max-age=#{1.hour.to_i}"
23
- }
18
+ # Configure public file server for tests with cache-control for performance.
19
+ config.public_file_server.headers = { "cache-control" => "public, max-age=3600" }
24
20
 
25
- # Show full error reports and disable caching.
26
- config.consider_all_requests_local = true
27
- config.action_controller.perform_caching = false
21
+ # Show full error reports.
22
+ config.consider_all_requests_local = true
28
23
  config.cache_store = :null_store
29
24
 
30
- # Raise exceptions instead of rendering exception templates.
31
- config.action_dispatch.show_exceptions = false
25
+ # Render exception templates for rescuable exceptions and raise for other exceptions.
26
+ config.action_dispatch.show_exceptions = :rescuable
32
27
 
33
28
  # Disable request forgery protection in test environment.
34
29
  config.action_controller.allow_forgery_protection = false
35
30
 
36
- # Store uploaded files on the local file system in a temporary directory.
37
- # config.active_storage.service = :test
38
-
39
- # config.action_mailer.perform_caching = false
40
-
41
- # Tell Action Mailer not to deliver emails to the real world.
42
- # The :test delivery method accumulates sent emails in the
43
- # ActionMailer::Base.deliveries array.
44
- # config.action_mailer.delivery_method = :test
45
- config.log_level = :info
46
-
47
31
  # Print deprecation notices to the stderr.
48
32
  config.active_support.deprecation = :stderr
49
33
 
50
- # Raise exceptions for disallowed deprecations.
51
- config.active_support.disallowed_deprecation = :raise
52
-
53
- # Tell Active Support which deprecation messages to disallow.
54
- config.active_support.disallowed_deprecation_warnings = []
55
-
56
- config.active_job.queue_adapter = :sidekiq
57
-
58
34
  # Raises error for missing translations.
59
35
  # config.i18n.raise_on_missing_translations = true
60
36
 
61
37
  # Annotate rendered view with file names.
62
38
  # config.action_view.annotate_rendered_view_with_filenames = true
39
+
40
+ # Raise error when a before_action's only/except options reference missing actions.
41
+ config.action_controller.raise_on_missing_callback_actions = true
42
+ config.active_job.queue_adapter = :sidekiq
63
43
  end
@@ -1,3 +1,6 @@
1
+ require 'active_job'
2
+ require 'sidekiq'
3
+
1
4
  queue_adapter = ENV['QUEUE_ADAPTER'] || :active_job
2
5
  CarrierWave::Backgrounder.configure do |c|
3
6
  c.backend queue_adapter.to_sym, queue: :carrierwave
@@ -1,7 +1,7 @@
1
1
  # Be sure to restart your server when you modify this file.
2
2
 
3
3
  # Avoid CORS issues when API is called from the frontend app.
4
- # Handle Cross-Origin Resource Sharing (CORS) in order to accept cross-origin AJAX requests.
4
+ # Handle Cross-Origin Resource Sharing (CORS) in order to accept cross-origin Ajax requests.
5
5
 
6
6
  # Read more: https://github.com/cyu/rack-cors
7
7
 
@@ -1,8 +1,8 @@
1
1
  # Be sure to restart your server when you modify this file.
2
2
 
3
- # Configure parameters to be filtered from the log file. Use this to limit dissemination of
4
- # sensitive information. See the ActiveSupport::ParameterFilter documentation for supported
5
- # notations and behaviors.
3
+ # Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file.
4
+ # Use this to limit dissemination of sensitive information.
5
+ # See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
6
6
  Rails.application.config.filter_parameters += [
7
- :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
7
+ :passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :cvv, :cvc
8
8
  ]
@@ -0,0 +1,30 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file eases your Rails 8.0 framework defaults upgrade.
4
+ #
5
+ # Uncomment each configuration one by one to switch to the new default.
6
+ # Once your application is ready to run with all new defaults, you can remove
7
+ # this file and set the `config.load_defaults` to `8.0`.
8
+ #
9
+ # Read the Guide for Upgrading Ruby on Rails for more info on each option.
10
+ # https://guides.rubyonrails.org/upgrading_ruby_on_rails.html
11
+
12
+ ###
13
+ # Specifies whether `to_time` methods preserve the UTC offset of their receivers or preserves the timezone.
14
+ # If set to `:zone`, `to_time` methods will use the timezone of their receivers.
15
+ # If set to `:offset`, `to_time` methods will use the UTC offset.
16
+ # If `false`, `to_time` methods will convert to the local system UTC offset instead.
17
+ #++
18
+ # Rails.application.config.active_support.to_time_preserves_timezone = :zone
19
+
20
+ ###
21
+ # When both `If-Modified-Since` and `If-None-Match` are provided by the client
22
+ # only consider `If-None-Match` as specified by RFC 7232 Section 6.
23
+ # If set to `false` both conditions need to be satisfied.
24
+ #++
25
+ # Rails.application.config.action_dispatch.strict_freshness = true
26
+
27
+ ###
28
+ # Set `Regexp.timeout` to `1`s by default to improve security over Regexp Denial-of-Service attacks.
29
+ #++
30
+ # Regexp.timeout = 1
@@ -0,0 +1,74 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file eases your Rails 8.1 framework defaults upgrade.
4
+ #
5
+ # Uncomment each configuration one by one to switch to the new default.
6
+ # Once your application is ready to run with all new defaults, you can remove
7
+ # this file and set the `config.load_defaults` to `8.1`.
8
+ #
9
+ # Read the Guide for Upgrading Ruby on Rails for more info on each option.
10
+ # https://guides.rubyonrails.org/upgrading_ruby_on_rails.html
11
+
12
+ ###
13
+ # Skips escaping HTML entities and line separators. When set to `false`, the
14
+ # JSON renderer no longer escapes these to improve performance.
15
+ #
16
+ # Example:
17
+ # class PostsController < ApplicationController
18
+ # def index
19
+ # render json: { key: "\u2028\u2029<>&" }
20
+ # end
21
+ # end
22
+ #
23
+ # Renders `{"key":"\u2028\u2029\u003c\u003e\u0026"}` with the previous default, but `{"key":"

<>&"}` with the config
24
+ # set to `false`.
25
+ #
26
+ # Applications that want to keep the escaping behavior can set the config to `true`.
27
+ #++
28
+ # Rails.configuration.action_controller.escape_json_responses = false
29
+
30
+ ###
31
+ # Skips escaping LINE SEPARATOR (U+2028) and PARAGRAPH SEPARATOR (U+2029) in JSON.
32
+ #
33
+ # Historically these characters were not valid inside JavaScript literal strings but that changed in ECMAScript 2019.
34
+ # As such it's no longer a concern in modern browsers: https://caniuse.com/mdn-javascript_builtins_json_json_superset.
35
+ #++
36
+ # Rails.configuration.active_support.escape_js_separators_in_json = false
37
+
38
+ ###
39
+ # Raises an error when order dependent finder methods (e.g. `#first`, `#second`) are called without `order` values
40
+ # on the relation, and the model does not have any order columns (`implicit_order_column`, `query_constraints`, or
41
+ # `primary_key`) to fall back on.
42
+ #
43
+ # The current behavior of not raising an error has been deprecated, and this configuration option will be removed in
44
+ # Rails 8.2.
45
+ #++
46
+ # Rails.configuration.active_record.raise_on_missing_required_finder_order_columns = true
47
+
48
+ ###
49
+ # Controls how Rails handles path relative URL redirects.
50
+ # When set to `:raise`, Rails will raise an `ActionController::Redirecting::UnsafeRedirectError`
51
+ # for relative URLs without a leading slash, which can help prevent open redirect vulnerabilities.
52
+ #
53
+ # Example:
54
+ # redirect_to "example.com" # Raises UnsafeRedirectError
55
+ # redirect_to "@attacker.com" # Raises UnsafeRedirectError
56
+ # redirect_to "/safe/path" # Works correctly
57
+ #
58
+ # Applications that want to allow these redirects can set the config to `:log` (previous default)
59
+ # to only log warnings, or `:notify` to send ActiveSupport notifications.
60
+ #++
61
+ # Rails.configuration.action_controller.action_on_path_relative_redirect = :raise
62
+
63
+ ###
64
+ # Use a Ruby parser to track dependencies between Action View templates
65
+ #++
66
+ # Rails.configuration.action_view.render_tracker = :ruby
67
+
68
+ ###
69
+ # When enabled, hidden inputs generated by `form_tag`, `token_tag`, `method_tag`, and the hidden parameter fields
70
+ # included in `button_to` forms will omit the `autocomplete="off"` attribute.
71
+ #
72
+ # Applications that want to keep generating the `autocomplete` attribute for those tags can set it to `false`.
73
+ #++
74
+ # Rails.configuration.action_view.remove_hidden_field_autocomplete = true
@@ -0,0 +1,42 @@
1
+ # This configuration file will be evaluated by Puma. The top-level methods that
2
+ # are invoked here are part of Puma's configuration DSL. For more information
3
+ # about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html.
4
+ #
5
+ # Puma starts a configurable number of processes (workers) and each process
6
+ # serves each request in a thread from an internal thread pool.
7
+ #
8
+ # You can control the number of workers using ENV["WEB_CONCURRENCY"]. You
9
+ # should only set this value when you want to run 2 or more workers. The
10
+ # default is already 1. You can set it to `auto` to automatically start a worker
11
+ # for each available processor.
12
+ #
13
+ # The ideal number of threads per worker depends both on how much time the
14
+ # application spends waiting for IO operations and on how much you wish to
15
+ # prioritize throughput over latency.
16
+ #
17
+ # As a rule of thumb, increasing the number of threads will increase how much
18
+ # traffic a given process can handle (throughput), but due to CRuby's
19
+ # Global VM Lock (GVL) it has diminishing returns and will degrade the
20
+ # response time (latency) of the application.
21
+ #
22
+ # The default is set to 3 threads as it's deemed a decent compromise between
23
+ # throughput and latency for the average Rails application.
24
+ #
25
+ # Any libraries that use a connection pool or another resource pool should
26
+ # be configured to provide at least as many connections as the number of
27
+ # threads. This includes Active Record's `pool` parameter in `database.yml`.
28
+ threads_count = ENV.fetch("RAILS_MAX_THREADS", 3)
29
+ threads threads_count, threads_count
30
+
31
+ # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
32
+ port ENV.fetch("PORT", 3000)
33
+
34
+ # Allow puma to be restarted by `bin/rails restart` command.
35
+ plugin :tmp_restart
36
+
37
+ # Run the Solid Queue supervisor inside of Puma for single-server deployments.
38
+ plugin :solid_queue if ENV["SOLID_QUEUE_IN_PUMA"]
39
+
40
+ # Specify the PID file. Defaults to tmp/pids/server.pid in development.
41
+ # In other environments, only set the PID file if requested.
42
+ pidfile ENV["PIDFILE"] if ENV["PIDFILE"]
@@ -0,0 +1,7 @@
1
+ class AddColumnsForPortrait < ActiveRecord::Migration[8.0]
2
+ def change
3
+ add_column :users, :portrait, :string
4
+ add_column :users, :portrait_tmp, :string
5
+ add_column :users, :portrait_processing, :boolean, null: false, default:false
6
+ end
7
+ end
@@ -10,7 +10,7 @@
10
10
  #
11
11
  # It's strongly recommended that you check this file into your version control system.
12
12
 
13
- ActiveRecord::Schema[7.0].define(version: 2023_08_11_155811) do
13
+ ActiveRecord::Schema[8.0].define(version: 2025_09_26_184915) do
14
14
  create_table "admins", force: :cascade do |t|
15
15
  t.string "avatar"
16
16
  t.boolean "avatar_processing", default: false, null: false
@@ -29,6 +29,8 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_11_155811) do
29
29
  t.string "images"
30
30
  t.string "images_tmp"
31
31
  t.boolean "images_processing", default: false, null: false
32
+ t.string "portrait"
33
+ t.string "portrait_tmp"
34
+ t.boolean "portrait_processing", default: false, null: false
32
35
  end
33
-
34
36
  end
@@ -5,6 +5,10 @@ class MockWorker < Struct.new(:klass, :id, :column)
5
5
  new(*args).perform
6
6
  end
7
7
 
8
+ def self.set(*)
9
+ self
10
+ end
11
+
8
12
  def perform(*args)
9
13
  set_args(*args) unless args.empty?
10
14
  end
@@ -12,6 +16,8 @@ class MockWorker < Struct.new(:klass, :id, :column)
12
16
  def set_args(klass, id, column)
13
17
  self.klass, self.id, self.column = klass, id, column
14
18
  end
19
+
20
+ def queue_name; end
15
21
  end
16
22
 
17
23
  class MockSidekiqWorker < MockWorker