neo4apis-activerecord 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/neo4apis/cli/activerecord.rb +11 -2
- data/neo4apis-activerecord.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 958a75dd44231361bc7386645f422d8041a49b00
|
4
|
+
data.tar.gz: 7805c98e8aaed169ce2f9e438a485fa12519652a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a9da16b04590e66e99d5aed580847df688cd39d3ed01e39ac729997bf8954ac76e58d9ff3e03992df09fa46f26682737f5483fb02924f639f4091dfdc4e7b3e
|
7
|
+
data.tar.gz: 96d2c984a9e98bd2133b741737be303a47c7c8ad807afe00a859e76d275dbb7759ad242b4f7e58ed60daeae162db4009be12cc21783721a36402ecf72d80f80e
|
@@ -18,12 +18,14 @@ module Neo4Apis
|
|
18
18
|
class_option :active_record_config_path, type: :string, default: './config/database.yml'
|
19
19
|
class_option :active_record_environment, type: :string, default: 'development'
|
20
20
|
|
21
|
-
desc '
|
22
|
-
def
|
21
|
+
desc 'tables MODELS_OR_TABLE_NAMES', 'Import SQL specified tables'
|
22
|
+
def tables(*models_or_table_names)
|
23
23
|
setup
|
24
24
|
|
25
25
|
model_classes = models_or_table_names.map(&method(:get_model))
|
26
26
|
|
27
|
+
puts "Importing tables: " + model_classes.map(&:table_name).join(', ')
|
28
|
+
|
27
29
|
model_classes.each do |model_class|
|
28
30
|
::Neo4Apis::ActiveRecord.model_importer(model_class)
|
29
31
|
end
|
@@ -37,6 +39,13 @@ module Neo4Apis
|
|
37
39
|
end
|
38
40
|
end
|
39
41
|
|
42
|
+
desc 'all_tables', 'Import all SQL tables'
|
43
|
+
def all_tables
|
44
|
+
setup
|
45
|
+
|
46
|
+
models(*::ActiveRecord::Base.connection.tables)
|
47
|
+
end
|
48
|
+
|
40
49
|
private
|
41
50
|
|
42
51
|
def setup
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neo4apis-activerecord
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Underwood
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: neo4apis
|