Upgrade to rails 6.1
This commit is contained in:
parent
7b45a8cb90
commit
4819ff3c7e
21 changed files with 227 additions and 33 deletions
2
Gemfile
2
Gemfile
|
@ -33,7 +33,7 @@ gem 'roadie-rails', '~> 2.1' # email generation helpers
|
|||
gem 'money', '~> 6.13'
|
||||
|
||||
# Database and Events
|
||||
gem 'pg', '~> 0.11'
|
||||
gem 'pg', '~> 1.1'
|
||||
|
||||
gem 'param_validation', path: 'gems/ruby-param-validation'
|
||||
gem 'qx', path: 'gems/ruby-qx'
|
||||
|
|
|
@ -239,7 +239,7 @@ GEM
|
|||
parallel
|
||||
parser (3.0.0.0)
|
||||
ast (~> 2.4.1)
|
||||
pg (0.21.0)
|
||||
pg (1.2.3)
|
||||
power_assert (1.2.0)
|
||||
pry (0.12.2)
|
||||
coderay (~> 1.1.0)
|
||||
|
@ -449,7 +449,7 @@ DEPENDENCIES
|
|||
nearest_time_zone (~> 0.0.4)
|
||||
parallel_tests (~> 2.32)
|
||||
param_validation!
|
||||
pg (~> 0.11)
|
||||
pg (~> 1.1)
|
||||
pry (~> 0.12.2)
|
||||
pry-byebug (~> 3.7.0)
|
||||
puma (~> 5.0)
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
APP_PATH = File.expand_path('../config/application', __dir__)
|
||||
require_relative '../config/boot'
|
||||
require_relative "../config/boot"
|
||||
require_relative '../lib/generators/overrides'
|
||||
require 'rails/commands'
|
||||
require "rails/commands"
|
||||
|
|
4
bin/rake
4
bin/rake
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
require_relative '../config/boot'
|
||||
require 'rake'
|
||||
require_relative "../config/boot"
|
||||
require "rake"
|
||||
Rake.application.run
|
||||
|
|
|
@ -10,8 +10,8 @@ def system!(*args)
|
|||
end
|
||||
|
||||
FileUtils.chdir APP_ROOT do
|
||||
# This script is a way to setup or update your development environment automatically.
|
||||
# This script is idempotent, so that you can run it at anytime and get an expectable outcome.
|
||||
# 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.
|
||||
|
||||
# we don't install dependencies on ci because it's been done already
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
# This file is used by Rack-based servers to start the application.
|
||||
|
||||
require ::File.expand_path('../config/environment', __FILE__)
|
||||
require_relative "config/environment"
|
||||
|
||||
run Commitchange::Application
|
||||
run Rails.application
|
||||
Rails.application.load_server
|
||||
|
|
|
@ -23,7 +23,6 @@ require "rails/test_unit/railtie"
|
|||
# you've limited to :test, :development, or :production.
|
||||
Bundler.require(*Rails.groups)
|
||||
# require File.expand_path('lib/htp') # Hamster Table Print
|
||||
|
||||
module Commitchange
|
||||
class Application < Rails::Application
|
||||
config.load_defaults '5.0'
|
||||
|
|
|
@ -5,5 +5,5 @@
|
|||
# Set up gems listed in the Gemfile.
|
||||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
|
||||
|
||||
require 'bundler/setup'
|
||||
require 'bootsnap/setup'
|
||||
require "bundler/setup" # Set up gems listed in the Gemfile.
|
||||
require "bootsnap/setup" # Speed up boot time by caching expensive operations.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
# License: AGPL-3.0-or-later WITH WTO-AP-3.0-or-later
|
||||
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE
|
||||
|
||||
require "active_support/core_ext/integer/time"
|
||||
Rails.application.configure do
|
||||
# Settings specified here will take precedence over those in config/application.rb.
|
||||
|
||||
|
@ -44,6 +44,12 @@ Rails.application.configure do
|
|||
# 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
|
||||
|
||||
|
@ -58,8 +64,11 @@ Rails.application.configure do
|
|||
# Suppress logger output for asset requests.
|
||||
config.assets.quiet = true
|
||||
|
||||
# Raises error for missing translations.
|
||||
# config.action_view.raise_on_missing_translations = true
|
||||
# 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.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
require "active_support/core_ext/integer/time"
|
||||
|
||||
Rails.application.configure do
|
||||
# Settings specified here will take precedence over those in config/application.rb.
|
||||
|
||||
|
@ -14,11 +16,6 @@ Rails.application.configure do
|
|||
config.consider_all_requests_local = false
|
||||
config.action_controller.perform_caching = true
|
||||
|
||||
# Enable Rack::Cache to put a simple HTTP cache in front of your application
|
||||
# Add `rack-cache` to your Gemfile before enabling this.
|
||||
# For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
|
||||
# config.action_dispatch.rack_cache = 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 decrypt credentials (and other encrypted files).
|
||||
# config.require_master_key = true
|
||||
|
@ -36,7 +33,7 @@ Rails.application.configure do
|
|||
# Generate digests for assets URLs.
|
||||
config.assets.digest = true
|
||||
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
||||
# config.action_controller.asset_host = 'http://assets.example.com'
|
||||
# config.asset_host = 'http://assets.example.com'
|
||||
|
||||
# Specifies the header that your server uses for sending files.
|
||||
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
||||
|
@ -75,11 +72,17 @@ Rails.application.configure do
|
|||
# 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'
|
||||
# require "syslog/logger"
|
||||
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
|
||||
|
||||
if ENV["RAILS_LOG_TO_STDOUT"].present?
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
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
|
||||
|
@ -46,8 +48,17 @@ Rails.application.configure do
|
|||
|
||||
config.action_mailer.default_url_options = { host: 'houdiniproject.test' }
|
||||
|
||||
# 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.action_view.raise_on_missing_translations = true
|
||||
# config.i18n.raise_on_missing_translations = true
|
||||
|
||||
# Annotate rendered view with file names.
|
||||
# config.action_view.annotate_rendered_view_with_filenames = true
|
||||
|
||||
#recommended by https://github.com/grosser/parallel_tests/wiki
|
||||
config.cache_store = :file_store, Rails.root.join("tmp", "cache", "paralleltests#{ENV['TEST_ENV_NUMBER']}")
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
||||
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
||||
# Rails.backtrace_cleaner.add_silencer { |line| /my_noisy_library/.match?(line) }
|
||||
|
||||
# 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"]
|
||||
|
|
|
@ -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 += [
|
||||
:passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
|
||||
]
|
||||
|
|
63
config/initializers/new_framework_defaults_6_1.rb
Normal file
63
config/initializers/new_framework_defaults_6_1.rb
Normal file
|
@ -0,0 +1,63 @@
|
|||
# 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
|
11
config/initializers/permissions_policy.rb
Normal file
11
config/initializers/permissions_policy.rb
Normal file
|
@ -0,0 +1,11 @@
|
|||
# Define an application-wide HTTP permissions policy. For further
|
||||
# information see https://developers.google.com/web/updates/2018/06/feature-policy
|
||||
#
|
||||
# Rails.application.config.permissions_policy do |f|
|
||||
# f.camera :none
|
||||
# f.gyroscope :none
|
||||
# f.microphone :none
|
||||
# f.usb :none
|
||||
# f.fullscreen :self
|
||||
# f.payment :self, "https://secure.example.com"
|
||||
# end
|
|
@ -3,7 +3,7 @@
|
|||
# License: AGPL-3.0-or-later WITH WTO-AP-3.0-or-later
|
||||
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE
|
||||
Rails.application.routes.draw do
|
||||
|
||||
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
|
||||
require_relative "./state_code_constraint"
|
||||
if Rails.env == 'development'
|
||||
get '/button_debug/embedded' => 'button_debug#embedded'
|
||||
|
|
|
@ -5,6 +5,7 @@ test:
|
|||
local:
|
||||
service: Disk
|
||||
root: <%= Rails.root.join("storage") %>
|
||||
public: true
|
||||
|
||||
# Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
|
||||
# amazon:
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
# This migration comes from active_storage (originally 20190112182829)
|
||||
class AddServiceNameToActiveStorageBlobs < ActiveRecord::Migration[6.0]
|
||||
def up
|
||||
unless column_exists?(:active_storage_blobs, :service_name)
|
||||
add_column :active_storage_blobs, :service_name, :string
|
||||
|
||||
if configured_service = ActiveStorage::Blob.service.name
|
||||
ActiveStorage::Blob.unscoped.update_all(service_name: configured_service)
|
||||
end
|
||||
|
||||
change_column :active_storage_blobs, :service_name, :string, null: false
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :active_storage_blobs, :service_name
|
||||
end
|
||||
end
|
|
@ -0,0 +1,12 @@
|
|||
# This migration comes from active_storage (originally 20191206030411)
|
||||
class CreateActiveStorageVariantRecords < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
create_table :active_storage_variant_records do |t|
|
||||
t.belongs_to :blob, null: false, index: false
|
||||
t.string :variation_digest, null: false
|
||||
|
||||
t.index %i[ blob_id variation_digest ], name: "index_active_storage_variant_records_uniqueness", unique: true
|
||||
t.foreign_key :active_storage_blobs, column: :blob_id
|
||||
end
|
||||
end
|
||||
end
|
|
@ -140,7 +140,8 @@ CREATE TABLE public.active_storage_blobs (
|
|||
metadata text,
|
||||
byte_size bigint NOT NULL,
|
||||
checksum character varying NOT NULL,
|
||||
created_at timestamp without time zone NOT NULL
|
||||
created_at timestamp without time zone NOT NULL,
|
||||
service_name character varying NOT NULL
|
||||
);
|
||||
|
||||
|
||||
|
@ -163,6 +164,36 @@ CREATE SEQUENCE public.active_storage_blobs_id_seq
|
|||
ALTER SEQUENCE public.active_storage_blobs_id_seq OWNED BY public.active_storage_blobs.id;
|
||||
|
||||
|
||||
--
|
||||
-- Name: active_storage_variant_records; Type: TABLE; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE TABLE public.active_storage_variant_records (
|
||||
id bigint NOT NULL,
|
||||
blob_id bigint NOT NULL,
|
||||
variation_digest character varying NOT NULL
|
||||
);
|
||||
|
||||
|
||||
--
|
||||
-- Name: active_storage_variant_records_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE SEQUENCE public.active_storage_variant_records_id_seq
|
||||
START WITH 1
|
||||
INCREMENT BY 1
|
||||
NO MINVALUE
|
||||
NO MAXVALUE
|
||||
CACHE 1;
|
||||
|
||||
|
||||
--
|
||||
-- Name: active_storage_variant_records_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER SEQUENCE public.active_storage_variant_records_id_seq OWNED BY public.active_storage_variant_records.id;
|
||||
|
||||
|
||||
--
|
||||
-- Name: activities; Type: TABLE; Schema: public; Owner: -
|
||||
--
|
||||
|
@ -2358,6 +2389,13 @@ ALTER TABLE ONLY public.active_storage_attachments ALTER COLUMN id SET DEFAULT n
|
|||
ALTER TABLE ONLY public.active_storage_blobs ALTER COLUMN id SET DEFAULT nextval('public.active_storage_blobs_id_seq'::regclass);
|
||||
|
||||
|
||||
--
|
||||
-- Name: active_storage_variant_records id; Type: DEFAULT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY public.active_storage_variant_records ALTER COLUMN id SET DEFAULT nextval('public.active_storage_variant_records_id_seq'::regclass);
|
||||
|
||||
|
||||
--
|
||||
-- Name: activities id; Type: DEFAULT; Schema: public; Owner: -
|
||||
--
|
||||
|
@ -2752,6 +2790,14 @@ ALTER TABLE ONLY public.active_storage_blobs
|
|||
ADD CONSTRAINT active_storage_blobs_pkey PRIMARY KEY (id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: active_storage_variant_records active_storage_variant_records_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY public.active_storage_variant_records
|
||||
ADD CONSTRAINT active_storage_variant_records_pkey PRIMARY KEY (id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: ar_internal_metadata ar_internal_metadata_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
|
@ -3269,6 +3315,13 @@ CREATE UNIQUE INDEX index_active_storage_attachments_uniqueness ON public.active
|
|||
CREATE UNIQUE INDEX index_active_storage_blobs_on_key ON public.active_storage_blobs USING btree (key);
|
||||
|
||||
|
||||
--
|
||||
-- Name: index_active_storage_variant_records_uniqueness; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE UNIQUE INDEX index_active_storage_variant_records_uniqueness ON public.active_storage_variant_records USING btree (blob_id, variation_digest);
|
||||
|
||||
|
||||
--
|
||||
-- Name: index_activities_on_nonprofit_id; Type: INDEX; Schema: public; Owner: -
|
||||
--
|
||||
|
@ -3605,6 +3658,14 @@ CREATE INDEX tag_joins_tag_master_id ON public.tag_joins USING btree (tag_master
|
|||
CREATE UNIQUE INDEX unique_schema_migrations ON public.schema_migrations USING btree (version);
|
||||
|
||||
|
||||
--
|
||||
-- Name: active_storage_variant_records fk_rails_993965df05; Type: FK CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY public.active_storage_variant_records
|
||||
ADD CONSTRAINT fk_rails_993965df05 FOREIGN KEY (blob_id) REFERENCES public.active_storage_blobs(id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: active_storage_attachments fk_rails_c3b3935057; Type: FK CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
|
@ -4091,6 +4152,8 @@ INSERT INTO "schema_migrations" (version) VALUES
|
|||
('20181129224030'),
|
||||
('20191105200033'),
|
||||
('20200423222447'),
|
||||
('20200901214156');
|
||||
('20200901214156'),
|
||||
('20210105192021'),
|
||||
('20210105192022');
|
||||
|
||||
|
||||
|
|
|
@ -85,14 +85,14 @@ module Houdini
|
|||
**options)
|
||||
Houdini.terms_and_privacy = app.config.houdini.terms_and_privacy
|
||||
|
||||
Houdini.intl = Houdini::Intl.new(app.config.houdini.intl)
|
||||
Houdini.intl = Houdini::Intl.new(app.config.houdini.intl.to_h)
|
||||
Houdini.intl.all_countries ||= ISO3166::Country.all.map(&:alpha2)
|
||||
Houdini.intl.all_currencies ||= Money::Currency.table
|
||||
raise("The language #{Houdini.intl.language} is not listed \
|
||||
in the provided locales: #{Houdini.intl.available_locales.join(', ')}") if Houdini.intl.available_locales.map(&:to_s)
|
||||
.none?{|l| l == Houdini.intl.language.to_s}
|
||||
|
||||
Houdini.maintenance = Houdini::Maintenance.new(app.config.houdini.maintenance)
|
||||
Houdini.maintenance = Houdini::Maintenance.new(app.config.houdini.maintenance.to_h)
|
||||
|
||||
Houdini.source_tokens = app.config.houdini.source_tokens
|
||||
|
||||
|
|
Loading…
Reference in a new issue