Sha256: 562f2a903d7e813db38f942d1dd84c4b96f630808e4d1a4055401f74fae58e4e

Contents?: true

Size: 422 Bytes

Versions: 6

Compression:

Stored size: 422 Bytes

Contents

module ActiveRecord
  module ActiveRecordAuditorRelation

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

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
active_record_auditor-0.2.1 lib/active_record_auditor/extensions/active_record_auditor_relation.rb
active_record_auditor-0.2.0 lib/active_record_auditor/extensions/active_record_auditor_relation.rb
active_record_auditor-0.1.9 lib/active_record_auditor/extensions/active_record_auditor_relation.rb
active_record_auditor-0.1.8 lib/active_record_auditor/extensions/active_record_auditor_relation.rb
active_record_auditor-0.1.7 lib/active_record_auditor/extensions/active_record_auditor_relation.rb
active_record_auditor-0.1.6 lib/active_record_auditor/extensions/active_record_auditor_relation.rb