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 +4 -4
- data/lib/genealogy/genealogy.rb +4 -1
- data/lib/genealogy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6a3789413a0f15b45dca9101f416f34b7b4b47c2e68c236fd83c1d3a8305077
|
4
|
+
data.tar.gz: 2be53f13d7e489235efb232865fa664124b0e37ac3f3a943cee2397b8a1153c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23c8bec528f25388264d9ec506c04473e3d4970d34298ce0b5a03d9620f9c2373574acadb337543444d7166d96d1428ada1adef560b05ad6df2ff76fe451d5e3
|
7
|
+
data.tar.gz: 4cc61c08bb91e6e58e3aafc3e25a57d765a955936e50d86d081582411bc46d26644800a48fc57f6deda18597fcddcf5703909a89f6ebc703b684ca743b266868
|
data/lib/genealogy/genealogy.rb
CHANGED
@@ -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,
|
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
|
data/lib/genealogy/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2018-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|