title: rails, how to pass self in function
body: <p>message and user. my message belongs_to user and user has_many messages.</p>
  
  <p>in one of my views, i call something like</p>
  
  <pre><code>current_user.home_messages?
  </code></pre>
  
  <p>and in my user model, i have...</p>
  
  <pre><code>  def home_messages?
      Message.any_messages_for
    end
  </code></pre>
  
  <p>and lastly in my message model, i have</p>
  
  <pre><code>scope :any_messages_for
  
      def self.any_messages_for
          Message.where("to_id = ?", self.id).exists? 
      end
  </code></pre>
  
  <p>ive been trying to get the current_users id in my message model. i could pass in current_user as a parameter from my view on top but since im doing</p>
  
  <pre><code>current_user.home_messages?
  </code></pre>
  
  <p>i thought it would be better if i used self. but how do i go about referring to it correctly?</p>
  
  <p>thank you.</p>