Sha256: 26294fbb78d08922fb97f16f41db1f1811c3581309cab99690cffb7b1aef2011

Contents?: true

Size: 994 Bytes

Versions: 8

Compression:

Stored size: 994 Bytes

Contents

# frozen_string_literal: true

module TouchableSpec
  module Embedded
    class Building
      include Mongoid::Document
      include Mongoid::Timestamps

      embeds_many :entrances
      embeds_many :floors
    end

    class Entrance
      include Mongoid::Document
      include Mongoid::Timestamps

      embedded_in :building

      field :last_used_at, type: Time
    end

    class Floor
      include Mongoid::Document
      include Mongoid::Timestamps

      embedded_in :building, touch: true
    end
  end

  module Referenced
    class Building
      include Mongoid::Document
      include Mongoid::Timestamps

      has_many :entrances, inverse_of: :building
      has_many :floors, inverse_of: :building
    end

    class Entrance
      include Mongoid::Document
      include Mongoid::Timestamps

      belongs_to :building
    end

    class Floor
      include Mongoid::Document
      include Mongoid::Timestamps

      belongs_to :building, touch: true
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
mongoid-7.5.4 spec/mongoid/touchable_spec_models.rb
mongoid-7.5.3 spec/mongoid/touchable_spec_models.rb
mongoid-7.5.2 spec/mongoid/touchable_spec_models.rb
mongoid-7.5.1 spec/mongoid/touchable_spec_models.rb
mongoid-7.4.3 spec/mongoid/touchable_spec_models.rb
mongoid-7.5.0 spec/mongoid/touchable_spec_models.rb
mongoid-7.4.1 spec/mongoid/touchable_spec_models.rb
mongoid-7.4.0 spec/mongoid/touchable_spec_models.rb