Skip to content

Commit

Permalink
version 4.5.1. rescue_from method conflict fix
Browse files Browse the repository at this point in the history
  • Loading branch information
garysweaver committed Aug 30, 2013
1 parent 831932b commit c5180a0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## restful_json 4.5.1 ##

* Changed `render_error` method name to `render_rj_action_error` to avoid Rails conflict.

## restful_json 4.5.0 ##

* Changed config: `rescue_handlers` -> `rj_action_rescue_handlers`, `rescue_class` -> `rj_action_rescue_class` to avoid conflicts with rescue_from.

## restful_json 4.4.0 ##

* Fix for "The method .includes() must contain arguments." Now does not call includes on the relation if empty.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ You only define what you need to provide and it can easily integrate with common
In your Rails app's `Gemfile`:

```ruby
gem 'restful_json', '~> 4.5.0'
gem 'restful_json' # and use ~> and set to latest version
```

Then:
Expand Down
4 changes: 2 additions & 2 deletions lib/restful_json/controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def handle_or_raise(e)
# this is something we intended to rescue, so log it
logger.error(e)
# render error only if we haven't rendered response yet
render_error(e, handling_data) unless @performed_render
render_rj_action_error(e, handling_data) unless @performed_render
end

def do_find_model_instance(first_method)
Expand Down Expand Up @@ -354,7 +354,7 @@ def allowed_params
# {"status": "not_found", "error", "Couldn't find Bar with id=23423423"}
#
# It handles any format in theory that is supported by respond_to and has a `to_(some format)` method.
def render_error(e, handling_data)
def render_rj_action_error(e, handling_data)
use_backtrace_cleaner = handling_data[:clean_backtrace] || true
i18n_key = handling_data[:i18n_key]
msg = t(i18n_key, default: e.message)
Expand Down
2 changes: 1 addition & 1 deletion lib/restful_json/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module RestfulJson
VERSION = '4.5.0'
VERSION = '4.5.1'
end

0 comments on commit c5180a0

Please sign in to comment.