activeadmin_addons 0.2.0 → 0.2.1

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: 95f4ecae57fd54f1e3c6ebbbc25a870edaa609f6
4
- data.tar.gz: 9a4e30551e31e85c7a87df7b681047ce572bdfea
3
+ metadata.gz: 528fbd49fdbf8ac382f410b426eb2d6cd2caf1b0
4
+ data.tar.gz: 4efd5f0aa574dde7fbbab34bdbd8f0eb78522e23
5
5
  SHA512:
6
- metadata.gz: fce96305288148f953886678e488912961579ed2ede09f2eea92f7c661722e49c7010840a61ee12b6bc33b336be42973e3ee531aa499d353abf53bb6a274b70e
7
- data.tar.gz: caa5401737347ebf0f2a820efcf643c4dd3885a41bc5e12183eccc51a488e8008f27992545850036df690492f8b20930fda973d56fc26f6a93c5edc0c5c31c6d
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?
@@ -1,3 +1,3 @@
1
1
  module ActiveadminAddons
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
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.0
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-21 00:00:00.000000000 Z
11
+ date: 2015-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails