Project

General

Profile

Actions

Patch #5416

closed

Exclude "fields_for" from overridden methods in TabularFormBuilder

Added by Jean-Baptiste Barth over 14 years ago. Updated over 14 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
Code cleanup/refactoring
Target version:
Start date:
2010-04-30
Due date:
% Done:

100%

Estimated time:

Description

...since it's broken in some way in current implementation, and it's never called on the builder itself in Redmine core. It would be helpful to handle nested attributes in plugins.

To be clear, I'd like to be able to do something like this :

f.fields_for :association, MyAssociatedModel.new do ... end
or
f.fields_for :association, @main_object.my_associated_models do ... end

...where "f" is a standard TabularFormBuilder.

But it's broken in current implementation since method is overridden with a different signature than its parent : fields_for(field, options={}) VS fields_for(record_or_name_or_array, *args, &block).

Patch attached, no test broken on my platform with current trunk (r3704). I can give a more detailed example if needed.


Files

tabular_fields_for.diff (547 Bytes) tabular_fields_for.diff Jean-Baptiste Barth, 2010-04-30 14:50
Actions #1

Updated by Eric Davis over 14 years ago

  • Status changed from New to Closed
  • Assignee set to Eric Davis
  • Target version set to 1.0.0 (RC)
  • % Done changed from 0 to 100

Added in r3804, thank you for your contribution.

Actions

Also available in: Atom PDF