table_on_steroids 0.1.1.13 → 0.1.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2f24d4f105e27626f6ac9038284f6ddff75784239fd7004fa5146cbb57c0c134
4
- data.tar.gz: e1b9627cf54ffc485856845972d776b2614663a21cd812cf7c8030a8a510ee03
3
+ metadata.gz: f0ba364a74ea76311ca1e2772cef86408871a3756499e82793fa63a4f8b95da3
4
+ data.tar.gz: fe1b250ade931bf258446c94ec756ef969a75d536d89a35f2e5375e6f6bedb7d
5
5
  SHA512:
6
- metadata.gz: 3f506dea75e687c7240cdb61d10806a504cca35f311ce1213e6c51b514ac259024ecd644e9a1120c10d167755c6c470e16c9021ddb8bb00d7973ebd09dc77835
7
- data.tar.gz: 5fb0e6809e49d51a9cce6a65cc8c4d5f8fddd38558b510e0feb0f03029197e1f6f286f6ee02479b735c318f45ea2cc9931b72580a63e25a49c4756a3b752caa2
6
+ metadata.gz: be347b11343d1cd0860755b40021a2361c1ea80796a5f43ee3f1483ada2fe832dd1389bb350e7bdb5f70e6d92eaece218becfc54b02fc6086531f3db146c93c7
7
+ data.tar.gz: 2ee840fe5b762f283849597770f6d8a73c8b296095c684bc59adb17da884a05f60d15f472e4bf2248616e137ab7980a2ee1b551d03f2e456962fae17c0f80d3c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- table_on_steroids (0.1.1.10)
4
+ table_on_steroids (0.1.1.14)
5
5
  bootstrap-datepicker-rails (~> 1)
6
6
  bootstrap-select-rails (~> 1.3)
7
7
  kaminari (~> 1.1)
@@ -9,74 +9,77 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- actionpack (6.0.1)
13
- actionview (= 6.0.1)
14
- activesupport (= 6.0.1)
15
- rack (~> 2.0)
12
+ actionpack (6.1.4.7)
13
+ actionview (= 6.1.4.7)
14
+ activesupport (= 6.1.4.7)
15
+ rack (~> 2.0, >= 2.0.9)
16
16
  rack-test (>= 0.6.3)
17
17
  rails-dom-testing (~> 2.0)
18
18
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
19
- actionview (6.0.1)
20
- activesupport (= 6.0.1)
19
+ actionview (6.1.4.7)
20
+ activesupport (= 6.1.4.7)
21
21
  builder (~> 3.1)
22
22
  erubi (~> 1.4)
23
23
  rails-dom-testing (~> 2.0)
24
24
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
25
- activemodel (6.0.1)
26
- activesupport (= 6.0.1)
27
- activerecord (6.0.1)
28
- activemodel (= 6.0.1)
29
- activesupport (= 6.0.1)
30
- activesupport (6.0.1)
25
+ activemodel (6.1.4.7)
26
+ activesupport (= 6.1.4.7)
27
+ activerecord (6.1.4.7)
28
+ activemodel (= 6.1.4.7)
29
+ activesupport (= 6.1.4.7)
30
+ activesupport (6.1.4.7)
31
31
  concurrent-ruby (~> 1.0, >= 1.0.2)
32
- i18n (>= 0.7, < 2)
33
- minitest (~> 5.1)
34
- tzinfo (~> 1.1)
35
- zeitwerk (~> 2.2)
36
- bootstrap-datepicker-rails (1.8.0.1)
32
+ i18n (>= 1.6, < 2)
33
+ minitest (>= 5.1)
34
+ tzinfo (~> 2.0)
35
+ zeitwerk (~> 2.3)
36
+ bootstrap-datepicker-rails (1.10.0.1)
37
37
  railties (>= 3.0)
38
38
  bootstrap-select-rails (1.13.8)
39
- builder (3.2.3)
40
- concurrent-ruby (1.1.5)
41
- crass (1.0.5)
39
+ builder (3.3.0)
40
+ concurrent-ruby (1.3.4)
41
+ crass (1.0.6)
42
42
  diff-lcs (1.3)
43
- erubi (1.9.0)
44
- i18n (1.7.0)
43
+ erubi (1.13.0)
44
+ i18n (1.14.6)
45
45
  concurrent-ruby (~> 1.0)
46
- kaminari (1.1.1)
46
+ kaminari (1.2.2)
47
47
  activesupport (>= 4.1.0)
48
- kaminari-actionview (= 1.1.1)
49
- kaminari-activerecord (= 1.1.1)
50
- kaminari-core (= 1.1.1)
51
- kaminari-actionview (1.1.1)
48
+ kaminari-actionview (= 1.2.2)
49
+ kaminari-activerecord (= 1.2.2)
50
+ kaminari-core (= 1.2.2)
51
+ kaminari-actionview (1.2.2)
52
52
  actionview
53
- kaminari-core (= 1.1.1)
54
- kaminari-activerecord (1.1.1)
53
+ kaminari-core (= 1.2.2)
54
+ kaminari-activerecord (1.2.2)
55
55
  activerecord
