From: Tom Hughes Date: Sun, 18 Apr 2010 11:44:53 +0000 (+0000) Subject: Ignore whitespace around the commas when splitting a user's list of X-Git-Tag: live~6367^2~7 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/f576c475255d4e91bc453cc426bfd7666f831752?hp=a4b1c178c93de40d36e8fea16a8a1403e22da68b;ds=sidebyside Ignore whitespace around the commas when splitting a user's list of preferred languages. Closes #2891. --- diff --git a/app/models/user.rb b/app/models/user.rb index 0b8b512ee..f02c9a5cd 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -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)