mumuki-domain 9.11.0 → 9.12.0

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: 641d60f1b417f2fa2a9d05fbdd0357b3415a42a222b8a38ab989c63baf5b064b
4
- data.tar.gz: db353f1f369e0ae15f0349c2448d476e302921ef36479236408d74bada703f29
3
+ metadata.gz: d20f0f5d9cfe938c4a33f561f9e4df1e5e84ab18296fda644038b87166d631fc
4
+ data.tar.gz: bf7adb112a37b84a8fb4f8fa7dc74db1c5df29dc0d8763005256e98e381b7951
5
5
  SHA512:
6
- metadata.gz: b8d1d6c40137d84dd7bf3d4c12c406ce88914efb9cce0a231a4ec1758e9b30ac61c881d940c0890a58dfaec3f69eefad432c67de3c88bef11950be1953f71ded
7
- data.tar.gz: 6e784be9dc46359358a831aae422ebadca1840cc9516d664aaa2d16b3100350dd8887a6dba2b1fa064a697b7a2443848cba238f5692caec72113c45a01ffd035
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 = notifications.where(read: false) + unread_messages + unread_discussions
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
 
@@ -10,7 +10,7 @@ module WithReminders
10
10
  end
11
11
 
12
12
  def remind!
13
- build_reminder.deliver_now
13
+ build_reminder.post!
14
14
  update! last_reminded_date: Time.current
15
15
  end
16
16
 
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).deliver_later
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).deliver_later unless ignores_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).deliver_now rescue nil if organization.greet_new_users?
336
+ UserMailer.welcome_email(self, organization).post! rescue nil if organization.greet_new_users?
331
337
  end
332
338
  end
333
339
 
@@ -1,5 +1,5 @@
1
1
  module Mumuki
2
2
  module Domain
3
- VERSION = '9.11.0'
3
+ VERSION = '9.12.0'
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: 9.11.0
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-06 00:00:00.000000000 Z
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.7'
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.7'
82
+ version: '1.11'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: mumukit-core
85
85
  requirement: !ruby/object:Gem::Requirement