mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Handle correctly null associations
null belongs_to associations are now serialized as nil instead of raise an error during serialization.
This commit is contained in:
1
test/fixtures/poro.rb
vendored
1
test/fixtures/poro.rb
vendored
@@ -43,6 +43,7 @@ PostSerializer = Class.new(ActiveModel::Serializer) do
|
||||
attributes :title, :body, :id
|
||||
|
||||
has_many :comments
|
||||
belongs_to :author
|
||||
url :comments
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user