tabulatr2 0.10.2 → 0.10.4
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 +4 -4
- data/lib/tabulatr/data/data.rb +11 -0
- data/lib/tabulatr/rails/action_controller.rb +5 -0
- data/lib/tabulatr/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 01cb926ba568910fd7399ca34aa45ced78baea8350c06f2f95ebbb375ea69279
|
4
|
+
data.tar.gz: 60ae4424e7722a5565f48a0038250f634e604655f4a4a4d790d0b7e86bd6c2f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3a292e95873de04fe6607d3ec67334fa6d4a5d84ebaf3a5d8d6e76c8100aca72eb85224e382664dcab78d315c01272dcff602034725b4eb3d7e8c8d5db26a18
|
7
|
+
data.tar.gz: 4f54883ecea4c22937e1ad961f23dd5bd3a6e6c621c728553ddc373e825f85eceff98b432a7e379034e507b7c0083b92a6f2c6ec1e0ab701b179642395be8cc5
|
data/lib/tabulatr/data/data.rb
CHANGED
@@ -139,6 +139,17 @@ class Tabulatr::Data
|
|
139
139
|
# assoc.to_sym
|
140
140
|
end
|
141
141
|
|
142
|
+
def filtered_data(params, distinct: true)
|
143
|
+
apply_filters(filter_params(params))
|
144
|
+
apply_search(search_param(params))
|
145
|
+
apply_sorting(sort_params(params))
|
146
|
+
join_required_tables(params)
|
147
|
+
if distinct
|
148
|
+
@relation.distinct
|
149
|
+
else
|
150
|
+
@relation
|
151
|
+
end
|
152
|
+
end
|
142
153
|
end
|
143
154
|
|
144
155
|
require_relative './dsl'
|
@@ -53,6 +53,11 @@ class ActionController::Base
|
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
|
+
def tabulatr_filtered_data_for(relation, distinct: true)
|
57
|
+
klass = relation.respond_to?(:klass) ? relation.klass : relation
|
58
|
+
klass.tabulatr(relation).filtered_data(params, distinct: distinct)
|
59
|
+
end
|
60
|
+
|
56
61
|
def batch_params(klass, params)
|
57
62
|
params["#{Tabulatr::Utility.formatted_name(klass.name)}_batch"]
|
58
63
|
end
|
data/lib/tabulatr/version.rb
CHANGED
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.10.
|
4
|
+
version: 0.10.4
|
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: 2024-
|
13
|
+
date: 2024-10-30 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
@@ -279,7 +279,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
279
279
|
- !ruby/object:Gem::Version
|
280
280
|
version: '0'
|
281
281
|
requirements: []
|
282
|
-
rubygems_version: 3.
|
282
|
+
rubygems_version: 3.5.9
|
283
283
|
signing_key:
|
284
284
|
specification_version: 4
|
285
285
|
summary: A tight DSL to build tables of ActiveRecord models with sorting, pagination,
|