title: What's the difference between using self.attribute and attribute in a model?
body: <p>In Ruby on Rails, what's the difference between using self.attribute and attribute in a model?</p>
  
  <p>In this example, assume my_attr is an attribute of the user that gets stored in the database.</p>
  
  <pre><code>class User &lt; ActiveRecord::Base
    def do_something!
      self.my_attr = 123
    end
  
    def do_another_thing!
      my_attr = 456
    end
  end
  </code></pre>