Sha256: 1babcd6e18c2a87fc85228577eb26db01991838e3873e3027696f97fd5e995a6

Contents?: true

Size: 521 Bytes

Versions: 2

Compression:

Stored size: 521 Bytes

Contents

class Tag < ActiveRecord::Base
  acts_as_tree :dependent => :destroy
  before_destroy :create_tag

  def to_s
    name
  end

  def create_tag
    # Proof for the tests that the destroy rather than the delete method was called:
    DestroyedTag.create(:name => name)
  end
end

class DestroyedTag < ActiveRecord::Base
end

class User < ActiveRecord::Base
  acts_as_tree :parent_column_name => "referrer_id",
    :name_column => 'email',
    :hierarchy_table_name => 'referral_hierarchies'

  def to_s
    email
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
closure_tree-2.0.0 spec/support/models.rb
closure_tree-2.0.0.beta1 spec/support/models.rb