Upgrade to Rails 5.2

This commit is contained in:
Karina Kwiatek 2020-04-19 00:45:50 +01:00
parent 012d29cc20
commit a19402af41
12 changed files with 67 additions and 67 deletions

View File

@ -1,7 +1,7 @@
source 'https://rubygems.org'
source 'https://rails-assets.org'
gem 'rails', '~> 5.0.7', '>= 5.0.7.2'
gem 'rails', '~> 5.2'
gem 'rails-i18n', '~> 5.0'
gem 'i18n-js', '= 3.0.0.rc10'

View File

@ -9,43 +9,47 @@ GEM
remote: https://rails-assets.org/
specs:
CFPropertyList (2.3.6)
actioncable (5.0.7.2)
actionpack (= 5.0.7.2)
nio4r (>= 1.2, < 3.0)
websocket-driver (~> 0.6.1)
actionmailer (5.0.7.2)
actionpack (= 5.0.7.2)
actionview (= 5.0.7.2)
activejob (= 5.0.7.2)
actioncable (5.2.4.2)
actionpack (= 5.2.4.2)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailer (5.2.4.2)
actionpack (= 5.2.4.2)
actionview (= 5.2.4.2)
activejob (= 5.2.4.2)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.0.7.2)
actionview (= 5.0.7.2)
activesupport (= 5.0.7.2)
rack (~> 2.0)
rack-test (~> 0.6.3)
actionpack (5.2.4.2)
actionview (= 5.2.4.2)
activesupport (= 5.2.4.2)
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 (5.0.7.2)
activesupport (= 5.0.7.2)
actionview (5.2.4.2)
activesupport (= 5.2.4.2)
builder (~> 3.1)
erubis (~> 2.7.0)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (5.0.7.2)
activesupport (= 5.0.7.2)
activejob (5.2.4.2)
activesupport (= 5.2.4.2)
globalid (>= 0.3.6)
activemodel (5.0.7.2)
activesupport (= 5.0.7.2)
activemodel (5.2.4.2)
activesupport (= 5.2.4.2)
activemodel-serializers-xml (1.0.2)
activemodel (> 5.x)
activesupport (> 5.x)
builder (~> 3.1)
activerecord (5.0.7.2)
activemodel (= 5.0.7.2)
activesupport (= 5.0.7.2)
arel (~> 7.0)
activesupport (5.0.7.2)
activerecord (5.2.4.2)
activemodel (= 5.2.4.2)
activesupport (= 5.2.4.2)
arel (>= 9.0)
activestorage (5.2.4.2)
actionpack (= 5.2.4.2)
activerecord (= 5.2.4.2)
marcel (~> 0.3.1)
activesupport (5.2.4.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
@ -54,7 +58,7 @@ GEM
public_suffix (>= 2.0.2, < 5.0)
airbrussh (1.4.0)
sshkit (>= 1.6.1, != 1.7.0)
arel (7.1.4)
arel (9.0.0)
autoprefixer-rails (9.7.6)
execjs
bcrypt (3.1.13)
@ -135,7 +139,6 @@ GEM
dry-inflector (0.2.0)
equalizer (0.0.11)
erubi (1.9.0)
erubis (2.7.0)
excon (0.73.0)
execjs (2.7.0)
factory_girl (4.9.0)
@ -391,13 +394,15 @@ GEM
lumberjack (1.2.4)
mail (2.7.1)
mini_mime (>= 0.1.1)
marcel (0.3.3)
mimemagic (~> 0.3.2)
memoizable (0.4.2)
thread_safe (~> 0.3, >= 0.3.1)
method_source (1.0.0)
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2019.1009)
mimemagic (0.3.0)
mimemagic (0.3.4)
mini_mime (1.0.2)
mini_portile2 (2.4.0)
minitest (5.14.0)
@ -437,12 +442,11 @@ GEM
rack
optimist (3.0.0)
orm_adapter (0.5.0)
paperclip (4.3.7)
paperclip (4.2.4)
activemodel (>= 3.2.0)
activesupport (>= 3.2.0)
cocaine (~> 0.5.5)
mime-types
mimemagic (= 0.3.0)
pg (1.2.3)
pghero (2.4.2)
activerecord (>= 5)
@ -462,19 +466,20 @@ GEM
rack (>= 1.1)
rack-protection (2.0.8.1)
rack
rack-test (0.6.3)
rack (>= 1.0)
rails (5.0.7.2)
actioncable (= 5.0.7.2)
actionmailer (= 5.0.7.2)
actionpack (= 5.0.7.2)
actionview (= 5.0.7.2)
activejob (= 5.0.7.2)
activemodel (= 5.0.7.2)
activerecord (= 5.0.7.2)
activesupport (= 5.0.7.2)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (5.2.4.2)
actioncable (= 5.2.4.2)
actionmailer (= 5.2.4.2)
actionpack (= 5.2.4.2)
actionview (= 5.2.4.2)
activejob (= 5.2.4.2)
activemodel (= 5.2.4.2)
activerecord (= 5.2.4.2)
activestorage (= 5.2.4.2)
activesupport (= 5.2.4.2)
bundler (>= 1.3.0)
railties (= 5.0.7.2)
railties (= 5.2.4.2)
sprockets-rails (>= 2.0.0)
rails-assets-growl (1.3.5)
rails-assets-jquery
@ -499,12 +504,12 @@ GEM
rails (>= 5.0, < 7)
remotipart (~> 1.3)
sassc-rails (>= 1.3, < 3)
railties (5.0.7.2)
actionpack (= 5.0.7.2)
activesupport (= 5.0.7.2)
railties (5.2.4.2)
actionpack (= 5.2.4.2)
activesupport (= 5.2.4.2)
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
thor (>= 0.19.0, < 2.0)
raindrops (0.19.1)
rake (13.0.1)
rb-fsevent (0.10.3)
@ -551,8 +556,8 @@ GEM
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sass-rails (5.0.7)
railties (>= 4.0.0, < 6)
sass-rails (5.1.0)
railties (>= 5.2.0)
sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
@ -642,7 +647,7 @@ GEM
binding_of_caller (>= 0.7.2)
railties (>= 4.0)
sprockets-rails (>= 2.0, < 4.0)
websocket-driver (0.6.5)
websocket-driver (0.7.1)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.4)
will_paginate (3.3.0)
@ -704,7 +709,7 @@ DEPENDENCIES
poltergeist
puma
questiongenerator!
rails (~> 5.0.7, >= 5.0.7.2)
rails (~> 5.2)
rails-assets-growl
rails-assets-jquery (~> 2.2.0)
rails-i18n (~> 5.0)

