X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/0e96027a209d59ff5e7f5c2b1405febc59664a16..99903362cab3d151a0fc48edb03b946615d3c68a:/app/models/user.rb diff --git a/app/models/user.rb b/app/models/user.rb index f38994e53..683fcc96b 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -90,6 +90,10 @@ class User < ActiveRecord::Base languages.find { |l| Language.find(:first, :conditions => { :code => l }) } end + def preferred_language_from(array) + (languages & array.collect { |i| i.to_s }).first + end + def nearby(radius = 50, num = 10) if self.home_lon and self.home_lat gc = OSM::GreatCircle.new(self.home_lat, self.home_lon)