insights_export 0.2.0 → 0.2.1

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: 246b8d0d36e3a7edcfcefd0eee4905267b413bdf
4
- data.tar.gz: 5130abb2f2042dfa39b67fd10183fd673ddce823
3
+ metadata.gz: 361e4d874de27627948c5a1f93e4c33cb849a277
4
+ data.tar.gz: 0bc4adb9a0092de2972417d4e24b70a44a219fe1
5
5
  SHA512:
6
- metadata.gz: f6317ec7dbd143bf3739a5d4757dd8470e8f93b09ae630d05b313c35545d36a45561fb99580f578596fca0f8a7e6d9906208ba3e23fa2e1e85e2132740e96229
7
- data.tar.gz: b8174fbec18cb8090db116908fe8cab72e94ffbc8a0be8ff51e8701569f17e02f452b22c1dfa32335bfd31cc02b6da461e0fffd827f8cde4c916fb7aef54616c
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
- next unless model_strings.include?(reflection.class_name)
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
- # reflection.class_name # User
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: reflection.class_name,
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: reflection.class_name,
141
+ model: reflection_class,
140
142
  model_key: reflection.foreign_key,
141
143
  my_key: reflection.association_primary_key
142
144
  }
@@ -1,3 +1,3 @@
1
1
  module InsightsExport
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: insights_export
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marius Andra