Module: ActiveRecord::ActiveRecordAuditorRelation

Included in:
Relation
Defined in:
lib/active_record_auditor/extensions/active_record_auditor_relation.rb

Instance Method Summary collapse

Instance Method Details

#delete_all(conditions = nil) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/active_record_auditor/extensions/active_record_auditor_relation.rb', line 4

def delete_all(conditions = nil)
  if conditions
    super
  else
    transaction do
      to_a.each {|object| object._delete_relation_record}
      super
    end
  end
end

#update_all(updates) ⇒ Object



15
16
17
18
19
20
# File 'lib/active_record_auditor/extensions/active_record_auditor_relation.rb', line 15

def update_all(updates)
  transaction do
    to_a.each {|object| object._update_relation_record}
    super
  end
end