diff options
author | Benjamin Kellermann <Benjamin.Kellermann@gmx.de> | 2010-01-21 10:08:10 +0100 |
---|---|---|
committer | Benjamin Kellermann <Benjamin.Kellermann@gmx.de> | 2010-01-21 10:08:10 +0100 |
commit | bbdf658b136687dc1751f8a249c5b6858d81774b (patch) | |
tree | 042758dca2ef5f62b9cac5451b252cb554ff7382 /timepollhead.rb | |
parent | aac243814d419a1b05fd898450d6f761de67d055 (diff) |
pressing add without entry has no effect
Diffstat (limited to 'timepollhead.rb')
-rw-r--r-- | timepollhead.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/timepollhead.rb b/timepollhead.rb index 5d7b54f..0bcdb59 100644 --- a/timepollhead.rb +++ b/timepollhead.rb @@ -88,12 +88,16 @@ class TimePollHead parsed_date end - # returns parsed title + # returns parsed title or nil in case of colum not changed def edit_column(column, newtitle, cgi) delete_column(column) if column != "" parsed_date = TimeString.new(newtitle, cgi["columntime"] != "" ? cgi["columntime"] : nil) - @data << parsed_date unless @data.include?(parsed_date) - parsed_date.to_s + if @data.include?(parsed_date) + return nil + else + @data << parsed_date + parsed_date.to_s + end end # returns a sorted array, containing the big units and how often each small is in the big one |