Sha256: 6e9a4bbd9db7eb1d41a0ae36ec3135c0d337382ac6162611788cd9a7f785813b

Contents?: true

Size: 612 Bytes

Versions: 24

Compression:

Stored size: 612 Bytes

Contents

# frozen_string_literal: true

class Service
  include Mongoid::Document
  field :sid
  field :before_destroy_called, type: Mongoid::Boolean, default: false
  field :after_destroy_called, type: Mongoid::Boolean, default: false
  field :after_initialize_called, type: Mongoid::Boolean, default: false
  embedded_in :person
  belongs_to :target, class_name: "User"
  validates_numericality_of :sid

  before_destroy do |doc|
    doc.before_destroy_called = true
  end

  after_destroy do |doc|
    doc.after_destroy_called = true
  end

  after_initialize do |doc|
    doc.after_initialize_called = true
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
mongoid-8.1.7 spec/support/models/service.rb
mongoid-8.1.6 spec/support/models/service.rb
mongoid-8.0.8 spec/support/models/service.rb
mongoid-8.1.5 spec/support/models/service.rb
mongoid-8.1.4 spec/support/models/service.rb
mongoid-8.0.7 spec/support/models/service.rb
mongoid-8.1.3 spec/support/models/service.rb
mongoid-8.1.2 spec/support/models/service.rb
mongoid-8.0.6 spec/support/models/service.rb
mongoid-7.5.4 spec/support/models/service.rb
mongoid-8.1.1 spec/support/models/service.rb
mongoid-8.0.5 spec/support/models/service.rb
mongoid-8.1.0 spec/support/models/service.rb
mongoid-7.5.3 spec/support/models/service.rb
mongoid-8.0.4 spec/support/models/service.rb
mongoid-8.0.3 spec/support/models/service.rb
mongoid-7.5.2 spec/support/models/service.rb
mongoid-8.0.2 spec/support/models/service.rb
mongoid-7.5.1 spec/support/models/service.rb
mongoid-7.4.3 spec/support/models/service.rb