Class: ActiveGraph::Migration

Inherits:
Object
  • Object
show all
Defined in:
lib/active_graph/migration.rb

Direct Known Subclasses

AddIdProperty

Defined Under Namespace

Classes: AddIdProperty

Instance Method Summary collapse

Instance Method Details

#default_pathObject



18
19
20
# File 'lib/active_graph/migration.rb', line 18

def default_path
  Rails.root if defined? Rails
end

#joined_path(path) ⇒ Object



22
23
24
# File 'lib/active_graph/migration.rb', line 22

def joined_path(path)
  File.join(path.to_s, 'db', 'neo4j-migrate')
end

#migrateObject



6
7
8
# File 'lib/active_graph/migration.rb', line 6

def migrate
  fail 'not implemented'
end

#output(string = '') ⇒ Object



10
11
12
# File 'lib/active_graph/migration.rb', line 10

def output(string = '')
  puts string unless !!ENV['MIGRATIONS_SILENCED']
end


14
15
16
# File 'lib/active_graph/migration.rb', line 14

def print_output(string)
  print string unless !!ENV['MIGRATIONS_SILENCED']
end

#query(*args) ⇒ Object



30
31
32
# File 'lib/active_graph/migration.rb', line 30

def query(*args)
  ActiveGraph::Base.query(*args)
end

#setupObject



26
27
28
# File 'lib/active_graph/migration.rb', line 26

def setup
  FileUtils.mkdir_p('db/neo4j-migrate')
end