Class: ActiveAudit::AuditRepository
- Inherits:
-
Object
- Object
- ActiveAudit::AuditRepository
- Defined in:
- lib/active_audit/audit_repository.rb
Class Method Summary collapse
- .create(attributes) ⇒ Object
- .find_by_record(record, options = {}) ⇒ Object
- .save(audit) ⇒ Object
- .storage_adapter ⇒ Object
- .storage_adapter=(repo_name) ⇒ Object
Class Method Details
.create(attributes) ⇒ Object
16 17 18 |
# File 'lib/active_audit/audit_repository.rb', line 16 def create attributes save Audit.deserialize(attributes) end |
.find_by_record(record, options = {}) ⇒ Object
12 13 14 |
# File 'lib/active_audit/audit_repository.rb', line 12 def find_by_record record, ={} storage_adapter.find_by_record(record, ) end |
.save(audit) ⇒ Object
20 21 22 23 24 |
# File 'lib/active_audit/audit_repository.rb', line 20 def save audit audit.save do storage_adapter.save audit end end |
.storage_adapter ⇒ Object
8 9 10 |
# File 'lib/active_audit/audit_repository.rb', line 8 def storage_adapter @@storage_adapter ||= ActiveAudit::StorageAdapters::TestAdapter end |
.storage_adapter=(repo_name) ⇒ Object
4 5 6 |
# File 'lib/active_audit/audit_repository.rb', line 4 def storage_adapter=(repo_name) @@storage_adapter = load_adapter(repo_name) end |