mongoid-paperclip 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,27 +8,19 @@ rescue LoadError
8
8
  end
9
9
 
10
10
  ##
11
- # The logger is set to the Active Record logger by Paperclip itself.
12
- # Because of this, we set the logger to false as "default" so that it doesn't raise
13
- # an "uninitialized constant" exception.
14
- #
15
- # You can manually change loggers by adding for example an initializer and configuring the logger, like so:
16
- #
17
- # Paperclip.options[:log] = MyLogger.log
18
- #
19
- Paperclip.options[:log] = false
11
+ # Use mongoid's logger.
12
+ module Paperclip
13
+ class << self
14
+ def logger
15
+ Mongoid::Config.logger
16
+ end
17
+ end
18
+ end
20
19
 
21
20
  ##
22
- # If Ruby on Rails is defined and the logger method exists, the Paperclip logger
23
- # will be set to the Rails logger by default. You may overwrite the logger by re-defining the
24
- # logger in for example an initializer file, like so:
25
- #
26
- # Paperclip.options[:log] = MyLogger.log
27
- #
28
- if defined?(Rails)
29
- if Rails.respond_to?(:logger)
30
- Paperclip.options[:log] = Rails.logger
31
- end
21
+ # the id of mongoid is not integer, correct the id_partitioin.
22
+ Paperclip.interpolates :id_partition do |attachment, style|
23
+ attachment.instance.id.to_s.scan(/.{4}/).join("/")
32
24
  end
33
25
 
34
26
  ##
@@ -3,7 +3,7 @@
3
3
  Gem::Specification.new do |gem|
4
4
 
5
5
  gem.name = 'mongoid-paperclip'
6
- gem.version = '0.0.3'
6
+ gem.version = '0.0.4'
7
7
  gem.platform = Gem::Platform::RUBY
8
8
  gem.authors = 'Michael van Rooijen'
9
9
  gem.email = 'meskyanichi@gmail.com'
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: mongoid-paperclip
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.3
5
+ version: 0.0.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Michael van Rooijen
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-02-08 00:00:00 +01:00
13
+ date: 2011-03-03 00:00:00 +01:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -61,7 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
61
  requirements: []
62
62
 
63
63
  rubyforge_project:
64
- rubygems_version: 1.5.0
64
+ rubygems_version: 1.5.2
65
65
  signing_key:
66
66
  specification_version: 3
67
67
  summary: Mongoid::Paperclip enables you to use Paperclip with the Mongoid ODM for MongoDB.