From 272d9cc9c07599c02111992cc8075f405eff60ee Mon Sep 17 00:00:00 2001 From: Cedric VINCENT Date: Mon, 21 Sep 2009 15:36:44 +0200 Subject: [PATCH 3/3] Allow to change the "owner" (a protected attribute) of a time entry. --- app/controllers/timelog_controller.rb | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/app/controllers/timelog_controller.rb b/app/controllers/timelog_controller.rb index cb9b958..356b0cf 100644 --- a/app/controllers/timelog_controller.rb +++ b/app/controllers/timelog_controller.rb @@ -204,7 +204,7 @@ class TimelogController < ApplicationController user = User.current end @time_entry ||= TimeEntry.new(:project => @project, :issue => @issue, :user => user, :spent_on => Date.today) - @time_entry.attributes = params[:time_entry] + @time_entry.send(:attributes=, params[:time_entry], false) if request.post? and @time_entry.save flash[:notice] = l(:notice_successful_update) redirect_back_or_default :action => 'details', :project_id => @time_entry.project -- 1.6.4