module Softy

Constants

VERSION

Public Instance Methods

delete() click to toggle source
# File lib/softy.rb, line 24
def delete
  update_column(:deleted_at, Time.now) if !destroyed? && persisted?
  freeze
end
deleted?()
Alias for: destroyed?
destroy() click to toggle source
# File lib/softy.rb, line 20
def destroy
  _run_destroy_callbacks { delete }
end
destroyed?() click to toggle source
# File lib/softy.rb, line 33
def destroyed?
  !self.deleted_at.nil?
end
Also aliased as: deleted?
has_softy?() click to toggle source
# File lib/softy.rb, line 16
def has_softy?
  true
end
persisted?() click to toggle source
# File lib/softy.rb, line 12
def persisted?
  !new_record?
end
restore!() click to toggle source
# File lib/softy.rb, line 29
def restore!
  self.class.with_deleted.update_all({ deleted_at: nil }, self.class.primary_key => self.id) > 0
end