actualización a rails 6

This commit is contained in:
fauno 2022-03-24 21:14:02 -03:00
parent 8c202193e8
commit f10c624c2d
18 changed files with 350 additions and 237 deletions

14
Gemfile
View File

@ -4,17 +4,17 @@ source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.3'
gem 'rails', '~> 6'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use Puma as the app server
gem 'puma', '~> 3.11'
gem 'puma'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
gem 'jbuilder'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use ActiveModel has_secure_password
gem 'bcrypt', '~> 3.1.7'
gem 'bcrypt'
gem 'sucker_punch'
gem 'validate_url'
@ -24,7 +24,7 @@ gem 'webpush'
# gem 'mini_magick', '~> 4.8'
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.1.0', require: false
gem 'bootsnap', require: false
# Use Rack CORS for handling Cross-Origin Resource Sharing (CORS),
# making cross-origin AJAX possible
@ -39,7 +39,7 @@ group :development, :test do
end
group :development do
gem 'listen', '>= 3.0.5', '< 3.2'
gem 'listen'
# Spring speeds up development by keeping your application running in
# the background. Read more: https://github.com/rails/spring
gem 'bcrypt_pbkdf'
@ -51,7 +51,7 @@ group :development do
gem 'ed25519'
gem 'rubocop-rails'
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
gem 'spring-watcher-listen'
gem 'stackprof'
gem 'yard'
end

View File

