Skip to content

Commit

Permalink
Adjust use of field_error_proc to work with Rails 7.
Browse files Browse the repository at this point in the history
  • Loading branch information
gregschmit authored and scambra committed Oct 19, 2022
1 parent 6fc4d47 commit 7ce9d2c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/active_scaffold/bridges/record_select/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def active_scaffold_record_select(record, column, options, value, multiple)
else
record_select_field(options[:name], value || klass.new, record_select_options)
end
html = self.class.field_error_proc.call(html, self) if record.errors[column.name].any?
html = self.instance_exec(html, self, &self.class.field_error_proc) if record.errors[column.name].any?
html
end

Expand All @@ -60,7 +60,7 @@ def active_scaffold_record_select_autocomplete(record, column, options)
:controller => active_scaffold_controller_for(record.class).controller_path
).merge(column.options)
html = record_select_autocomplete(options[:name], record, record_select_options)
html = self.class.field_error_proc.call(html, self) if record.errors[column.name].any?
html = self.instance_exec(html, self, &self.class.field_error_proc) if record.errors[column.name].any?
html
end
end
Expand Down

0 comments on commit 7ce9d2c

Please sign in to comment.