mumuki-domain 9.13.0 → 9.13.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/application_record.rb +2 -0
- data/app/models/concerns/with_reminders.rb +0 -1
- data/app/models/exam_registration.rb +0 -1
- data/app/models/organization_access_mode/base.rb +8 -0
- data/app/models/organization_access_mode/read_only.rb +8 -0
- data/app/models/user.rb +11 -5
- data/lib/mumuki/domain/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d31db11eea83cf47119ccf9d3e59f9664d58fb855d8d07ba28c8a3a82e21f43
|
4
|
+
data.tar.gz: 58a403f7d731986fdcb6226b388a650c990a3ddbb38543a25a1edf6574389076
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4527364cb58249d910cc3d89452638bf4447a0fb538da1291abbd89df0b0621785d473a5e61d25a35bf2278271506ae1e8ced880ab73bd2a9c2fd232def15d7b
|
7
|
+
data.tar.gz: 21077fb1b6576f433ebce3e9d3b24ad6466498454dee37ece7bfa650625cea3ea3ee12e7796ed4e26f4c96beaa44ec7d7c3bf031f837940fea9637b4a5ec25ec
|
@@ -25,6 +25,14 @@ class OrganizationAccessMode::ReadOnly < OrganizationAccessMode::Base
|
|
25
25
|
(has_scope(:exercises, :submitted) && content.has_progress_for?(user, organization))
|
26
26
|
end
|
27
27
|
|
28
|
+
def restore_indicators?(book)
|
29
|
+
!book.has_progress_for?(user, organization) && user.has_assignments_in_organization?(organization)
|
30
|
+
end
|
31
|
+
|
32
|
+
def read_only?
|
33
|
+
true
|
34
|
+
end
|
35
|
+
|
28
36
|
private
|
29
37
|
|
30
38
|
def has_scope(key, value = :all)
|
data/app/models/user.rb
CHANGED
@@ -54,7 +54,7 @@ class User < ApplicationRecord
|
|
54
54
|
resource_fields :uid, :social_id, :email, :permissions, :verified_first_name, :verified_last_name, *profile_fields
|
55
55
|
with_temporary_token :delete_account_token
|
56
56
|
|
57
|
-
organic_on :notifications
|
57
|
+
organic_on :notifications, :assignments
|
58
58
|
|
59
59
|
def last_lesson
|
60
60
|
last_guide.try(:lesson)
|
@@ -64,10 +64,6 @@ class User < ApplicationRecord
|
|
64
64
|
messages.where('assignments.organization': organization)
|
65
65
|
end
|
66
66
|
|
67
|
-
def notifications_in_organization(organization = Organization.current)
|
68
|
-
notifications.where(organization: organization)
|
69
|
-
end
|
70
|
-
|
71
67
|
def passed_submissions_count_in(organization)
|
72
68
|
assignments.where(top_submission_status: Mumuki::Domain::Status::Submission::Passed.to_i, organization: organization).count
|
73
69
|
end
|
@@ -111,6 +107,16 @@ class User < ApplicationRecord
|
|
111
107
|
end
|
112
108
|
end
|
113
109
|
|
110
|
+
def restore_organization_progress!(organization)
|
111
|
+
assignments_in_organization(organization).each do |assignment|
|
112
|
+
assignment.tap(&:parent).save!
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
def has_assignments_in_organization?(organization)
|
117
|
+
assignments_in_organization(organization).exists?
|
118
|
+
end
|
119
|
+
|
114
120
|
def accept_invitation!(invitation)
|
115
121
|
make_student_of! invitation.course_slug
|
116
122
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mumuki-domain
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 9.13.
|
4
|
+
version: 9.13.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Franco Leonardo Bulgarelli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-08-
|
11
|
+
date: 2021-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|