insights_export 0.2.0 → 0.2.1
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/insights_export/export_models.rb +6 -4
- data/lib/insights_export/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: 361e4d874de27627948c5a1f93e4c33cb849a277
|
4
|
+
data.tar.gz: 0bc4adb9a0092de2972417d4e24b70a44a219fe1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0651f79bee2317848cd3645475512e020f0a19ebf013d677689bc3e40f7e2721a08e37c2477b6afc7dfd395015f899d8d1e5e6c9af6719e14d068b4cde506b1
|
7
|
+
data.tar.gz: b2ccc5c8b845b0a62f54310996a8a95478da5548c81930e34bcd1af181501a9e0db97456915e32142dc4e0f3e8b51816064c2484572152d2d6ed67d9deb62d5b
|
@@ -116,16 +116,18 @@ module InsightsExport
|
|
116
116
|
}
|
117
117
|
|
118
118
|
model.reflections.each do |association_name, reflection|
|
119
|
-
|
119
|
+
reflection_class = reflection.class_name.gsub(/^::/, '')
|
120
|
+
|
121
|
+
next unless model_strings.include?(reflection_class)
|
120
122
|
|
121
123
|
if reflection.macro == :belongs_to
|
122
|
-
#
|
124
|
+
# reflection_class # User
|
123
125
|
# reflection.foreign_key # user_id
|
124
126
|
# reflection.association_primary_key # id
|
125
127
|
|
126
128
|
model_structure[:columns].delete(reflection.foreign_key.to_sym)
|
127
129
|
model_structure[:links][:outgoing][association_name] = {
|
128
|
-
model:
|
130
|
+
model: reflection_class,
|
129
131
|
model_key: reflection.association_primary_key,
|
130
132
|
my_key: reflection.foreign_key
|
131
133
|
}
|
@@ -136,7 +138,7 @@ module InsightsExport
|
|
136
138
|
end
|
137
139
|
|
138
140
|
model_structure[:links][:incoming][association_name] = {
|
139
|
-
model:
|
141
|
+
model: reflection_class,
|
140
142
|
model_key: reflection.foreign_key,
|
141
143
|
my_key: reflection.association_primary_key
|
142
144
|
}
|