Skip to content

Commit

Permalink
upgrade to rails 5.2rc2
Browse files Browse the repository at this point in the history
  • Loading branch information
mfenner committed Mar 30, 2018
1 parent 7ec8f1f commit d2efbde
Show file tree
Hide file tree
Showing 16 changed files with 193 additions and 59 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ COPY vendor/docker/ntp.conf /etc/ntp.conf
# Copy webapp folder
COPY . /home/app/webapp/
RUN mkdir -p /home/app/webapp/tmp/pids && \
mkdir -p /home/app/webapp/tmp/storage && \
mkdir -p /home/app/webapp/vendor/bundle && \
chown -R app:app /home/app/webapp && \
chmod -R 755 /home/app/webapp
Expand Down
7 changes: 5 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
source 'https://rubygems.org'

gem 'rails', '~> 5.1.1'
gem 'mysql2', '~> 0.4.10'
gem 'rails', '~> 5.2.0.rc2'
gem 'bootsnap', '~> 1.2', '>= 1.2.1'
gem 'mysql2', '~> 0.4.4'
gem 'dotenv'
gem 'multi_json'
gem 'json', '~> 1.8', '>= 1.8.5'
Expand Down Expand Up @@ -31,6 +32,7 @@ gem 'countries', '~> 2.1', '>= 2.1.2'
gem 'aasm', '~> 4.12', '>= 4.12.3'
gem "facets", require: false
gem 'shoryuken', '~> 3.2', '>= 3.2.2'
gem "aws-sdk-s3", require: false
gem 'aws-sdk-sqs', '~> 1.3'
gem 'bergamasco', '~> 0.3.10'
gem 'base32-url', '~> 0.3'
Expand All @@ -41,6 +43,7 @@ gem 'flipper-active_support_cache_store'
gem 'rack-cors', '~> 1.0', '>= 1.0.2', :require => 'rack/cors'
gem 'strip_attributes', '~> 1.8'
gem 'slack-notifier', '~> 2.1'
gem 'mini_magick', '~> 4.8'

