carrierwave-mongoid 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +3 -3
- data/lib/carrierwave/mongoid/version.rb +1 -1
- data/lib/carrierwave/storage/grid_fs.rb +2 -1
- metadata +64 -108
data/README.md
CHANGED
@@ -54,6 +54,8 @@ This version supports ONLY version of mongoid ~> 2.1
|
|
54
54
|
|
55
55
|
You can use `upload_identifier` to retrieve the original name of the uploaded file.
|
56
56
|
|
57
|
+
In the earlier version, the mount_uploader-method for mongoid had been defined in lib/carrierwave/orm/mongoid. This code has been moved to carrierwave/mongoid. If you update from earlier versions, don't forget to adjust your require accordingly in your carrierwave-initializer.
|
58
|
+
|
57
59
|
The default mount column used to be the name of the upload column plus `_filename`. Now it is simply the name of the column. Most of the time, the column was called `upload`, so it would have been mounted to `upload_filename`.
|
58
60
|
If you'd like to avoid a database migration, simply use the `:mount_on` option to specify
|
59
61
|
the field name explicitly. Therefore, you only have to add a `_filename` to your column name. For example, if your column is called `:upload`:
|
@@ -66,8 +68,6 @@ end
|
|
66
68
|
|
67
69
|
## Known issues and limitations
|
68
70
|
|
69
|
-
|
70
|
-
|
71
|
-
Note that embedded documents files aren't saved when parent documents are saved.
|
71
|
+
Note that files mounted in embedded documents aren't saved when parent documents are saved.
|
72
72
|
You must explicitly call save on embedded documents in order to save their attached files.
|
73
73
|
You can read more about this [here](https://github.com/jnicklas/carrierwave/issues#issue/81)
|
@@ -52,7 +52,7 @@ module CarrierWave
|
|
52
52
|
unless @uploader.grid_fs_access_url
|
53
53
|
nil
|
54
54
|
else
|
55
|
-
[@uploader.grid_fs_access_url, @path].join("/")
|
55
|
+
[@uploader.grid_fs_access_url, @path].join("/").squeeze("/")
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
@@ -77,6 +77,7 @@ module CarrierWave
|
|
77
77
|
def file_length
|
78
78
|
grid.open(@path, 'r').file_length
|
79
79
|
end
|
80
|
+
alias :size :file_length
|
80
81
|
|
81
82
|
protected
|
82
83
|
|
metadata
CHANGED
@@ -1,124 +1,90 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: carrierwave-mongoid
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.3
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 1
|
9
|
-
- 2
|
10
|
-
version: 0.1.2
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Jonas Nicklas
|
14
9
|
- Trevor Turk
|
15
10
|
autorequire:
|
16
11
|
bindir: bin
|
17
12
|
cert_chain: []
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
dependencies:
|
22
|
-
- !ruby/object:Gem::Dependency
|
13
|
+
date: 2011-09-22 00:00:00.000000000Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
23
16
|
name: carrierwave
|
24
|
-
|
25
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
17
|
+
requirement: &70094161229800 !ruby/object:Gem::Requirement
|
26
18
|
none: false
|
27
|
-
requirements:
|
28
|
-
- -
|
29
|
-
- !ruby/object:Gem::Version
|
30
|
-
hash: 7
|
31
|
-
segments:
|
32
|
-
- 0
|
33
|
-
- 5
|
34
|
-
- 6
|
19
|
+
requirements:
|
20
|
+
- - ! '>='
|
21
|
+
- !ruby/object:Gem::Version
|
35
22
|
version: 0.5.6
|
36
23
|
type: :runtime
|
37
|
-
version_requirements: *id001
|
38
|
-
- !ruby/object:Gem::Dependency
|
39
|
-
name: mongoid
|
40
24
|
prerelease: false
|
41
|
-
|
25
|
+
version_requirements: *70094161229800
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: mongoid
|
28
|
+
requirement: &70094161229280 !ruby/object:Gem::Requirement
|
42
29
|
none: false
|
43
|
-
requirements:
|
30
|
+
requirements:
|
44
31
|
- - ~>
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
|
47
|
-
segments:
|
48
|
-
- 2
|
49
|
-
- 1
|
50
|
-
version: "2.1"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '2.1'
|
51
34
|
type: :runtime
|
52
|
-
version_requirements: *id002
|
53
|
-
- !ruby/object:Gem::Dependency
|
54
|
-
name: rspec
|
55
35
|
prerelease: false
|
56
|
-
|
36
|
+
version_requirements: *70094161229280
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: rspec
|
39
|
+
requirement: &70094161228800 !ruby/object:Gem::Requirement
|
57
40
|
none: false
|
58
|
-
requirements:
|
41
|
+
requirements:
|
59
42
|
- - ~>
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
|
62
|
-
segments:
|
63
|
-
- 2
|
64
|
-
- 6
|
65
|
-
version: "2.6"
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '2.6'
|
66
45
|
type: :development
|
67
|
-
version_requirements: *id003
|
68
|
-
- !ruby/object:Gem::Dependency
|
69
|
-
name: bson_ext
|
70
46
|
prerelease: false
|
71
|
-
|
47
|
+
version_requirements: *70094161228800
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: bson_ext
|
50
|
+
requirement: &70094161228320 !ruby/object:Gem::Requirement
|
72
51
|
none: false
|
73
|
-
requirements:
|
52
|
+
requirements:
|
74
53
|
- - ~>
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
|
77
|
-
segments:
|
78
|
-
- 1
|
79
|
-
- 3
|
80
|
-
version: "1.3"
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '1.3'
|
81
56
|
type: :development
|
82
|
-
version_requirements: *id004
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: rake
|
85
57
|
prerelease: false
|
86
|
-
|
58
|
+
version_requirements: *70094161228320
|
59
|
+
- !ruby/object:Gem::Dependency
|
60
|
+
name: rake
|
61
|
+
requirement: &70094161227840 !ruby/object:Gem::Requirement
|
87
62
|
none: false
|
88
|
-
requirements:
|
63
|
+
requirements:
|
89
64
|
- - ~>
|
90
|
-
- !ruby/object:Gem::Version
|
91
|
-
|
92
|
-
segments:
|
93
|
-
- 0
|
94
|
-
- 9
|
95
|
-
version: "0.9"
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '0.9'
|
96
67
|
type: :development
|
97
|
-
version_requirements: *id005
|
98
|
-
- !ruby/object:Gem::Dependency
|
99
|
-
name: mini_magick
|
100
68
|
prerelease: false
|
101
|
-
|
69
|
+
version_requirements: *70094161227840
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: mini_magick
|
72
|
+
requirement: &70094161227460 !ruby/object:Gem::Requirement
|
102
73
|
none: false
|
103
|
-
requirements:
|
104
|
-
- -
|
105
|
-
- !ruby/object:Gem::Version
|
106
|
-
|
107
|
-
segments:
|
108
|
-
- 0
|
109
|
-
version: "0"
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
110
78
|
type: :development
|
111
|
-
|
79
|
+
prerelease: false
|
80
|
+
version_requirements: *70094161227460
|
112
81
|
description: Mongoid support for CarrierWave
|
113
|
-
email:
|
82
|
+
email:
|
114
83
|
- jonas.nicklas@gmail.com
|
115
84
|
executables: []
|
116
|
-
|
117
85
|
extensions: []
|
118
|
-
|
119
86
|
extra_rdoc_files: []
|
120
|
-
|
121
|
-
files:
|
87
|
+
files:
|
122
88
|
- .gitignore
|
123
89
|
- Gemfile
|
124
90
|
- README.md
|
@@ -138,41 +104,31 @@ files:
|
|
138
104
|
- spec/mongoid_spec.rb
|
139
105
|
- spec/spec_helper.rb
|
140
106
|
- spec/storage/grid_fs_spec.rb
|
141
|
-
has_rdoc: true
|
142
107
|
homepage: https://github.com/jnicklas/carrierwave-mongoid
|
143
108
|
licenses: []
|
144
|
-
|
145
109
|
post_install_message:
|
146
110
|
rdoc_options: []
|
147
|
-
|
148
|
-
require_paths:
|
111
|
+
require_paths:
|
149
112
|
- lib
|
150
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
113
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
151
114
|
none: false
|
152
|
-
requirements:
|
153
|
-
- -
|
154
|
-
- !ruby/object:Gem::Version
|
155
|
-
|
156
|
-
|
157
|
-
- 0
|
158
|
-
version: "0"
|
159
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - ! '>='
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '0'
|
119
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
160
120
|
none: false
|
161
|
-
requirements:
|
162
|
-
- -
|
163
|
-
- !ruby/object:Gem::Version
|
164
|
-
|
165
|
-
segments:
|
166
|
-
- 0
|
167
|
-
version: "0"
|
121
|
+
requirements:
|
122
|
+
- - ! '>='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
168
125
|
requirements: []
|
169
|
-
|
170
126
|
rubyforge_project: carrierwave-mongoid
|
171
|
-
rubygems_version: 1.
|
127
|
+
rubygems_version: 1.8.7
|
172
128
|
signing_key:
|
173
129
|
specification_version: 3
|
174
130
|
summary: Mongoid support for CarrierWave
|
175
|
-
test_files:
|
131
|
+
test_files:
|
176
132
|
- spec/fixtures/new.jpeg
|
177
133
|
- spec/fixtures/new.txt
|
178
134
|
- spec/fixtures/old.jpeg
|