module Console1984::Ext::ActiveRecord::ProtectedAuditableTables

Prevents accessing trail model tables when executing console commands.

Private Instance Methods

auditable_models() click to toggle source
# File lib/console1984/ext/active_record/protected_auditable_tables.rb, line 25
def auditable_models
  @auditable_models ||= Console1984::Base.descendants
end
auditable_tables() click to toggle source
# File lib/console1984/ext/active_record/protected_auditable_tables.rb, line 21
def auditable_tables
  @auditable_tables ||= Console1984.command_executor.run_as_system { auditable_models.collect(&:table_name) }
end
auditable_tables_regexp() click to toggle source
# File lib/console1984/ext/active_record/protected_auditable_tables.rb, line 17
def auditable_tables_regexp
  @auditable_tables_regexp ||= Regexp.new("#{auditable_tables.join("|")}")
end