lato_spaces 3.1.1 → 3.1.2

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: 49875855af24abd63cb03fc202475285810e55925a1593d4aa86955ebda7c470
4
- data.tar.gz: 11aa1714e929224eccb7e5410b569bb15a3e0005e3ae48aeae0862135da1a0cf
3
+ metadata.gz: 4bd598447fb55743b4cd8b2ac7ab0cea245cfe4dc20d80136f28dd5593e12d07
4
+ data.tar.gz: f0cb1927530c842a05926add45b95cbe0242b3dd1c27b37f4b6be4319f243475
5
5
  SHA512:
6
- metadata.gz: 8dcfc6cfaebbcd134c033028231aaf3ba6875b47fdfc7c8e36933d126a74f3d8a4076a42df37c36fcc258f3afd87223f1d9932baf0903d79b3bd93dd5cd40ee3
7
- data.tar.gz: e25afcada006f73cba923474de215421bb97f8b44c464312cd4605abb2e84b2ad95e250cc2ab5017bd403d6a011f3f2034ed273ea8e657ff9598d589f51a11d4
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 add_to_group(group_id)
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 remove_from_group(group_id)
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 switch_group(group_id)
41
+ def switch_lato_spaces_group(group_id)
42
42
  association = lato_spaces_associations.first
43
- return add_to_group(group_id) unless association
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
- <%= group.id %>
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>
@@ -1,3 +1,3 @@
1
1
  module LatoSpaces
2
- VERSION = "3.1.1"
2
+ VERSION = "3.1.2"
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.1
4
+ version: 3.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregorio Galante