Sha256: a900a31ca513102415933280f9fcb9d4c84a845ce80612d424066a3b035c4988

Contents?: true

Size: 268 Bytes

Versions: 38

Compression:

Stored size: 268 Bytes

Contents

class Album
  include Mongoid::Document

  belongs_to :artist
  before_destroy :set_parent_name

  attr_accessor :before_add_called

  private

  def set_parent_name
    artist.name = "destroyed" if artist
  end

  def set_parent_name_fail
    throw(:abort)
  end
end

Version data entries

38 entries across 36 versions & 2 rubygems

Version Path
mongoid-7.0.13 spec/app/models/album.rb
mongoid-7.0.12 spec/app/models/album.rb
mongoid-6.4.8 spec/app/models/album.rb
mongoid-7.0.11 spec/app/models/album.rb
mongoid-7.0.10 spec/app/models/album.rb
mongoid-6.4.7 spec/app/models/album.rb
mongoid-6.4.5 spec/app/models/album.rb
mongoid-7.0.8 spec/app/models/album.rb
mongoid-7.0.7 spec/app/models/album.rb
mongoid-7.0.6 spec/app/models/album.rb
mongoid-7.0.5 spec/app/models/album.rb
mongoid-7.0.4 spec/app/models/album.rb
mongoid-6.4.4 spec/app/models/album.rb
mongoid-7.0.3 spec/app/models/album.rb
mongoid-6.4.2 spec/app/models/album.rb
mongoid-7.0.2 spec/app/models/album.rb
mongoid-7.0.1 spec/app/models/album.rb
mongoid-6.4.1 spec/app/models/album.rb
tdiary-5.0.8 vendor/bundle/gems/mongoid-6.4.0/spec/app/models/album.rb
mongoid-7.0.0 spec/app/models/album.rb