Module: OrganizzePermanentRecords::Scopes

Defined in:
lib/organizze_permanent_records.rb

Instance Method Summary collapse

Instance Method Details

#deletedObject



33
34
35
# File 'lib/organizze_permanent_records.rb', line 33

def deleted
  where("#{table_name}.deleted_at IS NOT NULL")
end

#not_deletedObject



37
38
39
# File 'lib/organizze_permanent_records.rb', line 37

def not_deleted
  where("#{table_name}.deleted_at IS NULL")
end

#with_deleted(*args) ⇒ Object



41
42
43
44
45
46
47
# File 'lib/organizze_permanent_records.rb', line 41

def with_deleted(*args)
  if args.present?
    unscoped.find(args)
  else
    unscoped
  end
end