referer = nil
end
- referer.to_s
+ referer&.to_s
end
def scope_enabled?(scope)
friendship.add_error(t("friendships.make_friend.failed", :name => @new_friend.display_name))
end
- if params[:referer]
- redirect_to safe_referer(params[:referer])
- else
- redirect_to user_path
- end
+ referer = safe_referer(params[:referer]) if params[:referer]
+
+ redirect_to referer || user_path
end
else
render_unknown_user params[:display_name]
flash[:error] = t "friendships.remove_friend.not_a_friend", :name => @friend.display_name
end
- if params[:referer]
- redirect_to safe_referer(params[:referer])
- else
- redirect_to user_path
- end
+ referer = safe_referer(params[:referer]) if params[:referer]
+
+ redirect_to referer || user_path
end
else
render_unknown_user params[:display_name]
if @message.save && !request.xhr?
flash[:notice] = t ".destroyed"
- if params[:referer]
- redirect_to safe_referer(params[:referer])
+ referer = safe_referer(params[:referer]) if params[:referer]
+
+ if referer
+ redirect_to referer
else
redirect_to :action => :inbox
end
token&.destroy
session.delete(:token)
end
+
session.delete(:user)
session_expires_automatically
- if params[:referer]
- redirect_to safe_referer(params[:referer])
+
+ referer = safe_referer(params[:referer]) if params[:referer]
+
+ if referer
+ redirect_to referer
else
redirect_to :controller => "site", :action => "index"
end
flash[:notice] = { :partial => "users/terms_declined_flash" } if current_user.save
- if params[:referer]
- redirect_to safe_referer(params[:referer])
- else
- redirect_to user_account_path(current_user)
- end
+ referer = safe_referer(params[:referer]) if params[:referer]
+
+ redirect_to referer || user_account_path(current_user)
elsif params[:decline]
redirect_to t("users.terms.declined")
else
flash[:notice] = t "users.new.terms accepted" if current_user.save
end
- if params[:referer]
- redirect_to safe_referer(params[:referer])
- else
- redirect_to user_account_path(current_user)
- end
+ referer = safe_referer(params[:referer]) if params[:referer]
+
+ redirect_to referer || user_account_path(current_user)
else
self.current_user = session.delete(:new_user)