Vote #73251
完了Usage of attribute_present? in UserPreference
0%
説明
Hi,
when I enter @User.new.pref@ in the Rails console, @user_id@ is stored in the @others@ hash.
>> User.new.pref #nil}, hide_mail: false, time_zone: nil>
Solution: In @UserPreference#[]@ and @UserPreference#[]=@ @attribute_present?@ should be replaced by @has_attribute?@.
The current implementation also works because @UsersController#create@ saves the user before creating the preference, so @attribute_present? :user_id@ returns @true@.
Best regards,
Thomas
journals
--------------------------------------------------------------------------------
Fixed in r12126 with a test, thanks for pointing this out.
--------------------------------------------------------------------------------
Admin Redmine さんが約4年前に更新
- カテゴリ を Code cleanup/refactoring_30 にセット
- 対象バージョン を 2.3.3_73 にセット