Class: RailsConsolePro::Commands::ExplainCommand

Inherits:
BaseCommand
  • Object
show all
Defined in:
lib/rails_console_pro/commands/explain_command.rb

Instance Method Summary collapse

Methods included from RailsConsolePro::ColorHelper

#bold_color, #color, #method_missing, #pastel, #respond_to_missing?

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RailsConsolePro::ColorHelper

Instance Method Details

#execute(relation_or_model, *args) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/rails_console_pro/commands/explain_command.rb', line 6

def execute(relation_or_model, *args)
  relation = build_relation(relation_or_model, *args)
  return nil unless relation

  execute_explain(relation)
rescue => e
  RailsConsolePro::ErrorHandler.handle(e, context: :explain)
end