activerecord-bixformer 0.4.11 → 0.4.12

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: 96dec56c378491be442b81c6b549025c9916a2dc
4
- data.tar.gz: f911bddd732392c24ccc189dc98abfec6e2cf9f3
3
+ metadata.gz: 5a3541585aa33622c218ca37f1f491abdad35b18
4
+ data.tar.gz: 72cf94a236a2159812d76ded6bb1e9dc26db63af
5
5
  SHA512:
6
- metadata.gz: 5da0d260a367121dcdc3e4ba8308b3a12d78f46bead8e76ef87ee0bdfc6bf474cfabaf4d35c390471338cc97f79989d84f9087218b7ca856f78e9cd47c71f39d
7
- data.tar.gz: 91bfbbbe452155019b54c62061c648c996955fff55a9deee37b80a83a1fd77659e1b928cf89f15cfbfb229198100898b33ad067376426dd59e89415c6775554e
6
+ metadata.gz: 32ca63f4725f5f5ddb266c4421461d6f9b31d438cae03c4426bca8f62fd418ef7e57bd9331cc57cd787ab09c3b65eccefad58f5d6b6800e5c0a7de66aa057d49
7
+ data.tar.gz: ab63c757e9d0bb65341684192302853b976dd9158c5899b686666c1f264e59bbea59a3a46b0f7af62c1438e765385ab6bf2742ee212078302043c44007ff6ae3
@@ -84,7 +84,9 @@ module ActiveRecord
84
84
  end
85
85
 
86
86
  def should_be_included
87
- @model.activerecord_constant.reflections.find { |k, r| r.foreign_key == @name }.first
87
+ @model.activerecord_constant.reflections.find do |k, r|
88
+ r.foreign_key == @name && r.class_name.constantize.respond_to?(:table_name)
89
+ end&.first
88
90
  end
89
91
 
90
92
  private
@@ -105,9 +105,9 @@ module ActiveRecord
105
105
  assoc_should_be_included = assoc.should_be_included
106
106
 
107
107
  if assoc_should_be_included.empty?
108
- arr.push assoc.name.to_sym
108
+ arr.push assoc.name
109
109
  else
110
- hash[assoc.name.to_sym] = assoc_should_be_included
110
+ hash[assoc.name] = assoc_should_be_included
111
111
  end
112
112
  end
113
113
 
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord
2
2
  module Bixformer
3
- VERSION = "0.4.11"
3
+ VERSION = "0.4.12"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-bixformer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.11
4
+ version: 0.4.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroaki Otsu