Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove version conditional from rake task
  • Loading branch information
sikachu committed Mar 26, 2012
1 parent b3f9690 commit 8390516
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions lib/tasks/paperclip.rake
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8390516

Please sign in to comment.