Skip to content

Commit 88832d2

Browse files
committed
add a default scope that joins on an association to test model
1 parent a5b5c09 commit 88832d2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

test/activerecord_provider/models/dc_field.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ class DCField < ActiveRecord::Base
77

88
belongs_to :dc_lang, class_name: "DCLang", optional: true
99

10+
default_scope -> { left_outer_joins(:dc_lang) }
11+
1012
def language
1113
dc_lang&.name
1214
end

0 commit comments

Comments
 (0)