activerecord-snapshot 0.3.3 → 0.3.4

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
  SHA1:
3
- metadata.gz: b51b97b1c6cf1f04d2d3c38b89f953e1aafb4e9f
4
- data.tar.gz: 53fbe06bc4d402008d1e6732f8f51daec5c8d7a9
3
+ metadata.gz: d26f8f2b6e2bc02546609524b2c53f4c55409147
4
+ data.tar.gz: 9cdad92b18df4f187cbe87416426649fa603984d
5
5
  SHA512:
6
- metadata.gz: dcec9e3ef3029f1883bdf8973ca00f0e0ea2f06514b61e48ace9236e955175f394bd0abb0ad402fcc4b0843624996a4210af4438212c5722807ade46f49a1cd7
7
- data.tar.gz: 5eee2391e5f2b426cfd1c88833ee6cb4e508eb0cf4ec5b33b83fcbb9c9f837fadb365f087fcdd8f0d43949df6599b1574ed78a2a9bdaebd6affaae0b6c74a15e
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
- S3.new(directory: config.s3.paths.snapshots).upload(path)
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
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord
2
2
  module Snapshot
3
- VERSION = '0.3.3'
3
+ VERSION = '0.3.4'
4
4
  end
5
5
  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.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-06-27 00:00:00.000000000 Z
11
+ date: 2017-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties