Module: Sequel::Plugins::Paranoia::ClassMethods

Defined in:
lib/sequel_paranoia.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#deleted_timestamp_fieldObject (readonly)

The field to store the deleted timestamp



40
41
42
# File 'lib/sequel_paranoia.rb', line 40

def deleted_timestamp_field
  @deleted_timestamp_field
end

Instance Method Details

#deleted_timestamp_overwrite?Boolean

Whether to overwrite the deleted timestamp if it already exists

Returns:

  • (Boolean)


43
44
45
# File 'lib/sequel_paranoia.rb', line 43

def deleted_timestamp_overwrite?
  @deleted_timestamp_overwrite
end

#inherited(subclass) ⇒ Object

Copy the class instance variables used from the superclass to the subclass



48
49
50
51
52
53
# File 'lib/sequel_paranoia.rb', line 48

def inherited(subclass)
  super
  [:@deleted_timestamp_field, :@deleted_timestamp_overwrite].each do |iv|
    subclass.instance_variable_set(iv, instance_variable_get(iv))
  end
end

#with_deletedObject



55
56
57
# File 'lib/sequel_paranoia.rb', line 55

def with_deleted
  dataset.unfiltered
end