Class: RailsPulse::Route
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- RailsPulse::Route
- Defined in:
- app/models/rails_pulse/route.rb
Class Method Summary collapse
- .average_response_time ⇒ Object
- .ransackable_associations(auth_object = nil) ⇒ Object
- .ransackable_attributes(auth_object = nil) ⇒ Object
Instance Method Summary collapse
- #path_and_method ⇒ Object
-
#to_breadcrumb ⇒ Object
Remove the problematic ransacker that causes SQL syntax errors The status_indicator will be handled differently or removed from filtering ransacker :status_indicator do # Removed to fix SQL generation issues in tests end.
Class Method Details
.average_response_time ⇒ Object
69 70 71 |
# File 'app/models/rails_pulse/route.rb', line 69 def self.average_response_time joins(:requests).average("rails_pulse_requests.duration") || 0 end |
.ransackable_associations(auth_object = nil) ⇒ Object
19 20 21 |
# File 'app/models/rails_pulse/route.rb', line 19 def self.ransackable_associations(auth_object = nil) %w[requests] end |
.ransackable_attributes(auth_object = nil) ⇒ Object
15 16 17 |
# File 'app/models/rails_pulse/route.rb', line 15 def self.ransackable_attributes(auth_object = nil) %w[path average_response_time_ms max_response_time_ms request_count requests_per_minute occurred_at requests_occurred_at error_count error_rate_percentage status_indicator] end |
Instance Method Details
#path_and_method ⇒ Object
73 74 75 |
# File 'app/models/rails_pulse/route.rb', line 73 def path_and_method "#{path} #{method}" end |
#to_breadcrumb ⇒ Object
Remove the problematic ransacker that causes SQL syntax errors The status_indicator will be handled differently or removed from filtering ransacker :status_indicator do
# Removed to fix SQL generation issues in tests
end
65 66 67 |
# File 'app/models/rails_pulse/route.rb', line 65 def path end |