index_for 0.0.9 → 0.1.0

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: 5cf24571843f717768efa22c77e37682d7dcd6b7
4
- data.tar.gz: 5f18db5877b3889935063eaa75c0efec2de4a05e
3
+ metadata.gz: 320b8fec48df235b14a8e797e086e4da2f431f7e
4
+ data.tar.gz: 5d4c4600d8125cc3f3d99e2ddce6da0d95934d7a
5
5
  SHA512:
6
- metadata.gz: f8886d235b671a6e717b476be1f6001a7cafb5d29030ab3c33a4273fc565fda4eea04ed02107bd46e05d45186ad5b78966552bac5960e64fb1003904f4c26a7b
7
- data.tar.gz: 882d11430358a5989216b3e0b37ea1827d6846ca12908aa8706b4faf708c00be6a5ed86ae9bc446f604b24444c12c56d07f7dde31c23bdcd2ae27fcd16a8ff74
6
+ metadata.gz: 3a66c9303baa5a89ee30ec777fa95d5f33fb43e364d33e6160023148da5f3fa77aaad07d08d75eea05e1d246d85cad34123b88005e9ff5ec67b56901d5437295
7
+ data.tar.gz: 853c4cc0982705c336f1b21ad737c03abbfc6a4e9f00a834c19d4b229360e1c0fd88007bfdd70e956835fa2779e99ea2eae252925c6507fbf71aa761f537809c
@@ -3,7 +3,7 @@ module IndexFor
3
3
 
4
4
  private
5
5
 
6
- def attribute_value attribute_name, options
6
+ def attribute_value attribute_name, options, &block
7
7
  attribute_name = options[:value] if options[:value]
8
8
  attribute_name = :"#{attribute_name}.#{options[:with]}" if options[:with]
9
9
 
@@ -15,7 +15,9 @@ module IndexFor
15
15
  object = object.send(attribute_name)
16
16
  end if parts.any?
17
17
 
18
- if object.respond_to?(:"human_#{attribute_name}")
18
+ if block
19
+ nil
20
+ elsif object.respond_to?(:"human_#{attribute_name}")
19
21
  object.send :"human_#{attribute_name}"
20
22
  else
21
23
  object.send(attribute_name)
@@ -6,7 +6,7 @@ module IndexFor
6
6
  def attribute attribute_name, options = {}, &block
7
7
  append_html_class options, attribute_class_name(attribute_name)
8
8
  wrap_content_with :table_body_cell, attribute_value(attribute_name,
9
- options), options, &block
9
+ options, &block), options, &block
10
10
  end
11
11
 
12
12
  def actions *action_names, &block
@@ -1,3 +1,3 @@
1
1
  module IndexFor
2
- VERSION = "0.0.9"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: index_for
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Theo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-26 00:00:00.000000000 Z
11
+ date: 2015-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel