Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Circular dependencies #1812

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions app/assets/javascripts/tracks.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,6 @@ var TodoItems = {
/* Drag & Drop for successor/predecessor */
var dragged_todo = ui.draggable[0].id.split('_')[2];
var dropped_todo = this.id.split('_')[2];
ui.draggable.remove();
$('.drop_target').hide(); // IE8 doesn't call stop() in this situation

ajax_options = default_ajax_options_for_scripts('POST', relative_to_root('todos/add_predecessor'), $(this));
Expand All @@ -324,7 +323,7 @@ var TodoItems = {
setup_drag_and_drop: function() {
$('.item-show').draggable({
handle: '.grip',
revert: 'invalid',
revert: true,
start: TodoItems.drag_todo,
stop: function() {
$('.drop_target').hide();
Expand Down
15 changes: 12 additions & 3 deletions app/controllers/todos_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def create
create_multiple
else
p = Todos::TodoCreateParamsHelper.new(params, current_user)
p.parse_dates() unless mobile?
p.parse_dates unless mobile?
tag_list = p.tag_list

@todo = current_user.todos.build
Expand Down Expand Up @@ -423,7 +423,16 @@ def update
update_dependencies
update_attributes_of_todo

@saved = @todo.save
begin
@saved = @todo.save!
rescue ActiveRecord::RecordInvalid => exception
record = exception.record
if record.is_a?(Dependency)
record.errors.each { |key,value| @todo.errors[key] << value }
end
@saved = false
end


# this is set after save and cleared after reload, so save it here
@removed_predecessors = @todo.removed_predecessors
Expand Down Expand Up @@ -1133,7 +1142,7 @@ def cache_attributes_from_before_update
end

def update_project
@project_changed = false;
@project_changed = false
if params['todo']['project_id'].blank? && !params['project_name'].nil?
if params['project_name'] == 'None'
project = Project.null_object
Expand Down