diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 320ce93f0..73a3a35cf 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -6,13 +6,13 @@ class ApplicationController < ActionController::Base has_mobile_fu protect_from_forgery :except => :receive - before_filter :ensure_http_referer_is_set - before_filter :set_locale - before_filter :set_diaspora_header - before_filter :set_grammatical_gender - before_filter :mobile_switch - before_filter :gon_set_current_user - before_filter :gon_set_preloads + before_action :ensure_http_referer_is_set + before_action :set_locale + before_action :set_diaspora_header + before_action :set_grammatical_gender + before_action :mobile_switch + before_action :gon_set_current_user + before_action :gon_set_preloads inflection_method :grammatical_gender => :gender diff --git a/app/controllers/aspect_memberships_controller.rb b/app/controllers/aspect_memberships_controller.rb index ba0515bd1..5009902b9 100644 --- a/app/controllers/aspect_memberships_controller.rb +++ b/app/controllers/aspect_memberships_controller.rb @@ -4,7 +4,7 @@ # class AspectMembershipsController < ApplicationController - before_filter :authenticate_user! + before_action :authenticate_user! respond_to :html, :json diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 94460d09c..4afce2b8d 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -3,7 +3,7 @@ # the COPYRIGHT file. class AspectsController < ApplicationController - before_filter :authenticate_user! + before_action :authenticate_user! respond_to :html, :js, diff --git a/app/controllers/blocks_controller.rb b/app/controllers/blocks_controller.rb index f6f13ed7c..bcea0e561 100644 --- a/app/controllers/blocks_controller.rb +++ b/app/controllers/blocks_controller.rb @@ -1,5 +1,5 @@ class BlocksController < ApplicationController - before_filter :authenticate_user! + before_action :authenticate_user! respond_to :html, :json diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 18de5d16a..b368876d6 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -4,7 +4,7 @@ class CommentsController < ApplicationController include ApplicationHelper - before_filter :authenticate_user!, :except => [:index] + before_action :authenticate_user!, :except => [:index] respond_to :html, :mobile, diff --git a/app/controllers/contacts_controller.rb b/app/controllers/contacts_controller.rb index 68e3f6469..9508b4eb2 100644 --- a/app/controllers/contacts_controller.rb +++ b/app/controllers/contacts_controller.rb @@ -3,7 +3,7 @@ # the COPYRIGHT file. class ContactsController < ApplicationController - before_filter :authenticate_user! + before_action :authenticate_user! use_bootstrap_for :index, :spotlight diff --git a/app/controllers/conversation_visibilities_controller.rb b/app/controllers/conversation_visibilities_controller.rb index 125fdf985..24b4533ad 100644 --- a/app/controllers/conversation_visibilities_controller.rb +++ b/app/controllers/conversation_visibilities_controller.rb @@ -4,7 +4,7 @@ # class ConversationVisibilitiesController < ApplicationController - before_filter :authenticate_user! + before_action :authenticate_user! def destroy @vis = ConversationVisibility.where(:person_id => current_user.person.id, diff --git a/app/controllers/conversations_controller.rb b/app/controllers/conversations_controller.rb index 07ec4fd2b..58638651d 100644 --- a/app/controllers/conversations_controller.rb +++ b/app/controllers/conversations_controller.rb @@ -1,5 +1,5 @@ class ConversationsController < ApplicationController - before_filter :authenticate_user! + before_action :authenticate_user! layout ->(c) { request.format == :mobile ? "application" : "with_header" } use_bootstrap_for :index, :show, :new diff --git a/app/controllers/invitation_codes_controller.rb b/app/controllers/invitation_codes_controller.rb index d267db12f..896514739 100644 --- a/app/controllers/invitation_codes_controller.rb +++ b/app/controllers/invitation_codes_controller.rb @@ -1,5 +1,5 @@ class InvitationCodesController < ApplicationController - before_filter :ensure_valid_invite_code + before_action :ensure_valid_invite_code rescue_from ActiveRecord::RecordNotFound do redirect_to root_url, :notice => "That invite code is no longer valid" diff --git a/app/controllers/invitations_controller.rb b/app/controllers/invitations_controller.rb index ffcae4a0c..391c36cb5 100644 --- a/app/controllers/invitations_controller.rb +++ b/app/controllers/invitations_controller.rb @@ -4,7 +4,7 @@ class InvitationsController < ApplicationController - before_filter :authenticate_user!, :only => [:new, :create] + before_action :authenticate_user!, :only => [:new, :create] def new @invite_code = current_user.invitation_code diff --git a/app/controllers/likes_controller.rb b/app/controllers/likes_controller.rb index 8ab65b6ca..c5750bee5 100644 --- a/app/controllers/likes_controller.rb +++ b/app/controllers/likes_controller.rb @@ -4,7 +4,7 @@ class LikesController < ApplicationController include ApplicationHelper - before_filter :authenticate_user! + before_action :authenticate_user! respond_to :html, :mobile, diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index 752ffd573..e2f435af4 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -3,7 +3,7 @@ # the COPYRIGHT file. class MessagesController < ApplicationController - before_filter :authenticate_user! + before_action :authenticate_user! respond_to :html, :mobile respond_to :json, :only => :show diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index ef98e5b14..2f5a92191 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -3,7 +3,7 @@ # the COPYRIGHT file. class NotificationsController < ApplicationController - before_filter :authenticate_user! + before_action :authenticate_user! layout ->(c) { request.format == :mobile ? "application" : "with_header_with_footer" } use_bootstrap_for :index diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index 1616c80f2..df95f3d92 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -3,7 +3,7 @@ # the COPYRIGHT file. class PeopleController < ApplicationController - before_filter :authenticate_user!, :except => [:show, :last_post] + before_action :authenticate_user!, :except => [:show, :last_post] use_bootstrap_for :index diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index 18203d8c9..7e1fad0a6 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -3,7 +3,7 @@ # the COPYRIGHT file. class PhotosController < ApplicationController - before_filter :authenticate_user!, :except => :show + before_action :authenticate_user!, :except => :show respond_to :html, :json diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index 2f14fb638..56858f03e 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -5,9 +5,8 @@ class PostsController < ApplicationController include PostsHelper - before_filter :authenticate_user!, :except => [:show, :iframe, :oembed, :interactions] - before_filter :set_format_if_malformed_from_status_net, :only => :show - before_filter :find_post, :only => [:show, :interactions] + before_action :authenticate_user!, :except => [:show, :iframe, :oembed, :interactions] + before_action :set_format_if_malformed_from_status_net, :only => :show use_bootstrap_for :show diff --git a/app/controllers/profiles_controller.rb b/app/controllers/profiles_controller.rb index 4a78e21d4..1d1bcbf8d 100644 --- a/app/controllers/profiles_controller.rb +++ b/app/controllers/profiles_controller.rb @@ -3,8 +3,8 @@ # the COPYRIGHT file. class ProfilesController < ApplicationController - before_filter :authenticate_user!, :except => ['show'] - before_filter -> { @css_framework = :bootstrap }, only: [:show, :edit] + before_action :authenticate_user!, :except => ['show'] + before_action -> { @css_framework = :bootstrap }, only: [:show, :edit] layout ->(c) { request.format == :mobile ? "application" : "with_header_with_footer" }, only: [:show, :edit] diff --git a/app/controllers/publics_controller.rb b/app/controllers/publics_controller.rb index c0724190e..3609bdefa 100644 --- a/app/controllers/publics_controller.rb +++ b/app/controllers/publics_controller.rb @@ -5,10 +5,10 @@ class PublicsController < ApplicationController include Diaspora::Parser - skip_before_filter :set_header_data - skip_before_filter :set_grammatical_gender - before_filter :check_for_xml, :only => [:receive, :receive_public] - before_filter :authenticate_user!, :only => [:index] + skip_before_action :set_header_data + skip_before_action :set_grammatical_gender + before_action :check_for_xml, :only => [:receive, :receive_public] + before_action :authenticate_user!, :only => [:index] respond_to :html respond_to :xml, :only => :post diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index c1e24e91e..ff3699a3f 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -3,10 +3,10 @@ # the COPYRIGHT file. class RegistrationsController < Devise::RegistrationsController - before_filter :check_registrations_open_or_valid_invite!, :check_valid_invite! + before_action :check_registrations_open_or_valid_invite!, :check_valid_invite! layout ->(c) { request.format == :mobile ? "application" : "with_header" }, :only => [:new] - before_filter -> { @css_framework = :bootstrap }, only: [:new, :create] + before_action -> { @css_framework = :bootstrap }, only: [:new, :create] def create @user = User.build(user_params) diff --git a/app/controllers/reshares_controller.rb b/app/controllers/reshares_controller.rb index 5748386e1..7fc4e815f 100644 --- a/app/controllers/reshares_controller.rb +++ b/app/controllers/reshares_controller.rb @@ -1,5 +1,5 @@ class ResharesController < ApplicationController - before_filter :authenticate_user! + before_action :authenticate_user! respond_to :json def create diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index cc510215f..6c2f43474 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -1,5 +1,5 @@ class SearchController < ApplicationController - before_filter :authenticate_user! + before_action :authenticate_user! def search if search_query.starts_with?('#') diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb index 69fc83a0e..8baa56cfd 100644 --- a/app/controllers/services_controller.rb +++ b/app/controllers/services_controller.rb @@ -5,10 +5,10 @@ class ServicesController < ApplicationController # We need to take a raw POST from an omniauth provider with no authenticity token. # See https://github.com/intridea/omniauth/issues/203 # See also http://www.communityguides.eu/articles/16 - skip_before_filter :verify_authenticity_token, :only => :create - before_filter :authenticate_user! - before_filter :abort_if_already_authorized, :abort_if_read_only_access, :only => :create - before_filter -> { @css_framework = :bootstrap }, only: [:index] + skip_before_action :verify_authenticity_token, :only => :create + before_action :authenticate_user! + before_action :abort_if_already_authorized, :abort_if_read_only_access, :only => :create + before_action -> { @css_framework = :bootstrap }, only: [:index] layout ->(c) { request.format == :mobile ? "application" : "with_header_with_footer" }, only: [:index] diff --git a/app/controllers/share_visibilities_controller.rb b/app/controllers/share_visibilities_controller.rb index 005b0288a..bbc7bba16 100644 --- a/app/controllers/share_visibilities_controller.rb +++ b/app/controllers/share_visibilities_controller.rb @@ -4,7 +4,7 @@ # class ShareVisibilitiesController < ApplicationController - before_filter :authenticate_user! + before_action :authenticate_user! def update #note :id references a postvisibility diff --git a/app/controllers/status_messages_controller.rb b/app/controllers/status_messages_controller.rb index 06790768b..76cfc55aa 100644 --- a/app/controllers/status_messages_controller.rb +++ b/app/controllers/status_messages_controller.rb @@ -3,9 +3,9 @@ # the COPYRIGHT file. class StatusMessagesController < ApplicationController - before_filter :authenticate_user! + before_action :authenticate_user! - before_filter :remove_getting_started, :only => [:create] + before_action :remove_getting_started, :only => [:create] use_bootstrap_for :bookmarklet diff --git a/app/controllers/streams_controller.rb b/app/controllers/streams_controller.rb index 6ce788a17..0e4c156ca 100644 --- a/app/controllers/streams_controller.rb +++ b/app/controllers/streams_controller.rb @@ -3,9 +3,9 @@ # the COPYRIGHT file. class StreamsController < ApplicationController - before_filter :authenticate_user! - before_filter :save_selected_aspects, :only => :aspects - before_filter :redirect_unless_admin, :only => :public + before_action :authenticate_user! + before_action :save_selected_aspects, :only => :aspects + before_action :redirect_unless_admin, :only => :public respond_to :html, :mobile, diff --git a/app/controllers/tag_followings_controller.rb b/app/controllers/tag_followings_controller.rb index 94299bf8f..34c35184f 100644 --- a/app/controllers/tag_followings_controller.rb +++ b/app/controllers/tag_followings_controller.rb @@ -4,7 +4,7 @@ # class TagFollowingsController < ApplicationController - before_filter :authenticate_user! + before_action :authenticate_user! respond_to :json diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 86b095975..44f44239c 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -3,8 +3,8 @@ # the COPYRIGHT file. class TagsController < ApplicationController - skip_before_filter :set_grammatical_gender - before_filter :ensure_page, :only => :show + skip_before_action :set_grammatical_gender + before_action :ensure_page, :only => :show helper_method :tag_followed? diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index ef0ec6d14..d31773443 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -3,8 +3,8 @@ # the COPYRIGHT file. class UsersController < ApplicationController - before_filter :authenticate_user!, :except => [:new, :create, :public, :user_photo] - before_filter -> { @css_framework = :bootstrap }, only: [:privacy_settings, :edit] + before_action :authenticate_user!, :except => [:new, :create, :public, :user_photo] + before_action -> { @css_framework = :bootstrap }, only: [:privacy_settings, :edit] layout ->(c) { request.format == :mobile ? "application" : "with_header_with_footer" }, only: [:privacy_settings, :edit]