mumuki-domain 7.12.0 → 7.12.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/assignment.rb +4 -0
- data/app/models/concerns/with_terms_acceptance.rb +8 -0
- data/app/models/guide.rb +4 -1
- data/app/models/topic.rb +4 -1
- data/lib/mumuki/domain/incognito.rb +5 -6
- data/lib/mumuki/domain/submission/base.rb +5 -1
- 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: b5cd387b744651b03da4722b106d3c23584a8a610994bf3127fa03cd814e9a64
|
4
|
+
data.tar.gz: 73ecd3f88a806ec887ec68e76554db2468f1b3b0dd9d459197b366bdbd3575fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d43c7db4b34a5727005cf7f571d7980075fd27fd394942822759bd9e1800626e6880bd1a2bf3085d7332c443d6bdc9602f000e7ee8f3434099c02411a811d8e4
|
7
|
+
data.tar.gz: 24fb849fee899e0636448cedc7c03935931a25902edf5144eb952acb2aabe8d051fb6d6ef9b0c684cde9523b633454e6b6c2c0f24b63c5c54e682f14eef55be2
|
data/app/models/assignment.rb
CHANGED
@@ -7,6 +7,14 @@ module WithTermsAcceptance
|
|
7
7
|
!has_accepted_all?(profile_terms)
|
8
8
|
end
|
9
9
|
|
10
|
+
def has_role_terms_to_accept?
|
11
|
+
!has_accepted_all?(role_specific_terms)
|
12
|
+
end
|
13
|
+
|
14
|
+
def role_specific_terms
|
15
|
+
@role_specific_terms ||= Term.role_specific_terms_for(self)
|
16
|
+
end
|
17
|
+
|
10
18
|
def forum_terms
|
11
19
|
@forum_terms ||= Term.forum_related_terms
|
12
20
|
end
|
data/app/models/guide.rb
CHANGED
@@ -51,7 +51,10 @@ class Guide < Content
|
|
51
51
|
joins("left join public.assignments assignments
|
52
52
|
on assignments.exercise_id = exercises.id
|
53
53
|
and assignments.submitter_id = #{user.id}
|
54
|
-
and assignments.submission_status
|
54
|
+
and assignments.submission_status in (
|
55
|
+
#{Mumuki::Domain::Status::Submission::Passed.to_i},
|
56
|
+
#{Mumuki::Domain::Status::Submission::ManualEvaluationPending.to_i}
|
57
|
+
)").
|
55
58
|
where('assignments.id is null')
|
56
59
|
end
|
57
60
|
|
data/app/models/topic.rb
CHANGED
@@ -48,7 +48,10 @@ class Topic < Content
|
|
48
48
|
joins("left join public.assignments assignments
|
49
49
|
on assignments.exercise_id = exercises.id
|
50
50
|
and assignments.submitter_id = #{user.id}
|
51
|
-
and assignments.submission_status
|
51
|
+
and assignments.submission_status in (
|
52
|
+
#{Mumuki::Domain::Status::Submission::Passed.to_i},
|
53
|
+
#{Mumuki::Domain::Status::Submission::ManualEvaluationPending.to_i}
|
54
|
+
)").
|
52
55
|
where('assignments.id is null').
|
53
56
|
group('public.guides.id', 'lessons.number').map(&:lesson)
|
54
57
|
end
|
@@ -64,14 +64,13 @@ module Mumuki::Domain
|
|
64
64
|
# Terms
|
65
65
|
# ========
|
66
66
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
def accepted_forum_terms?
|
72
|
-
true
|
67
|
+
# It avoids role terms acceptance redirections
|
68
|
+
def has_role_terms_to_accept?
|
69
|
+
false
|
73
70
|
end
|
74
71
|
|
72
|
+
# It makes terms UI to be shown as if no terms were accepted
|
73
|
+
# It does not force any term to be accepted though
|
75
74
|
def has_accepted?(term)
|
76
75
|
false
|
77
76
|
end
|
@@ -53,7 +53,11 @@ class Mumuki::Domain::Submission::Base
|
|
53
53
|
|
54
54
|
def save_submission!(assignment)
|
55
55
|
assignment.content = content
|
56
|
-
assignment.organization
|
56
|
+
if assignment.organization != Organization.current
|
57
|
+
assignment.dirty_parent_by_submission! if assignment.organization
|
58
|
+
assignment.organization = Organization.current
|
59
|
+
assignment.parent_id = nil
|
60
|
+
end
|
57
61
|
assignment.save!
|
58
62
|
end
|
59
63
|
|
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: 7.12.
|
4
|
+
version: 7.12.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: 2020-11-
|
11
|
+
date: 2020-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|