]> git.openstreetmap.org Git - rails.git/blobdiff - app/helpers/application_helper.rb
Merge remote-tracking branch 'upstream/pull/1704'
[rails.git] / app / helpers / application_helper.rb
index a330eb5f97d47a19d98d874d3681384219e82d54..adcf5c6c011ec6fdcc31821b2c0af3b74065c083 100644 (file)
@@ -40,9 +40,7 @@ module ApplicationHelper
   end
 
   def if_user(user, tag = :div, &block)
   end
 
   def if_user(user, tag = :div, &block)
-    if user
-      content_tag(tag, capture(&block), :class => "hidden show_if_user_#{user.id}")
-    end
+    content_tag(tag, capture(&block), :class => "hidden show_if_user_#{user.id}") if user
   end
 
   def unless_user(user, tag = :div, &block)
   end
 
   def unless_user(user, tag = :div, &block)
@@ -110,9 +108,7 @@ module ApplicationHelper
     if current_user
       data[:user] = current_user.id.to_json
 
     if current_user
       data[:user] = current_user.id.to_json
 
-      unless current_user.home_lon.nil? || current_user.home_lat.nil?
-        data[:user_home] = { :lat => current_user.home_lat, :lon => current_user.home_lon }
-      end
+      data[:user_home] = { :lat => current_user.home_lat, :lon => current_user.home_lon } unless current_user.home_lon.nil? || current_user.home_lat.nil?
     end
 
     data[:location] = session[:location] if session[:location]
     end
 
     data[:location] = session[:location] if session[:location]