]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/user.rb
Update bundle
[rails.git] / app / models / user.rb
index 0053333e2c3ed5e8ede766dba02d284cb11372a4..1a0e3415eacfd416509fcea0ff01b1708029d2af 100644 (file)
@@ -131,8 +131,8 @@ class User < ActiveRecord::Base
     languages.find { |l| Language.exists?(:code => l) }
   end
 
     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)
   end
 
   def nearby(radius = NEARBY_RADIUS, num = NEARBY_USERS)
@@ -242,7 +242,7 @@ class User < ActiveRecord::Base
   private
 
   def set_defaults
   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
   end
 
   def encrypt_password