The separator is supposed to be comma, so technically having
space instead is user error, but it seems to be very common.
Fixes #942
end
def languages
- attribute_present?(:languages) ? self[:languages].split(/ *, */) : []
+ attribute_present?(:languages) ? self[:languages].split(/ *[, ] */) : []
end
def languages=(languages)
home_zoom: 12
terms_agreed: "2010-01-01 11:22:33"
terms_seen: true
- languages: en
+ languages: "en de"
creation_ip: "4.5.6.7"
inactive_user:
user.languages = %w(fr de sl)
assert_equal "de", user.preferred_language
assert_equal "de", user.preferred_language_from(%w(en sl de es))
+ user = users(:public_user)
+ assert_equal %w(en de), user.languages
end
def test_visible?