trk_datatables 0.2.16 → 0.2.18

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: 3fecf0c6923b35099111fc74976cf13d26087c42e7bb4461f7c91f540c5a2123
4
- data.tar.gz: 1be013aa2381e6f79fec4c84a2913eb1de087649e971cbfb42b7b4fc8c0e97d8
3
+ metadata.gz: bd9a91c8dcfc2bf1e0a7c77071e55a9d288643616f645bb15d8e47eedf1f75fe
4
+ data.tar.gz: 4d3be581d0f6682b31b9a78d31f60559f00739f65041bf742f9812b6b7505ca0
5
5
  SHA512:
6
- metadata.gz: c8d596f8b8c4ff323ca473d0d10d5cb55c991c815d936765e51ab3144ca08b71e003a01729b3ff112028555ca8fd87488b541278bc358d40e008e554e2b533d6
7
- data.tar.gz: f8296c711ce5bfed1a6a6aa222dd669bd1b92bf92858a4ab2c31ae544c470d8863172573de21cc3f85514251a356748ad1b24c36f847645cbc7361a2803df2d6
6
+ metadata.gz: ab0b8c20502fca77a59c4bfb8ee7fcb9cbe7a734eb981d034591deae16847103fe0f947ff4bafb7e967c9e32b2e15357bcc5b888921df220c2ec2f205b438f95
7
+ data.tar.gz: d3e5325a5f6eadad16af3f69af3cea1e910d31706e27704760694ca55a3dc8873af25833f6e346c7b3a9b892ea9b9e57cd375edd6d5add94d1b7bd409da56086
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.0.1
1
+ 3.4.7
data/Appraisals ADDED
@@ -0,0 +1,23 @@
1
+ appraise "rails-5" do
2
+ gem "rails", "~> 5.2.0"
3
+ gem "i18n", "~> 1.8", "< 1.9"
4
+ gem "nokogiri", "~> 1.15.0"
5
+ gem "pg", "~> 1.5.0"
6
+ gem "sqlite3", "~> 1.6.0"
7
+ gem "standard", "~> 1.35.0"
8
+ end
9
+
10
+ appraise "rails-6" do
11
+ gem "rails", "~> 6.0.0"
12
+ gem "sqlite3", "~> 1.6.0"
13
+ end
14
+
15
+ appraise "rails-7" do
16
+ gem "rails", "~> 7.0.0"
17
+ gem "sqlite3", "~> 1.6.0"
18
+ end
19
+
20
+ appraise "rails-7-1" do
21
+ gem "rails", "~> 7.1.0"
22
+ gem "sqlite3", ">= 2.0.0"
23
+ end
data/Gemfile.lock CHANGED
@@ -1,41 +1,60 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- trk_datatables (0.2.16)
4
+ trk_datatables (0.2.18)
5
5
  activesupport
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- activemodel (6.1.7.2)
11
- activesupport (= 6.1.7.2)
12
- activerecord (6.1.7.2)
13
- activemodel (= 6.1.7.2)
14
- activesupport (= 6.1.7.2)
15
- activesupport (6.1.7.2)
10
+ activemodel (7.1.6)
11
+ activesupport (= 7.1.6)
12
+ activerecord (7.1.6)
13
+ activemodel (= 7.1.6)
14
+ activesupport (= 7.1.6)
15
+ timeout (>= 0.4.0)
16
+ activesupport (7.1.6)
17
+ base64
18
+ benchmark (>= 0.3)
19
+ bigdecimal
16
20
  concurrent-ruby (~> 1.0, >= 1.0.2)
21
+ connection_pool (>= 2.2.5)
22
+ drb
17
23
  i18n (>= 1.6, < 2)
24
+ logger (>= 1.4.2)
18
25
  minitest (>= 5.1)
26
+ mutex_m
27
+ securerandom (>= 0.3)
19
28
  tzinfo (~> 2.0)
20
- zeitwerk (~> 2.3)
29
+ appraisal (2.5.0)
30
+ bundler
31
+ rake
32
+ thor (>= 0.14.0)
21
33
  ast (2.4.2)
