ack-paperclip-meta 3.0.0.1 → 3.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: 694a6136ef56089c20e41c1b6295e2527233dd79
4
- data.tar.gz: 032d53f654ba5a2e30e42cb461f89caa32c6cc85
3
+ metadata.gz: e30bf93a1c0c942ef040b6ba67722ee7942fc3a2
4
+ data.tar.gz: 23b760b0695ff83e53252af05ff5c3fe8bc2a61b
5
5
  SHA512:
6
- metadata.gz: f357bdeec11356c7e43e4f70884dd7771caee68e8ed21b5199caeac6cfea352f2d72ec229ae88ebb5cda17545e1a935df7ec28a963720ba7eef6a0c9389a6506
7
- data.tar.gz: c471f45698ffc461ee147ef27115689fe3111910580dd125ab5782ffed769a155cc06a815c6fba241aa7b54125c3912d9b124b0dc665e49e2e57420d5f7729d4
6
+ metadata.gz: 41078d22213e9c453f98cc44268106df65a1f9bb750a549d1a720d041448a9e0d054d72ce5f26a8a3cb2bd6fe62c1be8abe9683cc0f9dbc133c4a8b30dbb1f92
7
+ data.tar.gz: 75683ee450ca76f59716a1d259197cbaaf1b61fc842c2e8d1fcdd1529d68c1aa4910153d88a69bfdd5428d2c2bf09c19820fb09464058483b5ecc868d390df05
@@ -3,7 +3,7 @@ module Paperclip
3
3
  module Attachment
4
4
  def assign_attributes
5
5
  super
6
- assign_meta
6
+ assign_meta if content_type =~ /\Aimage\/.*\Z/
7
7
  end
8
8
 
9
9
  def save
@@ -44,6 +44,7 @@ module Paperclip
44
44
  private
45
45
 
46
46
  def assign_meta
47
+ return unless content_type =~ /\Aimage\/.*\Z/
47
48
  return unless instance.respond_to?(:"#{name}_meta=")
48
49
  meta = populate_meta(@queued_for_write)
49
50
  return if meta == {}
@@ -85,6 +86,7 @@ module Paperclip
85
86
 
86
87
  # Return decoded metadata as Object
87
88
  def meta_decode(meta)
89
+ return meta if meta.is_a?(Hash)
88
90
  Marshal.load(Base64.decode64(meta))
89
91
  end
90
92
 
@@ -1,5 +1,5 @@
1
1
  module Paperclip
2
2
  module Meta
3
- VERSION = "3.0.0.1"
3
+ VERSION = "3.0.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ack-paperclip-meta
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.1
4
+ version: 3.0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ack
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-03-27 00:00:00.000000000 Z
13
+ date: 2017-05-24 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: paperclip