我正在使用 Rails 4.2.3。我有这两个模型
class Address < ActiveRecord::Base
…
has_one :user
和
class User < ActiveRecord::Base
belongs_to :address
default_scope includes(:address)
我想在加载“MyObject”时自动加载父关联,但在“default_scope”行出现此错误……</p>
Support for calling #default_scope without a block is removed. For example instead of `default_scope where(color: 'red')`, please use `default_scope { where(color: 'red') }`. (Alternatively you can just redefine self.default_scope.)
如何调整我的“default_scope”行以自动加载我的父关联?