public
Description: The open source social networking platform in Ruby on Rails from the author of RailsSpace
Homepage: http://insoshi.com
Clone URL: git://github.com/insoshi/insoshi.git
Search Repo:
Polished up unfriending
Michael Hartl (author)
Wed May 07 12:00:19 -0700 2008
commit  ed4fb244bd0c174df2814784e443cffa1a12d9b1
tree    1b98daefa256153aa7243aa0fbe354dc8230b83a
parent  c50345cc82fbce88f710b5bc8c54111e30e480eb
...
76
77
78
 
79
80
81
...
76
77
78
79
80
81
82
0
@@ -76,6 +76,7 @@ class Connection < ActiveRecord::Base
0
         request(person, contact, mail)
0
         accept(person, contact)
0
       end
0
+ conn(person, contact)
0
     end
0
   
0
     # Delete a connection or cancel a pending request.
...
9
10
11
12
13
14
15
 
16
17
18
...
9
10
11
 
 
 
 
12
13
14
15
0
@@ -9,10 +9,7 @@
0
         <%= image_link contact, :image_options => { :class => "photo" },
0
                                 :link_options => { :class => "url" },
0
                                 :vcard => true,
0
- :image => :bounded_icon,
0
-
0
- :destroy => (current_person? @person), #destroy if in own profile
0
- :send_message => (current_person? (@person)) %>
0
+ :image => :bounded_icon %>
0
       </li>
0
     <%- end -%>
0
       
...
21
22
23
24
25
26
27
28
 
 
 
 
 
 
 
 
 
 
29
30
31
...
21
22
23
 
 
 
 
 
24
25
26
27
28
29
30
31
32
33
34
35
36
0
@@ -21,11 +21,16 @@
0
             </li>
0
           <%- end -%>
0
           <%- if Connection.connected?(@person, current_person) -%>
0
- <li><%= h @person.name %> is one of your contacts </li>
0
- <li><%= link_to "break up",
0
- connection_path(Connection.conn(current_person,@person)),
0
- :method => :delete,
0
- :confirm => "Are you sure you want to break up with #{@person.name}" %></li>
0
+ <li>
0
+ <%= h @person.name %> is one of your contacts
0
+ <br />
0
+ (<%= link_to "end connection",
0
+ connection_path(Connection.conn(current_person, @person)),
0
+ :method => :delete,
0
+ :confirm =>
0
+"Are you sure you want to end connection with #{h @person.name}?" %>)
0
+
0
+ </li>
0
           <%- end -%>
0
           <li><%= email_link @person %></li>
0
         <%- end -%>
...
221
222
223
224
225
 
226
227
 
228
229
230
...
232
233
234
235
 
236
237
238
...
221
222
223
 
 
224
225
 
226
227
228
229
...
231
232
233
 
234
235
236
237
0
@@ -221,10 +221,9 @@ describe PeopleController do
0
     it "should display break up link if connected" do
0
       login_as(@person)
0
       @contact = people(:aaron)
0
- conn = Connection.request(@person,@contact)
0
- conn.accept
0
+ conn = Connection.connect(@person, @contact)
0
       get :show, :id => @contact.reload
0
- response.should have_tag("a", :text => "break up")
0
+ response.should have_tag("a", :text => "end connection")
0
       response.should have_tag("a[href=?]", connection_path(conn))
0
     end
0
     
0
@@ -232,7 +231,7 @@ describe PeopleController do
0
       login_as(@person)
0
       @contact = people(:aaron)
0
       get :show, :id => @contact.reload
0
- response.should_not have_tag("a", :text => "break up")
0
+ response.should_not have_tag("a", :text => "end connection")
0
     end
0
   end
0
   

Comments

    No one has commented yet.