it can happen that the http referer is nil when we expect it to be set (for example if the user has a privacy extension enabled

This commit is contained in:
MrZYX 2011-03-01 18:38:40 +01:00
parent 31f5500b11
commit 00ebf6469b

View file

@ -6,6 +6,7 @@ class ApplicationController < ActionController::Base
has_mobile_fu
protect_from_forgery :except => :receive
before_filter :ensure_http_referer_is_set
before_filter :set_contacts_notifications_and_status, :except => [:create, :update]
before_filter :count_requests
before_filter :set_invites
@ -17,6 +18,10 @@ class ApplicationController < ActionController::Base
inflection_method :grammatical_gender => :gender
def ensure_http_referer_is_set
request.env['HTTP_REFERER'] ||= '/aspects'
end
def set_contacts_notifications_and_status
if user_signed_in?
@aspect = nil