Project

General

Profile

Actions

Patch #5416

closed

Exclude "fields_for" from overridden methods in TabularFormBuilder

Added by Jean-Baptiste Barth almost 14 years ago. Updated almost 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

Also available in: Atom PDF