notificon 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,14 +2,18 @@
2
2
  #
3
3
  # class ApplicationController
4
4
  # include Notificon::Controller
5
- # before_filter :notificon_tracker
6
5
  #
7
6
  # end
8
7
  module Notificon
9
8
  module Controller
10
9
 
11
10
  def self.included(base)
12
- base.before_filter :notificon_tracker if base.respond_to?(:before_filter)
11
+ if base.respond_to?(:before_filter)
12
+ base.before_filter :notificon_tracker
13
+ Notificon.logger.info { "Notificon::Controller.included wired up before_filter :notificon_tracker" }
14
+ else
15
+ Notificon.logger.info { "Notificon::Controller.included before_filter method not found" }
16
+ end
13
17
  end
14
18
 
15
19
  # Public : method to use as a before filter on the application controller to track read status
@@ -19,18 +23,18 @@ module Notificon
19
23
  def notificon_tracker
20
24
  request.get? && (_track_explicit_read | _track_implicit_read)
21
25
  rescue => e
22
- Notificon.logger.error { "Notificon::Controller#notificon_tracker error processing notification params - #{params.inspect} error - #{e.inspect}" }
26
+ Notificon.logger.info { "Notificon::Controller#notificon_tracker error processing notification params - #{params.inspect} error - #{e.inspect}" }
23
27
  end
24
28
 
25
29
  # Private : uses notificon explicit parameters to track reads for items
26
30
  def _track_explicit_read
27
31
  if params[Notificon.notification_item_id_param] && params[Notificon.notification_username_param]
28
32
  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]}" }
33
+ Notificon.logger.info { "Notificon::Controller#_track_explicit_read - all for item #{params[Notificon.notification_item_id_param]} #{params[Notificon.notification_username_param]}" }
30
34
  true
31
35
  elsif id = params[Notificon.notification_id_param]
32
36
  Notificon.mark_notification_read(id, _notificon_read_at)
33
- Notificon.logger.debug { "Notificon::Controller#_track_explicit_read - specific notification #{params[Notificon.notification_id_param]}" }
37
+ Notificon.logger.info { "Notificon::Controller#_track_explicit_read - specific notification #{params[Notificon.notification_id_param]}" }
34
38
  true
35
39
  end
36
40
  end
@@ -39,7 +43,7 @@ module Notificon
39
43
  def _track_implicit_read
40
44
  if respond_to?(:current_username) && respond_to?(:current_item_id) && current_username && current_item_id
41
45
  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}" }
46
+ Notificon.logger.info { "Notificon::Controller#_track_implicit_read - for user #{current_username} and item #{current_item_id}" }
43
47
  true
44
48
  end
45
49
  end
@@ -1,3 +1,3 @@
1
1
  module Notificon
2
- VERSION = "0.0.2".freeze
2
+ VERSION = "0.0.3".freeze
3
3
  end
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.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: