passive_record 0.4.13 → 0.4.14
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cacd9ce096b75a0cb189db566c1b506263462bcd
|
|
4
|
+
data.tar.gz: 6d05d9c4520b4f8a7365ff587ee72e49fcb93f37
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 56634dcfa1edfa95df038ace1d9ea482b95a3d4766961dd802955cbd35f37311a3b97d2d97f93fc255fdafd248ce7dbae7fa867de964f4a6f2dfa950fd24331f
|
|
7
|
+
data.tar.gz: 7aa8cec6e8442a4e9c7eb7a2cf1a72acd686028577b9604ef9ee373977a7deda2d8c3673fb6a9303eaaea713f0eae3289d18f06761afabd34d6cdbaf5bea6ba2
|
|
@@ -90,7 +90,6 @@ module PassiveRecord
|
|
|
90
90
|
through_class_collection_name = opts.delete(:through)
|
|
91
91
|
|
|
92
92
|
through_class_name = (through_class_collection_name.to_s).split('_').map(&:capitalize).join.singularize
|
|
93
|
-
# binding.pry if through_class_collection_name == :blogs
|
|
94
93
|
base_association = associations.detect { |assn| assn.child_class_name == through_class_name rescue false }
|
|
95
94
|
|
|
96
95
|
association = HasManyThroughAssociation.new(
|
|
@@ -31,7 +31,6 @@ module PassiveRecord
|
|
|
31
31
|
)
|
|
32
32
|
end
|
|
33
33
|
else
|
|
34
|
-
# binding.pry
|
|
35
34
|
intermediary_model = intermediary_relation.
|
|
36
35
|
where(
|
|
37
36
|
association.target_name_symbol.to_s.singularize + "_id" => child.id).
|
|
@@ -80,7 +79,6 @@ module PassiveRecord
|
|
|
80
79
|
end
|
|
81
80
|
|
|
82
81
|
def intermediary_relation
|
|
83
|
-
# binding.pry
|
|
84
82
|
@intermediary_relation ||= association.base_association.to_relation(parent_model)
|
|
85
83
|
end
|
|
86
84
|
|
|
@@ -133,13 +131,10 @@ module PassiveRecord
|
|
|
133
131
|
|
|
134
132
|
until !n.is_a?(HasManyThroughAssociation)
|
|
135
133
|
key = n.through_class.to_s.singularize.to_sym
|
|
136
|
-
p [ :n_class, n.class, key ]
|
|
137
134
|
hash = {key => hash}
|
|
138
135
|
n = n.nested_association
|
|
139
136
|
end
|
|
140
137
|
|
|
141
|
-
# binding.pry
|
|
142
|
-
|
|
143
138
|
hash
|
|
144
139
|
else
|
|
145
140
|
nested_conds
|
|
@@ -149,7 +144,6 @@ module PassiveRecord
|
|
|
149
144
|
|
|
150
145
|
def where(conditions={})
|
|
151
146
|
merged_conditions = conditions.merge(intermediary_conditions)
|
|
152
|
-
# binding.pry
|
|
153
147
|
child_class.where(merged_conditions)
|
|
154
148
|
end
|
|
155
149
|
end
|