Skip to content

Commit

Permalink
Merge pull request #350 from okuramasafumi/fix-as-json-compatibility
Browse files Browse the repository at this point in the history
[Fix] Make `as_json` compatible with Rails
  • Loading branch information
okuramasafumi authored Dec 13, 2023
2 parents 40cbf5f + 5cbcfc9 commit 8ba6cbf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/alba/resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,11 @@ def to_json(options = {}, root_key: nil, meta: {})

# Returns a Hash correspondng {#serialize}
#
# @param _options [Hash] dummy parameter for Rails compatibility
# @param root_key [Symbol, nil, true]
# @param meta [Hash] metadata for this seialization
# @return [Hash]
def as_json(root_key: nil, meta: {})
def as_json(_options = {}, root_key: nil, meta: {})
key = root_key.nil? ? fetch_key : root_key
key = Alba.regularize_key(key)
if key && !key.empty?
Expand Down

0 comments on commit 8ba6cbf

Please sign in to comment.