paperclip-cloudinary 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +17 -1
- data/lib/paperclip/cloudinary/version.rb +1 -1
- data/lib/paperclip/storage/cloudinary.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2c4446aa2b6a0704bd424769d7533e058515c3f
|
4
|
+
data.tar.gz: 9e890898c667652c347dbcee0ba85d9d05d27103
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a2cdc10ee8a707105267f0dbdccee1e1395d085609f84ae22f0c6cbee22fa6224fb31896e4bb6efa843a4c85ce44d661b7c56b4938d54ba27a952b29a2a4138
|
7
|
+
data.tar.gz: f39c17d00fff9f16dc860aa5d2b7b1c137df4e157a5dd0e29a7e6233e048faad7d86362dd5d676da9e8d83a766be8099a58ecb840c814e8a8f46d6d9c438616b
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -49,13 +49,29 @@ This will enable the
|
|
49
49
|
[Cloudinary gem](https://github.com/cloudinary/cloudinary_gem) to pick
|
50
50
|
up your configuration automatically.
|
51
51
|
|
52
|
-
To use in your model, add the following
|
52
|
+
To use in your model, add the following option for `storage` to `has_attached_file`:
|
53
53
|
|
54
54
|
```ruby
|
55
55
|
has_attached_file :image,
|
56
56
|
:storage => :cloudinary
|
57
57
|
```
|
58
58
|
|
59
|
+
You should specify the Paperclip `path` pattern that you would like to
|
60
|
+
use to store and access your saved attachments. The value should be URL-friendly,
|
61
|
+
should NOT begin with a forward slash, and, aside from forward slashes, can only
|
62
|
+
contain alphanumeric characters, dashes (-), periods (.) and underscores (\_).
|
63
|
+
The `path` can be specified in your default Paperclip options or
|
64
|
+
via `has_attached_file`:
|
65
|
+
|
66
|
+
```ruby
|
67
|
+
has_attached_file :image,
|
68
|
+
:storage => :cloudinary,
|
69
|
+
:path => ':id/:style/:filename'
|
70
|
+
```
|
71
|
+
|
72
|
+
Failure to supply a `path` in either of these places may result in the default path
|
73
|
+
being used, which could cause an `InfiniteInterpolationError`.
|
74
|
+
|
59
75
|
If you have put your cloudinary config file at a location other than
|
60
76
|
config/cloudinary.yml (which is ill-advised), you can specify where the
|
61
77
|
credentials are located by specifying the `cloudinary_credentials`
|
@@ -74,7 +74,8 @@ module Paperclip
|
|
74
74
|
style = style_or_options
|
75
75
|
end
|
76
76
|
inline_opts = options[:cloudinary] || {}
|
77
|
-
::Cloudinary::Utils.cloudinary_url path(style), cloudinary_url_options(style, inline_opts)
|
77
|
+
result = ::Cloudinary::Utils.cloudinary_url path(style), cloudinary_url_options(style, inline_opts)
|
78
|
+
result.nil? ? super(nil) : result
|
78
79
|
end
|
79
80
|
|
80
81
|
def public_id style
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paperclip-cloudinary
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carl Scott
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cloudinary
|