Sha256: 6693933f41afff545b2bcd891818d367e050ff2bffc949882db630c54f5ff00f

Contents?: true

Size: 890 Bytes

Versions: 13

Compression:

Stored size: 890 Bytes

Contents

# frozen_string_literal: true
# encoding: utf-8

class HomCollege
  include Mongoid::Document

  has_one :accreditation, class_name: 'HomAccreditation'

  field :state, type: String
end

class HomAccreditation
  include Mongoid::Document

  belongs_to :college, class_name: 'HomCollege'

  field :degree, type: String
  field :year, type: Integer, default: 2012
end

class HomAccreditation::Child
  include Mongoid::Document

  belongs_to :hom_college
end

module HomNs
  class PrefixedParent
    include Mongoid::Document

    has_one :child, class_name: 'PrefixedChild'
  end

  class PrefixedChild
    include Mongoid::Document

    belongs_to :parent, class_name: 'PrefixedParent'
  end
end

class HomPolymorphicParent
  include Mongoid::Document

  has_one :p_child, as: :parent
end

class HomPolymorphicChild
  include Mongoid::Document

  belongs_to :p_parent, polymorphic: true
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
mongoid-7.1.11 spec/mongoid/association/referenced/has_one_models.rb
mongoid-7.1.10 spec/mongoid/association/referenced/has_one_models.rb
mongoid-7.1.9 spec/mongoid/association/referenced/has_one_models.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/mongoid-7.1.7/spec/mongoid/association/referenced/has_one_models.rb
mongoid-7.1.8 spec/mongoid/association/referenced/has_one_models.rb
mongoid-7.1.7 spec/mongoid/association/referenced/has_one_models.rb
mongoid-7.1.6 spec/mongoid/association/referenced/has_one_models.rb
mongoid-7.1.5 spec/mongoid/association/referenced/has_one_models.rb
mongoid-7.1.4 spec/mongoid/association/referenced/has_one_models.rb
mongoid-7.1.2 spec/mongoid/association/referenced/has_one_models.rb
mongoid-7.1.1 spec/mongoid/association/referenced/has_one_models.rb
mongoid-7.1.0 spec/mongoid/association/referenced/has_one_models.rb
mongoid-7.1.0.rc0 spec/mongoid/association/referenced/has_one_models.rb