Skip to content

Commit

Permalink
rework some of the required_properties logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisHuynh333 committed Jan 8, 2025
1 parent bc9c565 commit ca34939
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ data: {
text-sm dark:focus:ring-primary-500 dark:focus:border-primary-500 cursor-pointer
hover:border-slate-300 border-transparent border-2
"
data-file-cell-required="<%= @required_properties.include?(@property) ? "true" : "false" %>"
data-file-cell-required="<%= @required_properties.present? && @required_properties.include?(@property) ? "true" : "false" %>"
>
<% unless @selected.empty? %>
<input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
</td>
</tr>
<% end %>
<% unless file_selector_params["required_properties"] && file_selector_params["required_properties"].include?(file_selector_params["property"]) %>
<% unless file_selector_params["required_properties"].present? && file_selector_params["required_properties"].include?(file_selector_params["property"]) %>
<tr>
<td>
<%= form.radio_button "attachment_id",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class FileSelectorControllerTest < ActionDispatch::IntegrationTest
'index' => 1,
'selected_id' => attachments(:attachment2).id,
'property' => 'input',
'required_properties' => [],
'required_properties' => nil,
'file_type' => 'other',
'file_selector_arguments' => { pattern: nil }
}
Expand Down

0 comments on commit ca34939

Please sign in to comment.