uploadcare-rails 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -72,17 +72,19 @@ Now we can use the Uploadcare widget in our forms:
72
72
 
73
73
  ## Displaying files
74
74
 
75
- Uploadcare-rails gem takes care of storing files when saving a model, so as soon as you add a field to your form, everything should work, and you'll be able to show an image just like that:
75
+ Uploadcare-rails gem takes care of storing files when saving a model, so as soon as you add a field to your form, everything should work.
76
+ You'll be able to show an image with `cdn_url` (or `public_url` alias) just like that:
76
77
 
77
78
  ```erb
78
- <%= image_tag @post.file.public_url("scale_crop/500x200", "effect/grayscale/") %>
79
+ <%= image_tag @post.file.cdn_url("scale_crop/500x200", "effect/grayscale/") %>
79
80
  ```
80
81
 
81
82
  If you need the unique identifier that Uploadcare uses to represent a file,
82
83
  it is available like so:
83
84
 
84
85
  ```erb
85
- UUID: <%= @post.file.file_id %>
86
+ UUID: <%= @post.file.uuid %>
87
+ UUID (alias): <%= @post.file.file_id %>
86
88
  ```
87
89
 
88
90
  [Other information](https://uploadcare.com/documentation/rest/#file) about the file is accessed through the `api` method that makes a single HTTP request to Uploadcare servers **for each file**. Use cautiously or cache the returned information somewhere.
@@ -11,8 +11,8 @@ module Uploadcare
11
11
  }.update options
12
12
 
13
13
  define_method "#{attribute}" do
14
- cdn_url = attributes[attribute.to_s]
15
- return nil unless cdn_url
14
+ cdn_url = attributes[attribute.to_s].to_s
15
+ return nil if cdn_url.empty?
16
16
 
17
17
  if instance_variable_defined?("@#{attribute}_cached")
18
18
  instance_variable_get("@#{attribute}_cached")
@@ -1,5 +1,5 @@
1
1
  module Uploadcare
2
2
  module Rails
3
- VERSION = "0.5.2"
3
+ VERSION = "0.5.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uploadcare-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-23 00:00:00.000000000 Z
12
+ date: 2013-04-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -125,7 +125,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
125
125
  version: '0'
126
126
  segments:
127
127
  - 0
128
- hash: 3635216388913281185
128
+ hash: 1091995933663225195
129
129
  required_rubygems_version: !ruby/object:Gem::Requirement
130
130
  none: false
131
131
  requirements:
@@ -134,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
134
  version: '0'
135
135
  segments:
136
136
  - 0
137
- hash: 3635216388913281185
137
+ hash: 1091995933663225195
138
138
  requirements: []
139
139
  rubyforge_project:
140
140
  rubygems_version: 1.8.24