attribute_imagifiable 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/attribute_imagifiable.gemspec +1 -1
- data/lib/attribute_imagifiable.rb +1 -1
- metadata +1 -1
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |gem|
|
6
6
|
gem.name = "attribute_imagifiable"
|
7
|
-
gem.version = "0.0.
|
7
|
+
gem.version = "0.0.4"
|
8
8
|
gem.authors = ["Stefan Wienert", "Akos Toth"]
|
9
9
|
gem.email = ["stefan.wienert@pludoni.de"]
|
10
10
|
gem.description = %q{Using paperclip to generate images from sensible attributes like e-mails and telephone numbers, in order to reduce crawler's success}
|
@@ -24,7 +24,7 @@ module AttributeImagifiable
|
|
24
24
|
attributes = self.class.instance_variable_get("@_imagifiable_attributes")
|
25
25
|
attributes.each do |attribute, as|
|
26
26
|
value = send(attribute)
|
27
|
-
if send
|
27
|
+
if send("#{attribute}_changed?") || !send(as).exists?
|
28
28
|
if value.present?
|
29
29
|
arg = Shellwords.escape(value)
|
30
30
|
tmp_name = Rails.root.join("tmp/#{as}-#{SecureRandom.hex(10)}.jpg")
|