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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 25dc12a1680c270205fc1db7405ac15f34b7b1be1185a340520ba0bfb9e442ec
4
- data.tar.gz: cebe2b2a13e11b31f49019be4bde68c62b7f297b996ba0042e2ba4d00ac59257
3
+ metadata.gz: fc1fa907947fab5a125008b4ce6d190f8fc10cbcc5e5a07f8645230adc81d056
4
+ data.tar.gz: 7b08aaa5c77bb19c27f144e24888ed641c118666fa408ff877bc59e1345fb0c9
5
5
  SHA512:
6
- metadata.gz: d96675d0ce0922948410a1e13835bb19d9354c1b1e85710e5c8f01b942b83e77547367552ca4f234bd6bfe0d710b21306e105b025b9845ce8c4aa0b4b0a4c023
7
- data.tar.gz: a0cbef102e56493def2d5e105f3bb463952a5aa636106ac8272d7eefb436fff3dfd50db469f42173acf4f202b329cb191b2c915866b10deef92b954d23882dee
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), row_digest,
20
- resource_columns, bookmark_digest, Time.zone.name] -%>
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)
@@ -1,4 +1,4 @@
1
1
  module Recourse
2
2
  # Version of the gem, read by the gemspec and by hosts checking compatibility.
3
- VERSION = '5.9.2'
3
+ VERSION = '5.10.0'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recourse
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.9.2
4
+ version: 5.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - claudiob