diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 34a8955788af3216cc8ab37c32e28f101b8cbb02..81317021e2244ae0183f1e0d07e774dce82c33a0 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -71,7 +71,7 @@ class UsersController < ApplicationController @person = @user.person @profile = @user.profile @services = @user.services - @requests = Request.to(@person).all + @requests = Request.where(:recipient_id => @person.id).all @step = ((params[:step].to_i>0)&&(params[:step].to_i<5)) ? params[:step].to_i : 1 @step ||= 1 diff --git a/app/models/notification.rb b/app/models/notification.rb index 14480536a17b431019c00679a6e6c9d8a0634c7b..62d6ad8408ded3c0fc42189b74f6768d89064255 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -3,6 +3,7 @@ # the COPYRIGHT file. # class Notification < ActiveRecord::Base + require File.join(Rails.root, 'lib/diaspora/web_socket') include Diaspora::Socketable belongs_to :recipient, :class_name => 'User' diff --git a/app/views/notifications/index.html.haml b/app/views/notifications/index.html.haml index 45d5048414e6524ea30a2f930f4dff1c8e7e429e..2e6e307b49bbd438e2a7981e2af296d3c470c05c 100644 --- a/app/views/notifications/index.html.haml +++ b/app/views/notifications/index.html.haml @@ -36,7 +36,7 @@ - notes.each do |note| %li.message{:data=>{:guid => note.id}, :class => "#{note.unread ? 'unread' : ''}"} %span.from - = link_to "#{note.person.name.titleize}", person_path(note.person) + = link_to "#{note.actor.name.titleize}", person_path(note.actor) = object_link(note) %span.time= "#{t('ago', :time => time_ago_in_words(note.created_at))}" diff --git a/app/views/shared/_notification.haml b/app/views/shared/_notification.haml index 7f99239f741d2b1067429685cac76d711caf1675..cb68338c559dd687e035c51ebe5e8a3c022ea1cb 100644 --- a/app/views/shared/_notification.haml +++ b/app/views/shared/_notification.haml @@ -5,5 +5,5 @@ = link_to t('.new', :type => object.class.to_s, :from => object.person.name), object_path(object.post) -= link_to "#{note.person.name.titelize}", person_path(note.person) += link_to "#{note.actor.name.titelize}", person_path(note.actor) = object_link(note) diff --git a/features/step_definitions/custom_web_steps.rb b/features/step_definitions/custom_web_steps.rb index e12e383f0831c59f0864e87c292df74304fe7ce2..2516c0547f9feaa1c369a597122129148df49dc7 100644 --- a/features/step_definitions/custom_web_steps.rb +++ b/features/step_definitions/custom_web_steps.rb @@ -37,7 +37,7 @@ When /^I wait for the aspects page to load$/ do end When /^I wait for the request's profile page to load$/ do - wait_until { current_path == person_path(Request.where(:recipient_id => @me.id).first.sender) } + wait_until { current_path == person_path(Request.where(:recipient_id => @me.person.id).first.sender) } end When /^I wait for the ajax to finish$/ do diff --git a/features/support/paths.rb b/features/support/paths.rb index 39d4e20baf979a68cf7b9fb05efd1d3531d927be..6ac317d49a9f17ebb7d0e2b95e5120a1f43fd841 100644 --- a/features/support/paths.rb +++ b/features/support/paths.rb @@ -12,7 +12,7 @@ module NavigationHelpers when /^my acceptance form page$/ accept_user_invitation_path(:invitation_token => @me.invitation_token) when /^the requestor's profile page$/ - person_path(Request.to(@me).first.from) + person_path(Request.where(:recipient_id => @me.person.id).first.sender) when /^"([^\"]*)"'s page$/ person_path(User.find_by_email($1).person) when /^"(\/.*)"/