Class: IronAdmin::AuditEntry
- Inherits:
-
ApplicationRecord
- Object
- ApplicationRecord
- IronAdmin::AuditEntry
- Defined in:
- app/models/iron_admin/audit_entry.rb
Overview
ActiveRecord model for persistent audit log entries.
Created by the install_audit generator. Stores a record of all admin panel actions when database storage is enabled.
Class Method Summary collapse
-
.table_exists? ⇒ Boolean
Checks if the audit entries table exists.
Instance Method Summary collapse
- #by_action(action) ⇒ ActiveRecord::Relation
- #by_record_id(record_id) ⇒ ActiveRecord::Relation
- #by_resource(resource) ⇒ ActiveRecord::Relation
- #from_date(date) ⇒ ActiveRecord::Relation
- #to_date(date) ⇒ ActiveRecord::Relation
Class Method Details
.table_exists? ⇒ Boolean
Checks if the audit entries table exists.
43 44 45 46 47 |
# File 'app/models/iron_admin/audit_entry.rb', line 43 def self.table_exists? super rescue ActiveRecord::NoDatabaseError, ActiveRecord::StatementInvalid false end |
Instance Method Details
#by_action(action) ⇒ ActiveRecord::Relation
24 |
# File 'app/models/iron_admin/audit_entry.rb', line 24 scope :by_action, ->(action) { where(action: action) } |
#by_record_id(record_id) ⇒ ActiveRecord::Relation
29 |
# File 'app/models/iron_admin/audit_entry.rb', line 29 scope :by_record_id, ->(record_id) { where(record_id: record_id) } |
#by_resource(resource) ⇒ ActiveRecord::Relation
19 |
# File 'app/models/iron_admin/audit_entry.rb', line 19 scope :by_resource, ->(resource) { where(resource: resource) } |
#from_date(date) ⇒ ActiveRecord::Relation
34 |
# File 'app/models/iron_admin/audit_entry.rb', line 34 scope :from_date, ->(date) { where(created_at: date..) } |
#to_date(date) ⇒ ActiveRecord::Relation
39 |
# File 'app/models/iron_admin/audit_entry.rb', line 39 scope :to_date, ->(date) { where(created_at: ..date) } |