lib/landable/traffic.rb in landable-1.13.1 vs lib/landable/traffic.rb in landable-1.13.2
- old
+ new
@@ -8,39 +8,35 @@
require 'landable/traffic/event_publisher'
module Landable
module Traffic
def track_with_landable!
- yield and return if untracked?
+ yield && return if untracked?
begin
@tracker = Tracker.for self
@tracker.track
rescue => e
Rails.logger.error e
- if respond_to? :newrelic_notice_error
- newrelic_notice_error e
- end
+ newrelic_notice_error e if respond_to? :newrelic_notice_error
end
yield
begin
@tracker.save
rescue => e
Rails.logger.error e
- if respond_to? :newrelic_notice_error
- newrelic_notice_error e
- end
+ newrelic_notice_error e if respond_to? :newrelic_notice_error
end
end
def untracked?
untracked_user? || untracked_path?
end
def untracked_user?
- Landable.configuration.dnt_enabled && request.headers["DNT"] == "1"
+ Landable.configuration.dnt_enabled && request.headers['DNT'] == '1'
end
def untracked_path?
Landable.configuration.untracked_paths.include? request.fullpath
end