title: Rails: Is there any way to rename columns without modifying the controllers?
body: <p>I'm trying to rename the columns in a Rails project, and I generated migration files and <code>bundle exec rake db:migrate</code>.</p>
  
  <p>Procedures are like this.</p>
  
  <p>generate file,</p>
  
  <pre><code>bin/rails g migration RenameUserTwitterNameToName
  </code></pre>
  
  <p>and write the method with column names,</p>
  
  <pre><code>def change
    rename_column :users, :twitter_name, :name
  end
  </code></pre>
  
  <p>finally execute the rake task.</p>
  
  <pre><code>bundle exec rake db:migrate
  </code></pre>
  
  <p>Although it works well, I need to modify the controllers related to the columns. </p>
  
  <p>For example, if there is a code like below, I need to change the method <code>find_by_twitter_name</code> to <code>find_by_name</code></p>
  
  <pre><code>@user = User.find_by_twitter_name(name)
  </code></pre>
  
  <p>Is there any way to modify the controller like above automatically?</p>