-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
42 lines (27 loc) · 1.19 KB
/
README
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
CarrierwaveSingleStore
======================
This plugin helps carrierwave(https://github.com/jnicklas/carrierwave) saving images/docs with same content on one place once, even if you have different names. It was developed for the models that can save the same(same content) files but in different records, saving disk space.
Imagine:
item = Item.find(3)
item.id #3
item.name #table
item.image #1234567_hex.jpg
item.image_url #uploads/item/image/12/34/56/1234567_hex.jpg
otherItem = Item.find(5)
otherItem.id #5
otherItem.name #other table
otherItem.updae_tattributes(:image=>'web_image_but_same_content.jpg')
otherItem.image #1234567_hex.jpg
otherItem.image_url #uploads/item/image/12/34/56/1234567_hex.jpg
#these two records have different data, but with identical content files. CarrierWave::SingleStore holds one file for both records, saving space disk
Example
=======
See examples folder.
Dependencies
===========
https://github.com/jnicklas/carrierwave
Install
=======
rails plugin install [email protected]:stvkoch/carrierwave_single_store.git
Any question, send message Steven Koch <[email protected]>
Copyright (c) 2011 Steven Koch <[email protected]>, released under the MIT license