@@ -286,23 +286,23 @@ def regulate_relationship(name, &block)
286286
287287 alias pre_syncromesh_has_many has_many
288288
289- def has_many ( name , *args , &block )
289+ def has_many ( name , *args , ** kwargs , &block )
290290 __synchromesh_regulate_from_macro (
291- opts = args . extract_options! ,
291+ opts = args . extract_options! . merge ( kwargs ) ,
292292 name ,
293293 method_defined? ( :"__secure_remote_access_to_#{ name } " ) ,
294294 &method ( :regulate_relationship )
295295 )
296- pre_syncromesh_has_many name , *args , opts . except ( :regulate ) , &block
296+ pre_syncromesh_has_many name , *args , ** opts . except ( :regulate ) , &block
297297 end
298298
299299 %i[ belongs_to has_one composed_of ] . each do |macro |
300300 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 )
304304 end
305- send ( :"pre_syncromesh_#{ macro } " , name , *aargs , &block )
305+ send ( :"pre_syncromesh_#{ macro } " , name , *aargs , ** kkwargs , &block )
306306 end
307307 end
308308 end
0 commit comments