Class: ActiveGraph::Migration
- Inherits:
-
Object
- Object
- ActiveGraph::Migration
- Defined in:
- lib/active_graph/migration.rb
Direct Known Subclasses
Defined Under Namespace
Classes: AddIdProperty
Instance Method Summary collapse
- #default_path ⇒ Object
- #joined_path(path) ⇒ Object
- #migrate ⇒ Object
- #output(string = '') ⇒ Object
- #print_output(string) ⇒ Object
- #query(*args) ⇒ Object
- #setup ⇒ Object
Instance Method Details
#default_path ⇒ Object
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 |
#migrate ⇒ Object
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 |
#print_output(string) ⇒ Object
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 |
#setup ⇒ Object
26 27 28 |
# File 'lib/active_graph/migration.rb', line 26 def setup FileUtils.mkdir_p('db/neo4j-migrate') end |