Permalink
Browse files

cleaned up some options malarky

git-svn-id: https://svn.thoughtbot.com/plugins/paperclip/trunk@249 7bbfaf0e-4d1d-0410-9690-a8bb5f8ef2aa
  • Loading branch information...
jyurek
jyurek committed Nov 18, 2007
1 parent d76ef9b commit 849b6b8cb7fc7c9746b47a323f3fd66a67d6f08b
Showing with 8 additions and 9 deletions.
  1. +1 −1 lib/paperclip/storage/filesystem.rb
  2. +0 −1 lib/paperclip/storage/s3.rb
  3. +7 −7 test/test_attachment_definition.rb
@@ -32,7 +32,7 @@ def attachment_exists? style = nil
def file_name style = nil
style ||= definition.default_style
- interpolate( style, definition.file_path )
+ interpolate( style, definition.path )
end
def ensure_directories
@@ -34,7 +34,6 @@ def url_with_s3 style = nil
http_host = definition.s3_host || "http://s3.amazonaws.com"
"#{http_host}/#{bucket}/#{url_without_s3(style)}"
end
- alias_method_chain :url, :s3
def file_name style = nil
style ||= definition.default_style
@@ -4,15 +4,15 @@
class TestAttachmentDefinition < Test::Unit::TestCase
context "Attachment definitions" do
should "allow overriding options" do
- not_expected = Paperclip::AttachmentDefinition.defaults[:file_path]
- Paperclip::AttachmentDefinition.defaults[:file_path] = "123"
- assert_not_equal not_expected, Paperclip::AttachmentDefinition.defaults[:file_path]
- assert_equal "123", Paperclip::AttachmentDefinition.defaults[:file_path]
+ not_expected = Paperclip::AttachmentDefinition.defaults[:path]
+ Paperclip::AttachmentDefinition.defaults[:path] = "123"
+ assert_not_equal not_expected, Paperclip::AttachmentDefinition.defaults[:path]
+ assert_equal "123", Paperclip::AttachmentDefinition.defaults[:path]
end
should "accept options that override defaults" do
- @def = Paperclip::AttachmentDefinition.new "attachment", :file_path => "123", :delete_on_destroy => false
- assert_not_equal Paperclip::AttachmentDefinition.defaults[:file_path], @def.path
+ @def = Paperclip::AttachmentDefinition.new "attachment", :path => "123", :delete_on_destroy => false
+ assert_not_equal Paperclip::AttachmentDefinition.defaults[:path], @def.path
assert_not_equal Paperclip::AttachmentDefinition.defaults[:delete_on_destroy], @def.delete_on_destroy
assert_equal "123", @def.path
assert_equal false, @def.delete_on_destroy
@@ -22,7 +22,7 @@ class TestAttachmentDefinition < Test::Unit::TestCase
context "An attachment defintion" do
setup do
@options = {
- :file_path => "/home/stuff/place",
+ :path => "/home/stuff/place",
:url => "/attachments/:attachment/:name",
:custom_definition => :boogie!,
:thumbnails => {:thumb => "100x100", :large => "300x300>"},

0 comments on commit 849b6b8

Please sign in to comment.