Method: Lockbox::Migrator#migrate
- Defined in:
- lib/lockbox/migrator.rb
#migrate(restart:) ⇒ Object
TODO add attributes option
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/lockbox/migrator.rb', line 26 def migrate(restart:) fields = model.respond_to?(:lockbox_attributes) ? model.lockbox_attributes.select { |k, v| v[:migrating] } : {} # need blind indexes for building relation blind_indexes = model.respond_to?(:blind_indexes) ? model.blind_indexes.select { |k, v| v[:migrating] } : {} = model.respond_to?(:lockbox_attachments) ? model..select { |k, v| v[:migrating] } : {} perform(fields: fields, blind_indexes: blind_indexes, restart: restart) if fields.any? || blind_indexes.any? (attachments: , restart: restart) if .any? end |