Class: BetterRecord::LoggedAction
- Defined in:
- app/models/better_record/logged_action.rb
Constant Summary collapse
- ACTIONS =
Constants ============================================================
{ D: 'DELETE', I: 'INSERT', U: 'UPDATE', T: 'TRUNCATE', }.with_indifferent_access
Class Method Summary collapse
-
.default_print ⇒ Object
Class Methods ========================================================.
Instance Method Summary collapse
- #action_type ⇒ Object
-
#changed_columns ⇒ Object
Instance Methods =====================================================.
Class Method Details
.default_print ⇒ Object
Class Methods ========================================================
29 30 31 32 33 34 35 36 37 38 39 |
# File 'app/models/better_record/logged_action.rb', line 29 def self.default_print [ :event_id, :row_id, :table_name, :app_user_id, :app_user_type, :action_type, :changed_columns ] end |
Instance Method Details
#action_type ⇒ Object
46 47 48 |
# File 'app/models/better_record/logged_action.rb', line 46 def action_type ACTIONS[action] || 'UNKNOWN' end |
#changed_columns ⇒ Object
Instance Methods =====================================================
42 43 44 |
# File 'app/models/better_record/logged_action.rb', line 42 def changed_columns (self.changed_fields || {}).keys.join(', ').presence || 'N/A' end |