record_view_helper 1.0.0 → 1.0.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: 8dbd093ebca3fa4b721c5de5b988e38e71f725c4
4
- data.tar.gz: 9f642317111c040a49362801bbefd2de82b82f18
3
+ metadata.gz: d613563d57f181d96b21daee693f428ac5424077
4
+ data.tar.gz: 1a48fb71c90cd36516e92c14c9465d6b4523f98c
5
5
  SHA512:
6
- metadata.gz: 641651508a5381454b3374e6496e08084ff2b738cf7f32700836c8bb0debabc0c631b73ddbeff0e7b137b78c147d696628659cb196806f947bd5c6c40bbfca07
7
- data.tar.gz: 8342101d86840591b4de495eb5c3122cb9485a2751bff785e7a4123e3da5d5ea8655e0749d296a21074081a1d38e49687818a4e21827e4c88dab589f76b8e674
6
+ metadata.gz: 1061d0457c6b9d242e295bc72129db54ab6ce5ed279fa44420457a19996e218b9500c581f2cb781474fe28f6e9e5c727bca7df514496353bc7f544426efb2f8b
7
+ data.tar.gz: 7c00b6cd33a07215ade4090543c1e60b04b99b9e33010a6b3f10ad1a3426294ae07892372746aed8e7d7ac661be946e10caaa703bbf64b3a3a6ced3d18d35dca
data/README.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # [RecordViewHelper](https://github.com/Narazaka/record_view_helper)
2
2
 
3
+ [![Gem](https://img.shields.io/gem/v/record_view_helper.svg)](https://rubygems.org/gems/record_view_helper)
4
+ [![Gem](https://img.shields.io/gem/dtv/record_view_helper.svg)](https://rubygems.org/gems/record_view_helper)
5
+ [![Gemnasium](https://gemnasium.com/Narazaka/record_view_helper.svg)](https://gemnasium.com/Narazaka/record_view_helper)
6
+ [![Inch CI](http://inch-ci.org/github/Narazaka/record_view_helper.svg)](http://inch-ci.org/github/Narazaka/record_view_helper)
7
+ [![Travis Build Status](https://travis-ci.org/Narazaka/record_view_helper.svg)](https://travis-ci.org/Narazaka/record_view_helper)
8
+ [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/Narazaka/record_view_helper?svg=true)](https://ci.appveyor.com/project/Narazaka/record-view-helper)
9
+
3
10
  table builder and description list (dl) helper for Rails / ActiveModels
4
11
 
5
12
  ## Usage
@@ -9,6 +9,7 @@ module RecordViewHelper
9
9
  # @yieldreturn [void]
10
10
  # @return [ActiveSupport::SafeBuffer] rendered result
11
11
  def dl_for(record, options = {})
12
+ return if record.nil?
12
13
  setting = RecordValueSetting.build_from_hash!(
13
14
  record.attributes.keys,
14
15
  record.class.name.tableize,
@@ -54,6 +54,7 @@ module RecordViewHelper
54
54
  # / recommended for complex settings
55
55
  # / see RecordValueSetting for details
56
56
  def table_for(records, options = {})
57
+ return if records.empty?
57
58
  setting = RecordValueSetting.build_from_hash!(
58
59
  records.first.attributes.keys,
59
60
  records.first.class.name.tableize,
@@ -1,4 +1,4 @@
1
1
  module RecordViewHelper
2
2
  # version
3
- VERSION = "1.0.0".freeze
3
+ VERSION = "1.0.1".freeze
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: record_view_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Narazaka
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-04 00:00:00.000000000 Z
11
+ date: 2017-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport