Skip to content

Commit

Permalink
Fix naming clash in rails applications
Browse files Browse the repository at this point in the history
Rails controllers have config method defined and this one overrode that
  • Loading branch information
Sebastian Wilgosz committed Dec 26, 2019
1 parent 5f9ee1a commit ec30cc1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/jsonapi_errors_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def handle_error(error)
end

def handle_unexpected_error(error)
return raise error unless config.handle_unexpected?
return raise error unless configuration.handle_unexpected?
log_error(error) if respond_to?(:log_error)
render_error(::JsonapiErrorsHandler::Errors::StandardError.new)
end
Expand All @@ -35,11 +35,10 @@ def render_error(error)
end

def self.configure(&block)
config = Configuration.instance
config.configure(&block)
Configuration.instance.configure(&block)
end

def config
def configuration
Configuration.instance
end
end

0 comments on commit ec30cc1

Please sign in to comment.