-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated config to 6.1, fixed more warnings
- Loading branch information
Showing
19 changed files
with
145 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#!/usr/bin/env ruby | ||
load File.expand_path("spring", __dir__) | ||
APP_PATH = File.expand_path('../config/application', __dir__) | ||
require_relative '../config/boot' | ||
require 'rails/commands' | ||
require_relative "../config/boot" | ||
require "rails/commands" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#!/usr/bin/env ruby | ||
require_relative '../config/boot' | ||
require 'rake' | ||
load File.expand_path("spring", __dir__) | ||
require_relative "../config/boot" | ||
require "rake" | ||
Rake.application.run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
#!/usr/bin/env ruby | ||
if !defined?(Spring) && [nil, "development", "test"].include?(ENV["RAILS_ENV"]) | ||
gem "bundler" | ||
require "bundler" | ||
|
||
# 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' | ||
require 'bundler' | ||
|
||
if (match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m)) | ||
Gem.paths = { 'GEM_PATH' => [Bundler.bundle_path.to_s, *Gem.path].uniq.join(Gem.path_separator) } | ||
gem 'spring', match[1] | ||
require 'spring/binstub' | ||
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# This file is used by Rack-based servers to start the application. | ||
|
||
require ::File.expand_path('../config/environment', __FILE__) | ||
require_relative "config/environment" | ||
|
||
run Rails.application | ||
Rails.application.load_server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,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, :password, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn | ||
] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
db/migrate/20241008205807_add_service_name_to_active_storage_blobs.active_storage.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# This migration comes from active_storage (originally 20190112182829) | ||
class AddServiceNameToActiveStorageBlobs < ActiveRecord::Migration[6.0] | ||
def up | ||
return unless table_exists?(:active_storage_blobs) | ||
|
||
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 | ||
return unless table_exists?(:active_storage_blobs) | ||
|
||
remove_column :active_storage_blobs, :service_name | ||
end | ||
end |
27 changes: 27 additions & 0 deletions
27
db/migrate/20241008205808_create_active_storage_variant_records.active_storage.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# This migration comes from active_storage (originally 20191206030411) | ||
class CreateActiveStorageVariantRecords < ActiveRecord::Migration[6.0] | ||
def change | ||
return unless table_exists?(:active_storage_blobs) | ||
|
||
# Use Active Record's configured type for primary key | ||
create_table :active_storage_variant_records, id: primary_key_type, if_not_exists: true do |t| | ||
t.belongs_to :blob, null: false, index: false, type: blobs_primary_key_type | ||
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 | ||
|
||
private | ||
def primary_key_type | ||
config = Rails.configuration.generators | ||
config.options[config.orm][:primary_key_type] || :primary_key | ||
end | ||
|
||
def blobs_primary_key_type | ||
pkey_name = connection.primary_key(:active_storage_blobs) | ||
pkey_column = connection.columns(:active_storage_blobs).find { |c| c.name == pkey_name } | ||
pkey_column.bigint? ? :bigint : pkey_column.type | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters