Sha256: 1240607980ab806757b56f63822085ce513a5fde093da83a952ec044210880a4
Contents?: true
Size: 449 Bytes
Versions: 29
Compression:
Stored size: 449 Bytes
Contents
# frozen_string_literal: true class Pet include Mongoid::Document field :name field :weight, type: Float, default: 0.0 embeds_many :vet_visits embedded_in :pet_owner after_destroy :set_destroy_flag attr_writer :destroy_flag def set_destroy_flag @destroy_flag = true end def destroy_flag @destroy_flag ||= false end def visits_count=(count) vet_visits.destroy_all count.times { vet_visits.new } end end
Version data entries
29 entries across 29 versions & 1 rubygems