module Softie

Constants

VERSION

Public Instance Methods

deleted(options = {}) click to toggle source
# File lib/softie.rb, line 30
def deleted(options = {})
  public_send("#{softie_options[:key]}=", Time.now.utc)

  if softie_options[:deleted_by_class]
    public_send("#{softie_options[:deleted_by_key]}=", options.delete(:by))
  end
end
deleted!(options = {}) click to toggle source
# File lib/softie.rb, line 38
def deleted!(options = {})
  deleted(options)
  save
end
deleted?() click to toggle source
# File lib/softie.rb, line 56
def deleted?
  public_send(softie_options[:key]) != nil
end
restore() click to toggle source
# File lib/softie.rb, line 43
def restore
  public_send("#{softie_options[:key]}=", nil)

  if softie_options[:deleted_by_class]
    public_send("#{softie_options[:deleted_by_key]}=", nil)
  end
end
restore!() click to toggle source
# File lib/softie.rb, line 51
def restore!
  restore
  save
end