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:
parent
31f5500b11
commit
00ebf6469b
1 changed files with 5 additions and 0 deletions
|
|
@ -6,6 +6,7 @@ class ApplicationController < ActionController::Base
|
||||||
has_mobile_fu
|
has_mobile_fu
|
||||||
protect_from_forgery :except => :receive
|
protect_from_forgery :except => :receive
|
||||||
|
|
||||||
|
before_filter :ensure_http_referer_is_set
|
||||||
before_filter :set_contacts_notifications_and_status, :except => [:create, :update]
|
before_filter :set_contacts_notifications_and_status, :except => [:create, :update]
|
||||||
before_filter :count_requests
|
before_filter :count_requests
|
||||||
before_filter :set_invites
|
before_filter :set_invites
|
||||||
|
|
@ -17,6 +18,10 @@ class ApplicationController < ActionController::Base
|
||||||
|
|
||||||
inflection_method :grammatical_gender => :gender
|
inflection_method :grammatical_gender => :gender
|
||||||
|
|
||||||
|
def ensure_http_referer_is_set
|
||||||
|
request.env['HTTP_REFERER'] ||= '/aspects'
|
||||||
|
end
|
||||||
|
|
||||||
def set_contacts_notifications_and_status
|
def set_contacts_notifications_and_status
|
||||||
if user_signed_in?
|
if user_signed_in?
|
||||||
@aspect = nil
|
@aspect = nil
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue