]> git.openstreetmap.org Git - rails.git/commitdiff
Ignore whitespace around the commas when splitting a user's list of
authorTom Hughes <tom@compton.nu>
Sun, 18 Apr 2010 11:44:53 +0000 (11:44 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 19 Apr 2010 13:28:03 +0000 (14:28 +0100)
preferred languages. Closes #2891.

app/models/user.rb

index 0b8b512ee3bab5becf3bc350fb916026bd51b5b0..f02c9a5cd0067b63afc3984575534c38fb0a550b 100644 (file)
@@ -85,7 +85,7 @@ class User < ActiveRecord::Base
   end
 
   def languages
-    attribute_present?(:languages) ? read_attribute(:languages).split(",") : []
+    attribute_present?(:languages) ? read_attribute(:languages).split(/ *, */) : []
   end
 
   def languages=(languages)