notificon 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/notificon/controller.rb +8 -0
- data/lib/notificon/version.rb +1 -1
- metadata +2 -2
data/lib/notificon/controller.rb
CHANGED
@@ -7,6 +7,11 @@
|
|
7
7
|
# end
|
8
8
|
module Notificon
|
9
9
|
module Controller
|
10
|
+
|
11
|
+
def self.included(base)
|
12
|
+
base.before_filter :notificon_tracker if base.respond_to?(:before_filter)
|
13
|
+
end
|
14
|
+
|
10
15
|
# Public : method to use as a before filter on the application controller to track read status
|
11
16
|
# of notifications
|
12
17
|
#
|
@@ -21,9 +26,11 @@ module Notificon
|
|
21
26
|
def _track_explicit_read
|
22
27
|
if params[Notificon.notification_item_id_param] && params[Notificon.notification_username_param]
|
23
28
|
Notificon.mark_all_read_for_item(params[Notificon.notification_username_param], params[Notificon.notification_item_id_param], _notificon_read_at)
|
29
|
+
Notificon.logger.debug { "Notificon::Controller#_track_explicit_read - all for item #{params[Notificon.notification_item_id_param]} #{params[Notificon.notification_username_param]}" }
|
24
30
|
true
|
25
31
|
elsif id = params[Notificon.notification_id_param]
|
26
32
|
Notificon.mark_notification_read(id, _notificon_read_at)
|
33
|
+
Notificon.logger.debug { "Notificon::Controller#_track_explicit_read - specific notification #{params[Notificon.notification_id_param]}" }
|
27
34
|
true
|
28
35
|
end
|
29
36
|
end
|
@@ -32,6 +39,7 @@ module Notificon
|
|
32
39
|
def _track_implicit_read
|
33
40
|
if respond_to?(:current_username) && respond_to?(:current_item_id) && current_username && current_item_id
|
34
41
|
Notificon.mark_all_read_for_item(current_username, current_item_id, _notificon_read_at)
|
42
|
+
Notificon.logger.debug { "Notificon::Controller#_track_implicit_read - for user #{current_username} and item #{current_item_id}" }
|
35
43
|
true
|
36
44
|
end
|
37
45
|
end
|
data/lib/notificon/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: notificon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-07
|
12
|
+
date: 2012-09-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mongo
|