Skip to content

Commit ec30cc1

Browse files
author
Sebastian Wilgosz
committed
Fix naming clash in rails applications
Rails controllers have config method defined and this one overrode that
1 parent 5f9ee1a commit ec30cc1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/jsonapi_errors_handler.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def handle_error(error)
2525
end
2626

2727
def handle_unexpected_error(error)
28-
return raise error unless config.handle_unexpected?
28+
return raise error unless configuration.handle_unexpected?
2929
log_error(error) if respond_to?(:log_error)
3030
render_error(::JsonapiErrorsHandler::Errors::StandardError.new)
3131
end
@@ -35,11 +35,10 @@ def render_error(error)
3535
end
3636

3737
def self.configure(&block)
38-
config = Configuration.instance
39-
config.configure(&block)
38+
Configuration.instance.configure(&block)
4039
end
4140

42-
def config
41+
def configuration
4342
Configuration.instance
4443
end
4544
end

0 commit comments

Comments
 (0)