recourse 5.9.2 → 5.10.0
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/app/views/recourses/_table.html.erb +3 -2
- data/lib/recourse/helpers/rows.rb +12 -0
- data/lib/recourse/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fc1fa907947fab5a125008b4ce6d190f8fc10cbcc5e5a07f8645230adc81d056
|
|
4
|
+
data.tar.gz: 7b08aaa5c77bb19c27f144e24888ed641c118666fa408ff877bc59e1345fb0c9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: aab672ef3d982d5b36eef34813c4d140ab4c3ad0267db0ae87b6e87b6304d3cc179ef5e9c6fe58160f62675390297c81c8ee0423c14fcbd811fea14840100560
|
|
7
|
+
data.tar.gz: a867787db27e144331de96386609e64a3b18241e42ac1c773ee91799c41bc28e98bad8afa0cefd55dfed433ace537d117c0ccb60506e90c02cfd5197b3951969
|
|
@@ -16,8 +16,9 @@
|
|
|
16
16
|
the fragment when a square is clicked. And the zone, for the same reason again:
|
|
17
17
|
a timestamp is drawn against the reader's own clock, so without it the first
|
|
18
18
|
person to load a table would settle what hour everybody else read. -%>
|
|
19
|
-
<% key = [recourses, rows_version(recourses), counters_version(recourses),
|
|
20
|
-
resource_columns, bookmark_digest,
|
|
19
|
+
<% key = [recourses, rows_version(recourses), counters_version(recourses),
|
|
20
|
+
selected_version(recourses), row_digest, resource_columns, bookmark_digest,
|
|
21
|
+
Time.zone.name] -%>
|
|
21
22
|
<% cache_if cacheable_table?, key do %>
|
|
22
23
|
<% actions = resource_actions %>
|
|
23
24
|
<%# Read once for the whole table: every row of it is positioned or none is. -%>
|
|
@@ -45,6 +45,18 @@ module Recourse
|
|
|
45
45
|
rows.map { |row| row.attributes.values_at(*columns) }
|
|
46
46
|
end
|
|
47
47
|
|
|
48
|
+
# And whatever the rows carry beyond their own columns. A host's relation may select
|
|
49
|
+
# a value worked out from another table -- whether this ZIP is in this market, which
|
|
50
|
+
# a join answers -- and nothing on the ZIP itself moves when the answer changes, so
|
|
51
|
+
# neither the version above nor the counts beside it see it. Read off the rows in
|
|
52
|
+
# memory like both of those, so this costs no query either.
|
|
53
|
+
def selected_version(rows)
|
|
54
|
+
extra = rows.first.attributes.keys - resource_model.column_names if rows.first
|
|
55
|
+
return if extra.blank?
|
|
56
|
+
|
|
57
|
+
rows.map { |row| row.attributes.values_at(*extra) }
|
|
58
|
+
end
|
|
59
|
+
|
|
48
60
|
# Every record the rows reach along `includes`, in any shape `includes` accepts:
|
|
49
61
|
# a name, a list of them, or a hash naming what to follow from there.
|
|
50
62
|
def reached(rows, names)
|
data/lib/recourse/version.rb
CHANGED