meta_notification 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/meta_notification/api/v1/notifications_controller.rb +1 -0
- data/app/views/meta_notification/api/v1/notifications/resource_notification.rabl +1 -1
- data/app/views/meta_notification/api/v1/user_notifications/notifications.rabl +2 -2
- data/lib/meta_notification/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41c7675c20a481f414b06845f671aa2660de8f18
|
4
|
+
data.tar.gz: 49de01fcb4035e4d579002b63677191f66d930f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ded417d9c5e5d7a3417316051768263289f1c5f1406f39e8c8325fcd906ec2a7da72c4de02a043e46a4521c71e09d765f471ea60dba08fa07c195893602a766
|
7
|
+
data.tar.gz: 9185ec190baaf8e471c05ae484a0538dab722872fdcf0cea49742108d41db234212af9c4ddba719eb93b40d03c02d54f3667bebf9d73a47ea706f9c75e3a814b
|
@@ -10,6 +10,7 @@ module MetaNotification
|
|
10
10
|
.joins('JOIN mn_notification_templates on mn_notification_templates.id = mn_notifications.notification_template_id')
|
11
11
|
.joins('JOIN mn_notification_types on mn_notification_types.id = mn_notification_templates.notification_type_id')
|
12
12
|
.where(resource_type: params[:resource_type], resource_id: params[:resource_id])
|
13
|
+
.order('mn_notifications.created_at DESC')
|
13
14
|
.includes(:users)
|
14
15
|
.page(params[:current_page]) if params[:current_page].present?
|
15
16
|
@created_by_users = User.where(id: @notifications.map(&:created_by_id).uniq)
|
@@ -6,7 +6,7 @@ node :created_by do |notification|
|
|
6
6
|
{ id: user.id, email: user.email, first_name: user.first_name, last_name: user.last_name } if user.present?
|
7
7
|
end
|
8
8
|
child :users do
|
9
|
-
attributes :id, :
|
9
|
+
attributes :id, :first_name, :last_name
|
10
10
|
end
|
11
11
|
|
12
12
|
node :attachment do |notification|
|
@@ -6,10 +6,10 @@ child(@notifications => :notifications) do
|
|
6
6
|
notification.name
|
7
7
|
end
|
8
8
|
node :first_name do |notification|
|
9
|
-
@created_by_users.map{|user| user.first_name if notification.created_by_id == user.id}.first
|
9
|
+
@created_by_users.map{|user| user.first_name if notification.created_by_id == user.id}.compact.first
|
10
10
|
end
|
11
11
|
node :last_name do |notification|
|
12
|
-
@created_by_users.map{|user| user.last_name if notification.created_by_id == user.id}.first
|
12
|
+
@created_by_users.map{|user| user.last_name if notification.created_by_id == user.id}.compact.first
|
13
13
|
end
|
14
14
|
node :attachment do |notification|
|
15
15
|
notification.attachment.url if notification.attachment.present?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: meta_notification
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shobhit Dixit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|