aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorMichel Etienne2014-08-29 11:44:05 +0200
committerMichel Etienne2014-08-29 11:44:05 +0200
commite1c8a62852616fcfcc6a79b6cc4aefc50e4bd628 (patch)
tree7f1aa8ebd5b789ae1ce7a46ff9c4a2b87be7d578 /app/models
parent47be58af8bdae063c7177bcab7019c19030c75db (diff)
downloadchouette-core-e1c8a62852616fcfcc6a79b6cc4aefc50e4bd628.tar.bz2
active pagination on remote
Diffstat (limited to 'app/models')
-rw-r--r--app/models/stop_area_copy.rb16
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?