tabulatr2 0.9.11 → 0.9.12

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: a677eed252e25251243c72fcd9273a5fa2a3e4d0
4
- data.tar.gz: fe38b3b4eccad2e746772356203cb233e5a76a71
3
+ metadata.gz: 5a47c45c08c541dbbb460f8aa315f35db38c82c8
4
+ data.tar.gz: e6fd77a9e25389bcfbbca3e82d8064842b421211
5
5
  SHA512:
6
- metadata.gz: f9824d54ec64a5c7cbe4aac03861f6aa4e9beee8d5a2a4d849a74c3a8193b4a51a7c4055d566d37627222741d39f64969b8a644b280e37f6e3695faf6be0ff86
7
- data.tar.gz: 1a3f528cb8f4198086384f163c65638002cd5348eb46db70c53170be40f488f3470fd3ddec59945660b350b40521c376c86bf9f94d136cc832e04aff776e98a1
6
+ metadata.gz: fbb8191710b05154d82532ba5b316c4914f95ea415bac16c0cc73bc6426381e3cdd5e11b7091564afd570553167639ea991b2dbcdaefaef439aea1ddc6baf086
7
+ data.tar.gz: d28ea60364b7841bc1c1125402754d8f9920c17d4dd88af0a7eb775ed4e5c51321998de725598b731ba46731b354bc5e75078683c514b0c655292a927efbd080
@@ -44,7 +44,7 @@ module Tabulatr::Data::DSL
44
44
  end
45
45
  end
46
46
 
47
- def column(name, sort_sql: nil, filter_sql: nil, sql: nil, table_column_options: {},
47
+ def column(name, header: nil, sort_sql: nil, filter_sql: nil, sql: nil, table_column_options: {},
48
48
  classes: nil, width: false, align: false, valign: false, wrap: nil, th_html: false,
49
49
  filter_html: false, filter: true, sortable: true, format: nil, map: true, cell_style: {},
50
50
  header_style: {},
@@ -52,19 +52,21 @@ module Tabulatr::Data::DSL
52
52
  @table_columns ||= []
53
53
  table_column_options = {classes: classes, width: width, align: align, valign: valign, wrap: wrap,
54
54
  th_html: th_html, filter_html: filter_html, filter: filter, sortable: sortable,
55
- format: format, map: map, cell_style: cell_style, header_style: header_style
55
+ format: format, map: map, cell_style: cell_style, header_style: header_style,
56
+ header: header
56
57
  }.merge(table_column_options)
57
58
  table_name = main_class.table_name
58
59
  table_column = Tabulatr::Renderer::Column.from(
59
60
  table_column_options.merge(name: name,
60
- klass: @base, sort_sql: sort_sql || sql || "#{table_name}.#{name}",
61
+ klass: @base,
62
+ sort_sql: sort_sql || sql || "#{table_name}.#{name}",
61
63
  filter_sql: filter_sql || sql || "#{table_name}.#{name}",
62
64
  table_name: table_name.to_sym,
63
65
  output: block_given? ? block : ->(record){record.send(name)}))
64
66
  @table_columns << table_column
65
67
  end
66
68
 
67
- def association(assoc, name, sort_sql: nil, filter_sql: nil, sql: nil, table_column_options: {},
69
+ def association(assoc, name, header: nil, sort_sql: nil, filter_sql: nil, sql: nil, table_column_options: {},
68
70
  classes: nil, width: false, align: false, valign: false, wrap: nil, th_html: false,
69
71
  filter_html: false, filter: true, sortable: true, format: nil, map: true, cell_style: {},
70
72
  header_style: {},
@@ -72,7 +74,8 @@ module Tabulatr::Data::DSL
72
74
  @table_columns ||= []
73
75
  table_column_options = {classes: classes, width: width, align: align, valign: valign, wrap: wrap,
74
76
  th_html: th_html, filter_html: filter_html, filter: filter, sortable: sortable,
75
- format: format, map: map, cell_style: cell_style, header_style: header_style
77
+ format: format, map: map, cell_style: cell_style, header_style: header_style,
78
+ header: header
76
79
  }.merge(table_column_options)
77
80
  assoc_klass = main_class.reflect_on_association(assoc.to_sym)
78
81
  t_name = assoc_klass.try(:table_name)
@@ -22,5 +22,5 @@
22
22
  #++
23
23
 
24
24
  module Tabulatr
25
- VERSION = "0.9.11"
25
+ VERSION = "0.9.12"
26
26
  end
@@ -19,7 +19,7 @@ class ProductTabulatrData < Tabulatr::Data
19
19
  column :vendor_product_name,
20
20
  sort_sql: "products.title || '' || vendors.name",
21
21
  filter_sql: "products.title || '' || vendors.name",
22
- table_column_options: {header: 'Product by vendor'} do
22
+ header: 'Product by vendor' do
23
23
  "#{record.title} from #{record.vendor.try(:name)}"
24
24
  end
25
25
  column :active, sortable: false
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tabulatr2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.11
4
+ version: 0.9.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Horn
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-10-06 00:00:00.000000000 Z
13
+ date: 2014-10-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails