Class: LlmCostTracker::Doctor::SchemaCheck
- Inherits:
-
Object
- Object
- LlmCostTracker::Doctor::SchemaCheck
- Defined in:
- lib/llm_cost_tracker/doctor/schema_check.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(name:, schema:, table:) ⇒ SchemaCheck
constructor
A new instance of SchemaCheck.
Constructor Details
#initialize(name:, schema:, table:) ⇒ SchemaCheck
Returns a new instance of SchemaCheck.
10 11 12 13 14 |
# File 'lib/llm_cost_tracker/doctor/schema_check.rb', line 10 def initialize(name:, schema:, table:) @name = name @schema = schema @table = table end |
Instance Method Details
#call ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/llm_cost_tracker/doctor/schema_check.rb', line 16 def call return unless Probe.table_exists?("llm_cost_tracker_calls") errors = @schema.current_schema_errors return Check.new(:ok, @name, "#{@table} exists") if errors.empty? Check.new( :error, @name, "current schema required; #{errors.join('; ')}; " \ "run bin/rails generate llm_cost_tracker:install && bin/rails db:migrate" ) end |