show in a user profile who the user was invited by

This commit is contained in:
joshua stein 2012-09-16 15:14:26 -05:00
parent 857f2964d7
commit dae138cddd
2 changed files with 10 additions and 1 deletions

View file

@ -9,6 +9,8 @@ class User < ActiveRecord::Base
:class_name => "Message",
:foreign_key => "recipient_user_id"
has_many :tag_filters
belongs_to :invited_by_user,
:class_name => "User"
has_secure_password

View file

@ -21,7 +21,14 @@
<label class="required">Joined:</label>
<span class="d">
<%= time_ago_in_words(@showing_user.created_at) %> ago
<%= time_ago_in_words(@showing_user.created_at) %>
<% if @showing_user.invited_by_user %>
ago, invited by
<a href="/u/<%= @showing_user.invited_by_user.username %>"><%=
@showing_user.invited_by_user.username %></a>
<% else %>
ago
<% end %>
</span>
<br>