Commit 2babec4ef313d876834b158f71214cf3747c3771
1 parent
01525b23
Exists in
master
and in
1 other branch
Moved long assignment into smaller more readable lines.
Showing
1 changed file
with
4 additions
and
2 deletions
Show diff stats
app/models/error_report.rb
@@ -23,8 +23,10 @@ class ErrorReport | @@ -23,8 +23,10 @@ class ErrorReport | ||
23 | end | 23 | end |
24 | 24 | ||
25 | def initialize(xml_or_attributes) | 25 | def initialize(xml_or_attributes) |
26 | - @attributes = (xml_or_attributes.is_a?(String) ? Hoptoad.parse_xml!(xml_or_attributes) : xml_or_attributes).with_indifferent_access | ||
27 | - @attributes.each{|k, v| instance_variable_set(:"@#{k}", v) } | 26 | + @attributes = xml_or_attributes |
27 | + @attributes = Hoptoad.parse_xml!(@attributes) if @attributes.is_a? String | ||
28 | + @attributes = @attributes.with_indifferent_access | ||
29 | + @attributes.each { |k, v| instance_variable_set(:"@#{k}", v) } | ||
28 | end | 30 | end |
29 | 31 | ||
30 | def rails_env | 32 | def rails_env |