Sha256: d52fb446606203aae8daec36b16fa016079f3cbb5db3749191443bcf9c31ece6

Contents?: true

Size: 267 Bytes

Versions: 38

Compression:

Stored size: 267 Bytes

Contents

module Helpers
  # Reloads the specified model class.
  #
  # @param [ String | Symbol ] name Class name to reload.
  def reload_model(name)
    Object.class_eval do
      remove_const(name)
    end
    load "spec/support/models/#{name.to_s.underscore}.rb"
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
mongoid-8.1.7 spec/support/helpers.rb
mongoid-8.1.6 spec/support/helpers.rb
mongoid-8.0.8 spec/support/helpers.rb
mongoid-8.1.5 spec/support/helpers.rb
mongoid-8.1.4 spec/support/helpers.rb
mongoid-8.0.7 spec/support/helpers.rb
mongoid-8.1.3 spec/support/helpers.rb
mongoid-8.1.2 spec/support/helpers.rb
mongoid-8.0.6 spec/support/helpers.rb
mongoid-7.5.4 spec/support/helpers.rb
mongoid-8.1.1 spec/support/helpers.rb
mongoid-8.0.5 spec/support/helpers.rb
mongoid-8.1.0 spec/support/helpers.rb
mongoid-7.5.3 spec/support/helpers.rb
mongoid-8.0.4 spec/support/helpers.rb
mongoid-8.0.3 spec/support/helpers.rb
mongoid-7.5.2 spec/support/helpers.rb
mongoid-8.0.2 spec/support/helpers.rb
mongoid-7.5.1 spec/support/helpers.rb
mongoid-7.4.3 spec/support/helpers.rb