activerecord-snapshot 0.3.3 → 0.3.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d26f8f2b6e2bc02546609524b2c53f4c55409147
|
4
|
+
data.tar.gz: 9cdad92b18df4f187cbe87416426649fa603984d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3afe2f09a0ac018f12ef80cf15f0eeffb3ea3730cb6084280539e5149410399d38f196f5fc90fa9e94e21628bcce6a3c1a299bc39b082333ddecdbf6b98c27d2
|
7
|
+
data.tar.gz: 9aff88d0a9fad5cdff2145bc47b7a9a3ee71f67afe58be86da7e462b0b4ffc19b83382332ef2f9352c6c43a5d21ead552cac3bf479b025d9f034b411b1e53842
|
@@ -20,8 +20,12 @@ module ActiveRecord
|
|
20
20
|
File.write(path, version)
|
21
21
|
end
|
22
22
|
|
23
|
+
def download
|
24
|
+
s3.download_to(path)
|
25
|
+
end
|
26
|
+
|
23
27
|
def upload
|
24
|
-
|
28
|
+
s3.upload(path)
|
25
29
|
end
|
26
30
|
|
27
31
|
def filename
|
@@ -34,6 +38,10 @@ module ActiveRecord
|
|
34
38
|
|
35
39
|
private
|
36
40
|
|
41
|
+
def s3
|
42
|
+
S3.new(directory: config.s3.paths.snapshots)
|
43
|
+
end
|
44
|
+
|
37
45
|
def config
|
38
46
|
ActiveRecord::Snapshot.config
|
39
47
|
end
|
@@ -3,6 +3,8 @@ namespace :db do
|
|
3
3
|
desc "Create a snapshot of the current database and store it in S3"
|
4
4
|
task create: :load do
|
5
5
|
abort "Meant for production only!" unless Rails.env.production?
|
6
|
+
ActiveRecord::Snapshot::List.download
|
7
|
+
ActiveRecord::Snapshot::Version.download
|
6
8
|
ActiveRecord::Snapshot::Create.call
|
7
9
|
end
|
8
10
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-snapshot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bernardo Farah
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|