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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d319c8d55dbe2cc6f9bdd23351115e825a1625c2
4
- data.tar.gz: c0eea32d332c6cb0c942845bfba6f1ee572d3965
3
+ metadata.gz: 209d85302c5fe08550bf637dcdd9db50bea0bd4b
4
+ data.tar.gz: 8892986ec1cd830c6e42fc909ef86f9fed5bcdb8
5
5
  SHA512:
6
- metadata.gz: 52bff925e34468964a5450db7348db940c48fbd09ffc6526751d7dbe2f43042ba7ba5cc6ce0f600e6ea6dae0d074d19bc745ffec4759c9c762e257d74e9b8faa
7
- data.tar.gz: 494b211ae5b48eccc542b9020d863a5c6ed1ac21aa0b321907276e579c3414660ec4a8037d0c4ef04ef540956b56d343eb557a7ef1cd373944e5e69e15de034c
6
+ metadata.gz: fd5166522f79bd6df035b61f61d6cfc359bae23768d5119bccf055c41aec95c7a5980d6d05cfe9e5d782e83bd3efc63cbdfa6a50413c5991a559408de9f5b950
7
+ data.tar.gz: c09e16c1d6fd014a3bbdbdb0261c510fe98fe186e7a0ca3e4b84c6490e71a149bd8510000be0672aa23de2a3ddf967db325d75449a5b75ec88f4064557c80bfb
data/.gitignore CHANGED
@@ -12,3 +12,5 @@
12
12
  *.o
13
13
  *.a
14
14
  mkmf.log
15
+
16
+ *.gem
@@ -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
- worker.perform_later record, name.to_s
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
@@ -1,5 +1,5 @@
1
1
  module Refile
2
2
  module Backgrounder
3
- VERSION = '0.0.1'
3
+ VERSION = '0.0.2'
4
4
  end
5
5
  end
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.1
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-12 00:00:00.000000000 Z
11
+ date: 2015-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails