neo4apis-activerecord 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 741e8e7cc55d6f668107298ce95c1a4902082fc9
4
- data.tar.gz: 67094cd3dd31f31cc5e684affd1c73baee06b04e
3
+ metadata.gz: 958a75dd44231361bc7386645f422d8041a49b00
4
+ data.tar.gz: 7805c98e8aaed169ce2f9e438a485fa12519652a
5
5
  SHA512:
6
- metadata.gz: 6de04fca88492660c424adca274cb13d6c59cf9463ff48aac742467b81779884fd128259ae96f8a2f1a5ee3c509ea17214c752b3a8c054e4c75ec7f28f264c75
7
- data.tar.gz: 1fcf87ffde8b393050442525ad4aeae4eed0bcbde2e8f5437cf3541101503158ee761820ecf9fae1b4cb21aae7ddeaa661d616dd377688eaca6aca52a2529cc6
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 'models MODELS_OR_TABLE_NAMES', 'Import SQL tables via ActiveRecord models'
22
- def models(*models_or_table_names)
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
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift lib unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = 'neo4apis-activerecord'
6
- s.version = '0.2.1'
6
+ s.version = '0.3.0'
7
7
  s.required_ruby_version = '>= 1.9.1'
8
8
 
9
9
  s.authors = 'Brian Underwood'
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.2.1
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-07 00:00:00.000000000 Z
11
+ date: 2015-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: neo4apis