mumuki-domain 7.12.2 → 8.0.0
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 +3 -4
- data/app/models/exam.rb +1 -3
- data/app/models/user.rb +18 -3
- data/lib/mumuki/domain/factories/term_factory.rb +1 -1
- data/lib/mumuki/domain/helpers/organization.rb +1 -1
- data/lib/mumuki/domain/helpers/user.rb +1 -0
- data/lib/mumuki/domain/organization/profile.rb +1 -1
- data/lib/mumuki/domain/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e3057a4511ba66a280fe3f5bf53052a33161ecd9a45dfb6851d2dc21ea7ad20
|
4
|
+
data.tar.gz: bb89fde6326417de9590369040b1d61a13ec35ea1abe8d365c0d21aa66777315
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 586446caac1b0eeecf18d5754e1fb1120e1d0f5a87a4d386152f64af9d6f0b5f18b089676cc994c7f717baa3382b120d7ea71e011263e8761ad5b830dbfefb02
|
7
|
+
data.tar.gz: 77d0ddcfaea1ffaae2d22e5cb7e9b30e08b3d6ef4d303fad9df0062294353dab7834f35fd8fdf339fa770cc233c293f6bf6173442262f11e98eef2521bf3d952
|
@@ -70,9 +70,8 @@ class ApplicationRecord < ActiveRecord::Base
|
|
70
70
|
end
|
71
71
|
|
72
72
|
def update_and_notify!(data)
|
73
|
-
|
74
|
-
|
75
|
-
self
|
73
|
+
assign_attributes data
|
74
|
+
save_and_notify!
|
76
75
|
end
|
77
76
|
|
78
77
|
def self.aggregate_of(association)
|
@@ -105,7 +104,7 @@ class ApplicationRecord < ActiveRecord::Base
|
|
105
104
|
obj
|
106
105
|
end
|
107
106
|
|
108
|
-
def self.whitelist_attributes(a_hash, options={})
|
107
|
+
def self.whitelist_attributes(a_hash, options = {})
|
109
108
|
attributes = attribute_names
|
110
109
|
attributes += reflections.keys if options[:relations]
|
111
110
|
a_hash.with_indifferent_access.slice(*attributes).except(*options[:except])
|
data/app/models/exam.rb
CHANGED
@@ -5,7 +5,7 @@ class Exam < ApplicationRecord
|
|
5
5
|
include TerminalNavigation
|
6
6
|
|
7
7
|
belongs_to :organization
|
8
|
-
belongs_to :course
|
8
|
+
belongs_to :course
|
9
9
|
|
10
10
|
has_many :authorizations, class_name: 'ExamAuthorization', dependent: :destroy
|
11
11
|
has_many :users, through: :authorizations
|
@@ -186,8 +186,6 @@ class Exam < ApplicationRecord
|
|
186
186
|
exam[:start_time] = exam[:start_time].to_time
|
187
187
|
exam[:end_time] = exam[:end_time].to_time
|
188
188
|
exam[:classroom_id] = exam[:eid] if exam[:eid].present?
|
189
|
-
exam[:passing_criterion_type] = exam.dig(:passing_criterion, :type)
|
190
|
-
exam[:passing_criterion_value] = exam.dig(:passing_criterion, :value)
|
191
189
|
end
|
192
190
|
|
193
191
|
def self.remove_previous_version(eid, guide_id)
|
data/app/models/user.rb
CHANGED
@@ -139,9 +139,9 @@ class User < ApplicationRecord
|
|
139
139
|
|
140
140
|
def interpolations
|
141
141
|
{
|
142
|
-
|
143
|
-
|
144
|
-
|
142
|
+
'user_email' => email,
|
143
|
+
'user_first_name' => first_name,
|
144
|
+
'user_last_name' => last_name
|
145
145
|
}
|
146
146
|
end
|
147
147
|
|
@@ -251,6 +251,21 @@ class User < ApplicationRecord
|
|
251
251
|
end
|
252
252
|
end
|
253
253
|
|
254
|
+
def notify_permissions_changed!
|
255
|
+
return if permissions_before_last_save == permissions
|
256
|
+
Mumukit::Nuntius.notify! 'user-permissions-changed', user: {
|
257
|
+
uid: uid,
|
258
|
+
old_permissions: permissions_before_last_save.as_json,
|
259
|
+
new_permissions: permissions.as_json
|
260
|
+
}
|
261
|
+
end
|
262
|
+
|
263
|
+
def save_and_notify!
|
264
|
+
save!
|
265
|
+
notify_permissions_changed!
|
266
|
+
self
|
267
|
+
end
|
268
|
+
|
254
269
|
private
|
255
270
|
|
256
271
|
def welcome_to_new_organizations!
|
@@ -36,6 +36,6 @@ class Mumuki::Domain::Organization::Profile < Mumukit::Platform::Model
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def open_graph_image_url
|
39
|
-
@open_graph_image_url ||= Mumukit::Platform.
|
39
|
+
@open_graph_image_url ||= Mumukit::Platform.laboratory.url_for("logo-alt.png") # Best image size: 256x256
|
40
40
|
end
|
41
41
|
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:
|
4
|
+
version: 8.0.0
|
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-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: '
|
131
|
+
version: '6.0'
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: '
|
138
|
+
version: '6.0'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: mumukit-sync
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|