Skip to content

Commit

Permalink
Add #to_hash conversion protocol to object serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
iamvery committed Feb 19, 2018
1 parent 7e59446 commit fc8de04
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/fast_jsonapi/object_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def serializable_hash
return hash_for_multiple_records(serializable_hash) if @records
serializable_hash
end
alias_method :to_hash, :serializable_hash

def hash_for_one_record(serializable_hash)
serializable_hash[:data] = self.class.record_hash(@record)
Expand Down

0 comments on commit fc8de04

Please sign in to comment.