Upgrade to Rails 5.2.8.1

Some important little upgrades but mostly straightforward!

Note that there's still a known issue where item searches crash, I was hoping that this was a bug in Rails 4.2 that would be fixed on upgading to 5, but nope, oh well!

Also uhh I just got a bit silly and didn't actually mean to go all the way to 5.2 in one go, I had meant to start at 5.0… but tbh the 5.1 and 5.2 changes seem small, and this seems to be working, so. Yeah ok let's roll!
This commit is contained in:
Emi Matchu 2023-08-02 16:05:02 -07:00
parent 685ac2b4ad
commit d97c32b5da
81 changed files with 134 additions and 110 deletions

13
Gemfile
View file

@ -1,10 +1,10 @@
source 'http://rubygems.org'
ruby '2.4.10'
gem 'rails', '= 4.2.11.3'
gem 'rails', '= 5.2.8.1'
# Our database is MySQL, in both development and production.
gem 'mysql2', '>= 0.3.11'
gem 'mysql2', '~> 0.5.5'
# For reading the .env file, which you can use in development to more easily
# set environment variables for secret data.
@ -18,15 +18,15 @@ gem 'uglifier', '~> 4.2'
gem 'react-rails', '~> 2.7', '>= 2.7.1'
# For UI libraries.
gem 'will_paginate', '~> 3.0.pre2'
gem 'will_paginate', '~> 4.0'
# For authentication.
gem 'devise', '~> 4.9', '>= 4.9.2'
# For translation, both for the site UI and for Neopets data.
gem 'rails-i18n', '~> 4.0', '>= 4.0.9'
gem 'rails-i18n', '~> 5.1', '>= 5.1.3'
gem 'http_accept_language', '~> 2.1', '>= 2.1.1'
gem 'globalize', '~> 4.0.3'
gem 'globalize', '~> 6.2', '>= 6.2.1'
# For reading and parsing HTML from Neopets.com, like importing Closet pages.
gem 'nokogiri', '~> 1.10', '>= 1.10.10'
@ -64,6 +64,9 @@ gem 'loofah', '~> 2.20', '< 2.21'
gem 'minitest', '~> 5.15', '< 5.16'
gem 'mail', '~> 2.7', '>= 2.7.1', '< 2.8'
# TODO: Review our use of content_tag_for etc and uninstall this!
gem 'record_tag_helper', '~> 1.0'
# For deployment.
group :development do
gem 'capistrano', '~> 2.15.5', require: false

View file