View File

@ -1,5 +1,5 @@
class Ajax::SubscriptionController < ApplicationController
before_filter :authenticate_user!
before_action :authenticate_user!
rescue_from(ActionController::ParameterMissing) do |param_miss_ex|
@status = :parameter_error
@message = I18n.t('messages.parameter_error', parameter: param_miss_ex.param.capitalize)

View File

@ -3,9 +3,9 @@ class ApplicationController < ActionController::Base
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
before_filter :configure_permitted_parameters, if: :devise_controller?
before_filter :check_locale
before_filter :banned?
before_action :configure_permitted_parameters, if: :devise_controller?
before_action :check_locale
before_action :banned?
# check if user wants to read
def check_locale

View File

@ -1,5 +1,5 @@
class DiscoverController < ApplicationController
before_filter :authenticate_user!
before_action :authenticate_user!
def index
top_x = 10 # only display the top X items

View File

@ -1,5 +1,5 @@
class GroupController < ApplicationController
before_filter :authenticate_user!
before_action :authenticate_user!
def index
@group = current_user.groups.find_by_name!(params[:group_name])

View File

@ -1,5 +1,5 @@
class InboxController < ApplicationController
before_filter :authenticate_user!
before_action :authenticate_user!
def show
@inbox = Inbox.where(user: current_user)

View File

@ -1,5 +1,5 @@
class ModerationController < ApplicationController
before_filter :authenticate_user!
before_action :authenticate_user!
def index
@type = params[:type]

View File

@ -1,5 +1,5 @@
class NotificationsController < ApplicationController
before_filter :authenticate_user!
before_action :authenticate_user!
def index
@type = params[:type]

View File

@ -1,5 +1,5 @@
class PublicController < ApplicationController
before_filter :authenticate_user!
before_action :authenticate_user!
def index
@timeline = Answer.joins(:user).where(users: { privacy_allow_public_timeline: true }).all.reverse_order.paginate(page: params[:page])

View File

@ -1,7 +1,7 @@
class UserController < ApplicationController
include ThemeHelper
before_filter :authenticate_user!, only: %w(edit update edit_privacy update_privacy edit_theme update_theme preview_theme delete_theme data export begin_export)
before_action :authenticate_user!, only: %w(edit update edit_privacy update_privacy edit_theme update_theme preview_theme delete_theme data export begin_export)
def show
@user = User.where('LOWER(screen_name) = ?', params[:username].downcase).first!

View File

@ -6,8 +6,6 @@
#
# Read the Guide for Upgrading Ruby on Rails for more info on each option.
Rails.application.config.action_controller.raise_on_unfiltered_parameters = true
# Enable per-form CSRF tokens. Previous versions had false.
Rails.application.config.action_controller.per_form_csrf_tokens = false
@ -20,6 +18,3 @@ ActiveSupport.to_time_preserves_timezone = false
# Require `belongs_to` associations by default. Previous versions had false.
Rails.application.config.active_record.belongs_to_required_by_default = true# false
# Do not halt callback chains when a callback returns false. Previous versions had true.
ActiveSupport.halt_callback_chains_on_return_false = true