one_touch 2.1.1 → 2.1.2

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: ce1e9c970fe307783c8cc7e941ed54907e77389f
4
- data.tar.gz: dea7b43a6d018a3dfc74accef7921a57093aadb2
3
+ metadata.gz: 32c8c028728efdec14df4d99b0695a448f003340
4
+ data.tar.gz: b15271d797e355e29e6071a022d42817a307e008
5
5
  SHA512:
6
- metadata.gz: 3fc4641a2881f681b586054b219207b16531849bdfcb15a899d990d84dcbb33f2f5f53e3c0fd50d1e6d4e7e45c5301b6733d3d1275917d5c271bd2c7a3c42ed1
7
- data.tar.gz: edc97ca57f82d8934fea42388001adb9d76add63951b72caaf878f5bb933a7eba344c24d4eaa3a9b2240f3992caa904b2f4b8e00ed157b8052ba6c4aece6f77e
6
+ metadata.gz: 8600fd34c5d5e18b0f962acf0e8051226a99cf6e50616af4ecd84e8bbed0853b2462e3ce9c971107f9fa337b0a4b2c8dbd54770edf2fb69ad41a20eca2158e30
7
+ data.tar.gz: 2d0d772022b744babfab44b07045938dc97764ee3e0205e95ecd7903469d0b626356cc37d12521e9014aac1f762c5996a55042139d48ff6e18109c53d941d804
@@ -68,7 +68,7 @@ module OneTouch
68
68
  if opt[:polymorphic] == true
69
69
  has_many :favors, :class_name => opt[:bridge_klass], :as => :host
70
70
  else
71
- has_many :favors, :class_name => opt[:bridge_klass]
71
+ has_many :favors, :class_name => opt[:bridge_klass], :foreign_key => :host_id
72
72
  end
73
73
  end
74
74
  include AsFavorHost
@@ -83,7 +83,7 @@ module OneTouch
83
83
  if opt[:polymorphic] == true
84
84
  has_many :be_favors, :class_name => opt[:bridge_klass], :as => :favorable
85
85
  else
86
- has_many :be_favors, :class_name => opt[:bridge_klass]
86
+ has_many :be_favors, :class_name => opt[:bridge_klass] # we need add option of foreign key
87
87
  end
88
88
  end
89
89
  include AsFavorable
@@ -1,3 +1,3 @@
1
1
  module OneTouch
2
- VERSION = "2.1.1"
2
+ VERSION = "2.1.2"
3
3
  end
data/readme.md CHANGED
@@ -1,4 +1,6 @@
1
1
  ### Upgrade warnning
2
+ In version > 2.1.1 , as_favor_host can accept option polymorphic, it default as false, so if your Favor model belongs_to host as a polymorphic relation, add as_favor_host polymorphic: true. I will update readme to include it later.
3
+
2
4
  The loading sequence bug in 2.0.0 was fixed in 2.1.0. Please upgrade to 2.1.0 or stay on ~> 1
3
5
 
4
6
  ### Intro
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: one_touch
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - raykin