34
+ base64 (0.3.0)
35
+ benchmark (0.5.0)
36
+ bigdecimal (4.1.2)
22
37
  byebug (11.1.3)
23
- concurrent-ruby (1.2.0)
38
+ concurrent-ruby (1.3.7)
39
+ connection_pool (2.5.5)
24
40
  database_cleaner (2.0.1)
25
41
  database_cleaner-active_record (~> 2.0.0)
26
42
  database_cleaner-active_record (2.0.1)
27
43
  activerecord (>= 5.a)
28
44
  database_cleaner-core (~> 2.0.0)
29
45
  database_cleaner-core (2.0.1)
30
- i18n (1.12.0)
46
+ drb (2.2.3)
47
+ i18n (1.14.8)
31
48
  concurrent-ruby (~> 1.0)
32
49
  json (2.7.2)
33
50
  language_server-protocol (3.17.0.3)
34
51
  lint_roller (1.1.0)
35
- mini_portile2 (2.8.1)
36
- minitest (5.17.0)
52
+ logger (1.7.0)
53
+ mini_portile2 (2.8.9)
54
+ minitest (5.26.1)
37
55
  minitest-color (0.0.2)
38
56
  minitest (~> 5)
57
+ mutex_m (0.3.0)
39
58
  parallel (1.24.0)
40
59
  parser (3.3.0.5)
41
60
  ast (~> 2.4.1)
@@ -43,7 +62,7 @@ GEM
43
62
  pg (1.4.5)
44
63
  racc (1.7.3)
45
64
  rainbow (3.1.1)
46
- rake (10.5.0)
65
+ rake (13.4.2)
47
66
  regexp_parser (2.9.0)
48
67
  rexml (3.2.6)
49
68
  rubocop (1.62.1)
@@ -63,7 +82,8 @@ GEM
63
82
  rubocop (>= 1.48.1, < 2.0)
64
83
  rubocop-ast (>= 1.30.0, < 2.0)
65
84
  ruby-progressbar (1.13.0)
66
- sqlite3 (1.6.0)
85
+ securerandom (0.3.2)
86
+ sqlite3 (2.9.5)
67
87
  mini_portile2 (~> 2.8.0)
68
88
  standard (1.35.1)
69
89
  language_server-protocol (~> 3.17.0.2)
@@ -77,28 +97,30 @@ GEM
77
97
  standard-performance (1.3.1)
78
98
  lint_roller (~> 1.1)
79
99
  rubocop-performance (~> 1.20.2)
100
+ thor (1.3.1)
80
101
  timecop (0.9.6)
102
+ timeout (0.6.1)
81
103
  tzinfo (2.0.6)
82
104
  concurrent-ruby (~> 1.0)
83
105
  unicode-display_width (2.5.0)
84
- zeitwerk (2.6.6)
85
106
 
86
107
  PLATFORMS
87
108
  ruby
88
109
 
89
110
  DEPENDENCIES
90
- activerecord (~> 6.0)
111
+ activerecord (>= 5.0)
112
+ appraisal
91
113
  bundler (~> 2.0)
92
114
  byebug
93
115
  database_cleaner
94
116
  minitest (~> 5.0)
95
117
  minitest-color
96
118
  pg
97
- rake (~> 10.0)
98
- sqlite3
119
+ rake (>= 10.0)
120
+ sqlite3 (>= 1.4)
99
121
  standard
100
122
  timecop
101
123
  trk_datatables!
102
124
 
103
125
  BUNDLED WITH
104
- 2.2.15
126
+ 2.7.2
data/README.md CHANGED
@@ -220,7 +220,8 @@ class PostsDatatable < TrkDatatables::ActiveRecord
220
220
  # instead Post.all you should use Post.joins(:user) or
221
221
  # Post.left_joins(:user) if user is optional. For has_many relations you
222
222
  # need to join them since you will get multiple table rows
223
- %w[posts.body users.name]
223
+ # Post.left_joins(:comments).group("id")
224
+ %w[posts.body users.name comments.body]
224
225
  end
225
226
  end
