Class: AwesomeExplain::Controller
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- AwesomeExplain::Controller
- Defined in:
- app/models/awesome_explain/controller.rb
Instance Method Summary collapse
Instance Method Details
#formatted_params ⇒ Object
16 17 18 19 |
# File 'app/models/awesome_explain/controller.rb', line 16 def formatted_params h_params = JSON.parse(params) gql? ? h_params.dig('graphql') : h_params end |
#gql? ⇒ Boolean
12 13 14 |
# File 'app/models/awesome_explain/controller.rb', line 12 def gql? path =~ /graphql/ || name =~ /GraphqlController/ end |
#total_duration ⇒ Object
8 9 10 |
# File 'app/models/awesome_explain/controller.rb', line 8 def total_duration logs.sum(:duration).round(3) end |