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 +4 -4
- data/Gemfile.lock +1 -1
- data/backup_restore_db-0.1.4.gem +0 -0
- data/lib/backup_restore_db/version.rb +1 -1
- data/lib/tasks/backup.rake +11 -9
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d9ae2c1448a156dbca8addca59d6145ea81c12f8bd877e8cc455ca357b36b97
|
4
|
+
data.tar.gz: aa3647508c997ecc66e547f519776ff778dc0eacf97c78419458aae5af95ddc5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef3a202d560855ead0221ea80f51d2ae3a749db1bb2d6f36b6f82a04869c2f7e993223f390beba8276b9c1711e3c4794fed532b3a0133d2c30cc248bdcfe75e6
|
7
|
+
data.tar.gz: 29f5d9eeebf621a41f0f5b6817547201002db1ed782023d58283dd503799a45ebf52f587d83d4a6c7b288b5fde8a9bed7fea7a29f8caeb3de0041aaebe671ab5
|
data/Gemfile.lock
CHANGED
Binary file
|
data/lib/tasks/backup.rake
CHANGED
@@ -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
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
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
|
+
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
|