Class: DataMigrations::Instruction::Copy
- Defined in:
- lib/data_migrations/instruction/copy.rb
Instance Attribute Summary
Attributes inherited from Base
#columns, #migration, #options
Instance Method Summary collapse
-
#initialize(migration, *columns) ⇒ Copy
constructor
A new instance of Copy.
- #statements ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(migration, *columns) ⇒ Copy
Returns a new instance of Copy.
4 5 6 7 8 9 |
# File 'lib/data_migrations/instruction/copy.rb', line 4 def initialize(migration, *columns) super(migration) self. = columns. [:to] = [nil].concat(Array([:to]) || []) self.columns = ['id'].concat(columns) end |
Instance Method Details
#statements ⇒ Object
11 12 13 |
# File 'lib/data_migrations/instruction/copy.rb', line 11 def statements [update_statement, insert_statement] end |