これらの ActiveRecord モデルがあるとしましょう:
class User < ActiveRecord::Base
has_many :emotions
end
class Emotion < ActiveRecord::Base
belongs_to :user
end
そして、私はこのコードを持っています:
user1 = User.where(id: 1).includes(:emotions).first
user2 = User.where(id: 1).first
と を区別する方法はありuser1.emotions
ますuser2.emotions
か? リレーションが熱心にロードされているか、データベースからのクエリをまだ待っているかを知るために呼び出すことができるメソッドはありますか?