Skip to content

Commit

Permalink
support using active_scaffold_input_singular_association with collect…
Browse files Browse the repository at this point in the history
…ion associations

used in active_scaffold_child_memberships to add fields to select individual records on a collection association
  • Loading branch information
scambra committed Jan 15, 2025
1 parent 8a95d7a commit f5fd0b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/active_scaffold/helpers/form_column_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ def active_scaffold_select_name_with_multiple(options)

def active_scaffold_input_singular_association(column, html_options, options = {}, ui_options: column.options)
record = html_options.delete(:object)
associated = record.send(column.association.name)
associated = html_options.include?(:associated) ? html_options.delete(:associated) : record.send(column.association.name)

select_options = sorted_association_options_find(column.association, nil, record)
select_options.unshift(associated) unless associated.nil? || select_options.include?(associated)
Expand Down

0 comments on commit f5fd0b0

Please sign in to comment.