Commit 162615089e203ae73bcdd6031424ae936438b486
1 parent
99ae3498
Exists in
master
and in
1 other branch
Moving Notice#to_xml to NoticesController, since it's only required by Airbrake gem API
Showing
2 changed files
with
1 additions
and
10 deletions
Show diff stats
app/controllers/notices_controller.rb
... | ... | @@ -4,7 +4,7 @@ class NoticesController < ApplicationController |
4 | 4 | def create |
5 | 5 | # params[:data] if the notice came from a GET request, raw_post if it came via POST |
6 | 6 | @notice = App.report_error!(params[:data] || request.raw_post) |
7 | - render :xml => @notice | |
7 | + render :xml => @notice.to_xml(:only => false, :methods => [:id]) | |
8 | 8 | end |
9 | 9 | |
10 | 10 | # Redirects a notice to the problem page. Useful when using User Information at Airbrake gem. | ... | ... |
app/models/notice.rb
... | ... | @@ -36,15 +36,6 @@ class Notice |
36 | 36 | |
37 | 37 | delegate :app, :problem, :to => :err |
38 | 38 | |
39 | - def to_xml(options = {}) | |
40 | - options[:indent] ||= 2 | |
41 | - xml = options[:builder] ||= ::Builder::XmlMarkup.new(:indent => options[:indent]) | |
42 | - xml.instruct! unless options[:skip_instruct] | |
43 | - xml.notice do | |
44 | - xml.id self.id | |
45 | - end | |
46 | - end | |
47 | - | |
48 | 39 | def user_agent |
49 | 40 | agent_string = env_vars['HTTP_USER_AGENT'] |
50 | 41 | agent_string.blank? ? nil : UserAgent.parse(agent_string) | ... | ... |