@ -1,69 +1,86 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (5.2.5)
actionpack (= 5.2.5)
actioncable (6.1.5)
actionpack (= 6.1.5)
activesupport (= 6.1.5)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailer (5.2.5)
actionpack (= 5.2.5)
actionview (= 5.2.5)
activejob (= 5.2.5)
actionmailbox (6.1.5)
actionpack (= 6.1.5)
activejob (= 6.1.5)
activerecord (= 6.1.5)
activestorage (= 6.1.5)
activesupport (= 6.1.5)
mail (>= 2.7.1)
actionmailer (6.1.5)
actionpack (= 6.1.5)
actionview (= 6.1.5)
activejob (= 6.1.5)
activesupport (= 6.1.5)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.2.5)
actionview (= 5.2.5)
activesupport (= 5.2.5)
rack (~> 2.0, >= 2.0.8)
actionpack (6.1.5)
actionview (= 6.1.5)
activesupport (= 6.1.5)
rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.2.5)
activesupport (= 5.2.5)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (6.1.5)
actionpack (= 6.1.5)
activerecord (= 6.1.5)
activestorage (= 6.1.5)
activesupport (= 6.1.5)
nokogiri (>= 1.8.5)
actionview (6.1.5)
activesupport (= 6.1.5)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (5.2.5)
activesupport (= 5.2.5)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (6.1.5)
activesupport (= 6.1.5)
globalid (>= 0.3.6)
activemodel (5.2.5)
activesupport (= 5.2.5)
activerecord (5.2.5)
activemodel (= 5.2.5)
activesupport (= 5.2.5)
arel (>= 9.0)
activestorage (5.2.5)
actionpack (= 5.2.5)
activerecord (= 5.2.5)
marcel (~> 1.0.0)
activesupport (5.2.5)
activemodel (6.1.5)
activesupport (= 6.1.5)
activerecord (6.1.5)
activemodel (= 6.1.5)
activesupport (= 6.1.5)
activestorage (6.1.5)
actionpack (= 6.1.5)
activejob (= 6.1.5)
activerecord (= 6.1.5)
activesupport (= 6.1.5)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (6.1.5)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
airbrussh (1.4.0)
sshkit (>= 1.6.1, != 1.7.0)
arel (9.0.0)
ast (2.4.2)
axiom-types (0.1.1)
descendants_tracker (~> 0.0.4)
ice_nine (~> 0.11.0)
thread_safe (~> 0.3, >= 0.3.1)
bcrypt (3.1.16)
bcrypt (3.1.17)
bcrypt_pbkdf (1.1.0)
benchmark-ips (2.8.4)
bootsnap (1.7.3)
msgpack (~> 1.0)
benchmark-ips (2.10.0)
bootsnap (1.11.1)
msgpack (~> 1.2)
builder (3.2.4)
capistrano (3.16.0)
capistrano (3.17.0)
airbrussh (>= 1.0.0)
i18n
rake (>= 10.0.0)
sshkit (>= 1.9.0)
capistrano-bundler (2.0.1)
capistrano (~> 3.1)
capistrano-rails (1.6.1)
capistrano-rails (1.6.2)
capistrano (~> 3.1)
capistrano-bundler (>= 1.1, < 3)
capistrano-rbenv (2.2.0)
@ -72,16 +89,16 @@ GEM
coderay (1.1.3)
coercible (1.0.0)
descendants_tracker (~> 0.0.1)
concurrent-ruby (1.1.8)
concurrent-ruby (1.1.10)
crass (1.0.6)
database_cleaner (2.0.1)
database_cleaner-active_record (~> 2.0.0)
database_cleaner-active_record (2.0.0)
database_cleaner-active_record (2.0.1)
activerecord (>= 5.a)
database_cleaner-core (~> 2.0.0)
database_cleaner-core (2.0.1)
dead_end (1.1.6)
derailed_benchmarks (2.0.1)
dead_end (3.1.1)
derailed_benchmarks (2.1.1)
benchmark-ips (~> 2)
dead_end
get_process_mem (~> 0)
@ -95,145 +112,147 @@ GEM
thor (>= 0.19, < 2)
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
ed25519 (1.2.4)
ed25519 (1.3.0)
equalizer (0.0.11)
erubi (1.10.0)
factory_bot (6.1.0)
factory_bot (6.2.1)
activesupport (>= 5.0.0)
factory_bot_rails (6.1.0)
factory_bot (~> 6.1.0)
factory_bot_rails (6.2.0)
factory_bot (~> 6.2.0)
railties (>= 5.0.0)
ffi (1.15.0)
ffi (1.15.5)
get_process_mem (0.2.7)
ffi (~> 1.0)
globalid (0.4.2)
activesupport (>= 4.2.0)
globalid (1.0.0)
activesupport (>= 5.0)
heapy (0.2.0)
thor
hkdf (0.3.0)
httpclient (2.8.3)
i18n (1.8.10)
i18n (1.10.0)
concurrent-ruby (~> 1.0)
ice_nine (0.11.2)
jbuilder (2.11.2)
jbuilder (2.11.5)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
jwt (2.2.2)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
loofah (2.9.1)
jwt (2.3.0)
listen (3.7.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
loofah (2.15.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
mini_mime (>= 0.1.1)
marcel (1.0.1)
marcel (1.0.2)
memory_profiler (1.0.0)
method_source (1.0.0)
mini_histogram (0.3.1)
mini_mime (1.1.0)
mini_portile2 (2.5.0)
minitest (5.14.4)
msgpack (1.4.2)
mini_mime (1.1.2)
mini_portile2 (2.8.0)
minitest (5.15.0)
msgpack (1.4.5)
net-scp (3.0.0)
net-ssh (>= 2.6.5, < 7.0.0)
net-ssh (6.1.0)
nio4r (2.5.7)
nokogiri (1.11.3)
mini_portile2 (~> 2.5.0)
nio4r (2.5.8)
nokogiri (1.13.3)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
parallel (1.20.1)
parser (3.0.1.0)
parallel (1.22.0)
parser (3.1.1.0)
ast (~> 2.4.1)
pry (0.14.0)
pry (0.14.1)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (4.0.6)
puma (3.12.6)
racc (1.5.2)
puma (5.6.2)
nio4r (~> 2.0)
racc (1.6.0)
rack (2.2.3)
rack-cors (1.1.1)
rack (>= 2.0.0)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (5.2.5)
actioncable (= 5.2.5)
actionmailer (= 5.2.5)
actionpack (= 5.2.5)
actionview (= 5.2.5)
activejob (= 5.2.5)
activemodel (= 5.2.5)
activerecord (= 5.2.5)
activestorage (= 5.2.5)
activesupport (= 5.2.5)
bundler (>= 1.3.0)
railties (= 5.2.5)
rails (6.1.5)
actioncable (= 6.1.5)
actionmailbox (= 6.1.5)
actionmailer (= 6.1.5)
actionpack (= 6.1.5)
actiontext (= 6.1.5)
actionview (= 6.1.5)
activejob (= 6.1.5)
activemodel (= 6.1.5)
activerecord (= 6.1.5)
activestorage (= 6.1.5)
activesupport (= 6.1.5)
bundler (>= 1.15.0)
railties (= 6.1.5)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.3.0)
rails-html-sanitizer (1.4.2)
loofah (~> 2.3)
railties (5.2.5)
actionpack (= 5.2.5)
activesupport (= 5.2.5)
railties (6.1.5)
actionpack (= 6.1.5)
activesupport (= 6.1.5)
method_source
rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0)
rainbow (3.0.0)
rake (13.0.3)
rb-fsevent (0.10.4)
rake (>= 12.2)
thor (~> 1.0)
rainbow (3.1.1)
rake (13.0.6)
rb-fsevent (0.11.1)
rb-inotify (0.10.1)
ffi (~> 1.0)
regexp_parser (2.1.1)
regexp_parser (2.2.1)
rexml (3.2.5)
rubocop (1.12.1)
rubocop (1.26.1)
parallel (~> 1.10)
parser (>= 3.0.0.0)
parser (>= 3.1.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.2.0, < 2.0)
rubocop-ast (>= 1.16.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.4.1)
parser (>= 2.7.1.5)
rubocop-rails (2.9.1)
rubocop-ast (1.16.0)
parser (>= 3.1.1.0)
rubocop-rails (2.14.2)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 0.90.0, < 2.0)
rubocop (>= 1.7.0, < 2.0)
ruby-progressbar (1.11.0)
ruby-statistics (2.1.3)
ruby_dep (1.5.0)
ruby-statistics (3.0.0)
spring (2.1.1)
spring-watcher-listen (2.0.1)
listen (>= 2.7, < 4.0)
spring (>= 1.2, < 3.0)
sprockets (4.0.2)
sprockets (4.0.3)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.2.2)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets-rails (3.4.2)
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
sqlite3 (1.4.2)
sshkit (1.21.2)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
stackprof (0.2.16)
stackprof (0.2.19)
sucker_punch (3.0.1)
concurrent-ruby (~> 1.0)
telegram-bot (0.15.3)
actionpack (>= 4.0, < 6.2)
activesupport (>= 4.0, < 6.2)
telegram-bot (0.15.6)
actionpack (>= 4.0, < 7.1)
activesupport (>= 4.0, < 7.1)
httpclient (~> 2.7)
telegram-bot-types (0.6.2)
telegram-bot-types (0.6.3)
virtus (~> 1.0)
thor (1.1.0)
thor (1.2.1)
thread_safe (0.3.6)
tzinfo (1.2.9)
thread_safe (~> 0.1)
unicode-display_width (2.0.0)
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
unicode-display_width (2.1.0)
validate_url (1.0.13)
activemodel (>= 3.0.0)
public_suffix
@ -245,18 +264,21 @@ GEM
webpush (1.1.0)
hkdf (~> 0.2)
jwt (~> 2.0)
websocket-driver (0.7.3)
webrick (1.7.0)
websocket-driver (0.7.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
yard (0.9.26)
yard (0.9.27)
webrick (~> 1.7.0)
zeitwerk (2.5.4)
PLATFORMS
ruby
DEPENDENCIES
bcrypt (~> 3.1.7)
bcrypt
bcrypt_pbkdf
bootsnap (>= 1.1.0)
bootsnap
capistrano
capistrano-bundler
capistrano-rails
@ -265,15 +287,15 @@ DEPENDENCIES
derailed_benchmarks
ed25519
factory_bot_rails
jbuilder (~> 2.5)
listen (>= 3.0.5, < 3.2)
jbuilder
listen
pry
puma (~> 3.11)
puma
rack-cors
rails (~> 5.2.3)
rails (~> 6)
rubocop-rails
spring
spring-watcher-listen (~> 2.0.0)
spring-watcher-listen
sqlite3
stackprof
sucker_punch
@ -284,4 +306,4 @@ DEPENDENCIES
yard
BUNDLED WITH
2.1.4
2.2.2

View File

@ -68,7 +68,7 @@ class BarcasController < ApplicationController
# Las piratas solo pueden modificar sus propias barcas
@barca = current_pirata.barcas.find(params[:id])
if @barca.update_attributes barca_params
if @barca.update barca_params
notify(subject: :update, urgency: :high)
render status: :no_content
else

View File

@ -1,11 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
begin
load File.expand_path('spring', __dir__)
rescue LoadError => e
raise unless e.message.include?('spring')
end
load File.expand_path('spring', __dir__)
APP_PATH = File.expand_path('../config/application', __dir__)
require_relative '../config/boot'
require 'rails/commands'

View File

@ -1,11 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
begin
load File.expand_path('spring', __dir__)
rescue LoadError => e
raise unless e.message.include?('spring')
end
load File.expand_path('spring', __dir__)
require_relative '../config/boot'
require 'rake'
Rake.application.run

View File

@ -1,8 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'fileutils'
include FileUtils
# path to your application root.
APP_ROOT = File.expand_path('..', __dir__)
@ -11,8 +9,9 @@ def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
end
chdir APP_ROOT do
# This script is a starting point to setup your application.
FileUtils.chdir APP_ROOT do
# This script is a way to set up or update your development environment automatically.
# This script is idempotent, so that you can run it at any time and get an expectable outcome.
# Add necessary setup steps to this file.
puts '== Installing dependencies =='
@ -21,11 +20,11 @@ chdir APP_ROOT do
# puts "\n== Copying sample files =="
# unless File.exist?('config/database.yml')
# cp 'config/database.yml.sample', 'config/database.yml'
# FileUtils.cp 'config/database.yml.sample', 'config/database.yml'
# end
puts "\n== Preparing database =="
system! 'bin/rails db:setup'
system! 'bin/rails db:prepare'
puts "\n== Removing old logs and tempfiles =="
system! 'bin/rails log:clear tmp:clear'

View File

@ -1,18 +1,15 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
# This file loads spring without using Bundler, in order to be fast.
# It gets overwritten when you run the `spring binstub` command.
unless defined?(Spring)
require 'rubygems'
if !defined?(Spring) && [nil, 'development', 'test'].include?(ENV['RAILS_ENV'])
gem 'bundler'
require 'bundler'
lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read)
spring = lockfile.specs.detect { |spec| spec.name == 'spring' }
if spring
# Load Spring without loading other gems in the Gemfile, for speed.
Bundler.locked_gems&.specs&.find { |spec| spec.name == 'spring' }&.tap do |spring|
Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
gem 'spring', spring.version
require 'spring/binstub'
rescue Gem::LoadError
# Ignore when Spring is not installed.
end
end

