Sha256: 167875435be15427e6e3eeab331589465d75deb83694a7adcbfb4d59e619fc10

Contents?: true

Size: 298 Bytes

Versions: 27

Compression:

Stored size: 298 Bytes

Contents

# frozen_string_literal: true

class ValidationCallback
  include Mongoid::Document
  field :history, type: Array, default: []
  validate do
    self.history << :validate
  end

  before_validation { self.history << :before_validation }
  after_validation { self.history << :after_validation }
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
mongoid-8.1.9 spec/support/models/validation_callback.rb
mongoid-8.0.9 spec/support/models/validation_callback.rb
mongoid-8.1.8 spec/support/models/validation_callback.rb
mongoid-8.1.7 spec/support/models/validation_callback.rb
mongoid-8.1.6 spec/support/models/validation_callback.rb
mongoid-8.0.8 spec/support/models/validation_callback.rb
mongoid-8.1.5 spec/support/models/validation_callback.rb
mongoid-8.1.4 spec/support/models/validation_callback.rb
mongoid-8.0.7 spec/support/models/validation_callback.rb
mongoid-8.1.3 spec/support/models/validation_callback.rb
mongoid-8.1.2 spec/support/models/validation_callback.rb
mongoid-8.0.6 spec/support/models/validation_callback.rb
mongoid-7.5.4 spec/support/models/validation_callback.rb
mongoid-8.1.1 spec/support/models/validation_callback.rb
mongoid-8.0.5 spec/support/models/validation_callback.rb
mongoid-8.1.0 spec/support/models/validation_callback.rb
mongoid-7.5.3 spec/support/models/validation_callback.rb
mongoid-8.0.4 spec/support/models/validation_callback.rb
mongoid-8.0.3 spec/support/models/validation_callback.rb
mongoid-7.5.2 spec/support/models/validation_callback.rb