class FactoryGirl::Declaration::Association

@api private

Attributes

options[R]

Public Class Methods

new(name, *options) click to toggle source
Calls superclass method FactoryGirl::Declaration.new
# File lib/factory_girl/declaration/association.rb, line 5
def initialize(name, *options)
  super(name, false)
  @options = options.dup
  @overrides = options.extract_options!
  @traits = options
end

Public Instance Methods

==(other) click to toggle source
# File lib/factory_girl/declaration/association.rb, line 12
def ==(other)
  name == other.name &&
    options == other.options
end

Private Instance Methods

build() click to toggle source
# File lib/factory_girl/declaration/association.rb, line 22
def build
  factory_name = @overrides[:factory] || name
  [Attribute::Association.new(name, factory_name, [@traits, @overrides.except(:factory)].flatten)]
end