group :development, :test do
gem 'rspec-rails', '~> 3.5', '>= 3.5.2'
Expand Down
100 changes: 61 additions & 39 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@ GEM
specs:
aasm (4.12.3)
concurrent-ruby (~> 1.0)
actioncable (5.1.6)
actionpack (= 5.1.6)
actioncable (5.2.0.rc2)
actionpack (= 5.2.0.rc2)
nio4r (~> 2.0)
websocket-driver (~> 0.6.1)
actionmailer (5.1.6)
actionpack (= 5.1.6)
actionview (= 5.1.6)
activejob (= 5.1.6)
websocket-driver (>= 0.6.1)
actionmailer (5.2.0.rc2)
actionpack (= 5.2.0.rc2)
actionview (= 5.2.0.rc2)
activejob (= 5.2.0.rc2)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.1.6)
actionview (= 5.1.6)
activesupport (= 5.1.6)
actionpack (5.2.0.rc2)
actionview (= 5.2.0.rc2)
activesupport (= 5.2.0.rc2)
rack (~> 2.0)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.1.6)
activesupport (= 5.1.6)
actionview (5.2.0.rc2)
activesupport (= 5.2.0.rc2)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
Expand All @@ -31,16 +31,20 @@ GEM
activemodel (>= 4.1, < 6)
case_transform (>= 0.2)
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
activejob (5.1.6)
activesupport (= 5.1.6)
activejob (5.2.0.rc2)
activesupport (= 5.2.0.rc2)
globalid (>= 0.3.6)
activemodel (5.1.6)
activesupport (= 5.1.6)
activerecord (5.1.6)
activemodel (= 5.1.6)
activesupport (= 5.1.6)
arel (~> 8.0)
activesupport (5.1.6)
activemodel (5.2.0.rc2)
activesupport (= 5.2.0.rc2)
activerecord (5.2.0.rc2)
activemodel (= 5.2.0.rc2)
activesupport (= 5.2.0.rc2)
arel (>= 9.0)
activestorage (5.2.0.rc2)
actionpack (= 5.2.0.rc2)
activerecord (= 5.2.0.rc2)
marcel (~> 0.3.1)
activesupport (5.2.0.rc2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
Expand All @@ -49,12 +53,19 @@ GEM
public_suffix (>= 2.0.2, < 4.0)
aggregate (0.2.2)
api-pagination (4.7.0)
arel (8.0.0)
arel (9.0.0)
aws-partitions (1.75.0)
aws-sdk-core (3.18.1)
aws-partitions (~> 1.0)
aws-sigv4 (~> 1.0)
jmespath (~> 1.0)
aws-sdk-kms (1.5.0)
aws-sdk-core (~> 3)
aws-sigv4 (~> 1.0)
aws-sdk-s3 (1.8.2)
aws-sdk-core (~> 3)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.0)
aws-sdk-sqs (1.3.0)
aws-sdk-core (~> 3)
aws-sigv4 (~> 1.0)
Expand Down Expand Up @@ -99,10 +110,12 @@ GEM
rdf-rdfxml (~> 2.0)
rdf-turtle (~> 2.2)
thor (~> 0.19)
bootsnap (1.2.1)
msgpack (~> 1.0)
bugsnag (6.6.4)
concurrent-ruby (~> 1.0)
builder (3.2.3)
byebug (10.0.1)
byebug (10.0.2)
cancancan (2.1.3)
capybara (2.18.0)
addressable
Expand Down Expand Up @@ -247,6 +260,8 @@ GEM
mini_mime (>= 0.1.1)
mailgun-ruby (1.1.9)
rest-client (~> 2.0)
marcel (0.3.2)
mimemagic (~> 0.3.2)
maremma (3.6.2)
activesupport (>= 4.2.5, < 6)
addressable (>= 2.3.6)
Expand All @@ -262,11 +277,14 @@ GEM
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mimemagic (0.3.2)
mini_magick (4.8.0)
mini_mime (1.0.0)
mini_portile2 (2.3.0)
minitest (5.11.3)
money (6.10.1)
i18n (>= 0.6.4, < 1.0)
msgpack (1.2.4)
multi_json (1.13.1)
multipart-post (2.0.0)
mysql2 (0.4.10)
Expand All @@ -293,26 +311,27 @@ GEM
rack-cors (1.0.2)
rack-test (1.0.0)
rack (>= 1.0, < 3)
rails (5.1.6)
actioncable (= 5.1.6)
actionmailer (= 5.1.6)
actionpack (= 5.1.6)
actionview (= 5.1.6)
activejob (= 5.1.6)
activemodel (= 5.1.6)
activerecord (= 5.1.6)
activesupport (= 5.1.6)
rails (5.2.0.rc2)
actioncable (= 5.2.0.rc2)
actionmailer (= 5.2.0.rc2)
actionpack (= 5.2.0.rc2)
actionview (= 5.2.0.rc2)
activejob (= 5.2.0.rc2)
activemodel (= 5.2.0.rc2)
activerecord (= 5.2.0.rc2)
activestorage (= 5.2.0.rc2)
activesupport (= 5.2.0.rc2)
bundler (>= 1.3.0)
railties (= 5.1.6)
railties (= 5.2.0.rc2)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.0.4)
loofah (~> 2.2, >= 2.2.2)
railties (5.1.6)
actionpack (= 5.1.6)
activesupport (= 5.1.6)
railties (5.2.0.rc2)
actionpack (= 5.2.0.rc2)
activesupport (= 5.2.0.rc2)
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
Expand Down Expand Up @@ -417,7 +436,7 @@ GEM
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff
websocket-driver (0.6.5)
websocket-driver (0.7.0)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.3)
xpath (3.0.0)
Expand All @@ -430,13 +449,15 @@ DEPENDENCIES
aasm (~> 4.12, >= 4.12.3)
active_model_serializers (~> 0.10.0)
api-pagination
aws-sdk-s3
aws-sdk-sqs (~> 1.3)
base32-url (~> 0.3)
bcrypt (~> 3.1.7)
bergamasco (~> 0.3.10)
better_errors
binding_of_caller
bolognese (~> 0.9, >= 0.9)
bootsnap (~> 1.2, >= 1.2.1)
bugsnag (~> 6.1, >= 6.1.1)
byebug
cancancan (~> 2.0)
Expand Down Expand Up @@ -465,14 +486,15 @@ DEPENDENCIES
lograge (~> 0.5)
mailgun-ruby (~> 1.1, >= 1.1.8)
maremma (>= 3.5)
mini_magick (~> 4.8)
multi_json
mysql2 (~> 0.4.10)
mysql2 (~> 0.4.4)
nokogiri (~> 1.8.1)
oj (~> 2.18, >= 2.18.1)
premailer (~> 1.11, >= 1.11.1)
pwqgen.rb (~> 0.1.0)
rack-cors (~> 1.0, >= 1.0.2)
rails (~> 5.1.1)
rails (~> 5.2.0.rc2)
rspec-rails (~> 3.5, >= 3.5.2)
shoryuken (~> 3.2, >= 3.2.2)
shoulda-matchers (~> 3.1)
Expand Down
2 changes: 1 addition & 1 deletion app/models/provider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def region_human_name
end

