Sha256: e6ed62614ab6754cc3648f62f9b72b45f5c3534e668c80ec28b8a1a080d69449

Contents?: true

Size: 623 Bytes

Versions: 2

Compression:

Stored size: 623 Bytes

Contents

if Gem::Version.new(Mongoid::VERSION) >= Gem::Version.new('7.0.0')
  require 'mongoid/association/embedded/embedded_in'
  ASSOCIATION = Mongoid::Association::Macros::ClassMethods
  EMBEDS_MANY = Mongoid::Association::Embedded::EmbedsMany
else
  require 'mongoid/relations/embedded/in'
  ASSOCIATION = Mongoid::Relations::Macros::ClassMethods
  EMBEDS_MANY = Mongoid::Relations::Embedded::Many
end

module ASSOCIATION
  alias embedded_in_without_embedded_errors embedded_in
  def embedded_in(*args)
    relation = embedded_in_without_embedded_errors(*args)
    send(:include, Mongoid::EmbeddedErrors)
    relation
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mongoid-embedded-errors-4.0.0 lib/mongoid/embedded_errors/embedded_in.rb
mongoid-embedded-errors-3.0.1 lib/mongoid/embedded_errors/embedded_in.rb