aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorZog2018-04-13 15:39:27 +0200
committercedricnjanga2018-04-16 06:34:37 -0700
commitac508f15b191a28a6582a8acb4d177fd20b9baa2 (patch)
treecd4053afa773fda975058ad3926663a4131a8cfd /app/models
parent51125f25847db2bb2c654c1bbfd1fd39295693f6 (diff)
downloadchouette-core-ac508f15b191a28a6582a8acb4d177fd20b9baa2.tar.bz2
Refs #6450; Don't consider the empty string as a valid color for Timetables
Same for PurchazeWindows
Diffstat (limited to 'app/models')
-rw-r--r--app/models/chouette/purchase_window.rb7
-rw-r--r--app/models/chouette/time_table.rb5
2 files changed, 9 insertions, 3 deletions
diff --git a/app/models/chouette/purchase_window.rb b/app/models/chouette/purchase_window.rb
index e10b106ec..d22674637 100644
--- a/app/models/chouette/purchase_window.rb
+++ b/app/models/chouette/purchase_window.rb
@@ -46,8 +46,9 @@ module Chouette
]
end
- # def checksum_attributes
- # end
-
+ def color
+ _color = read_attribute(:color)
+ _color.present? ? _color : nil
+ end
end
end
diff --git a/app/models/chouette/time_table.rb b/app/models/chouette/time_table.rb
index 648a0c5ea..29e3808e7 100644
--- a/app/models/chouette/time_table.rb
+++ b/app/models/chouette/time_table.rb
@@ -81,6 +81,11 @@ module Chouette
chunk.values.delete_if {|dates| dates.count < 2}
end
+ def color
+ _color = read_attribute(:color)
+ _color.present? ? _color : nil
+ end
+
def convert_continuous_dates_to_periods
chunks = self.continuous_dates