lato_spaces 3.1.3 → 3.1.4

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: 83d1d5a40a62a72578b2dae9e6c0147c0c85a1b937c187ab38cdbfbac706a6bd
4
- data.tar.gz: 61c10fa403fdeec163fdb834a877724a7ad0e8f3f0a62099a68e9c2d8338a8e9
3
+ metadata.gz: fe232e4b134fb01afbad6d9220fb77dce9141717b95cad6b9fb22699f5022f91
4
+ data.tar.gz: 3c8878cca97ac1bfe8ab2b122a899b03d163b308ccb1e3f45f4ac3fce6d11c44
5
5
  SHA512:
6
- metadata.gz: 3310aa62fbb20968b3b0506d9637c226765ddb188c1bcd441010ad4cd0eac2b4dfd3c5eeb5f97d9583c224b723f59dea423f69784d8337e5f5f7f79a3239e468
7
- data.tar.gz: 1865a648a751ed6dce943f63716326552d4c86c4b7a5836c18bc9878978f82ef2ce1ec49b58a515bae3e4e88fe300afaf18f42bd0c9dc9e955d9f9f30efa313b
6
+ metadata.gz: db3a73c4672d9bb625a1c38596645c73d9d7683d906b0a58c397df04caa734fcb1cb1cac6dd30236ecee0635c09d06089a620eeccc350b5f3c1e273d2ed6973f
7
+ data.tar.gz: 8e65409a32a0cade03aefa2e2eebec8957f65f59dab8f508778a3de061f6e7192f4c7d7c4721a6a2f5a52f24d76735a1ccb804699ff7346cf16951c7c68d3f1b
@@ -21,10 +21,7 @@ module LatoSpaces::AssociableRequired
21
21
 
22
22
  # listen LatoSpaces::Association destroy event to destroy item
23
23
  LatoSpaces::Association.after_destroy do |association|
24
- if lato_spaces_associations.find_by_id association.id
25
- self.destroy!
26
- end
24
+ association.item&.destroy!
27
25
  end
28
26
  end
29
27
  end
30
-
@@ -7,7 +7,7 @@ module LatoSpaces::AssociableUnique
7
7
 
8
8
  # listen LatoSpaces::Association create event to avoid duplicate associations
9
9
  LatoSpaces::Association.before_create do |association|
10
- if association.item_type == self.class.name && association.item_id == id && lato_spaces_associations.count.positive?
10
+ if association.item&.lato_spaces_associations&.length&.positive?
11
11
  throw(:abort)
12
12
  end
13
13
  end
@@ -1,3 +1,3 @@
1
1
  module LatoSpaces
2
- VERSION = "3.1.3"
2
+ VERSION = "3.1.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lato_spaces
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.3
4
+ version: 3.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregorio Galante