Merge pull request #893 from indentlabs/rails-6.1

Upgrade to Rails 6.1
This commit is contained in:
Andrew Brown 2021-10-27 02:30:07 -05:00 committed by GitHub
commit c92c059bcc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 70 additions and 13 deletions

View File

@ -74,6 +74,8 @@ gem 'barnes'
# Forum
gem 'thredded', git: 'https://github.com/indentlabs/thredded.git', branch: 'feature/report-posts'
# gem 'thredded', git: 'https://github.com/thredded/thredded', branch: 'master'
# gem 'thredded', git: 'https://github.com/sudara/thredded', branch: 'master'
gem 'rails-ujs'
gem 'language_filter'

View File

@ -1286,7 +1286,7 @@ GEM
railties (>= 3.1)
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)
@ -1294,7 +1294,7 @@ GEM
rails (> 4)
db_text_search (0.3.2)
activerecord (>= 4.1.15, < 7.0)
debug_inspector (1.0.0)
debug_inspector (1.1.0)
devise (4.8.0)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
@ -1308,7 +1308,7 @@ GEM
erubi (1.10.0)
eventmachine (1.2.7)
execjs (2.8.1)
faraday (0.17.3)
faraday (0.17.4)
multipart-post (>= 1.2, < 3)
faraday_middleware (0.14.0)
faraday (>= 0.7.4, < 1.0)
@ -1370,7 +1370,7 @@ GEM
thor (>= 0.14, < 2.0)
jquery-ui-rails (6.0.1)
railties (>= 3.2.16)
json (2.3.0)
json (2.5.1)
jwt (2.2.3)
kaminari (1.2.1)
activesupport (>= 4.1.0)
@ -1409,7 +1409,7 @@ GEM
method_source (1.0.0)
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2020.0512)
mime-types-data (3.2021.0704)
mimemagic (0.3.10)
nokogiri (~> 1)
rake
@ -1588,7 +1588,7 @@ GEM
terrapin (0.6.0)
climate_control (>= 0.0.3, < 1.0)
text-hyphen (1.4.1)
textstat (0.1.6)
textstat (0.1.7)
text-hyphen (~> 1.4, >= 1.4.1)
thor (1.1.0)
tilt (2.0.10)

View File

@ -293,7 +293,7 @@ class User < ApplicationRecord
params.delete(:username)
end
result = update_attributes(params, *options)
result = update(params, *options)
clean_up_passwords
result
end

View File

@ -10,7 +10,7 @@
<%= javascript_include_tag 'thredded',
async: !Rails.application.config.assets.debug,
defer: true %>
<%== Gravatar.prefetch_dns %>
<%== RailsGravatar.prefetch_dns_tag %>
</head>
<body data-in-app="true" class="<%= 'has-fixed-sidenav' if user_signed_in? %> <%= 'dark' if user_signed_in? && current_user.dark_mode_enabled? %>">
<%= render 'layouts/sidenav' if user_signed_in? %>

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,17 @@
class AddServiceNameMigrationAgain < ActiveRecord::Migration[6.1]
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

View File

@ -2,15 +2,15 @@
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# This file is the source Rails uses to define your schema when running `rails
# db:schema:load`. When creating a new database, `rails db:schema:load` tends to
# This file is the source Rails uses to define your schema when running `bin/rails
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
# be faster and is potentially less error prone than running all of your
# migrations from scratch. Old migrations may fail to apply correctly if those
# migrations use external dependencies or application code.
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2021_10_07_234707) do
ActiveRecord::Schema.define(version: 2021_10_27_065954) do
create_table "active_storage_attachments", force: :cascade do |t|
t.string "name", null: false
@ -27,12 +27,19 @@ ActiveRecord::Schema.define(version: 2021_10_07_234707) do
t.string "filename", null: false
t.string "content_type"
t.text "metadata"
t.bigint "byte_size", null: false
t.integer "byte_size", null: false
t.string "checksum", null: false
t.datetime "created_at", null: false
t.string "service_name", null: false
t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
end
create_table "active_storage_variant_records", force: :cascade do |t|
t.bigint "blob_id", null: false
t.string "variation_digest", null: false
t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true
end
create_table "api_keys", force: :cascade do |t|
t.integer "user_id"
t.string "key"
@ -3650,6 +3657,7 @@ ActiveRecord::Schema.define(version: 2021_10_07_234707) do
end
add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
add_foreign_key "api_keys", "users"
add_foreign_key "api_requests", "application_integrations"
add_foreign_key "api_requests", "integration_authorizations"

View File

@ -23,7 +23,7 @@ namespace :backfill do
end
end
task :most_used_attribute_word_counts: :environment do
task most_used_attribute_word_counts: :environment do
word_counts = {}
Attribute.where(word_count_cache: nil).group(:value).order('count_id DESC').limit(500).count(:id).each do |value, count|
word_count = WordCountAnalyzer::Counter.new(