Sha256: 50a0247ee85d92c4e199e6c99b8e9e41f041aaef826e68add19a3b30c57b2c28

Contents?: true

Size: 479 Bytes

Versions: 23

Compression:

Stored size: 479 Bytes

Contents

class ParanoidPhone
  include Mongoid::Document
  include Mongoid::Paranoia

  attr_accessor :after_destroy_called, :before_destroy_called

  field :number, type: String

  embedded_in :person

  before_destroy :before_destroy_stub, :halt_me
  after_destroy :after_destroy_stub

  def before_destroy_stub
    self.before_destroy_called = true
  end

  def after_destroy_stub
    self.after_destroy_called = true
  end

  def halt_me
    person.age == 42 ? false : true
  end
end

Version data entries

23 entries across 23 versions & 6 rubygems

Version Path
mongoid_paranoia-0.3.0 spec/app/models/paranoid_phone.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/bundler/gems/mongoid-paranoia-83dc8de7b426/spec/app/models/paranoid_phone.rb
mongoid-paranoia-2.0.0 spec/app/models/paranoid_phone.rb
mongoid-paranoia-1.3.0 spec/app/models/paranoid_phone.rb
mongoid-paranoia-1.2.0 spec/app/models/paranoid_phone.rb
mongoid-paranoia-1.1.0 spec/app/models/paranoid_phone.rb
mongoid_paranoia-0.2.1 spec/app/models/paranoid_phone.rb
mongoid_paranoia-0.2.0 spec/app/models/paranoid_phone.rb
mongoid-paranoia-1.0.1 spec/app/models/paranoid_phone.rb
mongoid-3.1.7 spec/app/models/paranoid_phone.rb
mongoid-paranoia-1.0.0 spec/app/models/paranoid_phone.rb
mongoid-paranoia-1.0.0.beta2 spec/app/models/paranoid_phone.rb
mongoid-paranoia-1.0.0.beta1 spec/app/models/paranoid_phone.rb
mongoid-3.1.6 spec/app/models/paranoid_phone.rb
sepastian-mongoid-paranoia-rails4-0.0.1.alpha spec/app/models/paranoid_phone.rb
mongoid-3.1.5 spec/app/models/paranoid_phone.rb
mongoid-paranoia-0.3.0 spec/app/models/paranoid_phone.rb
mongoid-paranoia-0.2.1 spec/app/models/paranoid_phone.rb
mongoid-versioning-0.2.0 spec/app/models/paranoid_phone.rb
mongoid-paranoia-0.2.0 spec/app/models/paranoid_phone.rb