This project is archived and is in readonly mode.
[PATCH] 410 Gone as ResourceGone for ActiveResource
Reported by Jordan Brough | March 23rd, 2009 @ 06:48 PM | in 2.x
Our app needs to distinguish between unknown entities & removed entities. It would be nice if ActiveResource had a ResourceGone error class so that we could do this:
rescue ActiveResource::ResourceGone => e
..
end
instead of:
rescue ActiveResource::ClientError => e
if e.response.code.to_i == 410
...
else
raise
end
end
Attached is a patch to do this.
Comments and changes to this ticket
-
Jordan Brough April 9th, 2009 @ 09:04 PM
- Assigned user cleared.
-
CancelProfileIsBroken August 6th, 2009 @ 01:36 PM
- Tag changed from activeresource, patch to activeresource, bugmash, patch
-
Jatinder Singh August 9th, 2009 @ 06:18 AM
+1 it works cleanly on 2.3-stable. Changes to exists? should indeed take ResourceGone exception into account.
I added a missing test, but can't create a patch, until https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets... gets out of the door.
-
Jatinder Singh August 9th, 2009 @ 06:58 AM
I've attached a patch for a missing test to the patch by Jordan.
-
Kieran P August 9th, 2009 @ 07:09 AM
- Title changed from 410 Gone as ResourceGone for ActiveResource to [PATCH] 410 Gone as ResourceGone for ActiveResource
-
Rizwan Reza August 9th, 2009 @ 04:19 PM
verified
+1 The patch by Jatinder applies to 2-3-stable only. All tests pass.
-
Elad Meidar August 9th, 2009 @ 08:52 PM
+1 Verified, applies and tests pass on 2-3-stable.
Attached patch and tests for master (my name appears on the commit, i didn't know how to credit the original author, sorry).
-
Repository August 9th, 2009 @ 10:56 PM
- State changed from new to resolved
(from [916b18adeb0a1ae09fdaff21dda8d0bc8ed4ffa9]) Active Resource recognizes 410 as Resource Gone now [#2316 state:resolved] [Jordan Brough, Jatinder Singh]
Signed-off-by: Pratik Naik pratiknaik@gmail.com
http://github.com/rails/rails/commit/916b18adeb0a1ae09fdaff21dda8d0... -
Jeremy Kemper August 9th, 2009 @ 11:29 PM
- Tag changed from activeresource, bugmash, patch to activeresource, patch
Worth backporting to 2-3-stable?
-
Repository August 9th, 2009 @ 11:34 PM
(from [be017fd7d54c9203dc574d8e1a6f22d80df0e899]) Active Resource recognizes 410 as Resource Gone now [#2316 state:resolved] [Jordan Brough, Jatinder Singh]
Signed-off-by: Pratik Naik pratiknaik@gmail.com
Conflicts:
activeresource/lib/active_resource/exceptions.rb
Signed-off-by: Pratik Naik pratiknaik@gmail.com
http://github.com/rails/rails/commit/be017fd7d54c9203dc574d8e1a6f22...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Tags
Referenced by
- 2316 [PATCH] 410 Gone as ResourceGone for ActiveResource (from [916b18adeb0a1ae09fdaff21dda8d0bc8ed4ffa9]) Active ...
- 2316 [PATCH] 410 Gone as ResourceGone for ActiveResource (from [be017fd7d54c9203dc574d8e1a6f22d80df0e899]) Active ...