diff options
| author | Michel Etienne | 2014-08-29 11:44:05 +0200 |
|---|---|---|
| committer | Michel Etienne | 2014-08-29 11:44:05 +0200 |
| commit | e1c8a62852616fcfcc6a79b6cc4aefc50e4bd628 (patch) | |
| tree | 7f1aa8ebd5b789ae1ce7a46ff9c4a2b87be7d578 /app/models | |
| parent | 47be58af8bdae063c7177bcab7019c19030c75db (diff) | |
| download | chouette-core-e1c8a62852616fcfcc6a79b6cc4aefc50e4bd628.tar.bz2 | |
active pagination on remote
Diffstat (limited to 'app/models')
| -rw-r--r-- | app/models/stop_area_copy.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/app/models/stop_area_copy.rb b/app/models/stop_area_copy.rb index 2bd6447ab..39ae42c34 100644 --- a/app/models/stop_area_copy.rb +++ b/app/models/stop_area_copy.rb @@ -14,6 +14,22 @@ class StopAreaCopy def initialize(attributes = {}) attributes.each { |name, value| send("#{name}=", value) } if attributes + if self.area_type.blank? && self.source != nil + self.source_id = self.source.id + if self.hierarchy == "child" + if self.source.area_type.underscore == "stop_place" + self.area_type="commercial_stop_point" + else + self.area_type="boarding_position" + end + else + if self.source.area_type.underscore == "stop_place" || self.source.area_type.underscore == "commercial_stop_point" + self.area_type="stop_place" + else + self.area_type="commercial_stop_point" + end + end + end end def persisted? |
