diff options
Diffstat (limited to 'activerecord/test/models/owner.rb')
-rw-r--r-- | activerecord/test/models/owner.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/test/models/owner.rb b/activerecord/test/models/owner.rb index 45508a7f67..21fc9b6eb8 100644 --- a/activerecord/test/models/owner.rb +++ b/activerecord/test/models/owner.rb @@ -6,14 +6,14 @@ class Owner < ActiveRecord::Base belongs_to :last_pet, class_name: "Pet" scope :including_last_pet, -> { - select(%q[ + select(' owners.*, ( select p.pet_id from pets p where p.owner_id = owners.owner_id order by p.name desc limit 1 ) as last_pet_id - ]).includes(:last_pet) + ').includes(:last_pet) } after_commit :execute_blocks |