Sha256: 7d0470709f458c76c90f59577ddae15702d87a28d4829df86abd910d31c96c1d

Contents?: true

Size: 641 Bytes

Versions: 28

Compression:

Stored size: 641 Bytes

Contents

module FactoryGirl
  class DefinitionHierarchy
    def callbacks
      []
    end

    def constructor
      FactoryGirl.constructor
    end

    def to_create
      FactoryGirl.to_create
    end

    def self.add_callbacks(callbacks)
      if callbacks.any?
        define_method :callbacks do
          super() + callbacks
        end
      end
    end

    def self.build_constructor(&block)
      if block
        define_method(:constructor) do
          block
        end
      end
    end

    def self.build_to_create(&block)
      if block
        define_method(:to_create) do
          block
        end
      end
    end
  end
end

Version data entries

28 entries across 20 versions & 4 rubygems

Version Path
challah-1.0.0.beta vendor/bundle/gems/factory_girl-4.1.0/lib/factory_girl/definition_hierarchy.rb
challah-0.9.1.beta.3 vendor/bundle/gems/factory_girl-4.1.0/lib/factory_girl/definition_hierarchy.rb
challah-0.9.1.beta vendor/bundle/gems/factory_girl-4.1.0/lib/factory_girl/definition_hierarchy.rb
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/factory_girl-4.1.0/lib/factory_girl/definition_hierarchy.rb
challah-0.9.0 vendor/bundle/gems/factory_girl-4.1.0/lib/factory_girl/definition_hierarchy.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/factory_girl-4.0.0/lib/factory_girl/definition_hierarchy.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/factory_girl-4.1.0/lib/factory_girl/definition_hierarchy.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.0.pre/vendor/bundle/gems/factory_girl-3.6.1/lib/factory_girl/definition_hierarchy.rb
challah-rolls-0.2.0 vendor/bundle/gems/factory_girl-3.6.1/lib/factory_girl/definition_hierarchy.rb
challah-rolls-0.2.0 vendor/bundle/gems/factory_girl-4.0.0/lib/factory_girl/definition_hierarchy.rb
challah-rolls-0.2.0 vendor/bundle/gems/factory_girl-4.1.0/lib/factory_girl/definition_hierarchy.rb
challah-0.8.3 vendor/bundle/gems/factory_girl-4.1.0/lib/factory_girl/definition_hierarchy.rb
challah-0.8.3 vendor/bundle/gems/factory_girl-4.0.0/lib/factory_girl/definition_hierarchy.rb
factory_girl-3.6.2 lib/factory_girl/definition_hierarchy.rb
challah-0.8.1 vendor/bundle/gems/factory_girl-4.0.0/lib/factory_girl/definition_hierarchy.rb
factory_girl-4.1.0 lib/factory_girl/definition_hierarchy.rb
challah-rolls-0.1.0 vendor/bundle/gems/factory_girl-3.6.1/lib/factory_girl/definition_hierarchy.rb
challah-rolls-0.1.0 vendor/bundle/gems/challah-0.8.0.pre/vendor/bundle/gems/factory_girl-3.6.1/lib/factory_girl/definition_hierarchy.rb
challah-rolls-0.1.0 vendor/bundle/gems/factory_girl-4.0.0/lib/factory_girl/definition_hierarchy.rb
challah-0.8.0.pre vendor/bundle/gems/factory_girl-3.6.1/lib/factory_girl/definition_hierarchy.rb