Это, вероятно, происходит из-за кэширования.
foo = Foo.create! #=> executes sql, and caches the result
foo #=> retrieved from cache
foo.bars << Bar.create #=> creates the bar, and associates it with the foo instance
foo.bars #=> retrieves the bars from cache, so it's []
Foo.find(foo.id).bars #=> executes sql, and returns [<bar# id: 1>]
Чтобы обойти это, вы просто создаете новый экземпляр foo или просто перезагружаете его:
foo.reload
Или, foo.bars(true)
.