@ -7,42 +7,49 @@ GIT
GEM
remote: http://rubygems.org/
specs:
actionmailer (4.2.11.3)
actionpack (= 4.2.11.3)
actionview (= 4.2.11.3)
activejob (= 4.2.11.3)
actioncable (5.2.8.1)
actionpack (= 5.2.8.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailer (5.2.8.1)
actionpack (= 5.2.8.1)
actionview (= 5.2.8.1)
activejob (= 5.2.8.1)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.11.3)
actionview (= 4.2.11.3)
activesupport (= 4.2.11.3)
rack (~> 1.6)
rack-test (~> 0.6.2)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-dom-testing (~> 2.0)
actionpack (5.2.8.1)
actionview (= 5.2.8.1)
activesupport (= 5.2.8.1)
rack (~> 2.0, >= 2.0.8)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (4.2.11.3)
activesupport (= 4.2.11.3)
actionview (5.2.8.1)
activesupport (= 5.2.8.1)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (4.2.11.3)
activesupport (= 4.2.11.3)
globalid (>= 0.3.0)
activemodel (4.2.11.3)
activesupport (= 4.2.11.3)
builder (~> 3.1)
activerecord (4.2.11.3)
activemodel (= 4.2.11.3)
activesupport (= 4.2.11.3)
arel (~> 6.0)
activesupport (4.2.11.3)
i18n (~> 0.7)
activejob (5.2.8.1)
activesupport (= 5.2.8.1)
globalid (>= 0.3.6)
activemodel (5.2.8.1)
activesupport (= 5.2.8.1)
activerecord (5.2.8.1)
activemodel (= 5.2.8.1)
activesupport (= 5.2.8.1)
arel (>= 9.0)
activestorage (5.2.8.1)
actionpack (= 5.2.8.1)
activerecord (= 5.2.8.1)
marcel (~> 1.0.0)
activesupport (5.2.8.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.3.8)
arel (6.0.4)
arel (9.0.0)
babel-source (5.8.35)
babel-transpiler (0.7.0)
babel-source (>= 4.0, < 6)
@ -89,7 +96,7 @@ GEM
dotenv-rails (2.8.1)
dotenv (= 2.8.1)
railties (>= 3.2)
erubis (2.7.0)
erubi (1.12.0)
execjs (2.5.2)
factory_girl (4.9.0)
activesupport (>= 3.0.0)
@ -99,16 +106,17 @@ GEM
ffi (1.12.2)
globalid (0.4.2)
activesupport (>= 4.2.0)
globalize (4.0.3)
activemodel (>= 4.0.0, < 5)
activerecord (>= 4.0.0, < 5)
globalize (6.2.1)
activemodel (>= 4.2, < 7.1)
activerecord (>= 4.2, < 7.1)
request_store (~> 1.0)
haml (6.1.1)
temple (>= 0.8.2)
thor
tilt
highline (1.7.2)
http_accept_language (2.1.1)
i18n (0.9.5)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
launchy (2.4.3)
addressable (~> 2.3)
@ -119,14 +127,16 @@ GEM
nokogiri (>= 1.5.9)
mail (2.7.1)
mini_mime (>= 0.1.1)
marcel (1.0.2)
memcache-client (1.8.5)
method_source (1.0.0)
mime-types (1.25.1)
mini_mime (1.1.2)
mini_portile2 (2.4.0)
minitest (5.15.0)
msgpack (1.6.1)
multi_json (1.15.0)
mysql2 (0.3.18)
mysql2 (0.5.5)
net-scp (1.0.4)
net-ssh (>= 1.99.1)
net-sftp (2.1.2)
@ -134,44 +144,46 @@ GEM
net-ssh (2.9.2)
net-ssh-gateway (1.2.0)
net-ssh (>= 2.6.5)
nio4r (2.5.9)
nokogiri (1.10.10)
mini_portile2 (~> 2.4.0)
openneo-auth-signatory (0.1.0)
ruby-hmac
orm_adapter (0.5.0)
parallel (1.13.0)
rack (1.6.13)
rack (2.2.8)
rack-attack (2.2.1)
rack
rack-test (0.6.3)
rack (>= 1.0)
rails (4.2.11.3)
actionmailer (= 4.2.11.3)
actionpack (= 4.2.11.3)
actionview (= 4.2.11.3)
activejob (= 4.2.11.3)
activemodel (= 4.2.11.3)
activerecord (= 4.2.11.3)
activesupport (= 4.2.11.3)
bundler (>= 1.3.0, < 2.0)
railties (= 4.2.11.3)
sprockets-rails
rails-deprecated_sanitizer (1.0.4)
activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.9)
activesupport (>= 4.2.0, < 5.0)
nokogiri (~> 1.6)
rails-deprecated_sanitizer (>= 1.0.1)
rack-test (2.1.0)
rack (>= 1.3)
rails (5.2.8.1)
actioncable (= 5.2.8.1)
actionmailer (= 5.2.8.1)
actionpack (= 5.2.8.1)
actionview (= 5.2.8.1)
activejob (= 5.2.8.1)
activemodel (= 5.2.8.1)
activerecord (= 5.2.8.1)
activestorage (= 5.2.8.1)
activesupport (= 5.2.8.1)
bundler (>= 1.3.0)
railties (= 5.2.8.1)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.1.1)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.5.0)
loofah (~> 2.19, >= 2.19.1)
rails-i18n (4.0.9)
i18n (~> 0.7)
railties (~> 4.0)
railties (4.2.11.3)
actionpack (= 4.2.11.3)
activesupport (= 4.2.11.3)
rails-i18n (5.1.3)
i18n (>= 0.7, < 2)
railties (>= 5.0, < 6)
railties (5.2.8.1)
actionpack (= 5.2.8.1)
activesupport (= 5.2.8.1)
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
thor (>= 0.19.0, < 2.0)
rake (13.0.6)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
@ -183,6 +195,10 @@ GEM
execjs
railties (>= 3.2)
tilt
record_tag_helper (1.0.1)
actionview (>= 5)
request_store (1.5.1)
rack (>= 1.4)
responders (2.4.1)
actionpack (>= 4.2.0, < 6.0)
railties (>= 4.2.0, < 6.0)
@ -234,7 +250,10 @@ GEM
binding_of_caller (>= 0.7.2)
railties (>= 4.0)
sprockets-rails (>= 2.0, < 4.0)
will_paginate (3.0.7)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
will_paginate (4.0.0)
PLATFORMS
ruby
@ -246,7 +265,7 @@ DEPENDENCIES
devise (~> 4.9, >= 4.9.2)
dotenv-rails (~> 2.8, >= 2.8.1)
factory_girl_rails (~> 4.9)
globalize (~> 4.0.3)
globalize (~> 6.2, >= 6.2.1)
haml (~> 6.1, >= 6.1.1)
http_accept_language (~> 2.1, >= 2.1.1)
letter_opener
@ -255,15 +274,16 @@ DEPENDENCIES
memcache-client (~> 1.8.5)
minitest (~> 5.15, < 5.16)
msgpack (~> 1.6, >= 1.6.1)
mysql2 (>= 0.3.11)
mysql2 (~> 0.5.5)
nokogiri (~> 1.10, >= 1.10.10)
openneo-auth-signatory (~> 0.1.0)
parallel (~> 1.13.0)
rack-attack (~> 2.2.0)
rails (= 4.2.11.3)
rails-i18n (~> 4.0, >= 4.0.9)
rails (= 5.2.8.1)
rails-i18n (~> 5.1, >= 5.1.3)
rdiscount (~> 1.6.5)
react-rails (~> 2.7, >= 2.7.1)
record_tag_helper (~> 1.0)
rest-client (~> 1.6.7)
rspec-rails (~> 2.0.0.beta.22)
rvm-capistrano (~> 1.5.6)
@ -271,7 +291,7 @@ DEPENDENCIES
sass-rails (~> 5.0, >= 5.0.7)
uglifier (~> 4.2)
web-console (~> 2.2, >= 2.2.1)
will_paginate (~> 3.0.pre2)
will_paginate (~> 4.0)
RUBY VERSION
ruby 2.4.10p364

