Class: Legion::Data::Model::AuditRecord
- Inherits:
-
Object
- Object
- Legion::Data::Model::AuditRecord
- Includes:
- Logging::Helper
- Defined in:
- lib/legion/data/models/audit_record.rb
Instance Method Summary collapse
- #before_destroy ⇒ Object
-
#before_update ⇒ Object
Enforce append-only semantics at the application layer.
- #parsed_metadata ⇒ Object
Methods included from Logging::Helper
Instance Method Details
#before_destroy ⇒ Object
19 20 21 |
# File 'lib/legion/data/models/audit_record.rb', line 19 def before_destroy raise 'audit_records are immutable and cannot be deleted' end |
#before_update ⇒ Object
Enforce append-only semantics at the application layer. PostgreSQL enforces this at the DB layer via rules (migration 058); the application guard covers SQLite and MySQL.
15 16 17 |
# File 'lib/legion/data/models/audit_record.rb', line 15 def before_update raise 'audit_records are immutable and cannot be updated' end |
#parsed_metadata ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/legion/data/models/audit_record.rb', line 23 def return {} unless Legion::JSON.load() rescue StandardError => e handle_exception(e, level: :warn, handled: true, operation: :parsed_metadata, id: self[:id]) {} end |