Commit 8390516f by Prem Sichanugrist

Remove version conditional from rake task

parent b3f96902
......@@ -49,11 +49,7 @@ namespace :paperclip do
instance.send("#{name}_file_name=", instance.send("#{name}_file_name").strip)
instance.send("#{name}_content_type=", file.content_type.to_s.strip)
instance.send("#{name}_file_size=", file.size) if instance.respond_to?("#{name}_file_size")
if Rails.version >= "3.0.0"
instance.save(:validate => false)
else
instance.save(false)
end
instance.save(:validate => false)
else
true
end
......@@ -88,11 +84,7 @@ namespace :paperclip do
attributes = %w(file_size file_name content_type).map{ |suffix| "#{name}_#{suffix}".to_sym }
if attributes.any?{ |attribute| instance.errors[attribute].present? }
instance.send("#{name}=", nil)
if Rails.version >= "3.0.0"
instance.save(:validate => false)
else
instance.save(false)
end
instance.save(:validate => false)
end
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment