Skip to content
This repository
Browse code

Remove version conditional from rake task

  • Loading branch information...
commit 8390516f435fd59cee08bb352041b2d1739a3a5a 1 parent b3f9690
Prem Sichanugrist authored March 26, 2012

Showing 1 changed file with 2 additions and 10 deletions. Show diff stats Hide diff stats

  1. 12  lib/tasks/paperclip.rake
12  lib/tasks/paperclip.rake
@@ -49,11 +49,7 @@ namespace :paperclip do
49 49
             instance.send("#{name}_file_name=", instance.send("#{name}_file_name").strip)
50 50
             instance.send("#{name}_content_type=", file.content_type.to_s.strip)
51 51
             instance.send("#{name}_file_size=", file.size) if instance.respond_to?("#{name}_file_size")
52  
-            if Rails.version >= "3.0.0"
53  
-              instance.save(:validate => false)
54  
-            else
55  
-              instance.save(false)
56  
-            end
  52
+            instance.save(:validate => false)
57 53
           else
58 54
             true
59 55
           end
@@ -88,11 +84,7 @@ namespace :paperclip do
88 84
           attributes = %w(file_size file_name content_type).map{ |suffix| "#{name}_#{suffix}".to_sym }
89 85
           if attributes.any?{ |attribute| instance.errors[attribute].present? }
90 86
             instance.send("#{name}=", nil)
91  
-            if Rails.version >= "3.0.0"
92  
-              instance.save(:validate => false)
93  
-            else
94  
-              instance.save(false)
95  
-            end
  87
+            instance.save(:validate => false)
96 88
           end
97 89
         end
98 90
       end

0 notes on commit 8390516

Please sign in to comment.
Something went wrong with that request. Please try again.