View File

@ -5,3 +5,4 @@
require_relative 'config/environment'
run Rails.application
Rails.application.load_server

View File

@ -7,7 +7,14 @@ require 'rails'
require 'active_model/railtie'
require 'active_job/railtie'
require 'active_record/railtie'
# require 'active_storage/engine'
require 'action_controller/railtie'
# require 'action_mailer/railtie'
# require 'action_mailbox/engine'
# require 'action_text/engine'
# require 'action_view/railtie'
# require 'action_cable/engine'
# require 'sprockets/railtie'
require 'rails/test_unit/railtie'
# Require the gems listed in Gemfile, including any gems
@ -20,10 +27,13 @@ module MiniloomApi
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 5.2
# Settings in config/environments/* take precedence over those specified here.
# Application configuration can go into files in config/initializers
# -- all .rb files in that directory are automatically loaded after loading
# the framework and any gems in your application.
# Configuration for the application, engines, and railties goes here.
#
# These settings can be overridden in specific environments using the files
# in config/environments, which are processed later.
#
# config.time_zone = 'Central Time (US & Canada)'
# config.eager_load_paths << Rails.root.join('extras')
# Only loads a smaller set of middleware suitable for API only apps.
# Middleware like session, flash, cookies can be added back manually.

View File

@ -1,5 +1,7 @@
# frozen_string_literal: true
require 'active_support/core_ext/integer/time'
Rails.application.configure do
# Settings specified here will take precedence over those in
# config/application.rb.
@ -19,8 +21,6 @@ Rails.application.configure do
# Enable/disable caching. By default caching is disabled.
# Run rails dev:cache to toggle caching.
if Rails.root.join('tmp', 'caching-dev.txt').exist?
config.action_controller.perform_caching = true
config.cache_store = :memory_store
config.public_file_server.headers = {
'Cache-Control' => "public, max-age=#{2.days.to_i}"
@ -31,29 +31,32 @@ Rails.application.configure do
config.cache_store = :null_store
end
# Store uploaded files on the local file system (see
# config/storage.yml for options)
# config.active_storage.service = :local
# Don't care if the mailer can't send.
# config.action_mailer.raise_delivery_errors = false
# config.action_mailer.perform_caching = false
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
# Raise exceptions for disallowed deprecations.
config.active_support.disallowed_deprecation = :raise
# Tell Active Support which deprecation messages to disallow.
config.active_support.disallowed_deprecation_warnings = []
# Raise an error on page load if there are pending migrations.
config.active_record.migration_error = :page_load
# Highlight code that triggered database queries in logs.
config.active_record.verbose_query_logs = true
# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true
# Use an evented file watcher to asynchronously detect changes in
# source code, routes, locales, etc. This feature depends on the
# listen gem.
# Raises error for missing translations.
# config.i18n.raise_on_missing_translations = true
# Annotate rendered view with file names.
# config.action_view.annotate_rendered_view_with_filenames = true
# Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem.
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
# Uncomment if you wish to allow Action Cable access from any origin.
# config.action_cable.disable_request_forgery_protection = true
end

View File

@ -1,5 +1,7 @@
# frozen_string_literal: true
require 'active_support/core_ext/integer/time'
Rails.application.routes.default_url_options[:host] = ENV.fetch('API_HOST', 'api.lumi.partidopirata.com.ar')
Rails.application.routes.default_url_options[:protocol] = 'https'
@ -18,7 +20,6 @@ Rails.application.configure do
# Full error reports are disabled and caching is turned on.
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
# Ensures that a master key has been made available in either
# ENV["RAILS_MASTER_KEY"] or in config/master.key. This key is used to
@ -36,28 +37,19 @@ Rails.application.configure do
# Specifies the header that your server uses for sending files.
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
# Store uploaded files on the local file system (see
# config/storage.yml for options)
# config.active_storage.service = :local
# Mount Action Cable outside main process or domain
# config.action_cable.mount_path = nil
# config.action_cable.url = 'wss://example.com/cable'
# config.action_cable.allowed_request_origins = [ 'http://example.com',
# /http:\/\/example.*/ ]
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
# Force all access to the app over SSL, use Strict-Transport-Security,
# and use secure cookies.
config.force_ssl = true
# Use the lowest log level to ensure availability of diagnostic
# information when problems arise.
# Include generic and useful information about system operation, but avoid
# logging too much information to avoid inadvertent exposure of personally
# identifiable information (PII).
config.log_level = :info
# Prepend all log lines with the following tags.
config.log_tags = [:request_id]
config.log_tags = %i[request_id]
# Use a different cache store in production.
# config.cache_store = :mem_cache_store
@ -67,20 +59,22 @@ Rails.application.configure do
config.active_job.queue_adapter = :sucker_punch
config.active_job.queue_name_prefix = "lumi_#{Rails.env}"
# config.action_mailer.perform_caching = false
# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate
# delivery to raise delivery errors.
#
# config.action_mailer.raise_delivery_errors = false
# Enable locale fallbacks for I18n (makes lookups for any locale fall
# back to the I18n.default_locale when a translation cannot be found).
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found).
config.i18n.fallbacks = true
# Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify
# Log disallowed deprecations.
config.active_support.disallowed_deprecation = :log
# Tell Active Support which deprecation messages to disallow.
config.active_support.disallowed_deprecation_warnings = []
# Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = ::Logger::Formatter.new
# Use a different logger for distributed setups.
require 'syslog/logger'
config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new('miniloom'))
@ -93,4 +87,25 @@ Rails.application.configure do
# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false
# Inserts middleware to perform automatic connection switching.
# The `database_selector` hash is used to pass options to the DatabaseSelector
# middleware. The `delay` is used to determine how long to wait after a write
# to send a subsequent read to the primary.
#
# The `database_resolver` class is used by the middleware to determine which
# database is appropriate to use based on the time delay.
#
# The `database_resolver_context` class is used by the middleware to set
# timestamps for the last write to the primary. The resolver uses the context
# class timestamps to determine how long to wait before reading from the
# replica.
#
# By default Rails will store a last write timestamp in the session. The
# DatabaseSelector middleware is designed as such you can define your own
# strategy for connection switching and pass that into the middleware through
# these configuration options.
# config.active_record.database_selector = { delay: 2.seconds }
# config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver
# config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session
end

