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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b5cd387b744651b03da4722b106d3c23584a8a610994bf3127fa03cd814e9a64
4
- data.tar.gz: 73ecd3f88a806ec887ec68e76554db2468f1b3b0dd9d459197b366bdbd3575fd
3
+ metadata.gz: c03b11014fe958aaa9ab0e980a40f5f68b3adafd4ccc593bc0fcf04771a68f5b
4
+ data.tar.gz: d2ac0f573097e57a62e4e13f2d2dc4116ecb8ab5dfca033fd5ac69d0c9afd33a
5
5
  SHA512:
6
- metadata.gz: d43c7db4b34a5727005cf7f571d7980075fd27fd394942822759bd9e1800626e6880bd1a2bf3085d7332c443d6bdc9602f000e7ee8f3434099c02411a811d8e4
7
- data.tar.gz: 24fb849fee899e0636448cedc7c03935931a25902edf5144eb952acb2aabe8d051fb6d6ef9b0c684cde9523b633454e6b6c2c0f24b63c5c54e682f14eef55be2
6
+ metadata.gz: 998b1c0f0ee18cc59a8173c1d2ebbbeb930e877bddf1fdcb6e3dc3edc31509f63e16f0db48cb506ba35e4e35ac363f9ee625c58f6cd0da95d82461f6dd586102
7
+ data.tar.gz: da140f00d91f6408e176453bf36b33108c9e73552e8c7ce3666f31d11145cf87bdcd5afc40e3edb8fac066073bb4ff49e0db4e435cfb862f295b2e05836a16ad
@@ -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
- 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
56
+ assignment.recontextualize!
61
57
  assignment.save!
62
58
  end
63
59
 
@@ -1,5 +1,5 @@
1
1
  module Mumuki
2
2
  module Domain
3
- VERSION = '7.12.1'
3
+ VERSION = '7.12.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumuki-domain
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.12.1
4
+ version: 7.12.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Leonardo Bulgarelli