allow singular embed when serializing association

Having

```ruby
has_one :post, embed: :ids
```

looks especially weird as it's a one-to-one association, hence there is
only one id. The following looks better:

```ruby
has_one :post, embed: :id
```
This commit is contained in:
Gosha Arinich 2013-05-05 10:57:07 +03:00
parent 22d72f76bc
commit e8ae3e1bb3

View File

@ -72,11 +72,11 @@ module ActiveModel
end end
def embed_ids? def embed_ids?
option(:embed, source_serializer._embed) == :ids [:id, :ids].include? option(:embed, source_serializer._embed)
end end
def embed_objects? def embed_objects?
option(:embed, source_serializer._embed) == :objects [:object, :objects].include? option(:embed, source_serializer._embed)
end end
def embed_in_root? def embed_in_root?