Module: GuardAgainstPhysicalDelete::Base

Defined in:
lib/guard_against_physical_delete/base.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.included(obj) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/guard_against_physical_delete/base.rb', line 3

def self.included(obj)
  obj.extend ClassMethods
  obj.class_eval do
    class_attribute :logical_delete_column

    class << self
      alias_method :set_logical_delete_column, :logical_delete_column=
    end

    set_logical_delete_column :deleted_at
  end
  obj.send(:include, InstanceMethods)
end