From 7a02a31440ed2ad436eb2537380f06ed9185039b Mon Sep 17 00:00:00 2001 From: maxwell Date: Tue, 18 Jan 2011 22:11:58 -0800 Subject: [PATCH] fix invitations#new, and a post spec which was mongo specific --- app/controllers/invitations_controller.rb | 4 ++-- app/views/invitations/new.html.haml | 1 - spec/models/post_spec.rb | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/controllers/invitations_controller.rb b/app/controllers/invitations_controller.rb index 906edc9f0..bb5447e2a 100644 --- a/app/controllers/invitations_controller.rb +++ b/app/controllers/invitations_controller.rb @@ -7,8 +7,8 @@ class InvitationsController < Devise::InvitationsController before_filter :check_token, :only => [:edit] def new - sent_invitations = current_user.invitations_from_me - @emails_delivered = sent_invitations.map!{ |i| i.to.email } + sent_invitations = current_user.invitations_from_me.includes(:recipient) + @emails_delivered = sent_invitations.map!{ |i| i.recipient.email } end def create diff --git a/app/views/invitations/new.html.haml b/app/views/invitations/new.html.haml index c2aee46f9..45fc2b88b 100644 --- a/app/views/invitations/new.html.haml +++ b/app/views/invitations/new.html.haml @@ -45,4 +45,3 @@ = t('.already_invited') - for email in @emails_delivered = email - diff --git a/spec/models/post_spec.rb b/spec/models/post_spec.rb index 2269e855f..96b56e22b 100644 --- a/spec/models/post_spec.rb +++ b/spec/models/post_spec.rb @@ -25,7 +25,7 @@ describe Post do post = @user.post :status_message, :message => "hello", :to => @aspect.id xml = post.to_diaspora_xml - xml.include?(@user.person.id.to_s).should be false + xml.include?("person_id").should be false xml.include?(@user.person.diaspora_handle).should be true end end