Skip to content

Commit

Permalink
Merge pull request #819 from open-data-rescue/fix-sort-order-bug
Browse files Browse the repository at this point in the history
set a sort order on add field
  • Loading branch information
balen authored Jan 23, 2024
2 parents e51251f + b790b15 commit 292ebd6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/controllers/admin/field_groups_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,11 @@ def add_to_page_type
@page_type = PageType.find params[:page_type_id]
@field_group = FieldGroup.find params[:field_group_id]

ptfg = PageTypesFieldGroup.create!(page_type_id: params[:page_type_id], field_group_id: params[:field_group_id])
ptfg = PageTypesFieldGroup.create!(
page_type_id: params[:page_type_id],
field_group_id: params[:field_group_id],
sort_order: 0
)
# raise ptfg.errors.full_messages.join("<br />") if ptfg.errors.any?
rescue => ex
Rails.logger.error ex.message
Expand Down

0 comments on commit 292ebd6

Please sign in to comment.