Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Tweaks

git-svn-id: https://svn.thoughtbot.com/plugins/paperclip/trunk@299 7bbfaf0e-4d1d-0410-9690-a8bb5f8ef2aa
  • Loading branch information...
commit 53f9558a16fced9635d794a508679142ecf2f564 1 parent 9412f71
jyurek authored
Showing with 10 additions and 7 deletions.
  1. +2 −3 lib/paperclip/attachment.rb
  2. +8 −4 test/test_paperclip.rb
View
5 lib/paperclip/attachment.rb
@@ -34,10 +34,9 @@ def assign uploaded_file
self.original_file_size = uploaded_file.size
self[:original] = uploaded_file.read
@dirty = true
+ @delete_on_save = false
- if definition.content_type == :image
- convert( self[:original] )
- end
+ convert( self[:original] )
end
def [](style) #:nodoc:
View
12 test/test_paperclip.rb
@@ -5,9 +5,12 @@ class TestPaperclip < Test::Unit::TestCase
context "Paperclip" do
should "allow overriding options" do
- not_expected = Paperclip.options[:image_magick_path]
- Paperclip.options[:image_magick_path] = "123"
- assert_equal "123", Paperclip.options[:image_magick_path]
+ [:image_magick_path, :whiny_deletes, :whiny_thumbnails].each do |option|
+ not_expected = Paperclip.options[option]
+ Paperclip.options[option] = "123"
+ assert_equal "123", Paperclip.options[option]
+ assert_not_equal not_expected, Paperclip.options[option]
+ end
end
should "give the correct path for a command" do
@@ -20,9 +23,10 @@ class TestPaperclip < Test::Unit::TestCase
assert_equal expected, Paperclip.path_for_command("wtf")
end
- context "being used on class Improper" do
+ context "being used on improper class Improper" do
setup do
ActiveRecord::Base.connection.create_table :impropers, :force => true do |table|
+ # Empty table
end
Object.send(:remove_const, :Improper) rescue nil
class ::Improper < ActiveRecord::Base; end
Please sign in to comment.
Something went wrong with that request. Please try again.