Project

General

Profile

Defect #33341 » 0001-Fix-time-entry-user-is-shown-twice-in-the-User-drop-.patch

Marius BĂLTEANU, 2020-04-26 18:51

View differences:

app/helpers/timelog_helper.rb
def user_collection_for_select_options(time_entry)
collection = time_entry.assignable_users
collection << time_entry.user unless time_entry.user.nil? && !collection.include?(time_entry.user)
collection << time_entry.user if time_entry.user && !collection.include?(time_entry.user)
principals_options_for_select(collection, time_entry.user_id.to_s)
end
test/functional/timelog_controller_test.rb
assert_response :success
assert_select 'select[name=?]', 'time_entry[user_id]' do
assert_select 'option[value="2"][selected=selected]'
assert_select 'option[value="2"][selected=selected]', 1
end
end
(3-3/3)