プロジェクト

全般

プロフィール

Vote #67152

完了

Exclude "fields_for" from overridden methods in TabularFormBuilder

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
Closed
優先度:
低め
担当者:
-
カテゴリ:
Code cleanup/refactoring_30
対象バージョン:
開始日:
2010/04/30
期日:
進捗率:

100%

予定工数:
category_id:
30
version_id:
14
issue_org_id:
5416
author_id:
1188
assigned_to_id:
5
comments:
1
status_id:
5
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

...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.


journals

Added in r3804, thank you for your contribution.
--------------------------------------------------------------------------------

Admin Redmine さんが約4年前に更新

  • カテゴリCode cleanup/refactoring_30 にセット
  • 対象バージョン1.0.0 (RC)_14 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0