backup_restore_db 0.1.4 → 0.1.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a3e1823137eaa3b89511900ddd83ec548a5c8a2c00e5a02754f8efe7d9ced803
4
- data.tar.gz: 6900553965466109c99ef5f1ee9c8b696c21d26ff10797013f904782394dadec
3
+ metadata.gz: 4d9ae2c1448a156dbca8addca59d6145ea81c12f8bd877e8cc455ca357b36b97
4
+ data.tar.gz: aa3647508c997ecc66e547f519776ff778dc0eacf97c78419458aae5af95ddc5
5
5
  SHA512:
6
- metadata.gz: ffb1fff8b94fd0bb57acc2b80e3ade3d6a9cea6dd1931418cc9a09e6d4c53bdbdd9da8468fa07a812cb16523049631828c7b0765a76995ceec61d598bbf6f84b
7
- data.tar.gz: bc404edbd5732275c8519e7f928290f78c3d000ebf7f69c0d74586cd67fc04bd50631fe641297a7b160bd297cab8dee39d0088819bdfc511c5b3fe57b3537836
6
+ metadata.gz: ef3a202d560855ead0221ea80f51d2ae3a749db1bb2d6f36b6f82a04869c2f7e993223f390beba8276b9c1711e3c4794fed532b3a0133d2c30cc248bdcfe75e6
7
+ data.tar.gz: 29f5d9eeebf621a41f0f5b6817547201002db1ed782023d58283dd503799a45ebf52f587d83d4a6c7b288b5fde8a9bed7fea7a29f8caeb3de0041aaebe671ab5
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- backup_restore_db (0.1.4)
4
+ backup_restore_db (0.1.5)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,3 +1,3 @@
1
1
  module BackupRestoreDb
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
@@ -42,16 +42,18 @@ namespace :db do
42
42
 
43
43
  # the key here is to use 'as_json', otherwise you get an ActiveRecord_Relation object, which extends
44
44
  # array, and works like in an array, but not for exporting
45
- #from a string I try to call a class instance with constantize
46
-
47
- data = (capitalize1(tableName).singularize).safe_constantize.all.as_json
48
-
49
- # The pretty is nice so I can diff exports easily, if that's not important, JSON(users) will do
50
- File.open(filepath, 'w') do |f|
51
- f.write(JSON.pretty_generate(data))
45
+ #from a string I try to call a class instance with safe_constantize
46
+
47
+ if capitalize1(tableName).singularize.safe_constantize != nil
48
+ data = (capitalize1(tableName).singularize).safe_constantize.all.as_json
49
+
50
+ # The pretty is nice so I can diff exports easily, if that's not important, JSON(users) will do
51
+ File.open(filepath, 'w') do |f|
52
+ f.write(JSON.pretty_generate(data))
53
+ end
54
+
55
+ puts "- dumped #{tableName.size} #{tableName}"
52
56
  end
53
-
54
- puts "- dumped #{tableName.size} #{tableName}"
55
57
  end
56
58
 
57
59
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backup_restore_db
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Corrado Tuccitto
@@ -27,6 +27,7 @@ files:
27
27
  - backup_restore_db-0.1.0.gem
28
28
  - backup_restore_db-0.1.2.gem
29
29
  - backup_restore_db-0.1.3.gem
30
+ - backup_restore_db-0.1.4.gem
30
31
  - backup_restore_db.gemspec
31
32
  - bin/console
32
33
  - bin/setup