Module: LLM::ActiveRecord::ActsAsAgent::Hooks
- Defined in:
- lib/llm/active_record/acts_as_agent.rb
Class Method Summary collapse
-
.extended(model) ⇒ void
Called when hooks are extended onto an ActiveRecord model.
Class Method Details
.extended(model) ⇒ void
This method returns an undefined value.
Called when hooks are extended onto an ActiveRecord model.
54 55 56 57 58 59 60 |
# File 'lib/llm/active_record/acts_as_agent.rb', line 54 def self.extended(model) = model. model.validates [:provider_column], [:model_column], presence: true model.include LLM::ActiveRecord::ActsAsLLM::InstanceMethods unless model.ancestors.include?(LLM::ActiveRecord::ActsAsLLM::InstanceMethods) model.include InstanceMethods unless model.ancestors.include?(InstanceMethods) model.extend ClassMethods unless model.singleton_class.ancestors.include?(ClassMethods) end |