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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 947202e0d0156a9405175275a20bca47515634d1
4
- data.tar.gz: 6b7bb55641e4cc1cff355e62912a87f11ca7a317
3
+ metadata.gz: 41c7675c20a481f414b06845f671aa2660de8f18
4
+ data.tar.gz: 49de01fcb4035e4d579002b63677191f66d930f0
5
5
  SHA512:
6
- metadata.gz: 8df0666e6e64102e5a4bebd689a424ef069f536f7ccdb89aee09e2fd0dfa06d807a3aef87d9cb364e189942a5b4521545456c305049e161857114443d3c81d75
7
- data.tar.gz: 4bd5015840bfd5eae39e8a34b5868485c9bef2f5a7b9018632a68d1fff1f6ef96b1ab06b25b68c65b54c7630f7b5a15b778bbd529e60ceb3eebc7b58bd50e1f0
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, :email, :first_name, :last_name
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?
@@ -1,3 +1,3 @@
1
1
  module MetaNotification
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
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.8
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-09-08 00:00:00.000000000 Z
11
+ date: 2016-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails