Sha256: a71f872509ffe86f8b34e51f8d961cf8fca37937948dc8ec8e81f8d4eda9a3e4

Contents?: true

Size: 411 Bytes

Versions: 6

Compression:

Stored size: 411 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
    return false if callback(:before_destroy) == false
    self.deleted_at = DateTime.now
    callback(:after_destroy)
  end
  
end

Version data entries

6 entries across 6 versions & 3 rubygems

Version Path
originator-3.1 test/models/post.rb
originator-3.0 test/models/post.rb
magiclabs-userstamp-3.0 test/models/post.rb
magiclabs-userstamp-2.1.0 test/models/post.rb
magiclabs-userstamp-2.0.2 test/models/post.rb
userstamp-2.0.1 test/models/post.rb