def logo_url
"#{ENV['CDN_URL']}/images/members/#{symbol.downcase}.png"
"#{ENV['CDN_URL']}/images/members/#{logo}" if logo.present?
end

def password_input=(value)
Expand Down
1 change: 1 addition & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
require "active_model/railtie"
require "active_job/railtie"
require "active_record/railtie"
require "active_storage/engine"
require "action_controller/railtie"
require "rails/test_unit/railtie"

Expand Down
1 change: 1 addition & 0 deletions config/boot.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)

require 'bundler/setup' # Set up gems listed in the Gemfile.
require 'bootsnap/setup' # Speed up boot time by caching expensive operations.
2 changes: 2 additions & 0 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
# config.action_mailer.raise_delivery_errors = false

config.active_storage.service = :amazon

# 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
Expand Down
2 changes: 2 additions & 0 deletions config/environments/stage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
# the I18n.default_locale when a translation cannot be found).
config.i18n.fallbacks = true

config.active_storage.service = :amazon

# Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify

Expand Down
10 changes: 6 additions & 4 deletions config/initializers/application_controller_renderer.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Be sure to restart your server when you modify this file.

# ApplicationController.renderer.defaults.merge!(
# http_host: 'example.org',
# https: false
# )
# ActiveSupport::Reloader.to_prepare do
# ApplicationController.renderer.defaults.merge!(
# http_host: 'example.org',
# https: false
# )
# end
35 changes: 35 additions & 0 deletions config/initializers/new_framework_defaults_5_2.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Be sure to restart your server when you modify this file.
#
# This file contains migration options to ease your Rails 5.2 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.

# Make Active Record use stable #cache_key alongside new #cache_version method.
# This is needed for recyclable cache keys.
# Rails.application.config.active_record.cache_versioning = true

# Use AES-256-GCM authenticated encryption for encrypted cookies.
# Also, embed cookie expiry in signed or encrypted cookies for increased security.
#
# This option is not backwards compatible with earlier Rails versions.
# It's best enabled when your entire app is migrated and stable on 5.2.
#
# Existing cookies will be converted on read then written with the new scheme.
# Rails.application.config.action_dispatch.use_authenticated_cookie_encryption = true

# Use AES-256-GCM authenticated encryption as default cipher for encrypting messages
# instead of AES-256-CBC, when use_authenticated_message_encryption is set to true.
# Rails.application.config.active_support.use_authenticated_message_encryption = true

# Add default protection from forgery to ActionController::Base instead of in
# ApplicationController.
# Rails.application.config.action_controller.default_protect_from_forgery = true

# Store boolean values are in sqlite3 databases as 1 and 0 instead of 't' and
# 'f' after migrating old data.
# Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true

# Use SHA-1 instead of MD5 to generate non-sensitive digests, such as the ETag header.
# Rails.application.config.active_support.use_sha1_digests = true
4 changes: 2 additions & 2 deletions config/spring.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%w(
%w[
.ruby-version
.rbenv-vars
tmp/restart.txt
tmp/caching-dev.txt
).each { |path| Spring.watch(path) }
].each { |path| Spring.watch(path) }
14 changes: 14 additions & 0 deletions config/storage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
test:
service: Disk
root: <%= Rails.root.join("tmp/storage") %>

local:
service: Disk
root: <%= Rails.root.join("storage") %>

amazon:
service: S3
access_key_id: <%= ENV['AWS_ACCESS_KEY_ID'] %>
secret_access_key: <%= ENV['AWS_SECRET_ACCESS_KEY'] %>
region: <%= ENV['AWS_REGION'] %>
bucket: <%= ENV['AWS_S3_BUCKET'] %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This migration comes from active_storage (originally 20170806125915)
class CreateActiveStorageTables < ActiveRecord::Migration[5.2]
def change
add_column :allocator, :logo, :string

create_table :active_storage_blobs do |t|
t.string :key, null: false
t.string :filename, null: false
t.string :content_type
t.text :metadata
t.bigint :byte_size, null: false
t.string :checksum, null: false
t.datetime :created_at, null: false

t.index [ :key ], unique: true
end

create_table :active_storage_attachments do |t|
t.string :name, null: false
t.references :record, null: false, polymorphic: true, index: false
t.references :blob, null: false

t.datetime :created_at, null: false

t.index [ :record_type, :record_id, :name, :blob_id ], name: "index_active_storage_attachments_uniqueness", unique: true
end
end
end
Loading

0 comments on commit d2efbde

Please sign in to comment.