meta_notification 0.0.5 → 0.0.6
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1e5320b07b4e14b03044f446238d5fc5496520d
|
4
|
+
data.tar.gz: bd873cc6e09c422f5cb187eab56b2eda6e11e1fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 693aa5806baa8ecb94ae9d7c63e16df7130fac5852a41a9d842c3c8c278d608a943fc0fdb25dce9a0503a4da1e07210f81cab08f4ea846b2a95d6ba54608abd4
|
7
|
+
data.tar.gz: 399674d90a233a5553259606aa9d80114b9dbd1524de351bbf72d63ec48955f9ccdffe1f7d4371b8440793b7535b8b9931a3037b43dbf3dd38a1f553d1188f66
|
data/README.rdoc
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
= Usage
|
2
2
|
For Installation,write following line in gem file:
|
3
|
-
gem 'meta_notification',
|
3
|
+
gem 'meta_notification', '~> 0.0.5'
|
4
4
|
|
5
5
|
To override authorizers, add following lines in application.rb,
|
6
6
|
config.autoload_paths += Dir["#{config.root}/lib/"]
|
@@ -27,11 +27,11 @@ module MetaNotification
|
|
27
27
|
@notifications = MetaNotification::Notification.select(:id, "mn_notifications.*", "mn_user_notifications.id as mn_user_notification_id","mn_user_notifications.user_id", mobile_or_in_app, "mn_user_notifications.is_read", "mn_notification_types.name", "mn_notification_types.icon", "mn_notification_types.label", "mn_notifications.created_by_id", "mn_notifications.created_at")
|
28
28
|
.joins('JOIN mn_user_notifications on mn_user_notifications.notification_id = mn_notifications.id')
|
29
29
|
.joins('JOIN mn_notification_types on mn_notification_types.id = mn_user_notifications.notification_type_id')
|
30
|
-
.where("mn_user_notifications.user_id"
|
31
|
-
.where.not("mn_user_notifications.notification_type_id"
|
30
|
+
.where("mn_user_notifications.user_id" => params[:user_id], "mn_user_notifications.notification_type_id"=> @notification_type_in_ids)
|
31
|
+
.where.not("mn_user_notifications.notification_type_id"=> @notification_type_not_in_ids)
|
32
32
|
@unread_count = @notifications.select { |n| n.is_read == 0 }.length
|
33
|
-
@notifications = @notifications.where("mn_user_notifications.is_read"
|
34
|
-
@notifications = @notifications.where("mn_notifications.resource_type"
|
33
|
+
@notifications = @notifications.where("mn_user_notifications.is_read" => ((params[:is_fetch_unread].try(:to_bool).present?) ? false : [true, false]) )
|
34
|
+
@notifications = @notifications.where("mn_notifications.resource_type"=> params[:resource_type], "mn_notifications.resource_id"=> params[:resource_id]) if params[:resource_id].present? && params[:resource_type].present?
|
35
35
|
@notifications = @notifications.order("mn_notifications.created_at DESC")
|
36
36
|
@notifications = @notifications.page(params[:current_page]) if params[:current_page].present?
|
37
37
|
|
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.6
|
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-08-
|
11
|
+
date: 2016-08-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|