Skip to content

Commit

Permalink
Merge pull request #201 from pitr-ch/828308-updating_sync_plan_does_n…
Browse files Browse the repository at this point in the history
…ot_update_products_schedule

828308 - Updating sync plan does not update associated product's (repo's) sync schedule
  • Loading branch information
iNecas committed Jun 14, 2012
2 parents 036eab5 + aa5a22b commit dbb4c15
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app/models/sync_plan.rb
Expand Up @@ -48,7 +48,11 @@ class SyncPlan < ActiveRecord::Base
before_save :reassign_sync_plan_to_products

def reassign_sync_plan_to_products
self.products.each &:save # triggers orchestration in products
# triggers orchestration in products
self.products.each do |product|
product.sync_plan = self # assign current updated sync_plan, don't let products to load sync_plan again
product.save!
end
end

def validate_sync_date
Expand Down

0 comments on commit dbb4c15

Please sign in to comment.