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.
- data/lib/mongoid_paperclip.rb +11 -19
- data/mongoid-paperclip.gemspec +1 -1
- metadata +3 -3
data/lib/mongoid_paperclip.rb
CHANGED
@@ -8,27 +8,19 @@ rescue LoadError
|
|
8
8
|
end
|
9
9
|
|
10
10
|
##
|
11
|
-
#
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
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
|
-
#
|
23
|
-
|
24
|
-
|
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
|
##
|
data/mongoid-paperclip.gemspec
CHANGED
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.
|
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-
|
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.
|
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.
|