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



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

def default_path
  Rails.root if defined? Rails
end

#joined_path(path) ⇒ Object



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

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

#migrateObject



3
4
5
# File 'lib/active_graph/migration.rb', line 3

def migrate
  fail 'not implemented'
end

#output(string = '') ⇒ Object



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

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


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

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

#query(*args) ⇒ Object



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

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

#setupObject



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

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