lundi 6 mai 2019

ActiveRelation Query is empty in Rails System Test, but works interactive

Works in interactive session, but fails in Rails System test:

Using byebug, this one unexpectedly returns empty @item.children.where(done: false)

If I skip the ActiveRelation, like this, I see the object correctly @item.children

#<ActiveRecord::Associations::CollectionProxy [#<Item id: 980190964, title: "my item", done: false

This one unexpectedly returns 1 record @item.children.where.not(done:false)

Aucun commentaire:

Enregistrer un commentaire