activeadmin_addons 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 528fbd49fdbf8ac382f410b426eb2d6cd2caf1b0
|
|
4
|
+
data.tar.gz: 4efd5f0aa574dde7fbbab34bdbd8f0eb78522e23
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 10870bf255ec311c4c800173d9e2d808aab2cf57a1bde264cc019ebcd7484f39b4d58f0963985efe81628bd36b2aaa487164f78b22f659f831b8a03fe9f6115a
|
|
7
|
+
data.tar.gz: f2f0a3bc5c2e9426a22b1e75e4b36107159cb5a7293f5d32b5afc2d4636274aaba853e99a57d69b2065465e9873f1cf8ae70be7881c223c3176a79cabbb2d7dc
|
|
@@ -24,6 +24,7 @@ module ActiveAdminAddons
|
|
|
24
24
|
def link(context, model, attribute, options)
|
|
25
25
|
options[:truncate] = options.fetch(:truncate, true)
|
|
26
26
|
doc = model.send(attribute)
|
|
27
|
+
return nil if doc.nil?
|
|
27
28
|
raise 'you need to pass a paperclip attribute' unless doc.respond_to?(:url)
|
|
28
29
|
|
|
29
30
|
icon = icon_for_filename(doc.original_filename)
|
|
@@ -3,6 +3,7 @@ module ActiveAdminAddons
|
|
|
3
3
|
class << self
|
|
4
4
|
def image(context, model, attribute, options)
|
|
5
5
|
img = model.send(attribute)
|
|
6
|
+
return nil if img.nil?
|
|
6
7
|
raise 'you need to pass a paperclip image attribute' unless img.respond_to?(:url)
|
|
7
8
|
style = options.fetch(:style, :original)
|
|
8
9
|
context.image_tag(img.url(style)) if img.exists?
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: activeadmin_addons
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Platanus
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-05-
|
|
11
|
+
date: 2015-05-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|