Sha256: 74c0954173e979b6229d355392f6708ed10cfca7646013ac3d77c1611e4ef6fd

Contents?: true

Size: 265 Bytes

Versions: 38

Compression:

Stored size: 265 Bytes

Contents

class Oscar
  include Mongoid::Document
  field :title, type: String
  field :destroy_after_save, type: Mongoid::Boolean, default: false
  before_save :complain

  def complain
    if destroy_after_save?
      destroy
    else
      throw(:abort)
    end
  end
end

Version data entries

38 entries across 36 versions & 2 rubygems

Version Path
mongoid-6.4.0 spec/app/models/oscar.rb
mongoid-6.3.0 spec/app/models/oscar.rb
mongoid-6.2.1 spec/app/models/oscar.rb
mongoid-7.0.0.beta spec/app/models/oscar.rb
tdiary-5.0.5 vendor/bundle/gems/mongoid-6.1.0/spec/app/models/oscar.rb
tdiary-5.0.5 vendor/bundle/gems/mongoid-6.2.0/spec/app/models/oscar.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/mongoid-6.1.0/spec/app/models/oscar.rb
mongoid-6.2.0 spec/app/models/oscar.rb
mongoid-6.1.1 spec/app/models/oscar.rb
tdiary-5.0.4 vendor/bundle/gems/mongoid-6.1.0/spec/app/models/oscar.rb
mongoid-6.1.0 spec/app/models/oscar.rb
mongoid-6.1.0.rc0 spec/app/models/oscar.rb
mongoid-6.0.3 spec/app/models/oscar.rb
mongoid-6.0.2 spec/app/models/oscar.rb
mongoid-6.0.1 spec/app/models/oscar.rb
mongoid-6.0.0 spec/app/models/oscar.rb
mongoid-6.0.0.rc0 spec/app/models/oscar.rb
mongoid-6.0.0.beta spec/app/models/oscar.rb