Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Rails 6.1 #203

Draft
wants to merge 3 commits into
base: staging
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ source 'https://rubygems.org'

ruby '2.7.6'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.0.5'
gem 'rails', '~> 6.1.6'
# Use postgresql as the database for Active Record
gem 'pg', '~> 1.4.1'

Expand Down
131 changes: 67 additions & 64 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,63 +1,67 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (6.0.5.1)
actionpack (= 6.0.5.1)
actioncable (6.1.6.1)
actionpack (= 6.1.6.1)
activesupport (= 6.1.6.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.0.5.1)
actionpack (= 6.0.5.1)
activejob (= 6.0.5.1)
activerecord (= 6.0.5.1)
activestorage (= 6.0.5.1)
activesupport (= 6.0.5.1)
actionmailbox (6.1.6.1)
actionpack (= 6.1.6.1)
activejob (= 6.1.6.1)
activerecord (= 6.1.6.1)
activestorage (= 6.1.6.1)
activesupport (= 6.1.6.1)
mail (>= 2.7.1)
actionmailer (6.0.5.1)
actionpack (= 6.0.5.1)
actionview (= 6.0.5.1)
activejob (= 6.0.5.1)
actionmailer (6.1.6.1)
actionpack (= 6.1.6.1)
actionview (= 6.1.6.1)
activejob (= 6.1.6.1)
activesupport (= 6.1.6.1)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.0.5.1)
actionview (= 6.0.5.1)
activesupport (= 6.0.5.1)
rack (~> 2.0, >= 2.0.8)
actionpack (6.1.6.1)
actionview (= 6.1.6.1)
activesupport (= 6.1.6.1)
rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actionpack-action_caching (1.2.2)
actionpack (>= 4.0.0)
actiontext (6.0.5.1)
actionpack (= 6.0.5.1)
activerecord (= 6.0.5.1)
activestorage (= 6.0.5.1)
activesupport (= 6.0.5.1)
actiontext (6.1.6.1)
actionpack (= 6.1.6.1)
activerecord (= 6.1.6.1)
activestorage (= 6.1.6.1)
activesupport (= 6.1.6.1)
nokogiri (>= 1.8.5)
actionview (6.0.5.1)
activesupport (= 6.0.5.1)
actionview (6.1.6.1)
activesupport (= 6.1.6.1)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (6.0.5.1)
activesupport (= 6.0.5.1)
activejob (6.1.6.1)
activesupport (= 6.1.6.1)
globalid (>= 0.3.6)
activemodel (6.0.5.1)
activesupport (= 6.0.5.1)
activerecord (6.0.5.1)
activemodel (= 6.0.5.1)
activesupport (= 6.0.5.1)
activestorage (6.0.5.1)
actionpack (= 6.0.5.1)
activejob (= 6.0.5.1)
activerecord (= 6.0.5.1)
activemodel (6.1.6.1)
activesupport (= 6.1.6.1)
activerecord (6.1.6.1)
activemodel (= 6.1.6.1)
activesupport (= 6.1.6.1)
activestorage (6.1.6.1)
actionpack (= 6.1.6.1)
activejob (= 6.1.6.1)
activerecord (= 6.1.6.1)
activesupport (= 6.1.6.1)
marcel (~> 1.0)
activesupport (6.0.5.1)
mini_mime (>= 1.1.0)
activesupport (6.1.6.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.2, >= 2.2.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
algolia (2.2.2)
faraday (>= 0.15, < 2.0)
multi_json (~> 1.0)
Expand Down Expand Up @@ -167,20 +171,20 @@ GEM
rack (>= 2.0.0)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (6.0.5.1)
actioncable (= 6.0.5.1)
actionmailbox (= 6.0.5.1)
actionmailer (= 6.0.5.1)
actionpack (= 6.0.5.1)
actiontext (= 6.0.5.1)
actionview (= 6.0.5.1)
activejob (= 6.0.5.1)
activemodel (= 6.0.5.1)
activerecord (= 6.0.5.1)
activestorage (= 6.0.5.1)
activesupport (= 6.0.5.1)
bundler (>= 1.3.0)
railties (= 6.0.5.1)
rails (6.1.6.1)
actioncable (= 6.1.6.1)
actionmailbox (= 6.1.6.1)
actionmailer (= 6.1.6.1)
actionpack (= 6.1.6.1)
actiontext (= 6.1.6.1)
actionview (= 6.1.6.1)
activejob (= 6.1.6.1)
activemodel (= 6.1.6.1)
activerecord (= 6.1.6.1)
activestorage (= 6.1.6.1)
activesupport (= 6.1.6.1)
bundler (>= 1.15.0)
railties (= 6.1.6.1)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
Expand All @@ -191,12 +195,12 @@ GEM
nokogiri (>= 1.6)
rails-html-sanitizer (1.4.3)
loofah (~> 2.3)
railties (6.0.5.1)
actionpack (= 6.0.5.1)
activesupport (= 6.0.5.1)
railties (6.1.6.1)
actionpack (= 6.1.6.1)
activesupport (= 6.1.6.1)
method_source
rake (>= 0.8.7)
thor (>= 0.20.3, < 2.0)
rake (>= 12.2)
thor (~> 1.0)
rake (13.0.6)
representable (3.1.1)
declarative (< 0.1.0)
Expand Down Expand Up @@ -245,7 +249,7 @@ GEM
skylight (5.3.0)
activesupport (>= 5.2.0)
spring (4.0.0)
sprockets (4.0.2)
sprockets (4.1.1)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.4.2)
Expand All @@ -256,10 +260,9 @@ GEM
diffy (~> 3.0)
nokogiri (>= 1.3.2)
thor (1.2.1)
thread_safe (0.3.6)
trailblazer-option (0.1.2)
tzinfo (1.2.10)
thread_safe (~> 0.1)
tzinfo (2.0.5)
concurrent-ruby (~> 1.0)
uber (0.1.0)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
Expand Down Expand Up @@ -296,7 +299,7 @@ DEPENDENCIES
pry-rails (~> 0.3.9)
puma (~> 5.6.4)
rack-cors
rails (~> 6.0.5)
rails (~> 6.1.6)
rails-controller-testing
responders
roar-rails
Expand All @@ -313,4 +316,4 @@ RUBY VERSION
ruby 2.7.6p219

