title: Seeing who viewed your profile w/ bonus feature - they can unlock if they retweet about the website
body: <p>so I've created a web app that has user profiles, where users can search for fellow users based on interests etc.. How can I provide users with the ability to see who viewed their profile, which isa bonus feature that they can unlock if they retweet about the website.</p>
  
  <p>The which users viewed your profile can be done with something like this I guess:</p>
  
  <pre><code>class User &lt; ActiveRecord::Base
    has_many :user_visits
    has_many :visitors, :through =&gt; :user_visits, :source =&gt; :visitor
  end
  
  class UserVisit &lt; ActiveRecord::Base
    # user_id :integer
    # visitor_id :integer
    # visited_at :datetime
  
    belongs_to :user
    belongs_to :visitor, :foreign_key =&gt; 'visitor_id', :class_name =&gt; 'User'
  end
  
  
  User.first.visitors = [user_1, user2]
  </code></pre>
  
  <p>Although, I'm not quite sure how they'd be added to the visitors array? I.e. If they visit the page what will cause them to be stored as a visitor?</p>
  
  <p>And the second feature how can I create the ability to un-lock a feature, and how can I make it so the feature will be un-locked if the user tweets a certain message, in this case the website URL.</p>