activerecord-bixformer 0.4.6 → 0.4.7
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eed4299b6586e43d9a42327f8ed6b1f84567ca3c
|
4
|
+
data.tar.gz: 55d4d7d1e7bc7e1bdc285141946b65f47c4d27ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b339983f68ab9f1dd111939afbcd57eb0eb7e7521c25cc4c9235ced30fccf38199bd21dbc82b91041cc4e924a6945a495d39be0c4d2721cfd07538f99cee186
|
7
|
+
data.tar.gz: 504b0010f3801df782e930c3643bfafe91aadbc159849e5721cad93df0da3fbecdad139981c944aa7ea75ba5e404cf8a6f408c6a48591628015e2ed6f7bb313c
|
@@ -86,15 +86,9 @@ module ActiveRecord
|
|
86
86
|
private
|
87
87
|
|
88
88
|
def foreign_constant
|
89
|
-
@foreign_constant ||=
|
90
|
-
|
91
|
-
|
92
|
-
if reflection.respond_to?(:class_name)
|
93
|
-
reflection.class_name.constantize
|
94
|
-
else
|
95
|
-
reflection.table_name.classify.constantize
|
96
|
-
end
|
97
|
-
end.call
|
89
|
+
@foreign_constant ||= @model.activerecord_constant
|
90
|
+
.reflections.values.find { |r| r.foreign_key == @name }
|
91
|
+
.class_name.constantize
|
98
92
|
end
|
99
93
|
end
|
100
94
|
end
|
@@ -77,7 +77,7 @@ module ActiveRecord
|
|
77
77
|
def activerecord_constant
|
78
78
|
@activerecord_constant ||=
|
79
79
|
if @parent
|
80
|
-
@parent.activerecord_constant.reflections[@name].
|
80
|
+
@parent.activerecord_constant.reflections[@name].class_name.constantize
|
81
81
|
else
|
82
82
|
@name.camelize.constantize
|
83
83
|
end
|