Class: AuditRails::Audit
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- AuditRails::Audit
- Defined in:
- app/models/audit_rails/audit.rb
Class Method Summary collapse
- .analysis_by_page_views ⇒ Object
- .analysis_by_user_name ⇒ Object
- .no_audit_entry_for_today?(action_name, user_name) ⇒ Boolean
Class Method Details
.analysis_by_page_views ⇒ Object
16 17 18 |
# File 'app/models/audit_rails/audit.rb', line 16 def self.analysis_by_page_views count(group: 'controller,action') end |
.analysis_by_user_name ⇒ Object
12 13 14 |
# File 'app/models/audit_rails/audit.rb', line 12 def self.analysis_by_user_name count(group: 'user_name') end |
.no_audit_entry_for_today?(action_name, user_name) ⇒ Boolean
5 6 7 8 9 10 |
# File 'app/models/audit_rails/audit.rb', line 5 def self.no_audit_entry_for_today?(action_name, user_name) audits = where(action: action_name, user_name: user_name, created_at: Time.now.to_date.beginning_of_day..Time.now.to_date.end_of_day) audits.blank? end |