Permalink
Browse files

making it so that :parent and :class can coexist in a factory definition

Signed-off-by: Nick Quaranto <nick@quaran.to>
  • Loading branch information...
1 parent 44ca8fc commit 7b6393979c94361b96cb5d2e4933cd61340b4c9c @ryana ryana committed with qrush Feb 24, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/factory_girl/factory.rb
@@ -70,7 +70,7 @@ def initialize (name, options = {}) #:nodoc:
end
def inherit_from(parent) #:nodoc:
- @options[:class] = parent.class_name
+ @options[:class] ||= parent.class_name
parent.attributes.each do |attribute|
unless attribute_defined?(attribute.name)
@attributes << attribute.clone

0 comments on commit 7b63939

Please sign in to comment.