Skip to content

Commit

Permalink
fixing rubocop offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
tompave committed Aug 17, 2014
1 parent 51b0cfc commit 1ce8cb6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/delayed/psych_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def visit_Psych_Nodes_Mapping_with_class(object) # rubocop:disable CyclomaticCom
begin
klass.unscoped.find(id)
rescue ActiveRecord::RecordNotFound => error
raise Delayed::DeserializationError, "ActiveRecord::RecordNotFound, class: #{klass}, primary key: #{id} (#{error.message})"
raise(Delayed::DeserializationError.new("ActiveRecord::RecordNotFound, class: #{klass}, primary key: #{id} (#{error.message})"))
end
when /^!ruby\/Mongoid:(.+)$/
klass = resolve_class(Regexp.last_match[1])
Expand All @@ -53,7 +53,7 @@ def visit_Psych_Nodes_Mapping_with_class(object) # rubocop:disable CyclomaticCom
begin
klass.find(id)
rescue Mongoid::Errors::DocumentNotFound => error
raise Delayed::DeserializationError, "Mongoid::Errors::DocumentNotFound, class: #{klass}, primary key: #{id} (#{error.message})"
raise(Delayed::DeserializationError.new("Mongoid::Errors::DocumentNotFound, class: #{klass}, primary key: #{id} (#{error.message})"))
end
when /^!ruby\/DataMapper:(.+)$/
klass = resolve_class(Regexp.last_match[1])
Expand All @@ -63,7 +63,7 @@ def visit_Psych_Nodes_Mapping_with_class(object) # rubocop:disable CyclomaticCom
key_names = primary_keys.collect { |p| p.name.to_s }
klass.get!(*key_names.collect { |k| payload['attributes'][k] })
rescue DataMapper::ObjectNotFoundError => error
raise Delayed::DeserializationError, "DataMapper::ObjectNotFoundError, class: #{klass} (#{error.message})"
raise(Delayed::DeserializationError.new("DataMapper::ObjectNotFoundError, class: #{klass} (#{error.message})"))
end
else
visit_Psych_Nodes_Mapping_without_class(object)
Expand Down

0 comments on commit 1ce8cb6

Please sign in to comment.