-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
I'm having trouble deleting the records in an embeds_many collection on MongoHQ via MongoID.
Decks embeds_many Cards
When I call
@deck.cards = []
or
@deck.cards.delete_all
I get: Cannot apply $push/$pushAll modifier to non-array
Alternatively, if I delete the records individually, the cards collection gets replaced with a hash instead of an Array.
Code is at
http://github.com/DanielHeath/Cards/blob/delete/app/models/deck.rb
Line 19 can be replaced with self.cards = [] or self.cards.delete_all