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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5282032568e76b71d4f01e390162d7dde6b59a56
4
- data.tar.gz: c6655e370ce7446e325af753b2ccb79d2396302c
3
+ metadata.gz: 7f82283cf1c50efd25ad1e3fa2e2f12b1a8b5ae1
4
+ data.tar.gz: 1c2b9e966c24424aade16aa96047cdb68c1dff4a
5
5
  SHA512:
6
- metadata.gz: d0eaa6f6f132be944c760b58f9b1810bfbbff6ba83c63f4e5f96d1501be84d0c0499be9be5e818b5a9991d81a4c7894bf4963d2d5c214e6076600dbbed63a814
7
- data.tar.gz: ca40dc9edb3edce66f1c1f327f726744d7604a4684313478f7b3237145f685a0d4163eff1ad6e292b2ff5046e955da7a3c1e0c671958f02199199b20cdd2eeb8
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
- 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
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
@@ -1,3 +1,3 @@
1
1
  module RailsSelectOnIncludes
2
- VERSION = "0.4.4"
2
+ VERSION = "0.4.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_select_on_includes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - alekseyl