226
227
  ```
@@ -727,12 +728,18 @@ save preferences) and this default values will be used
727
728
  # app/datatables/posts_datatable.rb
728
729
  class PostsDatatable
729
730
  # when we show invoice_no on first column, and that is reset every year
730
- # on first april, than it is better is to use date column ordering
731
+ # on first april, than it is better is to use last (date) column ordering
731
732
  # column starts from zero 0, 1, 2, 3
732
733
  def default_order
733
734
  [[columns.size - 1, :desc]]
734
735
  end
735
736
 
737
+ # order by
738
+ def default_order
739
+ index_by_column_key "users.updated_at"
740
+ end
741
+
742
+
736
743
  def default_page_length
737
744
  20
738
745
  end
@@ -1118,6 +1125,29 @@ ruby -I test test/trk_datatables/base_test.rb
1118
1125
  ruby -I test test/trk_datatables/base_test.rb -n /additional/
1119
1126
  ```
1120
1127
 
1128
+ Run the Appraisal matrix when changing ActiveRecord, Rails, or adapter support:
1129
+
1130
+ ```
1131
+ # install appraisal gemfiles
1132
+ ASDF_RUBY_VERSION=3.4.7 bundle exec appraisal install
1133
+
1134
+ # run the Ruby 3.4 Rails matrix
1135
+ ASDF_RUBY_VERSION=3.4.7 bundle exec appraisal rails-6 rake
1136
+ ASDF_RUBY_VERSION=3.4.7 bundle exec appraisal rails-7 rake
1137
+ ASDF_RUBY_VERSION=3.4.7 bundle exec appraisal rails-7-1 rake
1138
+ ```
1139
+
1140
+ Rails 5.2 is supported as a legacy appraisal on Ruby 2.7:
1141
+
1142
+ ```
1143
+ ASDF_RUBY_VERSION=2.7.8 BUNDLE_GEMFILE=gemfiles/rails_5.gemfile bundle exec rake
1144
+ ```
1145
+
1146
+ Install
1147
+ ```
1148
+ ASDF_RUBY_VERSION=3.4.7 BUNDLER_VERSION=2.7.2 BUNDLE_GEMFILE=gemfiles/rails_7_1.gemfile bundle _2.7.2_ install
1149
+ ```
1150
+
1121
1151
  You can also run `bin/console` for an interactive prompt that will allow you to experiment.
1122
1152
 
1123
1153
  To install this gem onto your local machine, run `bundle exec rake install`. To
data/Rakefile CHANGED
@@ -1,3 +1,4 @@
1
+ require "bundler/setup"
1
2
  require "bundler/gem_tasks"
2
3
  require "rake/testtask"
3
4
 