View file

@ -7,8 +7,8 @@ class ApplicationController < ActionController::Base
helper_method :can_use_image_mode?, :user_is?
before_filter :set_locale
before_filter :login_as_test_user if Rails.env.development?
before_action :set_locale
before_action :login_as_test_user if Rails.env.development?
def authenticate_user! # too lazy to change references to login_path
redirect_to(login_path) unless user_signed_in?

View file

@ -1,7 +1,7 @@
class ClosetHangersController < ApplicationController
before_filter :authorize_user!, :only => [:destroy, :create, :update, :update_quantities, :petpage]
before_filter :find_item, :only => [:create, :update_quantities]
before_filter :find_user, :only => [:index, :petpage, :update_quantities]
before_action :authorize_user!, :only => [:destroy, :create, :update, :update_quantities, :petpage]
before_action :find_item, :only => [:create, :update_quantities]
before_action :find_user, :only => [:index, :petpage, :update_quantities]
def destroy
if params[:list_id]

View file

@ -1,6 +1,6 @@
class ClosetListsController < ApplicationController
before_filter :authorize_user!
before_filter :find_closet_list, :only => [:edit, :update, :destroy]
before_action :authorize_user!
before_action :find_closet_list, :only => [:edit, :update, :destroy]
def create
@closet_list = current_user.closet_lists.build closet_list_params

View file

@ -1,5 +1,5 @@
class ItemsController < ApplicationController
before_filter :set_query
before_action :set_query
rescue_from Item::Search::Error, :with => :search_error
def index

View file

@ -1,9 +1,9 @@
class NeopetsPageImportTasksController < ApplicationController
include ActionView::Helpers::TextHelper
before_filter :authenticate_user!
before_action :authenticate_user!
before_filter :require_source, only: [:create]
before_action :require_source, only: [:create]
rescue_from NeopetsPage::ParseError, with: :on_parse_error
rescue_from NeopetsPage::TypeNotFound, with: :not_found

