rails_select_on_includes 0.4.4 → 0.4.5
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/rails_select_on_includes.rb +37 -37
- data/lib/rails_select_on_includes/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f82283cf1c50efd25ad1e3fa2e2f12b1a8b5ae1
|
4
|
+
data.tar.gz: 1c2b9e966c24424aade16aa96047cdb68c1dff4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88f9bc17c2c226ac0cc510820f70d981c84d45f548bffb1791d3fdb022c8d303d51de6e2bf90e3d7183af27f8806958cd02db8008e7ee35fe3700ab44021c940
|
7
|
+
data.tar.gz: 78a8698e7084c34a279649d860e5fe57f4f445d9e3178fafd7e7bba53327eb022c8ac67be143cc47823c3cbab4dbda1059cbd3e626f94ac9c73a9636c8ae026c
|
@@ -52,43 +52,43 @@ module ActiveRecord
|
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
|
-
class JoinPart
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
end
|
60
|
-
|
61
|
-
def instantiate(result_set, aliases)
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
end
|
55
|
+
# class JoinPart
|
56
|
+
# def instantiate(row, aliases, column_types = {}, &block)
|
57
|
+
# base_klass.instantiate(extract_record(row, aliases), column_types, &block)
|
58
|
+
# end
|
59
|
+
# end
|
60
|
+
#
|
61
|
+
# def instantiate(result_set, aliases)
|
62
|
+
# primary_key = aliases.column_alias(join_root, join_root.primary_key)
|
63
|
+
#
|
64
|
+
# seen = Hash.new { |i, object_id|
|
65
|
+
# i[object_id] = Hash.new { |j, child_class|
|
66
|
+
# j[child_class] = {}
|
67
|
+
# }
|
68
|
+
# }
|
69
|
+
#
|
70
|
+
# model_cache = Hash.new { |h,klass| h[klass] = {} }
|
71
|
+
# parents = model_cache[join_root]
|
72
|
+
# column_aliases = aliases.column_aliases join_root
|
73
|
+
#
|
74
|
+
# message_bus = ActiveSupport::Notifications.instrumenter
|
75
|
+
#
|
76
|
+
# payload = {
|
77
|
+
# record_count: result_set.length,
|
78
|
+
# class_name: join_root.base_klass.name
|
79
|
+
# }
|
80
|
+
#
|
81
|
+
# message_bus.instrument('instantiation.active_record', payload) do
|
82
|
+
# result_set.each { |row_hash|
|
83
|
+
# parent_key = primary_key ? row_hash[primary_key] : row_hash
|
84
|
+
# # DISTINCTION PART > join_root.instantiate(row_hash, column_aliases, result_set.column_types )
|
85
|
+
# # PREVIOUS > join_root.instantiate(row_hash, column_aliases )
|
86
|
+
# parent = parents[parent_key] ||= join_root.instantiate(row_hash, column_aliases, result_set.column_types )
|
87
|
+
# construct(parent, join_root, row_hash, result_set, seen, model_cache, aliases)
|
88
|
+
# }
|
89
|
+
# end
|
90
|
+
# parents.values
|
91
|
+
# end
|
92
92
|
|
93
93
|
end
|
94
94
|
end
|