carrierwave_backgrounder 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +6 -0
- data/lib/backgrounder/version.rb +1 -1
- data/lib/backgrounder/workers/store_asset.rb +2 -2
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -37,6 +37,12 @@ Currently ActiveRecord is the default orm and I have not tested this with others
|
|
37
37
|
# or
|
38
38
|
Sequel::Model.send(:extend, ::CarrierWave::Backgrounder::ORM)
|
39
39
|
|
40
|
+
== Usage
|
41
|
+
|
42
|
+
If you need to process/store the upload immediately:
|
43
|
+
|
44
|
+
@user.process_upload = true
|
45
|
+
|
40
46
|
== Word Of Caution
|
41
47
|
|
42
48
|
Temp files are stored by default in the tmp directory. They are not guaranteed to be available when your workers process them! For instance, on Heroku, they get blown away on every deploy. If image upload is the main function of your app, I would store the tmp files in a non-volatile directory if you have the option.
|
data/lib/backgrounder/version.rb
CHANGED
@@ -6,8 +6,8 @@ module CarrierWave
|
|
6
6
|
def perform
|
7
7
|
record = klass.find id
|
8
8
|
if record.send :"#{column}_tmp"
|
9
|
-
cache_dir = record.send(:"#{column}").root
|
10
|
-
cache_path = cache_dir
|
9
|
+
cache_dir = [record.send(:"#{column}").root, record.send(:"#{column}").cache_dir].join("/")
|
10
|
+
cache_path = [cache_dir, record.send(:"#{column}_tmp")].join("/")
|
11
11
|
|
12
12
|
record.send :"process_upload=", true
|
13
13
|
record.send :"#{column}=", File.open(cache_path)
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: carrierwave_backgrounder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Larry Sprock
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-03-
|
13
|
+
date: 2011-03-28 00:00:00 -07:00
|
14
14
|
default_executable:
|
15
15
|
dependencies: []
|
16
16
|
|