mumuki-domain 9.11.0 → 9.12.0
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d20f0f5d9cfe938c4a33f561f9e4df1e5e84ab18296fda644038b87166d631fc
|
|
4
|
+
data.tar.gz: bf7adb112a37b84a8fb4f8fa7dc74db1c5df29dc0d8763005256e98e381b7951
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fbcc0dcdd8fd5134d463f61f18da8dfc872b7142f221f16ea3d99dac828bdbcf628d47b924559ac40e3224597955ad575720dc318b385297509cc3364b5c9897
|
|
7
|
+
data.tar.gz: 4a2a358f2b888268d4193b0b9b50873702ac293430c26e5d64576f7c02b185fc4263cbc0b30c02758c611240e9646bb917277ed5ec37951521762db028f0fb52
|
|
@@ -7,7 +7,7 @@ module WithNotifications
|
|
|
7
7
|
|
|
8
8
|
def unread_notifications
|
|
9
9
|
# TODO: message and discussion should trigger a notification instead of being one
|
|
10
|
-
all =
|
|
10
|
+
all = notifications_in_organization.where(read: false) + unread_messages + unread_discussions
|
|
11
11
|
all.sort_by(&:created_at).reverse
|
|
12
12
|
end
|
|
13
13
|
|
data/app/models/user.rb
CHANGED
|
@@ -54,6 +54,8 @@ class User < ApplicationRecord
|
|
|
54
54
|
resource_fields :uid, :social_id, :email, :permissions, :verified_first_name, :verified_last_name, *profile_fields
|
|
55
55
|
with_temporary_token :delete_account_token
|
|
56
56
|
|
|
57
|
+
organic_on :notifications
|
|
58
|
+
|
|
57
59
|
def last_lesson
|
|
58
60
|
last_guide.try(:lesson)
|
|
59
61
|
end
|
|
@@ -62,6 +64,10 @@ class User < ApplicationRecord
|
|
|
62
64
|
messages.where('assignments.organization': organization)
|
|
63
65
|
end
|
|
64
66
|
|
|
67
|
+
def notifications_in_organization(organization = Organization.current)
|
|
68
|
+
notifications.where(organization: organization)
|
|
69
|
+
end
|
|
70
|
+
|
|
65
71
|
def passed_submissions_count_in(organization)
|
|
66
72
|
assignments.where(top_submission_status: Mumuki::Domain::Status::Submission::Passed.to_i, organization: organization).count
|
|
67
73
|
end
|
|
@@ -300,7 +306,7 @@ class User < ApplicationRecord
|
|
|
300
306
|
def certificate_in(certificate_program, certificate_h)
|
|
301
307
|
return if certificated_in?(certificate_program)
|
|
302
308
|
certificate = certificates.create certificate_h.merge(certificate_program: certificate_program)
|
|
303
|
-
UserMailer.certificate(certificate).
|
|
309
|
+
UserMailer.certificate(certificate).post!
|
|
304
310
|
end
|
|
305
311
|
|
|
306
312
|
def clear_progress_for!(organization)
|
|
@@ -316,7 +322,7 @@ class User < ApplicationRecord
|
|
|
316
322
|
end
|
|
317
323
|
|
|
318
324
|
def notify_via_email!(notification)
|
|
319
|
-
UserMailer.notification(notification).
|
|
325
|
+
UserMailer.notification(notification).post! unless ignores_notification? notification
|
|
320
326
|
end
|
|
321
327
|
|
|
322
328
|
def ignores_notification?(notification)
|
|
@@ -327,7 +333,7 @@ class User < ApplicationRecord
|
|
|
327
333
|
|
|
328
334
|
def welcome_to_new_organizations!
|
|
329
335
|
new_accessible_organizations.each do |organization|
|
|
330
|
-
UserMailer.welcome_email(self, organization).
|
|
336
|
+
UserMailer.welcome_email(self, organization).post! rescue nil if organization.greet_new_users?
|
|
331
337
|
end
|
|
332
338
|
end
|
|
333
339
|
|
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: 9.
|
|
4
|
+
version: 9.12.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: 2021-08-
|
|
11
|
+
date: 2021-08-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -72,14 +72,14 @@ dependencies:
|
|
|
72
72
|
requirements:
|
|
73
73
|
- - "~>"
|
|
74
74
|
- !ruby/object:Gem::Version
|
|
75
|
-
version: '1.
|
|
75
|
+
version: '1.11'
|
|
76
76
|
type: :runtime
|
|
77
77
|
prerelease: false
|
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
79
|
requirements:
|
|
80
80
|
- - "~>"
|
|
81
81
|
- !ruby/object:Gem::Version
|
|
82
|
-
version: '1.
|
|
82
|
+
version: '1.11'
|
|
83
83
|
- !ruby/object:Gem::Dependency
|
|
84
84
|
name: mumukit-core
|
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|