Sha256: ba640804a3fe7c93ebca1102bf9ff92e1b48efd75d86f382ac00ab7ee1dc0783

Contents?: true

Size: 987 Bytes

Versions: 69

Compression:

Stored size: 987 Bytes

Contents

class Track
  include Mongoid::Document
  field :name, type: String

  field :before_create_called, type: Mongoid::Boolean, default: false
  field :before_save_called, type: Mongoid::Boolean, default: false
  field :before_update_called, type: Mongoid::Boolean, default: false
  field :before_validation_called, type: Mongoid::Boolean, default: false
  field :before_destroy_called, type: Mongoid::Boolean, default: false

  embedded_in :record

  before_create :before_create_stub
  before_save :before_save_stub
  before_update :before_update_stub
  before_validation :before_validation_stub
  before_destroy :before_destroy_stub

  def before_create_stub
    self.before_create_called = true
  end

  def before_save_stub
    self.before_save_called = true
  end

  def before_update_stub
    self.before_update_called = true
  end

  def before_validation_stub
    self.before_validation_called = true
  end

  def before_destroy_stub
    self.before_destroy_called = true
  end
end

Version data entries

69 entries across 64 versions & 3 rubygems

Version Path
mongoid-6.0.1 spec/app/models/track.rb
mongoid-5.1.5 spec/app/models/track.rb
mongoid-6.0.0 spec/app/models/track.rb
mongoid-5.1.4 spec/app/models/track.rb
mongoid-6.0.0.rc0 spec/app/models/track.rb
mongoid-6.0.0.beta spec/app/models/track.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/mongoid-5.1.3/spec/app/models/track.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/mongoid-4.0.2/spec/app/models/track.rb
mongoid-5.1.3 spec/app/models/track.rb
mongoid-5.1.2 spec/app/models/track.rb
mongoid-5.1.1 spec/app/models/track.rb
mongoid-5.1.0 spec/app/models/track.rb
tdiary-4.2.1 vendor/bundle/ruby/2.2.0/gems/mongoid-5.0.1/spec/app/models/track.rb
tdiary-4.2.1 vendor/bundle/ruby/2.3.0/gems/mongoid-5.0.2/spec/app/models/track.rb
tdiary-4.2.1 vendor/bundle/ruby/2.2.0/gems/mongoid-5.0.2/spec/app/models/track.rb
mongoid-5.0.2 spec/app/models/track.rb
mongoid-5.0.1 spec/app/models/track.rb
mongoid-5.0.0 spec/app/models/track.rb
mongoid-5.0.0.rc0 spec/app/models/track.rb
mongoid-5.0.0.beta spec/app/models/track.rb