paperclip_database 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- paperclip_database (1.0.0)
4
+ paperclip_database (1.0.1)
5
5
  paperclip
6
6
 
7
7
  GEM
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", "~> 2.0"
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.4"
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)
@@ -1,3 +1,3 @@
1
1
  module PaperclipDatabase
2
- VERSION = "1.0.0" unless defined? PaperclipDatabase::VERSION
2
+ VERSION = "1.0.1" unless defined? PaperclipDatabase::VERSION
3
3
  end
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.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: -247996340476176020
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: -247996340476176020
274
+ hash: 1511061106308966496
275
275
  requirements:
276
276
  - ImageMagick
277
277
  rubyforge_project: paperclip_database