genealogy 2.2.2 → 2.4.0
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 +4 -4
- data/lib/genealogy/alter_methods.rb +34 -0
- data/lib/genealogy/query_methods.rb +3 -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: cdc120f7f9e2dcf06406a5ff6c0f9ff3e141479c30f7f25e6882003de83b6ba7
|
|
4
|
+
data.tar.gz: a7d8e6e2842288b654795134416882dcb9f84efea646d6808b24eef3638662f3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: aa770c140025e6f4a990302dcb804eed27de2c3aae987d83aefbb6c5fa7c51d4f4380f18c9194cce4a33d93c7432fc92d8d297dd38e8cc31db99a0d862ac0412
|
|
7
|
+
data.tar.gz: b40dbcdc590f93623e1836cd2de2aa0caa3f8ad0bc383e1a5c24f0023af75f20b6ff18d69f3f278bffc96f9d54a2a08fc79c77a403515f100084937b92a2ab7c
|
|
@@ -203,6 +203,22 @@ module Genealogy
|
|
|
203
203
|
add_siblings(sibling,options)
|
|
204
204
|
end
|
|
205
205
|
|
|
206
|
+
# @see #add_siblings
|
|
207
|
+
def add_paternal_half_siblings(*args)
|
|
208
|
+
options = args.extract_options!
|
|
209
|
+
options[:half] = :father
|
|
210
|
+
add_siblings(*args,options)
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
# @see #add_siblings
|
|
214
|
+
def add_maternal_half_siblings(*args)
|
|
215
|
+
options = args.extract_options!
|
|
216
|
+
options[:half] = :mother
|
|
217
|
+
add_siblings(*args,options)
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
alias :add_paternal_half_sibling :add_paternal_half_siblings
|
|
221
|
+
alias :add_maternal_half_sibling :add_maternal_half_siblings
|
|
206
222
|
|
|
207
223
|
# remove siblings by nullifying parents of passed individuals
|
|
208
224
|
# @overload remove_siblings(*siblings,options={})
|
|
@@ -241,6 +257,24 @@ module Genealogy
|
|
|
241
257
|
remove_siblings(sib,options)
|
|
242
258
|
end
|
|
243
259
|
|
|
260
|
+
# @see #remove_siblings
|
|
261
|
+
def remove_paternal_half_siblings(*args)
|
|
262
|
+
options = args.extract_options!
|
|
263
|
+
options[:half] = :father
|
|
264
|
+
remove_siblings(*args,options)
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
# @see #remove_siblings
|
|
268
|
+
def remove_maternal_half_siblings(*args)
|
|
269
|
+
options = args.extract_options!
|
|
270
|
+
options[:half] = :mother
|
|
271
|
+
remove_siblings(*args,options)
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
alias :remove_paternal_half_sibling :remove_paternal_half_siblings
|
|
275
|
+
alias :remove_maternal_half_sibling :remove_maternal_half_siblings
|
|
276
|
+
|
|
277
|
+
|
|
244
278
|
# add children by assigning self as parent
|
|
245
279
|
# @overload add_children(*children,options={})
|
|
246
280
|
# @param [Object] children list of children
|
|
@@ -284,12 +284,14 @@ module Genealogy
|
|
|
284
284
|
[]
|
|
285
285
|
when :include
|
|
286
286
|
[:half_siblings]
|
|
287
|
+
when :include_separately
|
|
288
|
+
[:paternal_half_siblings, :maternal_half_siblings]
|
|
287
289
|
when :father
|
|
288
290
|
[:paternal_half_siblings]
|
|
289
291
|
when :mother
|
|
290
292
|
[:maternal_half_siblings]
|
|
291
293
|
else
|
|
292
|
-
raise ArgumentError, "Admitted values for :half options are: :father, :mother, :include, nil"
|
|
294
|
+
raise ArgumentError, "Admitted values for :half options are: :father, :mother, :include, :include_separately, nil"
|
|
293
295
|
end
|
|
294
296
|
roles += [:paternal_grandfather, :paternal_grandmother, :maternal_grandfather, :maternal_grandmother, :grandchildren, :uncles_and_aunts, :nieces_and_nephews, :cousins] if options[:extended] == true
|
|
295
297
|
roles.inject({}){|res,role| res.merge!({role => self.send(role)})}
|
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.
|
|
4
|
+
version: 2.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- masciugo
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-
|
|
11
|
+
date: 2018-07-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activerecord
|