标签: ruby-on-rails mongoid
如果我们有两个具有has_many / belongs_to关系的clases,即User =>项目和项目类我们有default_scope -> {includes(:user)}然后:
default_scope -> {includes(:user)}
project.user # returns X user project.user = another_user project.user # returns X user again instead of anoter_user
为什么会这样?