]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/diary_entries_controller.rb
Avoid using _id in queries
[rails.git] / app / controllers / diary_entries_controller.rb
index 018343d7c457dbc3d0565e106f9e6008a78fd0c9..dcb625d836932a9746e2aac99bc5d2952577ae92 100644 (file)
@@ -1,4 +1,6 @@
 class DiaryEntriesController < ApplicationController
+  include UserMethods
+
   layout "site", :except => :rss
 
   before_action :authorize_web
@@ -25,7 +27,7 @@ class DiaryEntriesController < ApplicationController
     elsif params[:friends]
       if current_user
         @title = t ".title_friends"
-        entries = DiaryEntry.where(:user_id => current_user.friends)
+        entries = DiaryEntry.where(:user => current_user.friends)
       else
         require_user
         return
@@ -33,7 +35,7 @@ class DiaryEntriesController < ApplicationController
     elsif params[:nearby]
       if current_user
         @title = t ".title_nearby"
-        entries = DiaryEntry.where(:user_id => current_user.nearby)
+        entries = DiaryEntry.where(:user => current_user.nearby)
       else
         require_user
         return
@@ -280,7 +282,7 @@ class DiaryEntriesController < ApplicationController
       @lon = @diary_entry.longitude
       @lat = @diary_entry.latitude
       @zoom = 12
-    elsif !current_user.has_home?
+    elsif !current_user.home_location?
       @lon = params[:lon] || -0.1
       @lat = params[:lat] || 51.5
       @zoom = params[:zoom] || 4