Class: RailsAiContext::Introspectors::SeedsIntrospector
- Inherits:
-
Object
- Object
- RailsAiContext::Introspectors::SeedsIntrospector
- 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
-
#app ⇒ Object
readonly
Returns the value of attribute app.
Instance Method Summary collapse
-
#call ⇒ Hash
Seed file info and detected models.
-
#initialize(app) ⇒ SeedsIntrospector
constructor
A new instance of SeedsIntrospector.
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
#app ⇒ Object (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
#call ⇒ Hash
Returns 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. } end |