title: Method variables in rails models
body: <p>When I write <code>ActiveRecord</code> models in rails I want to make sure that local variables I use in my method will remain local to the scope of the method I write, and I will not be accidentally overwriting model property in future.</p>
  
  <p>For example:</p>
  
  <pre><code>class User &lt; ActiveRecord::Base
    after_save :do_something
  
    def do_something
      # ... some logic
      group = "some value"
      # ... more logic 
    end    
  end
  </code></pre>
  
  <p>How do I make sure that if I happen to add <code>group</code> property to my model in future - my method will not accidentally overwrite it? </p>
  
  <p>I thought about class variables, but it's not what they are for, and I think using them will be a bad practice.</p>