exception_notification_server 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ff6c4b7d7d6d97d6904d24ee91605c7e5c14b2b6
4
- data.tar.gz: db3b49e19a0f56b3c96ad6a6360bf7e73c87600a
3
+ metadata.gz: 632ebc13bca4d09b9fe0199c9b7f50d21465b8b6
4
+ data.tar.gz: 69357b6764c65305e13fab961bf329a21e5b6a82
5
5
  SHA512:
6
- metadata.gz: 49d28e04e01f321f6d40c0325bd4f9846b965f58a1264e484cdd4438544692e64b11e9990c4eb563cb21bd2c48dbc19374c3f268a78bc5bbbddda1163cfd8857
7
- data.tar.gz: 933ace4582c0c80ddbd9597728c92c9248542b21200d12e0e5f859339800fa6d29ffbf7663914e72d113a4e76dbef4383ac7e107c1a5bbb80765b2a99ba4203a
6
+ metadata.gz: e4e3ddf5b8038f20c008893531c55b66e875c973065789c3011d4243987488570beb884a00324743848339fa76ffb975fc69f44ed776901683f7ce0ae44dabc5
7
+ data.tar.gz: 3fd6f2caa91c894a92cfd4075fcad7b585e39f04262a35e7994082ca97143fd3f63fe83705dd85ebe3d1bf38721c25efe1fed85ed0ea2dc32d08ddd359f60716
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.3
@@ -91,7 +91,6 @@ module ExceptionNotificationServer
91
91
  def update_notification(notification, notification_params = notification_params_update, recursive = true)
92
92
  notification.send("update#{'_recursive_all' if recursive}", notification_params)
93
93
  notification.remove_data if recursive && notification_params[:status] == :fixed
94
- notification.recover_data if recursive && notification_params[:status] == :new && notification.status == 'fixed'
95
94
  end
96
95
 
97
96
  def notifications_actions(&block)
@@ -58,16 +58,16 @@ module ExceptionNotificationServer
58
58
  update_recursive(data: nil, request: nil, session: nil, environment: nil)
59
59
  end
60
60
 
61
- # We recover information from base notification. Better solution is just use base info but i wanna divide notifications.
62
- def recover_data
63
- base_notification = Notification.find(base_id)
64
- update_recursive(data: base_notification.data, request: base_notification.request, session: base_notification.session, environment: base_notification.environment)
65
- end
66
-
67
61
  def destroy_recursive
68
62
  Notification.where(arel_table[:id].eq(base_id).or(arel_table[:parent_id].eq(base_id))).delete_all if base_id.present?
69
63
  end
70
64
 
65
+ [:data, :request, :session, :environment].each do |name|
66
+ define_method "get_#{name}" do
67
+ send(name) || parent.try(name)
68
+ end
69
+ end
70
+
71
71
  protected
72
72
 
73
73
  def graph_data(from)
@@ -55,22 +55,22 @@
55
55
  .backtrace
56
56
  %h3 Backtrace
57
57
  = pretty_json @notification.backtrace
58
- - if @notification.data.present?
58
+ - if @notification.get_data.present?
59
59
  .data
60
60
  %h3 Data
61
- = pretty_json @notification.data
62
- - if @notification.request.present?
61
+ = pretty_json @notification.get_data
62
+ - if @notification.get_request.present?
63
63
  .request
64
64
  %h3 Request
65
- = pretty_json @notification.request
66
- - if @notification.session.present?
65
+ = pretty_json @notification.get_request
66
+ - if @notification.get_session.present?
67
67
  .session
68
68
  %h3 Session
69
- = pretty_json @notification.session
70
- - if @notification.environment.present?
69
+ = pretty_json @notification.get_session
70
+ - if @notification.get_environment.present?
71
71
  .environment
72
72
  %h3 Environment
73
- = pretty_json @notification.environment
73
+ = pretty_json @notification.get_environment
74
74
  - if @notification.similar.to_a.present?
75
75
  %br
76
76
  = render partial: 'exception_notification_server/notifications/notifications', object: @notification.similar, as: :notifications, locals: {count: false, last_time: false, env: true}
@@ -2,11 +2,11 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: exception_notification_server 0.0.1 ruby lib
5
+ # stub: exception_notification_server 0.0.3 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = 'exception_notification_server'
9
- s.version = '0.0.1'
9
+ s.version = '0.0.3'
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ['lib']
@@ -1,3 +1,3 @@
1
1
  module ExceptionNotificationServer
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exception_notification_server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anatoliy Varanitsa