View file

@ -1,5 +1,5 @@
class NeopetsUsersController < ApplicationController
before_filter :authenticate_user!, :build_neopets_user
before_action :authenticate_user!, :build_neopets_user
rescue_from NeopetsUser::NotFound, :with => :not_found

View file

@ -1,5 +1,5 @@
class OutfitsController < ApplicationController
before_filter :find_authorized_outfit, :only => [:update, :destroy]
before_action :find_authorized_outfit, :only => [:update, :destroy]
def create
@outfit = Outfit.build_for_user(current_user, outfit_params)

View file

@ -4,7 +4,7 @@ class PetsController < ApplicationController
rescue_from Pet::DownloadError, :with => :pet_download_error
protect_from_forgery except: :submit
before_filter :local_only, only: :submit
before_action :local_only, only: :submit
cache_sweeper :user_sweeper

View file

@ -2,9 +2,9 @@ class SessionsController < ApplicationController
rescue_from Openneo::Auth::Session::InvalidSignature, :with => :invalid_signature
rescue_from Openneo::Auth::Session::MissingParam, :with => :missing_param
before_filter :initialize_session, :only => [new]
before_action :initialize_session, :only => [new]
skip_before_filter :verify_authenticity_token, :only => [:create]
skip_before_action :verify_authenticity_token, :only => [:create]
def new
redirect_to Openneo::Auth.remote_auth_url(params, session)

View file

@ -1,5 +1,5 @@
class UsersController < ApplicationController
before_filter :find_and_authorize_user!, :only => [:update]
before_action :find_and_authorize_user!, :only => [:update]
def index # search, really
name = params[:name]

View file

@ -0,0 +1,3 @@
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end

View file

@ -1,4 +1,4 @@
class Campaign < ActiveRecord::Base
class Campaign < ApplicationRecord
has_many :donations
def progress_percent

View file

@ -1,4 +1,4 @@
class ClosetHanger < ActiveRecord::Base
class ClosetHanger < ApplicationRecord
belongs_to :item
belongs_to :list, :class_name => 'ClosetList'
belongs_to :user

View file

@ -1,4 +1,4 @@
class ClosetList < ActiveRecord::Base
class ClosetList < ApplicationRecord
belongs_to :user
has_many :hangers, :class_name => 'ClosetHanger', :foreign_key => 'list_id'

View file

@ -1,4 +1,4 @@
class Color < ActiveRecord::Base
class Color < ApplicationRecord
translates :name
scope :alphabetical, -> { with_translations(I18n.locale).order(Color::Translation.arel_table[:name]) }

View file

