Skip to content

Commit d2cf718

Browse files
authored
Merge pull request rails#51806 from yahonda/follow_up_51571
Use `foreign_key` option for destroy_async test models
2 parents dae4867 + 9a77052 commit d2cf718

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

activerecord/test/models/cpk/book_destroy_async.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ module Cpk
44
class BookDestroyAsync < ActiveRecord::Base
55
self.table_name = :cpk_books
66

7-
has_many :chapters, query_constraints: [:author_id, :book_id], class_name: "Cpk::ChapterDestroyAsync", dependent: :destroy_async
7+
has_many :chapters, foreign_key: [:author_id, :book_id], class_name: "Cpk::ChapterDestroyAsync", dependent: :destroy_async
88
end
99
end

activerecord/test/models/cpk/chapter_destroy_async.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ class ChapterDestroyAsync < ActiveRecord::Base
55
self.table_name = :cpk_chapters
66
self.primary_key = [:author_id, :id]
77

8-
belongs_to :book, query_constraints: [:author_id, :book_id], class_name: "Cpk::BookDestroyAsync"
8+
belongs_to :book, foreign_key: [:author_id, :book_id], class_name: "Cpk::BookDestroyAsync"
99
end
1010
end

0 commit comments

Comments
 (0)