56
- kaminari-core (= 1.1.1)
57
- kaminari-core (1.1.1)
58
- loofah (2.3.1)
56
+ kaminari-core (= 1.2.2)
57
+ kaminari-core (1.2.2)
58
+ loofah (2.22.0)
59
59
  crass (~> 1.0.2)
60
- nokogiri (>= 1.5.9)
61
- method_source (0.9.2)
62
- mini_portile2 (2.4.0)
63
- minitest (5.13.0)
64
- nokogiri (1.10.5)
65
- mini_portile2 (~> 2.4.0)
66
- rack (2.0.7)
67
- rack-test (1.1.0)
68
- rack (>= 1.0, < 3)
69
- rails-dom-testing (2.0.3)
70
- activesupport (>= 4.2.0)
60
+ nokogiri (>= 1.12.0)
61
+ method_source (1.1.0)
62
+ mini_portile2 (2.6.1)
63
+ minitest (5.15.0)
64
+ nokogiri (1.12.5)
65
+ mini_portile2 (~> 2.6.1)
66
+ racc (~> 1.4)
67
+ racc (1.8.1)
68
+ rack (2.2.9)
69
+ rack-test (2.1.0)
70
+ rack (>= 1.3)
71
+ rails-dom-testing (2.2.0)
72
+ activesupport (>= 5.0.0)
73
+ minitest
71
74
  nokogiri (>= 1.6)
72
- rails-html-sanitizer (1.3.0)
73
- loofah (~> 2.3)
74
- railties (6.0.1)
75
- actionpack (= 6.0.1)
76
- activesupport (= 6.0.1)
75
+ rails-html-sanitizer (1.5.0)
76
+ loofah (~> 2.19, >= 2.19.1)
77
+ railties (6.1.4.7)
78
+ actionpack (= 6.1.4.7)
79
+ activesupport (= 6.1.4.7)
77
80
  method_source
78
- rake (>= 0.8.7)
79
- thor (>= 0.20.3, < 2.0)
81
+ rake (>= 0.13)
82
+ thor (~> 1.0)
80
83
  rake (10.5.0)
81
84
  rspec (3.8.0)
82
85
  rspec-core (~> 3.8.0)
@@ -91,11 +94,10 @@ GEM
91
94
  diff-lcs (>= 1.2.0, < 2.0)
92
95
  rspec-support (~> 3.8.0)
93
96
  rspec-support (3.8.0)
94
- thor (0.20.3)
95
- thread_safe (0.3.6)
96
- tzinfo (1.2.5)
97
- thread_safe (~> 0.1)
98
- zeitwerk (2.2.1)
97
+ thor (1.2.2)
98
+ tzinfo (2.0.6)
99
+ concurrent-ruby (~> 1.0)
100
+ zeitwerk (2.6.18)
99
101
 
100
102
  PLATFORMS
101
103
  ruby
@@ -40,7 +40,6 @@ module TableOnSteroids
40
40
  end
41
41
 
42
42
  def filter_and_order(objects, columns_on_steroid, global_search = nil, include_counts = false, all_pages = false, table_on_steroids = nil, rows_to_display = nil)
43
-
44
43
  limit = rows_to_display || OBJECTS_PER_PAGE
45
44
 
46
45
  # execute the global search if you have one
@@ -102,15 +101,21 @@ module TableOnSteroids
102
101
  include_counts ? [objects, total_pages, total_count, page] : objects
103
102
  end
104
103
 
105
- def table_csv(objects, columns_on_steroid)
104
+ def table_csv(objects, columns_on_steroid, client = false)
106
105
  titles = []
106
+ value_lambda = :download_value_lambda
107
+ label = :download_label
108
+ if(client)
109
+ value_lambda = :client_download_value_lambda
110
+ label = :client_download_label
111
+ end
107
112
  csvs = CSV.generate do |csv|
108
- columns_on_steroid.select { |_c, v| v[:download_value_lambda].present? }.each { |_c, v| (v[:download_label].present? ? titles.push(*v[:download_label]) : titles << v[:label]) }
113
+ columns_on_steroid.select { |_c, v| v[value_lambda].present? }.each { |_c, v| (v[label].present? ? titles.push(*v[label]) : titles << v[:label]) }
109
114
  csv << titles
110
115
  objects.each do |o|
111
116
  vals = []
112
- columns_on_steroid.select { |_c, v| v[:download_value_lambda].present? }.each do |_c, v|
113
- vals.push(*v[:download_value_lambda].call(o))
117
+ columns_on_steroid.select { |_c, v| v[value_lambda].present? }.each do |_c, v|
118
+ vals.push(*v[value_lambda].call(o))
114
119
  end
115
120
  csv << vals
116
121
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TableOnSteroids
4
- VERSION = '0.1.1.13'
4
+ VERSION = '0.1.1.14'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: table_on_steroids
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1.13
4
+ version: 0.1.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marieke Gueye
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2024-06-13 00:00:00.000000000 Z
12
+ date: 2024-10-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bootstrap-datepicker-rails
@@ -152,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
152
  version: '0'
153
153
  requirements: []
154
154
  rubyforge_project:
155
- rubygems_version: 2.7.7
155
+ rubygems_version: 2.7.6.2
156
156
  signing_key:
157
157
  specification_version: 4
158
158
  summary: Create awesome tables for rails