deferred_columns 0.0.2 → 0.0.3
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/CHANGELOG.md +4 -0
- data/lib/deferred_columns/relation.rb +7 -5
- data/lib/deferred_columns/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: b5ee4e024494b9c3bf5677b3db75ad6b45e0d04720c1bc2531f785913cfeb529
|
|
4
|
+
data.tar.gz: 9dcbd4c5df5a0c335fb0e3c1e4241faebc7d0b9a6ac60abde0e58f908bde8e12
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ec342be182915bf2caa13dff2de5f8d0c8795f97a7bca974165555b0486bc1a30a6e222972efd17d39550fb974658ad96c032428ac5d325332106a988789830a
|
|
7
|
+
data.tar.gz: 93998c8e593c3c7add42080b1ec95896b63c63e932bde96bcd318129e166dea204b4bac0e71c7ed64826cdcbf885af8b101a8e2830317b8fcf33d5111043ca65
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.0.3 (2026-11-18)
|
|
4
|
+
|
|
5
|
+
- Fix `NoMethodError` for the private `construct_join_dependency` when merging joins of another model, or in association scopes that reference an eager loaded association.
|
|
6
|
+
|
|
3
7
|
## 0.0.2 (2026-11-18)
|
|
4
8
|
|
|
5
9
|
- Rename `select_all_columns` to `with_deferred_columns`.
|
|
@@ -30,6 +30,13 @@ module DeferredColumns
|
|
|
30
30
|
deferred.empty? ? self : extending(OptIn.new(deferred))
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
+
# Passes the opt-ins to the root of `eager_load`, which selects its columns.
|
|
34
|
+
# Public like the Rails method, which merges and association scopes call on
|
|
35
|
+
# other relations.
|
|
36
|
+
def construct_join_dependency(...) # :nodoc:
|
|
37
|
+
super.tap { |dependency| dependency.send(:join_root).deferred_columns_opted_into = DeferredColumns.opted_into(self) }
|
|
38
|
+
end
|
|
39
|
+
|
|
33
40
|
private
|
|
34
41
|
|
|
35
42
|
def build_select(arel)
|
|
@@ -40,11 +47,6 @@ module DeferredColumns
|
|
|
40
47
|
loaded = opted.empty? ? klass.default_select_columns : klass.column_names - (deferred - opted)
|
|
41
48
|
arel.project(*loaded.map { |column| table[column] })
|
|
42
49
|
end
|
|
43
|
-
|
|
44
|
-
# Passes the opt-ins to the root of `eager_load`, which selects its columns.
|
|
45
|
-
def construct_join_dependency(...)
|
|
46
|
-
super.tap { |dependency| dependency.send(:join_root).deferred_columns_opted_into = DeferredColumns.opted_into(self) }
|
|
47
|
-
end
|
|
48
50
|
end
|
|
49
51
|
|
|
50
52
|
# The deferred columns a query opted into.
|