airbrake-local 0.0.7 → 0.0.8

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.
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  module AirbrakeLocal
3
3
  class ErrorMailer < ActionMailer::Base
4
- default from: "server@example.com"
4
+ default from: AirbrakeLocal.mail_from
5
5
 
6
6
  def error_notify errorlog
7
7
  @errorlog = errorlog
@@ -1,6 +1,6 @@
1
1
  class AirbrakeLocal::ErrorLog < ActiveRecord::Base
2
- attr_accessible :exception, :backtrace, :error_class, :environment_name,
3
- :cgi_data, :error_message, :parameters, :component, :action,
4
- :session_data, :project_root, :url,
5
- :status, :assign_to
2
+ # attr_accessible :exception, :backtrace, :error_class, :environment_name,
3
+ # :cgi_data, :error_message, :parameters, :component, :action,
4
+ # :session_data, :project_root, :url,
5
+ # :status, :assign_to
6
6
  end
@@ -34,7 +34,8 @@ Airbrake.instance_eval do
34
34
 
35
35
  if notice.environment_name == "production"
36
36
 
37
- errorlog = {}
37
+ errorlog = AirbrakeLocal::ErrorLog.new
38
+ errorlog_in_hash = {}
38
39
 
39
40
  attributes = [
40
41
  :exception, :backtrace, :error_class, :environment_name,
@@ -44,24 +45,22 @@ Airbrake.instance_eval do
44
45
 
45
46
  attributes.each do |attr|
46
47
  if attr==:cgi_data
47
- errorlog[attr] = notice[attr].to_json
48
+ errorlog.send("#{attr}=", notice[attr].to_json)
49
+ errorlog_in_hash[attr] = notice[attr].to_json
48
50
  else
49
- errorlog[attr] = notice[attr].to_s
51
+ errorlog.send("#{attr}=", notice[attr].to_s)
52
+ errorlog_in_hash[attr] = notice[attr].to_s
50
53
  end
51
54
  end
52
55
 
53
- # puts errorlog.inspect
56
+ # AirbrakeLocal::ErrorLog.create(errorlog)
57
+ errorlog.save
54
58
 
55
- # AirbrakeLocal::ErrorLog
56
- # puts AirbrakeLocal::ErrorLog
57
- AirbrakeLocal::ErrorLog.create(errorlog)
58
-
59
- AirbrakeLocal::ErrorMailer.error_notify(errorlog).deliver
59
+ AirbrakeLocal::ErrorMailer.error_notify(errorlog_in_hash).deliver
60
60
 
61
61
  end
62
-
62
+
63
63
  end
64
-
65
64
  end
66
65
 
67
66
  require "airbrake_local/rails"
@@ -1,3 +1,3 @@
1
1
  module AirbrakeLocal
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
@@ -2,18 +2,18 @@ class AirbrakeLocalCreateErrorLogs < ActiveRecord::Migration
2
2
  def change
3
3
  create_table(:airbrake_local_error_logs) do |t|
4
4
 
5
- t.string :exception
5
+ t.text :exception
6
6
  t.text :backtrace
7
7
  t.string :error_class
8
8
  t.string :environment_name
9
9
  t.text :cgi_data
10
- t.string :error_message
10
+ t.text :error_message
11
11
  t.text :parameters
12
12
  t.string :component
13
13
  t.string :action
14
14
  t.text :session_data
15
- t.string :project_root
16
- t.string :url
15
+ t.string :project_root, :limit=>512
16
+ t.text :url
17
17
 
18
18
  t.string :status, :default=>"Unsolved"
19
19
  t.string :assign_to
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: airbrake-local
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
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: 2014-01-05 00:00:00.000000000 Z
12
+ date: 2014-02-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: airbrake