Module: LLM::ActiveRecord::ActsAsAgent::Hooks

Defined in:
lib/llm/active_record/acts_as_agent.rb

Class Method Summary collapse

Class Method Details

.extended(model) ⇒ void

This method returns an undefined value.

Called when hooks are extended onto an ActiveRecord model.

Parameters:

  • model (Class)


59
60
61
62
63
# File 'lib/llm/active_record/acts_as_agent.rb', line 59

def self.extended(model)
  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