add object_aspect_ids to status_message controller

This commit is contained in:
Maxwell Salzberg 2011-06-16 15:59:03 -07:00
parent 41e8a32b28
commit 1f11e51a9b
2 changed files with 11 additions and 1 deletions

View file

@ -185,7 +185,7 @@ class PhotosController < ApplicationController
# used on the show page to show which aspects are selected # used on the show page to show which aspects are selected
def object_aspect_ids def object_aspect_ids
if params[:action] == 'show' && parent_aspects = parent.aspects.where(:user_id => current_user.id).all if params[:action] == 'show' && parent_aspects = parent.aspects.where(:user_id => current_user.id).all
@object_aspect_ids ||= parent_aspects.map!{|a| a.id} @object_aspect_ids ||= parent_aspects.map{|a| a.id}
else else
super super
end end

View file

@ -9,6 +9,9 @@ class StatusMessagesController < ApplicationController
respond_to :mobile respond_to :mobile
respond_to :json, :only => :show respond_to :json, :only => :show
helper_method :object_aspect_ids
def new def new
@person = Person.find(params[:person_id]) @person = Person.find(params[:person_id])
@aspect = :profile @aspect = :profile
@ -121,4 +124,11 @@ class StatusMessagesController < ApplicationController
end end
end end
def object_aspect_ids
if params[:action] == 'show'
@object_aspect_ids ||= @status_message.aspects.map{|a| a.id}
else
super
end
end
end end