Sha256: 34704a34aa2dd81e86b76f5955e777d57c7c875ddca31120fcd3e0479f83b787

Contents?: true

Size: 556 Bytes

Versions: 3

Compression:

Stored size: 556 Bytes

Contents

module FactoryGirl
  class Proxy #:nodoc:
    class Create < Build #:nodoc:
      def result(to_create)
        run_callbacks(:after_build)
        if to_create
          to_create.call(@instance)
        else
          @instance.save!
        end
        run_callbacks(:after_create)
        @instance
      end

      def get_method(method_string)
        # Leaving this as Proxy::Build in the :method => :build case
        # is a bit strange, but does it have any user-visible behaviors?
        parse_method(method_string)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
factory_girl-2.2.0 lib/factory_girl/proxy/create.rb
factory_girl-2.1.2 lib/factory_girl/proxy/create.rb
factory_girl-2.1.0 lib/factory_girl/proxy/create.rb