Commit fd229ce 1 parent 117dbca commit fd229ce Copy full SHA for fd229ce
File tree 1 file changed +9
-7
lines changed
1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -61,12 +61,18 @@ def handle
61
61
private
62
62
63
63
def set_query
64
- @query = if selected_all?
64
+ @query = if action_params [ :fields ] &. dig ( :avo_selected_all ) == "true"
65
65
decrypted_index_query
66
66
else
67
- resource_ids = action_params [ :fields ] &.dig ( :avo_resource_ids ) &.split ( "," ) || [ ]
67
+ find_records_from_resource_ids
68
+ end
69
+ end
68
70
69
- resource_ids . any? ? @resource . find_record ( resource_ids , params : params ) : [ ]
71
+ def find_records_from_resource_ids
72
+ if ( ids = action_params [ :fields ] &.dig ( :avo_resource_ids ) &.split ( "," ) || [ ] ) . any?
73
+ @resource . find_record ( ids , params : params )
74
+ else
75
+ [ ]
70
76
end
71
77
end
72
78
@@ -181,10 +187,6 @@ def decrypted_index_query
181
187
end
182
188
end
183
189
184
- def selected_all?
185
- action_params [ :fields ] &.dig ( :avo_selected_all ) == "true"
186
- end
187
-
188
190
def flash_messages
189
191
get_messages . each do |message |
190
192
flash [ message [ :type ] ] = message [ :body ]
You can’t perform that action at this time.
0 commit comments