mumuki-domain 7.12.1 → 7.12.2
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 +8 -0
- data/lib/mumuki/domain/submission/base.rb +1 -5
- data/lib/mumuki/domain/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: c03b11014fe958aaa9ab0e980a40f5f68b3adafd4ccc593bc0fcf04771a68f5b
|
4
|
+
data.tar.gz: d2ac0f573097e57a62e4e13f2d2dc4116ecb8ab5dfca033fd5ac69d0c9afd33a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 998b1c0f0ee18cc59a8173c1d2ebbbeb930e877bddf1fdcb6e3dc3edc31509f63e16f0db48cb506ba35e4e35ac363f9ee625c58f6cd0da95d82461f6dd586102
|
7
|
+
data.tar.gz: da140f00d91f6408e176453bf36b33108c9e73552e8c7ce3666f31d11145cf87bdcd5afc40e3edb8fac066073bb4ff49e0db4e435cfb862f295b2e05836a16ad
|
data/app/models/assignment.rb
CHANGED
@@ -52,6 +52,14 @@ class Assignment < Progress
|
|
52
52
|
self.organization = Organization.current
|
53
53
|
end
|
54
54
|
|
55
|
+
def recontextualize!
|
56
|
+
if organization != Organization.current
|
57
|
+
dirty_parent_by_submission! if organization.present? && exercise.used_in?(organization)
|
58
|
+
self.organization = Organization.current
|
59
|
+
self.parent_id = nil
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
55
63
|
def set_default_top_submission_status
|
56
64
|
self.top_submission_status ||= 0
|
57
65
|
end
|
@@ -53,11 +53,7 @@ class Mumuki::Domain::Submission::Base
|
|
53
53
|
|
54
54
|
def save_submission!(assignment)
|
55
55
|
assignment.content = content
|
56
|
-
|
57
|
-
assignment.dirty_parent_by_submission! if assignment.organization
|
58
|
-
assignment.organization = Organization.current
|
59
|
-
assignment.parent_id = nil
|
60
|
-
end
|
56
|
+
assignment.recontextualize!
|
61
57
|
assignment.save!
|
62
58
|
end
|
63
59
|
|