mumuki-domain 7.9.1 → 7.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad60eb8f13c6f52972aa84b4ebf50135ba135516b1585bc62f40207f07996adc
4
- data.tar.gz: 10dc84895d41a0ee5f78e43ed9a8aa6d4acaade45241d43de3228dee2050eb1f
3
+ metadata.gz: 0ebe5d37552a117a8d4ee657170a55eefdea340126a6b44f4a31b670420029b4
4
+ data.tar.gz: 8efe4d2b2e478ee887d7c346031e2b0fc87ea3c243991e6cd8d42909c1b361aa
5
5
  SHA512:
6
- metadata.gz: 2457634d76eb4c1023af5c05915a7150aa9425ce77b03b10f073872fc3e9db6edfa071c7937b74bbb315db4f105c3a8006bd2085ed7fce0020811deab750a450
7
- data.tar.gz: 221ec0189f3dfa9d62df6beb258a046e2f327d90133109ef88c8e937e383f7473fa2dc5c54f65d5c81448a180a2450e172270b096bc0729fbbacc3233484096d
6
+ metadata.gz: ac6768c2f693a49e9d9d63e4c5c55100d98705edd6e4141b49c69c63078a7a72d7b843be81f289f1ea1770abc464bfa365f4895efa79e7caae2504abadac0db8
7
+ data.tar.gz: 12b89e6ebf0e13bcdb0634eb18abfb96bb816296a482503fe504ad54860993a87b93337593fb9e77a7437907dc88ae1d30916dc104e3d8f4f250ab8272fbef7a
@@ -42,6 +42,7 @@ class Assignment < Progress
42
42
  alias_method :parent_content, :guide
43
43
  alias_method :user, :submitter
44
44
 
45
+ after_initialize :set_default_top_submission_status
45
46
  before_save :award_experience_points!, :update_top_submission!, if: :submission_status_changed?
46
47
  after_save :dirty_parent_by_submission!, if: :completion_changed?
47
48
  before_validation :set_current_organization!, unless: :organization
@@ -51,6 +52,10 @@ class Assignment < Progress
51
52
  self.organization = Organization.current
52
53
  end
53
54
 
55
+ def set_default_top_submission_status
56
+ self.top_submission_status ||= 0
57
+ end
58
+
54
59
  def completion_changed?
55
60
  completed_before_last_save? != completed?
56
61
  end
@@ -1,5 +1,5 @@
1
1
  class AddTopSubmissionStatusToAssignments < ActiveRecord::Migration[5.1]
2
2
  def change
3
- add_column :assignments, :top_submission_status, :integer, default: 0
3
+ add_column :assignments, :top_submission_status, :integer
4
4
  end
5
5
  end
@@ -32,11 +32,11 @@ class Mumuki::Domain::Organization::Settings < Mumukit::Platform::Model
32
32
  end
33
33
 
34
34
  def disabled_from=(disabled_from)
35
- @disabled_from = disabled_from.to_time
35
+ @disabled_from = disabled_from&.to_time
36
36
  end
37
37
 
38
38
  def in_preparation_until=(in_preparation_until)
39
- @in_preparation_until = in_preparation_until.to_time
39
+ @in_preparation_until = in_preparation_until&.to_time
40
40
  end
41
41
 
42
42
  def disabled?
@@ -1,5 +1,5 @@
1
1
  module Mumuki
2
2
  module Domain
3
- VERSION = '7.9.1'
3
+ VERSION = '7.9.2'
4
4
  end
5
5
  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: 7.9.1
4
+ version: 7.9.2
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-09-15 00:00:00.000000000 Z
11
+ date: 2020-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails