aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXinhui2017-09-01 13:36:14 +0200
committerXinhui2017-09-01 13:37:07 +0200
commitd127ed12158550f84ef1fb9c21d6360c86ac3642 (patch)
tree250d82958953d5341f5fc223fd578c9e04aa732a
parent569a075ffa3e25ec794ede2ba0ec63de10e67498 (diff)
downloadchouette-core-d127ed12158550f84ef1fb9c21d6360c86ac3642.tar.bz2
Fix Reflex sync check for valid stopArea before save
Refs #4367
-rw-r--r--lib/stif/reflex_synchronization.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/stif/reflex_synchronization.rb b/lib/stif/reflex_synchronization.rb
index 63270a986..fe372f0b9 100644
--- a/lib/stif/reflex_synchronization.rb
+++ b/lib/stif/reflex_synchronization.rb
@@ -99,7 +99,7 @@ module Stif
if entry['parent']
stop.parent = self.find_by_object_id entry['parent']
- stop.save! if stop.changed
+ stop.save if stop.changed && stop.valid?
end
if entry['quays']
@@ -107,7 +107,7 @@ module Stif
children = self.find_by_object_id id
next unless children
children.parent = stop
- children.save! if children.changed?
+ children.save if children.changed? && children.valid?
end
end
end
@@ -166,7 +166,7 @@ module Stif
stop.import_xml = entry[:xml]
prop = stop.new_record? ? :imported_count : :updated_count
increment_counts prop, 1
- stop.save!
+ stop.save if stop.valid?
end
# Create AccessPoint from StopPlaceEntrance
if entry[:stop_place_entrances]