Sha256: 7ea7e0b4a5875dd06fffaac7ed8c17bc2953f6c48bc6d1e16ff75cf153ced2a4
Contents?: true
Size: 1.44 KB
Versions: 8
Compression:
Stored size: 1.44 KB
Contents
# frozen_string_literal: true module TouchableSpec module Embedded class Building include Mongoid::Document include Mongoid::Timestamps embeds_many :entrances, class_name: "TouchableSpec::Embedded::Entrance" embeds_many :floors, class_name: "TouchableSpec::Embedded::Floor" end class Entrance include Mongoid::Document include Mongoid::Timestamps embedded_in :building, class_name: "TouchableSpec::Embedded::Building" field :last_used_at, type: Time end class Floor include Mongoid::Document include Mongoid::Timestamps field :level, type: Integer embedded_in :building, touch: true, class_name: "TouchableSpec::Embedded::Building" end end module Referenced class Building include Mongoid::Document include Mongoid::Timestamps has_many :entrances, inverse_of: :building, class_name: "TouchableSpec::Referenced::Entrance" has_many :floors, inverse_of: :building, class_name: "TouchableSpec::Referenced::Floor" end class Entrance include Mongoid::Document include Mongoid::Timestamps belongs_to :building, touch: false, class_name: "TouchableSpec::Referenced::Building" end class Floor include Mongoid::Document include Mongoid::Timestamps field :level, type: Integer belongs_to :building, touch: true, class_name: "TouchableSpec::Referenced::Building" end end end
Version data entries
8 entries across 8 versions & 1 rubygems