Sha256: 05894c406ba12e8c66b493b174e97b5ff09089a3b8aa10861a6f8bf53449bd66

Contents?: true

Size: 385 Bytes

Versions: 1

Compression:

Stored size: 385 Bytes

Contents

module Sqlserver::Sequence
  module Testing
    module ModelMacros
      def spawn_model(klass, &block)
        Object.instance_eval { remove_const klass } if Object.const_defined?(klass)
        Object.const_set klass, Class.new(ActiveRecord::Base)
        Object.const_get(klass).class_eval(&block) if block_given?
        @spawned_models << klass.to_sym
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sqlserver-sequence-0.3.0 spec/support/model_macros.rb