lato_spaces 3.1.8 → 3.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/concerns/lato_spaces/associable.rb +1 -8
- data/lib/lato_spaces/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 138e35921ac438d9b8fc8fe960bd405f306df59af2ff49fe92890178f29da04d
|
4
|
+
data.tar.gz: 854e74f7a0b3ed0de3f43396391ce980d738b29a492c2b4812ae3f2c53975eed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c6143b36e197207cfb694285966b12ddc6438bee8303f85cdebba9078d103812e8b32af262ae4697bb5e166bb5871aaaaa0b654ee4785126a25d79dc2de0d61
|
7
|
+
data.tar.gz: 06e84a844a8458658cc1bced1a5a0d7843b08cbb83dcf72f08633742a678946fefb1f03eabdc47bd9c66f5c325bffc293fede034cd5c352d8d30bf93c40ebdb1
|
@@ -5,7 +5,7 @@ module LatoSpaces::Associable
|
|
5
5
|
# Relations
|
6
6
|
##
|
7
7
|
|
8
|
-
has_many :lato_spaces_associations, class_name: 'LatoSpaces::Association', as: :item, dependent: :
|
8
|
+
has_many :lato_spaces_associations, class_name: 'LatoSpaces::Association', as: :item, dependent: :delete # HACK: delete instead of destroy to avoid infinite loop caused by AssociableRequired concern
|
9
9
|
has_many :lato_spaces_groups, through: :lato_spaces_associations, class_name: 'LatoSpaces::Group'
|
10
10
|
|
11
11
|
# Scopes
|
@@ -14,13 +14,6 @@ module LatoSpaces::Associable
|
|
14
14
|
scope :for_lato_spaces_group, -> (group_id) { joins(:lato_spaces_groups).where(lato_spaces_groups: { id: group_id }) }
|
15
15
|
scope :with_lato_spaces_groups, -> { joins(:lato_spaces_groups) }
|
16
16
|
scope :without_lato_spaces_groups, -> { left_outer_joins(:lato_spaces_groups).where(lato_spaces_groups: { id: nil }) }
|
17
|
-
|
18
|
-
# Hooks
|
19
|
-
##
|
20
|
-
|
21
|
-
after_destroy do
|
22
|
-
lato_spaces_associations.map(&:delete) # HACK: delete instead of destroy to avoid infinite loop caused by AssociableRequired concern
|
23
|
-
end
|
24
17
|
end
|
25
18
|
|
26
19
|
# Helpers
|
data/lib/lato_spaces/version.rb
CHANGED