Listing 11.1 Adding indices for the relationships table
Listing 11.2 Testing Relationshio creation and attributes
Listing 11.2 Testing Relationshio creation and attributes (fix typo)
Listing 11.3 Testing for the user.relationships attribute.
Listing 11.3 Testing for the user.relationships attribute.(fix typo)
Listing 11.4 Implementing the user/relationships has_many association.
Listing 11.5 Testing the user/relationships belongs_to association
Listing 11.6 Adding the belongs_to associations to the Relationship model
Listing 11.7 Testing the Relationship model validations
Listing 11.8 Adding the Relationship model validations
Listing 11.9 A test for the user.followed_users attribute
Listing 11.10 Adding the User model followed_users association
Listing 11.11 Tests for some 'following' utility methods
Listing 11.12 The following? and follow! utility methods
Listing 11.13 A test for unfollowing a user.
Listing 11.14 Unfollowing a user by destroying a user relationship
Listing 11.15 Testing for reverse relationships
Listing 11.16 Implementing user.followers using reverse relationships
Listing 11.17 Adding following/follower relationships to the sample data
Listing 11.18 Adding following and followers actions to the Users controller