acts_as_hoc_avatarable 0.1.12 → 0.1.13
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c9f04d56aebca0580dca962139921e82b38c2dd
|
4
|
+
data.tar.gz: beec91128041f909bb30fef49d4f068b38c3b3d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6e2eeb0ba027837e02084930397ef7abb322663b268ec80c34db5b878029bfa48e1782a3308aa818c41135f68094eb39abcdd5ed5fa479432dcb41f660d5697
|
7
|
+
data.tar.gz: a1e4f3fae101df77af62598bcda8902e8e7b26c7ab73ce97119696b0a5a82eb561e1523204d8b6478f147d37e9015ae71fef45e3d55b348c62f72c17f43f55b0
|
@@ -5,6 +5,7 @@ module ActsAsHocAvatarable
|
|
5
5
|
|
6
6
|
module ClassMethods
|
7
7
|
def acts_as_hoc_avatarable(_options = {})
|
8
|
+
require 'digest/md5'
|
8
9
|
has_one_attached :avatar
|
9
10
|
attr_accessor :avatar_contents
|
10
11
|
attr_accessor :avatar_name
|
@@ -15,8 +16,11 @@ module ActsAsHocAvatarable
|
|
15
16
|
end
|
16
17
|
|
17
18
|
def avatar_url
|
19
|
+
unless persisted?
|
20
|
+
return nil
|
21
|
+
end
|
18
22
|
return Rails.application.routes.url_helpers.rails_blob_url(avatar, host: ActsAsHocAvatarable.configuration.default_host) if avatar.attached?
|
19
|
-
return "https://www.gravatar.com/avatar/#{Digest::MD5.hexdigest(email)}" if ActsAsHocAvatarable.configuration.fallback_to_gravatar
|
23
|
+
return "https://www.gravatar.com/avatar/#{Digest::MD5.hexdigest(email ||= '')}" if ActsAsHocAvatarable.configuration.fallback_to_gravatar
|
20
24
|
return nil
|
21
25
|
end
|
22
26
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_hoc_avatarable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gert Lavsen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mini_magick
|