@@ -286,23 +286,23 @@ def regulate_relationship(name, &block)
286
286
287
287
alias pre_syncromesh_has_many has_many
288
288
289
- def has_many ( name , *args , &block )
289
+ def has_many ( name , *args , ** kwargs , &block )
290
290
__synchromesh_regulate_from_macro (
291
- opts = args . extract_options! ,
291
+ opts = args . extract_options! . merge ( kwargs ) ,
292
292
name ,
293
293
method_defined? ( :"__secure_remote_access_to_#{ name } " ) ,
294
294
&method ( :regulate_relationship )
295
295
)
296
- pre_syncromesh_has_many name , *args , opts . except ( :regulate ) , &block
296
+ pre_syncromesh_has_many name , *args , ** opts . except ( :regulate ) , &block
297
297
end
298
298
299
299
%i[ belongs_to has_one composed_of ] . each do |macro |
300
300
alias_method :"pre_syncromesh_#{ macro } " , macro
301
- define_method ( macro ) do |name , *aargs , &block |
302
- define_method ( :"__secure_remote_access_to_#{ name } " ) do |this , _acting_user , *args |
303
- this . send ( name , *args )
301
+ define_method ( macro ) do |name , *aargs , ** kkwargs , &block |
302
+ define_method ( :"__secure_remote_access_to_#{ name } " ) do |this , _acting_user , *args , ** kargs |
303
+ this . send ( name , *args , ** kargs )
304
304
end
305
- send ( :"pre_syncromesh_#{ macro } " , name , *aargs , &block )
305
+ send ( :"pre_syncromesh_#{ macro } " , name , *aargs , ** kkwargs , &block )
306
306
end
307
307
end
308
308
end
0 commit comments