File tree 2 files changed +9
-0
lines changed
2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,10 @@ class Preloader < ActiveRecord::Associations::Preloader
3
3
4
4
attr_accessor :records
5
5
6
+ def foo ( **kwargs )
7
+ kwargs
8
+ end
9
+
6
10
if Gem ::Version . new ( ActiveRecord ::VERSION ::STRING ) >= Gem ::Version . new ( "7.0.0" )
7
11
def self . attach ( records )
8
12
new ( records : records . dup , associations : nil ) . tap do |loader |
Original file line number Diff line number Diff line change 49
49
-> ( event , data ) { source_map [ data [ :source ] ] << data [ :association ] }
50
50
end
51
51
52
+
53
+ it "should warn about keyword arguments" do
54
+ expect ( described_class . new ( records : nil , associations : nil ) . foo ( { a : 1 } ) ) . to eq ( { a : 1 } )
55
+ end
56
+
52
57
context "for single table inheritance" do
53
58
context "when preloading an aggregate for a child model" do
54
59
let! ( :contact_book ) { ContactBook . create ( name : "The Yellow Pages" ) }
You can’t perform that action at this time.
0 commit comments