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
- .needs_attr_accessible? ⇒ Boolean
- .no_audit_entry_for_today?(action_name, user_name) ⇒ Boolean
Class Method Details
.analysis_by_page_views ⇒ Object
34 35 36 |
# File 'app/models/audit_rails/audit.rb', line 34 def self.analysis_by_page_views group_by_controller_action.count end |
.analysis_by_user_name ⇒ Object
30 31 32 |
# File 'app/models/audit_rails/audit.rb', line 30 def self.analysis_by_user_name group_by_user_name.count end |
.needs_attr_accessible? ⇒ Boolean
3 4 5 |
# File 'app/models/audit_rails/audit.rb', line 3 def self.needs_attr_accessible? Rails::VERSION::MAJOR == 3 end |
.no_audit_entry_for_today?(action_name, user_name) ⇒ Boolean
23 24 25 26 27 28 |
# File 'app/models/audit_rails/audit.rb', line 23 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 |