Module: RailsApiLogger::Loggable::ClassMethods

Defined in:
app/models/rails_api_logger/loggable.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#has_many_inbound_request_logsObject



15
16
17
18
19
# File 'app/models/rails_api_logger/loggable.rb', line 15

def has_many_inbound_request_logs
  has_many :inbound_request_logs, -> { order(:created_at) },
    class_name: "RailsApiLogger::InboundRequestLog",
    inverse_of: :loggable, dependent: :destroy, as: :loggable
end

#has_many_outbound_request_logsObject



9
10
11
12
13
# File 'app/models/rails_api_logger/loggable.rb', line 9

def has_many_outbound_request_logs
  has_many :outbound_request_logs, -> { order(:created_at) },
    class_name: "RailsApiLogger::OutboundRequestLog",
    inverse_of: :loggable, dependent: :destroy, as: :loggable
end

#has_many_request_logsObject



21
22
23
24
# File 'app/models/rails_api_logger/loggable.rb', line 21

def has_many_request_logs
  has_many_inbound_request_logs
  has_many_outbound_request_logs
end