@@ -0,0 +1,2 @@
1
+ ---
2
+ BUNDLE_RETRY: "1"
@@ -0,0 +1,12 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 5.2.0"
6
+ gem "i18n", "~> 1.8", "< 1.9"
7
+ gem "nokogiri", "~> 1.15.0"
8
+ gem "pg", "~> 1.5.0"
9
+ gem "sqlite3", "~> 1.6.0"
10
+ gem "standard", "~> 1.35.0"
11
+
12
+ gemspec path: "../"
@@ -0,0 +1,224 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ trk_datatables (0.2.17)
5
+ activesupport
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actioncable (5.2.8.1)
11
+ actionpack (= 5.2.8.1)
12
+ nio4r (~> 2.0)
13
+ websocket-driver (>= 0.6.1)
14
+ actionmailer (5.2.8.1)
15
+ actionpack (= 5.2.8.1)
16
+ actionview (= 5.2.8.1)
17
+ activejob (= 5.2.8.1)
18
+ mail (~> 2.5, >= 2.5.4)
19
+ rails-dom-testing (~> 2.0)
20
+ actionpack (5.2.8.1)
21
+ actionview (= 5.2.8.1)
22
+ activesupport (= 5.2.8.1)
23
+ rack (~> 2.0, >= 2.0.8)
24
+ rack-test (>= 0.6.3)
25
+ rails-dom-testing (~> 2.0)
26
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
27
+ actionview (5.2.8.1)
28
+ activesupport (= 5.2.8.1)
29
+ builder (~> 3.1)
30
+ erubi (~> 1.4)
31
+ rails-dom-testing (~> 2.0)
32
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
33
+ activejob (5.2.8.1)
34
+ activesupport (= 5.2.8.1)
35
+ globalid (>= 0.3.6)
36
+ activemodel (5.2.8.1)
37
+ activesupport (= 5.2.8.1)
38
+ activerecord (5.2.8.1)
39
+ activemodel (= 5.2.8.1)
40
+ activesupport (= 5.2.8.1)
41
+ arel (>= 9.0)
42
+ activestorage (5.2.8.1)
43
+ actionpack (= 5.2.8.1)
44
+ activerecord (= 5.2.8.1)
45
+ marcel (~> 1.0.0)
46
+ activesupport (5.2.8.1)
47
+ concurrent-ruby (~> 1.0, >= 1.0.2)
48
+ i18n (>= 0.7, < 2)
49
+ minitest (~> 5.1)
50
+ tzinfo (~> 1.1)
51
+ appraisal (2.5.0)
52
+ bundler
53
+ rake
54
+ thor (>= 0.14.0)
55
+ arel (9.0.0)
56
+ ast (2.4.3)
57
+ base64 (0.3.0)
58
+ builder (3.3.0)
59
+ byebug (11.1.3)
60
+ concurrent-ruby (1.3.7)
61
+ crass (1.0.7)
62
+ database_cleaner (2.1.0)
63
+ database_cleaner-active_record (>= 2, < 3)
64
+ database_cleaner-active_record (2.2.2)
65
+ activerecord (>= 5.a)
66
+ database_cleaner-core (~> 2.0)
67
+ database_cleaner-core (2.1.0)
68
+ date (3.5.1)
69
+ erubi (1.13.1)
70
+ globalid (1.1.0)
71
+ activesupport (>= 5.0)
72
+ i18n (1.8.11)
73
+ concurrent-ruby (~> 1.0)
74
+ json (2.20.0)
75
+ language_server-protocol (3.17.0.5)
76
+ lint_roller (1.1.0)
77
+ logger (1.7.0)
78
+ loofah (2.25.1)
79
+ crass (~> 1.0.2)
80
+ nokogiri (>= 1.12.0)
81
+ mail (2.9.0)
82
+ logger
83
+ mini_mime (>= 0.1.1)
84
+ net-imap
85
+ net-pop
86
+ net-smtp
87
+ marcel (1.0.4)
88
+ method_source (1.1.0)
89
+ mini_mime (1.1.5)
90
+ mini_portile2 (2.8.9)
91
+ minitest (5.26.1)
92
+ minitest-color (0.0.2)
93
+ minitest (~> 5)
94
+ net-imap (0.4.24)
95
+ date
96
+ net-protocol
97
+ net-pop (0.1.2)
98
+ net-protocol
99
+ net-protocol (0.2.2)
100
+ timeout
101
+ net-smtp (0.5.1)
102
+ net-protocol
103
+ nio4r (2.7.5)
104
+ nokogiri (1.15.7)
105
+ mini_portile2 (~> 2.8.2)
106
+ racc (~> 1.4)
107
+ nokogiri (1.15.7-arm64-darwin)
108
+ racc (~> 1.4)
109
+ parallel (1.28.0)
110
+ parser (3.3.11.1)
111
+ ast (~> 2.4.1)
112
+ racc
113
+ pg (1.5.9)
114
+ prism (1.9.0)
115
+ racc (1.8.1)
116
+ rack (2.2.9)
117
+ rack-test (2.2.0)
118
+ rack (>= 1.3)
119
+ rails (5.2.8.1)
120
+ actioncable (= 5.2.8.1)
121
+ actionmailer (= 5.2.8.1)
122
+ actionpack (= 5.2.8.1)
123
+ actionview (= 5.2.8.1)
124
+ activejob (= 5.2.8.1)
125
+ activemodel (= 5.2.8.1)
126
+ activerecord (= 5.2.8.1)
127
+ activestorage (= 5.2.8.1)
128
+ activesupport (= 5.2.8.1)
129
+ bundler (>= 1.3.0)
130
+ railties (= 5.2.8.1)
131
+ sprockets-rails (>= 2.0.0)
132
+ rails-dom-testing (2.3.0)
133
+ activesupport (>= 5.0.0)
134
+ minitest
135
+ nokogiri (>= 1.6)
136
+ rails-html-sanitizer (1.7.0)
137
+ loofah (~> 2.25)
138
+ nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
139
+ railties (5.2.8.1)
140
+ actionpack (= 5.2.8.1)
141
+ activesupport (= 5.2.8.1)
142
+ method_source
143
+ rake (>= 0.8.7)
144
+ thor (>= 0.19.0, < 2.0)
145
+ rainbow (3.1.1)
146
+ rake (13.4.2)
147
+ regexp_parser (2.12.0)
148
+ rexml (3.4.4)
149
+ rubocop (1.62.1)
150
+ json (~> 2.3)
151
+ language_server-protocol (>= 3.17.0)
152
+ parallel (~> 1.10)
153
+ parser (>= 3.3.0.2)
154
+ rainbow (>= 2.2.2, < 4.0)
155
+ regexp_parser (>= 1.8, < 3.0)
156
+ rexml (>= 3.2.5, < 4.0)
157
+ rubocop-ast (>= 1.31.1, < 2.0)
158
+ ruby-progressbar (~> 1.7)
159
+ unicode-display_width (>= 2.4.0, < 3.0)
160
+ rubocop-ast (1.49.1)
161
+ parser (>= 3.3.7.2)
162
+ prism (~> 1.7)
163
+ rubocop-performance (1.21.1)
164
+ rubocop (>= 1.48.1, < 2.0)
165
+ rubocop-ast (>= 1.31.1, < 2.0)
166
+ ruby-progressbar (1.13.0)
167
+ sprockets (4.2.1)
168
+ concurrent-ruby (~> 1.0)
169
+ rack (>= 2.2.4, < 4)
170
+ sprockets-rails (3.4.2)
171
+ actionpack (>= 5.2)
172
+ activesupport (>= 5.2)
173
+ sprockets (>= 3.0.0)
174
+ sqlite3 (1.6.9)
175
+ mini_portile2 (~> 2.8.0)
176
+ sqlite3 (1.6.9-arm64-darwin)
177
+ standard (1.35.1)
178
+ language_server-protocol (~> 3.17.0.2)
179
+ lint_roller (~> 1.0)
180
+ rubocop (~> 1.62.0)
181
+ standard-custom (~> 1.0.0)
182
+ standard-performance (~> 1.3)
183
+ standard-custom (1.0.2)
184
+ lint_roller (~> 1.0)
185
+ rubocop (~> 1.50)
186
+ standard-performance (1.4.0)
187
+ lint_roller (~> 1.1)
188
+ rubocop-performance (~> 1.21.0)
189
+ thor (1.5.0)
190
+ thread_safe (0.3.6)
191
+ timecop (0.9.11)
192
+ timeout (0.6.1)
193
+ tzinfo (1.2.11)
194
+ thread_safe (~> 0.1)
195
+ unicode-display_width (2.6.0)
196
+ websocket-driver (0.8.2)
197
+ base64
198
+ websocket-extensions (>= 0.1.0)
199
+ websocket-extensions (0.1.5)
200
+
201
+ PLATFORMS
202
+ arm64-darwin-24
203
+ ruby
204
+
205
+ DEPENDENCIES
206
+ activerecord (>= 5.0)
207
+ appraisal
208
+ bundler (~> 2.0)
209
+ byebug
210
+ database_cleaner
211
+ i18n (~> 1.8, < 1.9)
212
+ minitest (~> 5.0)
213
+ minitest-color
214
+ nokogiri (~> 1.15.0)
215
+ pg (~> 1.5.0)
216
+ rails (~> 5.2.0)
217
+ rake (>= 10.0)
218
+ sqlite3 (~> 1.6.0)
219
+ standard (~> 1.35.0)
220
+ timecop
221
+ trk_datatables!
222
+
223
+ BUNDLED WITH
224
+ 2.2.33
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 6.0.0"
6
+ gem "sqlite3", "~> 1.6.0"
7
+
8
+ gemspec path: "../"