Sha256: 5123f4ce11f69cbff45efb65276789f61c05104e3d9507e9653df600287c1206

Contents?: true

Size: 368 Bytes

Versions: 1

Compression:

Stored size: 368 Bytes

Contents

class Post < ActiveRecord::Base
  stampable :stamper_class_name => :person, :deleter => true
  has_many :comments
  
  # override destroy to get soft delete like acts_as_paranoid style delete
  # Note: delete_all (used in helper) bypasses this and deletes all rows.
  def destroy
    run_callbacks :destroy do
      self.deleted_at = DateTime.now
    end
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activerecord-userstamp-2.1.1 spec/dummy/app/models/post.rb