genealogy 2.2.0 → 2.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
  SHA256:
3
- metadata.gz: 0b07b270d80c0d915e01f45424b27989f04b920a79bb4cd973484589d47530a6
4
- data.tar.gz: 40753227d2d9e72a7779aa6fa28365f2a37e6e5121df1b0a821d71a835850de7
3
+ metadata.gz: c6a3789413a0f15b45dca9101f416f34b7b4b47c2e68c236fd83c1d3a8305077
4
+ data.tar.gz: 2be53f13d7e489235efb232865fa664124b0e37ac3f3a943cee2397b8a1153c1
5
5
  SHA512:
6
- metadata.gz: 67a933f6335a5a8d95dffa4284e8a198062a09cca098888e6d785608a22fbf463164322232376e1c83d7f1ea0362254ebbfac4e7e36bc8c500bb97510eb06b21
7
- data.tar.gz: edb60383749cd28a0458252102e994b676796025a1fb55e716cc16a23f20810f23c3c9801163a4e93c06bbae45078cd41d71be40cbdd3808ddf4d8e1145b7845
6
+ metadata.gz: 23c8bec528f25388264d9ec506c04473e3d4970d34298ce0b5a03d9620f9c2373574acadb337543444d7166d96d1428ada1adef560b05ad6df2ff76fe451d5e3
7
+ data.tar.gz: 4cc61c08bb91e6e58e3aafc3e25a57d765a955936e50d86d081582411bc46d26644800a48fc57f6deda18597fcddcf5703909a89f6ebc703b684ca743b266868
@@ -89,8 +89,11 @@ module Genealogy
89
89
 
90
90
  tracked_relatives = [:father, :mother]
91
91
  tracked_relatives << :current_spouse if current_spouse_enabled
92
+
93
+ belongs_to_options = {class_name: self.name}
94
+ belongs_to_options[:optional] = true if Gem::Specification.find_by_name('activerecord').version >= Gem::Version.new("5")
92
95
  tracked_relatives.each do |k|
93
- belongs_to k, class_name: self.name, foreign_key: self.send("#{k}_id_column")
96
+ belongs_to k, belongs_to_options.merge(foreign_key: self.send("#{k}_id_column"))
94
97
  end
95
98
 
96
99
  has_many :children_as_father, class_name: self.name, foreign_key: self.father_id_column, dependent: :nullify
@@ -1,3 +1,3 @@
1
1
  module Genealogy
2
- VERSION = "2.2.0"
2
+ VERSION = "2.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: genealogy
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - masciugo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-18 00:00:00.000000000 Z
11
+ date: 2018-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord