Module: ActionFactory::ActiveRecord::ClassMethods

Defined in:
lib/action_factory/active_record.rb

Instance Method Summary collapse

Instance Method Details

#association(name, strategy: nil, factory: name, traits: [], &block) ⇒ Object



39
40
41
# File 'lib/action_factory/active_record.rb', line 39

def association(name, strategy: nil, factory: name, traits: [], &block)
  associations[name] = Association.new(strategy:, factory_name: factory, traits:, block:)
end

#associationsObject



35
36
37
# File 'lib/action_factory/active_record.rb', line 35

def associations
  @associations ||= {}.with_indifferent_access
end