Skip to content

Commit a9e478b

Browse files
author
Sebastian Wilgosz
committed
Fix bug for invalid error
The errors value was not properly assigned due to calling wrong method
1 parent a3922a4 commit a9e478b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
jsonapi_errors_handler (0.1.1)
4+
jsonapi_errors_handler (0.1.2)
55

66
GEM
77
remote: https://rubygems.org/
@@ -32,4 +32,4 @@ DEPENDENCIES
3232
rspec (~> 3.0)
3333

3434
BUNDLED WITH
35-
1.16.6
35+
1.17.3

lib/jsonapi_errors_handler/errors/standard_error.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def initialize(title: nil, detail: nil, status: nil, source: {})
1313
@source = KeysStringifier.call(source)
1414
end
1515

16-
def to_h
16+
def serializable_hash
1717
{
1818
status: status,
1919
title: title,
@@ -22,12 +22,12 @@ def to_h
2222
}
2323
end
2424

25-
def serializable_hash
26-
to_h
25+
def to_h
26+
serializable_hash
2727
end
2828

2929
def to_s
30-
to_h.to_s
30+
serializable_hash.to_s
3131
end
3232

3333
attr_reader :title, :detail, :status, :source

0 commit comments

Comments
 (0)