Class: LazyFixtures::FactoryGirl::AssociationManager

Inherits:
Object
  • Object
show all
Includes:
ObjectHelper
Defined in:
lib/lazy_fixtures/factory_girl/association_manager.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ObjectHelper

#get_object, #invalid_object?

Constructor Details

#initialize(object) ⇒ AssociationManager

Returns a new instance of AssociationManager.



7
8
9
10
# File 'lib/lazy_fixtures/factory_girl/association_manager.rb', line 7

def initialize(object)
  @object = object
  @klass = @object.class.name.constantize
end

Instance Attribute Details

#objectObject (readonly)

Returns the value of attribute object.



6
7
8
# File 'lib/lazy_fixtures/factory_girl/association_manager.rb', line 6

def object
  @object
end

Instance Method Details

#get_associationsObject



12
13
14
15
16
# File 'lib/lazy_fixtures/factory_girl/association_manager.rb', line 12

def get_associations
  columns_info.keys.map do |method|
    get_object(object.send(method))
  end
end