Class: RailsAiContext::Introspectors::SeedsIntrospector

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_ai_context/introspectors/seeds_introspector.rb

Overview

Discovers database seed configuration: db/seeds.rb structure, seed files in db/seeds/ directory, and what models they populate.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ SeedsIntrospector

Returns a new instance of SeedsIntrospector.



10
11
12
# File 'lib/rails_ai_context/introspectors/seeds_introspector.rb', line 10

def initialize(app)
  @app = app
end

Instance Attribute Details

#appObject (readonly)

Returns the value of attribute app.



8
9
10
# File 'lib/rails_ai_context/introspectors/seeds_introspector.rb', line 8

def app
  @app
end

Instance Method Details

#callHash

Returns seed file info and detected models.

Returns:

  • (Hash)

    seed file info and detected models



15
16
17
18
19
20
21
22
23
# File 'lib/rails_ai_context/introspectors/seeds_introspector.rb', line 15

def call
  {
    seeds_file: analyze_seeds_file,
    seed_files: discover_seed_files,
    models_seeded: detect_seeded_models
  }
rescue => e
  { error: e.message }
end