Class: RailsBand::ActiveRecord::Event::DeprecatedAssociation

Inherits:
BaseEvent
  • Object
show all
Defined in:
lib/rails_band/active_record/event/deprecated_association.rb

Overview

A wrapper for the event that is passed to deprecated_association.active_record.

Instance Attribute Summary

Attributes inherited from BaseEvent

#allocations, #cpu_time, #duration, #end, #idle_time, #name, #time, #transaction_id

Instance Method Summary collapse

Methods inherited from BaseEvent

#initialize, #slice, #to_h

Constructor Details

This class inherits a constructor from RailsBand::BaseEvent

Instance Method Details

#backtrace ⇒ Object

:backtrace is only present when the option is enabled; fetch would raise KeyError in the default configuration.



22
23
24
# File 'lib/rails_band/active_record/event/deprecated_association.rb', line 22

def backtrace
  @backtrace ||= @event.payload[:backtrace]
end

#location ⇒ Object



16
17
18
# File 'lib/rails_band/active_record/event/deprecated_association.rb', line 16

def location
  @location ||= @event.payload.fetch(:location)
end

#message ⇒ Object



12
13
14
# File 'lib/rails_band/active_record/event/deprecated_association.rb', line 12

def message
  @message ||= @event.payload.fetch(:message)
end

#reflection ⇒ Object



8
9
10
# File 'lib/rails_band/active_record/event/deprecated_association.rb', line 8

def reflection
  @reflection ||= @event.payload.fetch(:reflection)
end