Class: AuditTables::CreateAuditTablesForExistingTables
- Inherits:
-
Object
- Object
- AuditTables::CreateAuditTablesForExistingTables
- Defined in:
- lib/audit_tables/create_audit_tables_for_existing_tables.rb
Instance Attribute Summary collapse
-
#klasses ⇒ Object
readonly
Returns the value of attribute klasses.
Instance Method Summary collapse
-
#initialize(options) ⇒ CreateAuditTablesForExistingTables
constructor
A new instance of CreateAuditTablesForExistingTables.
- #process ⇒ Object
Constructor Details
#initialize(options) ⇒ CreateAuditTablesForExistingTables
Returns a new instance of CreateAuditTablesForExistingTables.
6 7 8 9 |
# File 'lib/audit_tables/create_audit_tables_for_existing_tables.rb', line 6 def initialize() @klasses = ActiveRecord::Base.connection.tables @klasses -= end |
Instance Attribute Details
#klasses ⇒ Object (readonly)
Returns the value of attribute klasses.
4 5 6 |
# File 'lib/audit_tables/create_audit_tables_for_existing_tables.rb', line 4 def klasses @klasses end |
Instance Method Details
#process ⇒ Object
11 12 13 14 15 16 |
# File 'lib/audit_tables/create_audit_tables_for_existing_tables.rb', line 11 def process klasses.each do |klass| AuditTables::BuildAuditTrigger.new(klass).build AuditTables::CreateNewAuditTable.new(klass).build end end |