View File

@ -1,14 +1,18 @@
# frozen_string_literal: true
require 'active_support/core_ext/integer/time'
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data there!
Rails.application.configure do
# Settings specified here will take precedence over those in
# config/application.rb.
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data there!
config.cache_classes = true
config.cache_classes = false
config.action_view.cache_template_loading = true
# Do not eager load code on boot. This avoids loading your whole
# application just for the purpose of running a single test. If you
@ -19,12 +23,14 @@ Rails.application.configure do
# Configure public file server for tests with Cache-Control for
# performance.
config.public_file_server.enabled = true
config.public_file_server.headers = { 'Cache-Control' => "public,
max-age=#{1.hour.to_i}" }
config.public_file_server.headers = {
'Cache-Control' => "public, max-age=#{1.hour.to_i}"
}
# Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
config.cache_store = :null_store
# Raise exceptions instead of rendering exception templates.
config.action_dispatch.show_exceptions = false
@ -32,20 +38,18 @@ Rails.application.configure do
# Disable request forgery protection in test environment.
config.action_controller.allow_forgery_protection = false
# Store uploaded files on the local file system in a temporary
# directory
# config.active_storage.service = :test
# config.action_mailer.perform_caching = false
# Tell Action Mailer not to deliver emails to the real world.
# The :test delivery method accumulates sent emails in the
# ActionMailer::Base.deliveries array.
# config.action_mailer.delivery_method = :test
# Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr
# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true
# Raise exceptions for disallowed deprecations.
config.active_support.disallowed_deprecation = :raise
# Tell Active Support which deprecation messages to disallow.
config.active_support.disallowed_deprecation_warnings = []
# Raises error for missing translations.
# config.i18n.raise_on_missing_translations = true
# Annotate rendered view with file names.
# config.action_view.annotate_rendered_view_with_filenames = true
end

View File

@ -7,6 +7,6 @@
# Rails.backtrace_cleaner.add_silencer { |line| line =~
# /my_noisy_library/ }
# You can also remove all the silencers if you're trying to debug a
# problem that might stem from framework code.
# Rails.backtrace_cleaner.remove_silencers!
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code
# by setting BACKTRACE=1 before calling your invocation, like "BACKTRACE=1 ./bin/rails runner 'MyClass.perform'".
Rails.backtrace_cleaner.remove_silencers! if ENV["BACKTRACE"]

View File

@ -3,4 +3,6 @@
# Be sure to restart your server when you modify this file.
# Configure sensitive parameters which will be filtered from the log file.
Rails.application.config.filter_parameters += [:password]
Rails.application.config.filter_parameters += %i[
password passw secret token _key crypt salt certificate otp ssn
]

View File

@ -0,0 +1,67 @@
# Be sure to restart your server when you modify this file.
#
# This file contains migration options to ease your Rails 6.1 upgrade.
#
# Once upgraded flip defaults one by one to migrate to the new default.
#
# Read the Guide for Upgrading Ruby on Rails for more info on each option.
# Support for inversing belongs_to -> has_many Active Record associations.
# Rails.application.config.active_record.has_many_inversing = true
# Track Active Storage variants in the database.
# Rails.application.config.active_storage.track_variants = true
# Apply random variation to the delay when retrying failed jobs.
# Rails.application.config.active_job.retry_jitter = 0.15
# Stop executing `after_enqueue`/`after_perform` callbacks if
# `before_enqueue`/`before_perform` respectively halts with `throw :abort`.
# Rails.application.config.active_job.skip_after_callbacks_if_terminated = true
# Specify cookies SameSite protection level: either :none, :lax, or :strict.
#
# This change is not backwards compatible with earlier Rails versions.
# It's best enabled when your entire app is migrated and stable on 6.1.
# Rails.application.config.action_dispatch.cookies_same_site_protection = :lax
# Generate CSRF tokens that are encoded in URL-safe Base64.
#
# This change is not backwards compatible with earlier Rails versions.
# It's best enabled when your entire app is migrated and stable on 6.1.
# Rails.application.config.action_controller.urlsafe_csrf_tokens = true
# Specify whether `ActiveSupport::TimeZone.utc_to_local` returns a time with an
# UTC offset or a UTC time.
# ActiveSupport.utc_to_local_returns_utc_offset_times = true
# Change the default HTTP status code to `308` when redirecting non-GET/HEAD
# requests to HTTPS in `ActionDispatch::SSL` middleware.
# Rails.application.config.action_dispatch.ssl_default_redirect_status = 308
# Use new connection handling API. For most applications this won't have any
# effect. For applications using multiple databases, this new API provides
# support for granular connection swapping.
# Rails.application.config.active_record.legacy_connection_handling = false
# Make `form_with` generate non-remote forms by default.
# Rails.application.config.action_view.form_with_generates_remote_forms = false
# Set the default queue name for the analysis job to the queue adapter default.
# Rails.application.config.active_storage.queues.analysis = nil
# Set the default queue name for the purge job to the queue adapter default.
# Rails.application.config.active_storage.queues.purge = nil
# Set the default queue name for the incineration job to the queue adapter default.
# Rails.application.config.action_mailbox.queues.incineration = nil
# Set the default queue name for the routing job to the queue adapter default.
# Rails.application.config.action_mailbox.queues.routing = nil
# Set the default queue name for the mail deliver job to the queue adapter default.
# Rails.application.config.action_mailer.deliver_later_queue_name = nil
# Generate a `Link` header that gives a hint to modern browsers about
# preloading assets when using `javascript_include_tag` and `stylesheet_link_tag`.
# Rails.application.config.action_view.preload_links_header = true

View File

@ -5,8 +5,7 @@
# This file contains settings for ActionController::ParamsWrapper which
# is enabled by default.
# Enable parameter wrapping for JSON. You can disable this by setting
# :format to an empty array.
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActiveSupport.on_load(:action_controller) do
wrap_parameters format: [:json]
end

View File

@ -6,8 +6,14 @@
# maximum value specified for Puma. Default is set to 5 threads for
# minimum and maximum; this matches the default thread size of Active
# Record.
threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 }
threads threads_count, threads_count
max_threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 }
min_threads_count = ENV.fetch('RAILS_MIN_THREADS') { max_threads_count }
threads min_threads_count, max_threads_count
# Specifies the `worker_timeout` threshold that Puma will use to wait before
# terminating a worker in development environments.
#
worker_timeout 3600 if ENV.fetch('RAILS_ENV', 'development') == 'development'
# Specifies the `port` that Puma will listen on to receive requests;
# default is 3000.
@ -18,6 +24,9 @@ port ENV.fetch('PORT') { 3000 }
#
environment ENV.fetch('RAILS_ENV') { 'development' }
# Specifies the `pidfile` that Puma will use.
pidfile ENV.fetch('PIDFILE') { 'tmp/pids/server.pid' }
# Specifies the number of `workers` to boot in clustered mode. Workers
# are forked webserver processes. If using threads and workers together
# the concurrency of the application would be max `threads` * `workers`.

View File

@ -1,8 +1,3 @@
# frozen_string_literal: true
%w[
.ruby-version
.rbenv-vars
tmp/restart.txt
tmp/caching-dev.txt
].each { |path| Spring.watch(path) }
Spring.watch(*%w[.ruby-version .rbenv-vars tmp/restart.txt tmp/caching-dev.txt])