refile-backgrounder 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/lib/refile/backgrounder/activerecord.rb +3 -1
- data/lib/refile/backgrounder/store_worker.rb +2 -1
- data/lib/refile/backgrounder/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 209d85302c5fe08550bf637dcdd9db50bea0bd4b
|
4
|
+
data.tar.gz: 8892986ec1cd830c6e42fc909ef86f9fed5bcdb8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd5166522f79bd6df035b61f61d6cfc359bae23768d5119bccf055c41aec95c7a5980d6d05cfe9e5d782e83bd3efc63cbdfa6a50413c5991a559408de9f5b950
|
7
|
+
data.tar.gz: c09e16c1d6fd014a3bbdbdb0261c510fe98fe186e7a0ca3e4b84c6490e71a149bd8510000be0672aa23de2a3ddf967db325d75449a5b75ec88f4064557c80bfb
|
@@ -8,7 +8,9 @@ module Refile
|
|
8
8
|
|
9
9
|
attr_accessor :_skip_refile_backgrounder
|
10
10
|
after_save(unless: :_skip_refile_backgrounder) do |record|
|
11
|
-
|
11
|
+
metadata = record.send(name)
|
12
|
+
metadata = nil unless metadata.is_a? String
|
13
|
+
worker.perform_later record, name.to_s, metadata
|
12
14
|
end
|
13
15
|
end
|
14
16
|
|
@@ -4,9 +4,10 @@ module Refile
|
|
4
4
|
attr_reader :record, :attachment_name
|
5
5
|
queue_as :refile
|
6
6
|
|
7
|
-
def perform(record, attachment_name)
|
7
|
+
def perform(record, attachment_name, metadata = nil)
|
8
8
|
@record = record
|
9
9
|
@attachment_name = attachment_name
|
10
|
+
@record.send "#{attachment_name}=", metadata if metadata
|
10
11
|
return unless attachment_cached?
|
11
12
|
|
12
13
|
file = attacher.get
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: refile-backgrounder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Logan Serman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|