BUNDLED WITH
2.3.9
2.3.21
2 changes: 1 addition & 1 deletion app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def show
end

def finished_tutorial
@user.update_attributes needs_tutorial: false
@user.update(needs_tutorial: false)
render json: user_representation(@user)
end

Expand Down
6 changes: 3 additions & 3 deletions app/models/organization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,16 @@ def can_access?(user, passed_api_token)

def enable_api_access!
return true if api_enabled
update_attributes api_token: get_secure_token, api_enabled: true
update(api_token: get_secure_token, api_enabled: true)
end

def disable_api_access!
return true unless api_enabled
update_attributes api_token: nil, api_enabled: false
update(api_token: nil, api_enabled: false)
end

def rotate_api_token!
update_attributes api_token: get_secure_token if api_enabled
update(api_token: get_secure_token) if api_enabled
end

private
Expand Down
8 changes: 4 additions & 4 deletions app/models/space.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def recommend!
end

def clean_graph!
update_attributes(graph: cleaned_graph)
update(graph: cleaned_graph)
end

def cleaned_graph
Expand Down Expand Up @@ -268,16 +268,16 @@ def decrement_exported_facts_count!

def enable_shareable_link!
return true if shareable_link_enabled
update_attributes shareable_link_token: get_secure_token, shareable_link_enabled: true
update(shareable_link_token: get_secure_token, shareable_link_enabled: true)
end

def disable_shareable_link!
return true unless shareable_link_enabled
update_attributes shareable_link_token: nil, shareable_link_enabled: false
update(shareable_link_token: nil, shareable_link_enabled: false)
end

def rotate_shareable_link!
update_attributes shareable_link_token: get_secure_token if shareable_link_enabled
update(shareable_link_token: get_secure_token) if shareable_link_enabled
end

def shareable_link_url
Expand Down
7 changes: 6 additions & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
require File.expand_path('../boot', __FILE__)

require 'rails/all'
require "rails"
require "active_model/railtie"
require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "action_view/railtie"

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Expand Down
14 changes: 0 additions & 14 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,6 @@
# Raise an error on page load if there are pending migrations.
config.active_record.migration_error = :page_load

# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large
# number of complex assets.
config.assets.debug = true

# Asset digests allow you to set far-future HTTP expiration dates on all assets,
# yet still be able to expire them through the digest params.
config.assets.digest = true

# Adds additional error checking when serving assets at runtime.
# Checks for improperly declared sprockets dependencies.
# Raises helpful error messages.
config.assets.raise_runtime_errors = true

# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true

Expand Down
13 changes: 0 additions & 13 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,6 @@
config.logger = ActiveSupport::TaggedLogging.new(logger)
end

# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
# config.assets.css_compressor = :sass

# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false

# Asset digests allow you to set far-future HTTP expiration dates on all assets,
# yet still be able to expire them through the digest params.
config.assets.digest = true

# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb

# Specifies the header that your server uses for sending files.
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
Expand Down