flexy-odf-report 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/odf-report/table.rb +4 -1
- data/odf-report.gemspec +1 -1
- metadata +1 -1
data/lib/odf-report/table.rb
CHANGED
@@ -34,8 +34,11 @@ class Table
|
|
34
34
|
#
|
35
35
|
def add_column_if(condition, name, field=nil, &block)
|
36
36
|
if condition
|
37
|
+
block_result = yield if block_given?
|
38
|
+
|
37
39
|
# Only render the column if condition holds true...
|
38
|
-
if
|
40
|
+
if condition == :skip_blank_fields &&
|
41
|
+
(field.nil? || field.strip.blank?) && (block.nil? || block_result.nil?)
|
39
42
|
# Do nothing!
|
40
43
|
elsif field
|
41
44
|
@fields[name] = lambda { |item| item.send(field)}
|
data/odf-report.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{flexy-odf-report}
|
5
|
-
s.version = "0.1.
|
5
|
+
s.version = "0.1.4"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Sandro Duarte", "Mark von Zeschau"]
|