lib/audited/s3_auditor.rb
def modify_audit(audit, audit_attrs)
      # if the associated reference has changed, we need to delete the audit
      # from the old location so it gets properly moved to the new one
      if audit_attrs[:associated]
        move_audit(audit, audit_attrs)
      else
        s3_key = resolve_s3_key(audit)
        audits = read_audits(s3_key)
        audit_to_modify = audits.detect { |a| a == audit }
        audit_to_modify.assign_attributes(audit_attrs)

        put_audits(s3_key, audits)
      end
    end
# NOTE! This isn't a good idea. You really should never modify audits except
# in the event that the audit was written incorrectly or you are needing to go
# back and backfill data that was missing.
NOTE. This isn't a good idea. You really should never modify audits except
in the event that the audit was written incorrectly or you are needing to go
back and backfill data that was missing.
NOTE . This isn ' t a good idea . You really should never modify audits except in the event that the audit was written incorrectly or you are needing to go back and backfill data that was missing .
def modify_audit(audit, audit_attrs)
      if audit_attrs[:associated]
        move_audit(audit, audit_attrs)
      else
        s3_key = resolve_s3_key(audit)
        audits = read_audits(s3_key)
        audit_to_modify = audits.detect { |a| a == audit }
        audit_to_modify.assign_attributes(audit_attrs)
        put_audits(s3_key, audits)
      end
    end
def modify_audit ( audit , audit_attrs ) if audit_attrs [ :associated ] move_audit ( audit , audit_attrs ) else s3_key = resolve_s3_key ( audit ) audits = read_audits ( s3_key ) audit_to_modify = audits . detect { | a | a == audit } audit_to_modify . assign_attributes ( audit_attrs ) put_audits ( s3_key , audits ) end end
NOTE!
NOTE!
# if the associated reference has changed, we need to delete the audit # from the old location so it gets properly moved to the new one
audit
audit_attrs