Sha256: 4779231f80791187cd1e0064e15f9c284152e0d57ac4a4c8c2a0527615ec0224
Contents?: true
Size: 754 Bytes
Versions: 72
Compression:
Stored size: 754 Bytes
Contents
require 'neo4j/migration' namespace :neo4j do desc 'Run a script against the database to perform system-wide changes' task :migrate, [:task_name, :subtask] => :environment do |_, args| path = Rake.original_dir migration_task = args[:task_name] task_name_constant = migration_task.split('_').map(&:capitalize).join('') begin migration_class = "Neo4j::Migration::#{task_name_constant}".constantize rescue NameError load File.join(path, 'db', 'neo4j-migrate', "#{migration_task}.rb") migration_class = "#{task_name_constant}".constantize end migration = migration_class.new(path) subtask = args[:subtask] if subtask migration.send(subtask) else migration.migrate end end end
Version data entries
72 entries across 72 versions & 2 rubygems