Class: RailsAiBridge::Doctor::Checkers::MigrationsChecker
- Inherits:
-
BaseChecker
- Object
- BaseChecker
- RailsAiBridge::Doctor::Checkers::MigrationsChecker
- Defined in:
- lib/rails_ai_bridge/doctor/checkers/migrations_checker.rb
Overview
Verifies +db/migrate+ contains migration files.
Instance Attribute Summary
Attributes inherited from BaseChecker
Instance Method Summary collapse
-
#call ⇒ Doctor::Check
+:pass+ when migrations exist; +:warn+ otherwise.
Methods inherited from BaseChecker
Constructor Details
This class inherits a constructor from RailsAiBridge::Doctor::Checkers::BaseChecker
Instance Method Details
#call ⇒ Doctor::Check
Returns +:pass+ when migrations exist; +:warn+ otherwise.
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/rails_ai_bridge/doctor/checkers/migrations_checker.rb', line 9 def call migrations_path = File.join(app.root, 'db/migrate', '*.rb') migrations = Dir.glob(migrations_path) check( 'Migrations', migrations.any?, pass: { message: "#{migrations.size} migration files found" }, fail: { status: :warn, message: 'No migrations found in db/migrate/', fix: 'Run `rails generate migration` to create one' } ) end |