public
Description: Treat an ActiveRecord model as a file attachment, storing its patch, size, content type, etc.
Homepage: http://weblog.techno-weenie.net
Clone URL: git://github.com/technoweenie/attachment_fu.git
Click here to lend your support to: attachment_fu and make a donation at www.pledgie.com !
fix public_path to leave a beginning slash
rick (author)
Mon Apr 28 17:55:12 -0700 2008
commit  f73671e84b90fb0e4fd52d2f035684d1c02828a8
tree    110526824ba13a5431659808a52c95d96085c8b6
parent  2e3736bccb05c870f4942bf177bd58e39ebcc620
...
156
157
158
159
 
160
161
162
...
156
157
158
 
159
160
161
162
0
@@ -156,7 +156,7 @@ module AttachmentFu
0
     end
0
 
0
     def public_path(*args)
0
- File.join(attachment_path, *partitioned_path(*args)).sub(/^public\//, '')
0
+ File.join(attachment_path, *partitioned_path(*args)).sub(/^public\//, '/')
0
     end
0
 
0
     def full_path(*args)
...
65
66
67
68
69
 
 
70
71
72
...
65
66
67
 
 
68
69
70
71
72
0
@@ -65,8 +65,8 @@ module AttachmentFu
0
       end
0
 
0
       it "creates public_path from record id and attachment_path" do
0
- @asset.public_path.should == "afu_spec_assets/#{@asset.partitioned_path * '/'}"
0
- @asset.public_path("foo", "bar").should == "afu_spec_assets/#{@asset.partitioned_path * '/'}/foo/bar"
0
+ @asset.public_path.should == "/afu_spec_assets/#{@asset.partitioned_path * '/'}"
0
+ @asset.public_path("foo", "bar").should == "/afu_spec_assets/#{@asset.partitioned_path * '/'}/foo/bar"
0
       end
0
 
0
       it "creates partitioned path from the record id" do

Comments

    No one has commented yet.