X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/c9d35839befe92d916425baa4daec7dd77ade929..c7061991e74a20cc0576a3afa269821a87178f77:/app/models/user.rb diff --git a/app/models/user.rb b/app/models/user.rb index 0053333e2..1a0e3415e 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -131,8 +131,8 @@ class User < ActiveRecord::Base languages.find { |l| Language.exists?(:code => l) } end - def preferred_language_from(array) - (languages & array.collect(&:to_s)).first + def preferred_languages + @locales ||= Locale.list(languages) end def nearby(radius = NEARBY_RADIUS, num = NEARBY_USERS) @@ -242,7 +242,7 @@ class User < ActiveRecord::Base private def set_defaults - self.creation_time = Time.now.getutc unless self.attribute_present?(:creation_time) + self.creation_time = Time.now.getutc unless attribute_present?(:creation_time) end def encrypt_password