Skip to content
Extraits de code Groupes Projets
Valider f33038f1 rédigé par Niall Paterson's avatar Niall Paterson Validation de Jonne Haß
Parcourir les fichiers

updated before_filters to before_actions as recommended for rails 4

parent 244388fc
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Affichage de
avec 32 ajouts et 33 suppressions
......@@ -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
......
......@@ -4,7 +4,7 @@
#
class AspectMembershipsController < ApplicationController
before_filter :authenticate_user!
before_action :authenticate_user!
respond_to :html, :json
......
......@@ -3,7 +3,7 @@
# the COPYRIGHT file.
class AspectsController < ApplicationController
before_filter :authenticate_user!
before_action :authenticate_user!
respond_to :html,
:js,
......
class BlocksController < ApplicationController
before_filter :authenticate_user!
before_action :authenticate_user!
respond_to :html, :json
......
......@@ -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,
......
......@@ -3,7 +3,7 @@
# the COPYRIGHT file.
class ContactsController < ApplicationController
before_filter :authenticate_user!
before_action :authenticate_user!
use_bootstrap_for :index, :spotlight
......
......@@ -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,
......
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
......
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"
......
......@@ -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
......
......@@ -4,7 +4,7 @@
class LikesController < ApplicationController
include ApplicationHelper
before_filter :authenticate_user!
before_action :authenticate_user!
respond_to :html,
:mobile,
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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]
......
......@@ -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
......
......@@ -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)
......
class ResharesController < ApplicationController
before_filter :authenticate_user!
before_action :authenticate_user!
respond_to :json
def create
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter