public
Description: Easily upload files to your Ruby on Rails application
Homepage: http://uploadcolumn.rubyforge.org/
Clone URL: git://github.com/jnicklas/uploadcolumn.git
uploadcolumn / CHANGELOG
100644 123 lines (64 sloc) 6.602 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
0.3
 
Note: The 0.3 branch is a complete rewrite of everything, with a similar (but not identical) API, don't expect it to work drop-in.
 
[TODO] You can now set a default image if the column is blank
 
[TODO] Integrated mocking support, to make testing your UploadColumns easier.
 
[NEW] Complete rewrite, maintaining most of the legacy API
 
[NEW] Framework for custom manipulators, for clean and easy extension.
 
[NEW] Manipulate images with ImageScience instead of RMagick if you want
 
[NEW] Support for animated GIFs in the RMagick manipulator
 
[NEW] Fully tested with RSpec
 
[NEW] Following the law of Demeter better by adding _public_path, _thumb, _thumb_public_path etc... magic methods.
 
[DEPRECATED] UploadedFile#url is deprecated in favour of UploadedFile#public_path and will be removed in the next major release
 
[CHANGED] Store dir and temp dir procs now take two piped variables, the UploadedFile object and the ActiveRecord
 
[CHANGED] the :root_path option is now called :root_dir
 
[CHANGED] web_root must now be set with a leading slash if an absolute URL is desired and no trailing slash.
 
[CHANGED] UploadedFile#filename_base is removed in favor of #basename
 
[CHANGED] UploadedFile#filename_extension is removed in favor of #extension
 
[CHANGED] UploadedFile#mime_type is removed in favor of #content_type
 
[CHANGED] _store_dir and _tmp_dir callbacks now take the file object as an argument, which means that the methods always MUST take an argument, even if you don't need it.
 
[CHANGED] The _after_assigns callback has changed name to _after_upload and take the UploadedFile as param.
 
[REMOVED] Support for the exif columns, as in 0.2.X has been removed temporarily. It might be readded later.
 
[REMOVED] The old_files option as in 0.2.X has been removed. All old files are now stored. This option will be reintroduced in later versions of 0.3.X
 
[REMOVED] The :force_format option for image_columns as in 0.2.X has been removed and will be reintroduced later.
 
[REMOVED] The remote_upload_form helper has been removed, for encouraging bad JS practice. It will not be readded. If you need remote uploads, uploading with Flash is much cooler, and can be done in an unobtrusive way. Check out Swiff.js for hints.
 
[REMOVED] The 'image' helper has been removed, since its functionality is not really useful in any app (hopefully most apps) that uses named routes.
 
============================
 
0.2.1
 
* Added :force_format option to image_column
 
* Various Rails 1.2.1 compatibility fixes (mainly in test)
 
* Added :permissions option to upload_column.
 
* You can now assign normal Ruby File objects to upload and image columns
 
* upload_form_tag and remote_upload_form_tag now accept a block, just like Rails' form_tag
 
* You can now pass :none to image_column versions so nothing will be done to your image.
 
* FIXED #8109 Parallell uploads no longer wipe each other out
 
* WARNING: Compatibility with Rails < 1.2.1 dropped
 
============================
 
0.2
 
* A freaking huge refactoring of the code, basically ALL of the methods for accessing paths have changed, except for path itself. This was overdue and I apologize if it breaks anything, but I felt that the gain in consistency was worth it. It now works like this:
 
    path --the current path of the file (including the filename)
    relative_path --the current path of the file relative to the root_path option
    
    dir --the directory where the file is currently stored
    relative_dir --like dir but relative to root_path
    
    store_dir --The directory where files are permanently stored
    relative_store_dir --the same but relative to root_dir
    
    tmp_dir --The directory where tempfiles are stored
    relative_tmp_dir --you can work this out yourself
    
As you can see, this is now actually consistent, with all the relative paths relative to the same directory (err... wow?) and a consistent naming convention.
 
* In related news: you can now pass a Proc to the :store_dir and :tmp_dir options. The default options are now also procs, instead of being some kind of arcane super-exception like before. The procs will be passed to arguments, first the current model instance and the name of the upload column as the second.
 
* The :accumulate option was removed from :old_files. I really liked it, but it doesn't make sense with th new Proc-based system (it would wipe out data without thinking, thus potentially getting rid of files you want to keep). Use :keep instead or implement some kind of versioning. The new default is :delete. So beware, if you need to keep those files, make sure to change it!
 
* You can now specify individual versions that should be cropped in image_columns, simply add a 'c' before the string that specifies the size, so you can do:
 
    image_column :picture, :versions => { :thumb => "100x100", :banner => "c400x200" }
    
Where thumb will be no larger than 100x100 (but might be smaller) and banner will be cropped to 400x200 exactly!
 
* Furthermore you can pass a Proc instead of a string to an image_column version:
 
    image_column :picture, :versions => { :thumb => "100x100", :solarized => proc{|img| img.solarize} }
 
The Proc will be passed an RMagick object, just like process!
 
* render_image now uses send_file if no block is given for faster performance.
 
* FIXED #6955 store_dir callback called when the file is assigned
 
* FIXED #7697 Editing with old-files :delete / :replace erases the original file
 
* FIXED #7686 Problem uploading files with spaces in name
 
============================
 
1.1.2 (unreleased)
 
* new :validates_integrity option replaces the old validates_integrity_of. The latter was more elegant, but posed a security risk, since files would be stored on the server in a remotely accessible location without having been validated. I tried to fix the bug, but couldn't make it work, so I opted for the less elegant, but safe solution instead.
 
* readded the :file_exec option, it's now possible to set this manually again. I cut it originally, because I felt that it was unneccessary and that there were too many options already, I readded it mainly to make it possible to test the validation better.
 
* assign, save, delete_temporary_files, delete, filename= and dir= are now all private, I see no reason why they should be public, and since they aren't really useful out of context I think it makes for a cleaner API to make them private, if you still need to use them, you can use .send(:save), etc.. instead.
 
* Added magic columns, see the readme for detaills.