paperclip_database 1.0.0 → 1.0.1
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/Gemfile.lock +1 -1
- data/README.md +2 -2
- data/lib/paperclip/storage/database.rb +6 -1
- data/lib/paperclip_database/version.rb +1 -1
- metadata +3 -3
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -18,7 +18,7 @@ should be used in your app.
|
|
18
18
|
|
19
19
|
Include the gem in your Gemfile:
|
20
20
|
|
21
|
-
gem "paperclip_database", "~>
|
21
|
+
gem "paperclip_database", "~> 1.0"
|
22
22
|
|
23
23
|
Or, if you want to get the latest, you can get master from the main
|
24
24
|
paperclip repository:
|
@@ -37,7 +37,7 @@ For rails 2 you should add this to snippet to your environment.
|
|
37
37
|
...
|
38
38
|
Rails::Initializer.run do |config|
|
39
39
|
...
|
40
|
-
config.gem "paperclip", :version => "~> 2.
|
40
|
+
config.gem "paperclip", :version => "~> 2.5"
|
41
41
|
...
|
42
42
|
end
|
43
43
|
|
@@ -102,7 +102,11 @@ module Paperclip
|
|
102
102
|
|
103
103
|
end
|
104
104
|
private :setup_paperclip_files_model
|
105
|
-
|
105
|
+
|
106
|
+
def copy_to_local_file(style, dest_path)
|
107
|
+
File.open(dest_path, 'wb+'){|df| to_file(style).tap{|sf| File.copy_stream(sf, df); sf.close;sf.unlink} }
|
108
|
+
end
|
109
|
+
|
106
110
|
def override_default_options(base)
|
107
111
|
if @options[:url] == base.class.default_options[:url]
|
108
112
|
@options[:url] = ":relative_root/:class/:attachment/:id?style=:style"
|
@@ -174,6 +178,7 @@ module Paperclip
|
|
174
178
|
|
175
179
|
def flush_deletes #:nodoc:
|
176
180
|
ActiveRecord::Base.logger.info("[paperclip] Deleting files for #{name}")
|
181
|
+
@queued_for_delete.uniq! ##This is apparently necessary for paperclip v 3.x
|
177
182
|
@queued_for_delete.each do |path|
|
178
183
|
/id=([0-9]+)/.match(path)
|
179
184
|
if @options[:cascade_deletion] && !instance.class.exists?(instance.id)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paperclip_database
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -262,7 +262,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
262
262
|
version: '0'
|
263
263
|
segments:
|
264
264
|
- 0
|
265
|
-
hash:
|
265
|
+
hash: 1511061106308966496
|
266
266
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
267
267
|
none: false
|
268
268
|
requirements:
|
@@ -271,7 +271,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
271
271
|
version: '0'
|
272
272
|
segments:
|
273
273
|
- 0
|
274
|
-
hash:
|
274
|
+
hash: 1511061106308966496
|
275
275
|
requirements:
|
276
276
|
- ImageMagick
|
277
277
|
rubyforge_project: paperclip_database
|