diff --git a/Gemfile b/Gemfile index 1e9adae2..3e9c5879 100644 --- a/Gemfile +++ b/Gemfile @@ -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' diff --git a/Gemfile.lock b/Gemfile.lock index 612e4bb5..ca0370a9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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) diff --git a/app/controllers/ajax/subscription_controller.rb b/app/controllers/ajax/subscription_controller.rb index aaca19bb..746bcf48 100644 --- a/app/controllers/ajax/subscription_controller.rb +++ b/app/controllers/ajax/subscription_controller.rb @@ -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) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index ef5ee974..ccc1e3f9 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -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 diff --git a/app/controllers/discover_controller.rb b/app/controllers/discover_controller.rb index 5d1490a5..dc553544 100644 --- a/app/controllers/discover_controller.rb +++ b/app/controllers/discover_controller.rb @@ -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 diff --git a/app/controllers/group_controller.rb b/app/controllers/group_controller.rb index 7c3eb2c1..7fc45a42 100644 --- a/app/controllers/group_controller.rb +++ b/app/controllers/group_controller.rb @@ -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]) diff --git a/app/controllers/inbox_controller.rb b/app/controllers/inbox_controller.rb index 63ffa80f..5b40b455 100644 --- a/app/controllers/inbox_controller.rb +++ b/app/controllers/inbox_controller.rb @@ -1,5 +1,5 @@ class InboxController < ApplicationController - before_filter :authenticate_user! + before_action :authenticate_user! def show @inbox = Inbox.where(user: current_user) diff --git a/app/controllers/moderation_controller.rb b/app/controllers/moderation_controller.rb index 98b62c5f..dd23ec67 100644 --- a/app/controllers/moderation_controller.rb +++ b/app/controllers/moderation_controller.rb @@ -1,5 +1,5 @@ class ModerationController < ApplicationController - before_filter :authenticate_user! + before_action :authenticate_user! def index @type = params[:type] diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index 32861e64..8e824ebc 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -1,5 +1,5 @@ class NotificationsController < ApplicationController - before_filter :authenticate_user! + before_action :authenticate_user! def index @type = params[:type] diff --git a/app/controllers/public_controller.rb b/app/controllers/public_controller.rb index 9ea76e76..d5b8af94 100644 --- a/app/controllers/public_controller.rb +++ b/app/controllers/public_controller.rb @@ -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]) diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 104062c6..acebb416 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -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! diff --git a/config/initializers/new_framework_defaults.rb b/config/initializers/new_framework_defaults.rb index f9fa1b88..9bbfaab6 100644 --- a/config/initializers/new_framework_defaults.rb +++ b/config/initializers/new_framework_defaults.rb @@ -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