@@ -323,7 +323,7 @@ defmodule Ash.Actions.Update.Bulk do
323323 fn
324324 % { change: { module , change_opts } } ->
325325 module . has_after_batch? ( ) &&
326- module . batch_callbacks? ( query , change_opts , context )
326+ Ash.Resource.Change . batch_callbacks? ( module , query , change_opts , context )
327327
328328 _ ->
329329 false
@@ -1157,7 +1157,7 @@ defmodule Ash.Actions.Update.Bulk do
11571157 |> Enum . filter ( fn
11581158 { % { change: { module , change_opts } } , _index } ->
11591159 module . has_after_batch? ( ) &&
1160- module . batch_callbacks? ( query , change_opts , context )
1160+ Ash.Resource.Change . batch_callbacks? ( module , query , change_opts , context )
11611161
11621162 _ ->
11631163 false
@@ -2406,7 +2406,7 @@ defmodule Ash.Actions.Update.Bulk do
24062406 case change_opts do
24072407 { :templated , change_opts } ->
24082408 if module . has_before_batch? ( ) && module . has_batch_change? ( ) &&
2409- module . batch_callbacks? ( batch , change_opts , context ) do
2409+ Ash.Resource.Change . batch_callbacks? ( module , batch , change_opts , context ) do
24102410 Ash.Resource.Change . before_batch (
24112411 module ,
24122412 batch ,
@@ -2420,7 +2420,7 @@ defmodule Ash.Actions.Update.Bulk do
24202420 change_opts ->
24212421 Enum . flat_map ( batch , fn changeset ->
24222422 if module . has_before_batch? ( ) && module . has_batch_change? ( ) &&
2423- module . batch_callbacks? ( batch , change_opts , context ) do
2423+ Ash.Resource.Change . batch_callbacks? ( module , batch , change_opts , context ) do
24242424 change_opts =
24252425 templated_opts (
24262426 change_opts ,
@@ -2458,7 +2458,7 @@ defmodule Ash.Actions.Update.Bulk do
24582458 { :templated , change_opts } ->
24592459 if module . has_before_batch? ( ) &&
24602460 module . has_batch_change? ( ) &&
2461- module . batch_callbacks? ( matches , change_opts , context ) do
2461+ Ash.Resource.Change . batch_callbacks? ( module , matches , change_opts , context ) do
24622462 Ash.Resource.Change . before_batch (
24632463 module ,
24642464 matches ,
@@ -2483,7 +2483,7 @@ defmodule Ash.Actions.Update.Bulk do
24832483
24842484 if module . has_before_batch? ( ) &&
24852485 module . has_batch_change? ( ) &&
2486- module . batch_callbacks? ( [ changeset ] , change_opts , context ) do
2486+ Ash.Resource.Change . batch_callbacks? ( module , [ changeset ] , change_opts , context ) do
24872487 Ash.Resource.Change . before_batch (
24882488 module ,
24892489 [ changeset ] ,
@@ -3249,7 +3249,7 @@ defmodule Ash.Actions.Update.Bulk do
32493249 { :templated , change_opts } ->
32503250 if module . has_after_batch? ( ) &&
32513251 module . has_batch_change? ( ) &&
3252- module . batch_callbacks? ( changesets , change_opts , context ) do
3252+ Ash.Resource.Change . batch_callbacks? ( module , changesets , change_opts , context ) do
32533253 Ash.Resource.Change . after_batch (
32543254 module ,
32553255 results_for_callback ,
@@ -3292,7 +3292,7 @@ defmodule Ash.Actions.Update.Bulk do
32923292
32933293 if module . has_after_batch? ( ) &&
32943294 module . has_batch_change? ( ) &&
3295- module . batch_callbacks? ( changesets , change_opts , context ) do
3295+ Ash.Resource.Change . batch_callbacks? ( module , changesets , change_opts , context ) do
32963296 Ash.Resource.Change . after_batch (
32973297 module ,
32983298 [ { changeset , record } ] ,
@@ -3340,7 +3340,7 @@ defmodule Ash.Actions.Update.Bulk do
33403340 { :templated , change_opts } ->
33413341 if module . has_after_batch? ( ) &&
33423342 module . has_batch_change? ( ) &&
3343- module . batch_callbacks? ( changesets , change_opts , context ) do
3343+ Ash.Resource.Change . batch_callbacks? ( module , changesets , change_opts , context ) do
33443344 Ash.Resource.Change . after_batch (
33453345 module ,
33463346 matches_for_callback ,
@@ -3383,7 +3383,7 @@ defmodule Ash.Actions.Update.Bulk do
33833383 Enum . flat_map ( matches_for_callback , fn { changeset , record } = result ->
33843384 if module . has_after_batch? ( ) &&
33853385 module . has_batch_change? ( ) &&
3386- module . batch_callbacks? ( changesets , change_opts , context ) do
3386+ Ash.Resource.Change . batch_callbacks? ( module , changesets , change_opts , context ) do
33873387 change_opts =
33883388 templated_opts (
33893389 change_opts ,
@@ -3597,7 +3597,7 @@ defmodule Ash.Actions.Update.Bulk do
35973597 end ) ||
35983598 ( module . has_after_batch? ( ) &&
35993599 module . has_batch_change? ( ) &&
3600- module . batch_callbacks? ( batch , change_opts , context ) )
3600+ Ash.Resource.Change . batch_callbacks? ( module , batch , change_opts , context ) )
36013601
36023602 match_indices =
36033603 if Enum . empty? ( non_matches ) do
@@ -3729,7 +3729,7 @@ defmodule Ash.Actions.Update.Bulk do
37293729 { :templated , change_opts } ->
37303730 cond do
37313731 ! must_be_atomic? && module . has_batch_change? ( ) &&
3732- module . batch_callbacks? ( batch , change_opts , context ) ->
3732+ Ash.Resource.Change . batch_callbacks? ( module , batch , change_opts , context ) ->
37333733 { :ok , change_opts } = Ash.Resource.Change . init ( module , change_opts )
37343734 Ash.Resource.Change . batch_change ( module , batch , change_opts , context )
37353735
@@ -3800,7 +3800,7 @@ defmodule Ash.Actions.Update.Bulk do
38003800 cond do
38013801 ! must_be_atomic? && module . has_batch_change? ( ) ->
38023802 Enum . flat_map ( batch , fn changeset ->
3803- if module . batch_callbacks? ( batch , change_opts , context ) do
3803+ if Ash.Resource.Change . batch_callbacks? ( module , batch , change_opts , context ) do
38043804 change_opts =
38053805 templated_opts (
38063806 change_opts ,
0 commit comments