Module: Land::Action
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/land/action.rb
Instance Method Summary collapse
-
#track_with_land! ⇒ Object
Use @land to avoid conflicts in controller namespace.
- #untracked? ⇒ Boolean
- #untracked_ip? ⇒ Boolean
- #untracked_path? ⇒ Boolean
Instance Method Details
#track_with_land! ⇒ Object
Use @land to avoid conflicts in controller namespace
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/land/action.rb', line 10 def track_with_land! yield && return if untracked? begin @land = Tracker.for(self) @land.track rescue => e begin Rails.logger.error e if defined?(NewRelic::Agent) && NewRelic::Agent.respond_to?(:notice_error) NewRelic::Agent.notice_error(e) end rescue # eat this error end end begin yield rescue => e @land.status = ActionDispatch::ExceptionWrapper.status_code_for_exception(e.class.name) raise e ensure begin @land.save rescue => e begin Rails.logger.error e if defined?(NewRelic::Agent) && NewRelic::Agent.respond_to?(:notice_error) NewRelic::Agent.notice_error(e) end rescue # bubble controller error, not this one end end end end |
#untracked? ⇒ Boolean
50 51 52 |
# File 'lib/land/action.rb', line 50 def untracked? untracked_path? || untracked_ip? end |