lato_spaces 3.1.0 → 3.1.2
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4bd598447fb55743b4cd8b2ac7ab0cea245cfe4dc20d80136f28dd5593e12d07
|
4
|
+
data.tar.gz: f0cb1927530c842a05926add45b95cbe0242b3dd1c27b37f4b6be4319f243475
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc181e79db41bab5c947d48a3729c0159127884a39a16c052519e2520fb563d9d758049eeb45c1dcfc57b5b643d5f1d91d0d80182fa1a2448421559a0129f038
|
7
|
+
data.tar.gz: a203322fd20e2f97fe7af0b504c2fe5a4b1fa133d602d16deee36e5f7e111f56ecc82931c491ea7f848cb759385f9a705d4bc155c84a32b82f7798c56d6574d4
|
@@ -16,7 +16,7 @@ module LatoSpaces::Associable
|
|
16
16
|
scope :without_lato_spaces_groups, -> { left_outer_joins(:lato_spaces_groups).where(lato_spaces_groups: { id: nil }) }
|
17
17
|
end
|
18
18
|
|
19
|
-
def
|
19
|
+
def add_to_lato_spaces_group(group_id)
|
20
20
|
association = lato_spaces_associations.create(lato_spaces_group_id: group_id)
|
21
21
|
unless association.valid?
|
22
22
|
errors.add(:base, association.errors.full_messages.join(', '))
|
@@ -26,7 +26,7 @@ module LatoSpaces::Associable
|
|
26
26
|
true
|
27
27
|
end
|
28
28
|
|
29
|
-
def
|
29
|
+
def remove_from_lato_spaces_group(group_id)
|
30
30
|
association = lato_spaces_associations.find_by(lato_spaces_group_id: group_id)
|
31
31
|
return true unless association
|
32
32
|
|
@@ -38,9 +38,9 @@ module LatoSpaces::Associable
|
|
38
38
|
true
|
39
39
|
end
|
40
40
|
|
41
|
-
def
|
41
|
+
def switch_lato_spaces_group(group_id)
|
42
42
|
association = lato_spaces_associations.first
|
43
|
-
return
|
43
|
+
return add_to_lato_spaces_group(group_id) unless association
|
44
44
|
|
45
45
|
unless association.update(lato_spaces_group_id: group_id)
|
46
46
|
errors.add(:base, association.errors.full_messages.join(', '))
|
@@ -48,5 +48,9 @@ module LatoSpaces::Associable
|
|
48
48
|
end
|
49
49
|
|
50
50
|
true
|
51
|
-
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def lato_spaces_group
|
54
|
+
lato_spaces_groups.first
|
55
|
+
end
|
52
56
|
end
|
@@ -4,4 +4,15 @@ group ||= LatoSpaces::Group.new
|
|
4
4
|
|
5
5
|
%>
|
6
6
|
|
7
|
-
|
7
|
+
<table class="table">
|
8
|
+
<tbody>
|
9
|
+
<tr>
|
10
|
+
<th>Total members</th>
|
11
|
+
<td><%= group.lato_spaces_memberships.count %></td>
|
12
|
+
</tr>
|
13
|
+
<tr>
|
14
|
+
<th>Total items</th>
|
15
|
+
<td><%= group.lato_spaces_associations.count %></td>
|
16
|
+
</tr>
|
17
|
+
</tbody>
|
18
|
+
</table>
|
data/lib/lato_spaces/version.rb
CHANGED
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.
|
4
|
+
version: 3.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregorio Galante
|
@@ -91,6 +91,7 @@ licenses:
|
|
91
91
|
- MIT
|
92
92
|
metadata:
|
93
93
|
homepage_uri: https://mysite.com
|
94
|
+
source_code_uri: https://github.com/Lato-GAM/lato_spaces
|
94
95
|
post_install_message:
|
95
96
|
rdoc_options: []
|
96
97
|
require_paths:
|