@ -1,4 +1,4 @@
class Contribution < ActiveRecord::Base
class Contribution < ApplicationRecord
POINT_VALUES = {
'Item' => 3,
'SwfAsset' => 2,

View file

@ -1,4 +1,4 @@
class Donation < ActiveRecord::Base
class Donation < ApplicationRecord
FEATURE_COST = 500 # in cents = $5.00
belongs_to :campaign

View file

@ -1,4 +1,4 @@
class DonationFeature < ActiveRecord::Base
class DonationFeature < ApplicationRecord
belongs_to :donation
belongs_to :outfit

View file

@ -1,4 +1,4 @@
class Item < ActiveRecord::Base
class Item < ApplicationRecord
include PrettyParam
# We use the `type` column to mean something other than what Rails means!

View file

@ -1,4 +1,4 @@
class ItemOutfitRelationship < ActiveRecord::Base
class ItemOutfitRelationship < ApplicationRecord
belongs_to :item
belongs_to :outfit

View file

@ -1,4 +1,4 @@
class NeopetsConnection < ActiveRecord::Base
class NeopetsConnection < ApplicationRecord
belongs_to :user
validates :neopets_username, uniqueness: {scope: :user_id}

View file

@ -1,4 +1,4 @@
class Outfit < ActiveRecord::Base
class Outfit < ApplicationRecord
has_many :item_outfit_relationships, :dependent => :destroy
has_many :worn_item_outfit_relationships, -> { where(is_worn: true) },
:class_name => 'ItemOutfitRelationship'

View file

@ -1,4 +1,4 @@
class ParentSwfAssetRelationship < ActiveRecord::Base
class ParentSwfAssetRelationship < ApplicationRecord
self.table_name = 'parents_swf_assets'
belongs_to :parent, :polymorphic => true

View file

@ -1,7 +1,7 @@
require 'rocketamf/remote_gateway'
require 'ostruct'
class Pet < ActiveRecord::Base
class Pet < ApplicationRecord
NEOPETS_URL_ORIGIN = ENV['NEOPETS_URL_ORIGIN'] || 'http://www.neopets.com'
GATEWAY_URL = NEOPETS_URL_ORIGIN + '/amfphp/gateway.php'
PET_VIEWER = RocketAMF::RemoteGateway.new(GATEWAY_URL).

View file

@ -1,4 +1,4 @@
class PetState < ActiveRecord::Base
class PetState < ApplicationRecord
SwfAssetType = 'biology'
has_many :contributions, :as => :contributed,

View file

@ -1,4 +1,4 @@
class PetType < ActiveRecord::Base
class PetType < ApplicationRecord
IMAGE_CPN_FORMAT = 'http://pets.neopets.com/cpn/%s/1/1.png';
IMAGE_CP_LOCATION_REGEX = %r{^/cp/(.+?)/[0-9]+/[0-9]+\.png$};
IMAGE_CPN_ACCEPTABLE_NAME = /^[a-z0-9_]+$/

View file

@ -1,4 +1,4 @@
class Species < ActiveRecord::Base
class Species < ApplicationRecord
translates :name
scope :alphabetical, -> { with_translations(I18n.locale).order(Species::Translation.arel_table[:name]) }

View file

@ -1,7 +1,7 @@
require 'fileutils'
require 'uri'
class SwfAsset < ActiveRecord::Base
class SwfAsset < ApplicationRecord
# We use the `type` column to mean something other than what Rails means!
self.inheritance_column = nil

View file

@ -1,4 +1,4 @@
class User < ActiveRecord::Base
class User < ApplicationRecord
include PrettyParam
DefaultAuthServerId = 1

View file

@ -1,4 +1,4 @@
class Zone < ActiveRecord::Base
class Zone < ApplicationRecord
translates :label, :plain_label
# When selecting zones that an asset occupies, we allow the zone to set

View file

@ -32,8 +32,6 @@ module OpenneoImpressItems
config.assets.initialize_on_precompile = false
config.middleware.insert_after ActionDispatch::Flash, Rack::Attack
config.active_record.raise_in_transactional_callbacks = true
end
end

BIN
vendor/cache/actioncable-5.2.8.1.gem vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/actionmailer-5.2.8.1.gem vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/actionpack-5.2.8.1.gem vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/actionview-5.2.8.1.gem vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/activejob-5.2.8.1.gem vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/activemodel-5.2.8.1.gem vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/activerecord-5.2.8.1.gem vendored Normal file

Binary file not shown.

BIN
vendor/cache/activestorage-5.2.8.1.gem vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/activesupport-5.2.8.1.gem vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/arel-9.0.0.gem vendored Normal file

Binary file not shown.

BIN
vendor/cache/erubi-1.12.0.gem vendored Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/globalize-6.2.1.gem vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/i18n-1.14.1.gem vendored Normal file

Binary file not shown.

BIN
vendor/cache/marcel-1.0.2.gem vendored Normal file

Binary file not shown.

BIN
vendor/cache/method_source-1.0.0.gem vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/mysql2-0.5.5.gem vendored Normal file

Binary file not shown.

BIN
vendor/cache/nio4r-2.5.9.gem vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/rack-2.2.8.gem vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/rack-test-2.1.0.gem vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/rails-5.2.8.1.gem vendored Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/rails-dom-testing-2.1.1.gem vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/rails-i18n-5.1.3.gem vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/railties-5.2.8.1.gem vendored Normal file

Binary file not shown.

BIN
vendor/cache/record_tag_helper-1.0.1.gem vendored Normal file

Binary file not shown.

BIN
vendor/cache/request_store-1.5.1.gem vendored Normal file

Binary file not shown.

BIN
vendor/cache/websocket-driver-0.7.6.gem vendored Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/will_paginate-4.0.0.gem vendored Normal file

Binary file not shown.