diff options
| author | Thomas Haddad | 2017-04-19 16:30:55 +0200 |
|---|---|---|
| committer | Thomas Haddad | 2017-04-19 16:31:10 +0200 |
| commit | e0fd60242c3994b4157d506c1ce71cab6ffab268 (patch) | |
| tree | f5672fa04d425e774a9be48302cd8035ff578302 | |
| parent | b7684b0cd694605d2c140159c79f7155fb601130 (diff) | |
| download | chouette-core-e0fd60242c3994b4157d506c1ce71cab6ffab268.tar.bz2 | |
Add Day_types in tt month rabl
Signed-off-by: Thomas Shawarma Haddad <thomas.haddad@af83.com>
| -rw-r--r-- | app/views/time_tables/month.rabl | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/views/time_tables/month.rabl b/app/views/time_tables/month.rabl index 571abfb0c..5b8b67f6c 100644 --- a/app/views/time_tables/month.rabl +++ b/app/views/time_tables/month.rabl @@ -1,4 +1,9 @@ object @time_table -node(:name) { I18n.l(@date, format: '%B') } -node(:days) {|tt| tt.month_inspect(@date) } +node do |tt| + { + name: I18n.l(@date, format: '%B'), + days: tt.month_inspect(@date), + day_types: %w(monday tuesday wednesday thursday friday saturday sunday).select{ |d| tt.send(d) }.map{ |d| tt.human_attribute_name(d).first(2)}.join('') + } +end |
