Newer
Older
module SocketsHelper
(object.is_a? Post) ? object.id : object.post_id
user = User.find_by_id(User.ensure_bson uid)
v = render_to_string(:partial => type_partial(object), :locals => {:post => object, :current_user => user}) unless object.is_a? Retraction
Rails.logger.error("web socket view rendering failed for object #{object.inspect}.")
action_hash = {:class =>object.class.to_s.underscore.pluralize, :html => v, :post_id => obj_id(object)}
action_hash.merge! opts
action_hash[:photo_hash] = object.thumb_hash
elsif object.is_a? StatusMessage
action_hash[:status_message_hash] = object.latest_hash
action_hash[:status_message_hash][:mine?] = true if object.person.owner_id == uid
if object.person.owner_id == uid
action_hash[:mine?] = true
end