simple_drilldown 0.12.0 → 0.12.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88e7498fba4f1e8b9d25a98861c8ceb5d6b38c7b986c31e8850edf513e832ad9
|
4
|
+
data.tar.gz: 6fc5db5c12c5e81833343ffdace9c3e94711393b33b1c8ae43c8c6b0d36c212c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be393d70922fcbed0111f2f2160477db1b4020bce4ba7643617564bdd13fd22416088857e1c61fda841a36f453b909e5e17d1215b6fafc5658c0ae3207f11fa4
|
7
|
+
data.tar.gz: ea0f6996e1bad25de17e3e671b32cc9c0b90bb368fbdf48f8576e417413f37b4c8db147c27026bf5804530462b2ae3ecb84fc7b047da77f7573065ea09efbbf3
|
@@ -26,7 +26,7 @@ class <%= class_name %>DrilldownController < SimpleDrilldown::Controller
|
|
26
26
|
# base_includes :user, :comments # TODO(uwe): Read relations from schema?
|
27
27
|
|
28
28
|
# What fields should be displayed as default when listing actual <%= class_name %> records.
|
29
|
-
default_fields %w[created_at updated_at] # TODO(uwe): Read fields from schema?
|
29
|
+
default_fields %w[id created_at updated_at] # TODO(uwe): Read fields from schema?
|
30
30
|
|
31
31
|
# When listing records, what relations should be included for optimization?
|
32
32
|
# list_includes :user, :comments # TODO(uwe): Read relations from schema?
|
@@ -35,6 +35,7 @@ class <%= class_name %>DrilldownController < SimpleDrilldown::Controller
|
|
35
35
|
list_order '<%= plural_name %>.created_at'
|
36
36
|
|
37
37
|
# Field definitions when listing records
|
38
|
+
field :id
|
38
39
|
field :created_at
|
39
40
|
field :updated_at
|
40
41
|
|
@@ -270,7 +270,7 @@ module SimpleDrilldown
|
|
270
270
|
sql = +"LEFT JOIN #{include_table} #{include_alias} ON #{include_alias}.#{fk_col} = #{model_table}.id"
|
271
271
|
sql << " AND #{include_alias}.deleted_at IS NULL" if ass.klass.paranoid?
|
272
272
|
if ass.scope && (base_ass_order = ScopeHolder.new(ass.scope).to_s)
|
273
|
-
/^(?<ass_order
|
273
|
+
/^(?<ass_order>.*?)(?<ass_order_desc>\s+DESC)?$/i =~ base_ass_order
|
274
274
|
ass_order_prefixed = ass_order.dup
|
275
275
|
ActiveRecord::Base.connection.columns(include_table).map(&:name).each do |cname|
|
276
276
|
ass_order_prefixed.gsub!(/\b#{cname}\b/, "#{include_alias}.#{cname}")
|
@@ -383,11 +383,9 @@ module SimpleDrilldown
|
|
383
383
|
group = nil if group.empty?
|
384
384
|
|
385
385
|
joins = self.class.make_join([], c_target_class.name.underscore.to_sym, includes)
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
.order(order)
|
390
|
-
.to_a
|
386
|
+
row_query = c_target_class.unscoped.where(c_base_condition).select(select)
|
387
|
+
row_query = row_query.where(conditions) if conditions
|
388
|
+
rows = row_query.joins(joins).group(group).order(order).to_a
|
391
389
|
if rows.empty?
|
392
390
|
@result = { value: 'All', count: 0, row_count: 0, nodes: 0, rows: [] }
|
393
391
|
c_summary_fields.each { |f| @result[f] = 0 }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_drilldown
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Uwe Kubosch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: caxlsx_rails
|
@@ -172,7 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
172
172
|
- !ruby/object:Gem::Version
|
173
173
|
version: '0'
|
174
174
|
requirements: []
|
175
|
-
rubygems_version: 3.3.
|
175
|
+
rubygems_version: 3.3.7
|
176
176
|
signing_key:
|
177
177
|
specification_version: 4
|
178
178
|
summary: Simple data warehouse and drilldown.
|