has_siblings 0.1.5 → 0.1.6

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
  SHA1:
3
- metadata.gz: 9f9a89302f89bb8250b6244b893be2f0778db9fe
4
- data.tar.gz: 8b0f86c625db09473ab791ed9d684165da592686
3
+ metadata.gz: 225b2668f88cde5bcb19f84fdb8e39e3d0638bf9
4
+ data.tar.gz: 5c3e1ee5c93536affd5e803ad55b26dc0eb080cd
5
5
  SHA512:
6
- metadata.gz: 98caa42fb0fa17325fa3ba68fea9423a5ed8345db64c123bcc0f41372cd3eee0b8300f384b1a742b8e8b0fa3561299b0d752251bf14d5ecda9c582af1cf652e5
7
- data.tar.gz: a584ddf70c1b38769faecff09ecd9939263ad6972cc81eb3fe32847d2af29fc279ff02971845409a66207329e2bfa5d03bd26be91e5e59982f2eb7123208253c
6
+ metadata.gz: 8ca3a08dd3c86bd0215f65e32a43b4ae58ac0c8f387256037d2444ce448179c23f1a41706246bba38fa4c9fb2413ca2da3fbd9a91823e72ab4f017d6ef95237f
7
+ data.tar.gz: 8cad965dc87162c9dc77e6d753a9585d9ff8250061df889073ed7ad5660aeb1b13b796e240864cc820622a3cdac9b40dbef3e715da77ccd24ee369ad29037a7b
@@ -26,6 +26,7 @@ module HasSiblings
26
26
 
27
27
  mixin.class_eval <<-CODE, __FILE__, __LINE__ + 1
28
28
  def #{name}
29
+ return [] if [#{parents.join(",")}].any?(&:nil?)
29
30
  #{([first_parent_association] + merge_scopes).join(".")}.where.not(id: id)
30
31
  end
31
32
  CODE
@@ -1,3 +1,3 @@
1
1
  module HasSiblings
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: has_siblings
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Octavian Neamtu