simple_table 0.0.16 → 0.0.17

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,14 @@ module SimpleTable
6
6
  build
7
7
  super(''.tap do |html|
8
8
  table.collection.each_with_index do |record, ix|
9
- html << rows.map { |row| row.render(record, options_for_record(record, ix, options)) }.join
9
+ html << rows.map do |row|
10
+ # FIXME: For some reason the options hash is accumulated from one row to the next.
11
+ # Furthermore the rows instance variable only contains one row (should contain 3 when running render_test.rb)
12
+ # This causes setting of the alternate class in render_test.rb to fail.
13
+ # As a temporary fix we are resetting options here.
14
+ row.instance_variable_set(:'@options', {})
15
+ row.render(record, options_for_record(record, ix, options))
16
+ end.join
10
17
  end
11
18
  end)
12
19
  end
@@ -22,7 +29,7 @@ module SimpleTable
22
29
  def options_for_record(record, ix, options = {})
23
30
  options.dup.tap do |options|
24
31
  options[:id] = "#{table.collection_name.singularize}_#{record.id}"
25
- add_class!(options, 'alternate') if ix % 2 == 1
32
+ add_class!(options, 'alternate') if (ix % 2 == 1)
26
33
  end
27
34
  end
28
35
  end
@@ -1,3 +1,3 @@
1
1
  module SimpleTable
2
- VERSION = '0.0.16'
2
+ VERSION = '0.0.17'
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_table
3
3
  version: !ruby/object:Gem::Version
4
- hash: 63
4
+ hash: 61
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 16
10
- version: 0.0.16
9
+ - 17
10
+ version: 0.0.17
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sven Fuchs
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-01-20 00:00:00 +01:00
19
+ date: 2011-04-27 00:00:00 +02:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency