app/controllers/notes_controller.rb in artfully_ose-1.2.0 vs app/controllers/notes_controller.rb in artfully_ose-1.3.0.pre1
- old
+ new
@@ -9,10 +9,11 @@
def create
note = @person.notes.build(params[:note])
note.user = current_user
note.organization = current_user.current_organization
+ note.occurred_at = DateTime.now
note.save
redirect_to @person
end
def destroy
@@ -30,11 +31,14 @@
render :layout => false
end
def update
@note = Note.find params[:id]
+ @note.text = params[:note][:text]
+ @note.occurred_at = ActiveSupport::TimeZone.create(current_user.current_organization.time_zone).
+ parse(params[:note][:occurred_at])
- if @note.update_attributes(params[:note])
+ if @note.save
flash[:notice] = "Note updated successfully!"
redirect_to person_url(@person)
else
flash[:alert] = "There was a problem editing your note, please contact support if the problem persists."
redirect_to :back