From 76c48f3c9c62aa340f8d70414a4d69fc041ffed0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabi=C3=A1n=20Rodr=C3=ADguez?= Date: Mon, 29 Oct 2012 18:52:17 -0200 Subject: [PATCH] privatize non-action controller method --- app/controllers/people_controller.rb | 30 ++++++++++++++-------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index 7bf708867..473165f83 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -66,20 +66,6 @@ class PeopleController < ApplicationController respond_with @people end - def hashes_for_people(people, aspects) - ids = people.map{|p| p.id} - contacts = {} - Contact.unscoped.where(:user_id => current_user.id, :person_id => ids).each do |contact| - contacts[contact.person_id] = contact - end - - people.map{|p| - {:person => p, - :contact => contacts[p.id], - :aspects => aspects} - } - end - def show @person = Person.find_from_guid_or_username(params) @@ -162,6 +148,8 @@ class PeopleController < ApplicationController end end + private + def redirect_if_tag_search if search_query.starts_with?('#') if search_query.length > 1 @@ -173,7 +161,19 @@ class PeopleController < ApplicationController end end - private + def hashes_for_people(people, aspects) + ids = people.map{|p| p.id} + contacts = {} + Contact.unscoped.where(:user_id => current_user.id, :person_id => ids).each do |contact| + contacts[contact.person_id] = contact + end + + people.map{|p| + {:person => p, + :contact => contacts[p.id], + :aspects => aspects} + } + end def search_query @search_query ||= params[:q] || params[:term] || ''