aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorRobert2018-01-08 08:34:34 +0100
committerRobert2018-01-08 08:34:34 +0100
commitdcc56c4d02f9f71b13dd38251367306842cd10c7 (patch)
tree50f69c0ea454e2ba3d8576bfd5fc0c4d98127bff /app/models
parent04274ab7d2b02dd43bb117b817657db5a1ccbfd4 (diff)
parentfa63d6e3d51ccc0b3a38616747fcd91b5fdfbba5 (diff)
downloadchouette-core-dcc56c4d02f9f71b13dd38251367306842cd10c7.tar.bz2
Merge branch 'master' of github.com:af83/stif-boiv
Diffstat (limited to 'app/models')
-rw-r--r--app/models/chouette/area_type.rb2
-rw-r--r--app/models/chouette/journey_pattern.rb3
-rw-r--r--app/models/chouette/vehicle_journey.rb3
3 files changed, 6 insertions, 2 deletions
diff --git a/app/models/chouette/area_type.rb b/app/models/chouette/area_type.rb
index 43d96b391..4703ea646 100644
--- a/app/models/chouette/area_type.rb
+++ b/app/models/chouette/area_type.rb
@@ -13,6 +13,8 @@ class Chouette::AreaType
@@instances = {}
def self.find(code)
+ return unless code
+
code = code.to_sym
@@instances[code] ||= new(code) if ALL.include? code
end
diff --git a/app/models/chouette/journey_pattern.rb b/app/models/chouette/journey_pattern.rb
index 03967abfa..366fde188 100644
--- a/app/models/chouette/journey_pattern.rb
+++ b/app/models/chouette/journey_pattern.rb
@@ -40,7 +40,8 @@ module Chouette
# Update attributes and stop_points associations
jp.update_attributes(state_permited_attributes(item)) unless item['new_record']
jp.state_stop_points_update(item) if !jp.errors.any? && jp.persisted?
- item['errors'] = jp.errors if jp.errors.any?
+ item['errors'] = jp.errors if jp.errors.any?
+ item['checksum'] = jp.checksum
end
if state.any? {|item| item['errors']}
diff --git a/app/models/chouette/vehicle_journey.rb b/app/models/chouette/vehicle_journey.rb
index 332ddb7b8..d4dc82a56 100644
--- a/app/models/chouette/vehicle_journey.rb
+++ b/app/models/chouette/vehicle_journey.rb
@@ -170,7 +170,8 @@ module Chouette
vj.update_attributes(state_permited_attributes(item))
vj.update_has_and_belongs_to_many_from_state(item)
- item['errors'] = vj.errors.full_messages.uniq if vj.errors.any?
+ item['errors'] = vj.errors.full_messages.uniq if vj.errors.any?
+ item['checksum'] = vj.checksum
end
# Delete ids of new object from state if we had to rollback