title: Why alias_method fails in Rails model
body: <pre><code>class Country &lt; ActiveRecord::Base
  
    #alias_method :name, :langEN # here fails
    #alias_method :name=, :langEN=
  
    #attr_accessible :name
  
    def name; langEN end # here works
  end
  </code></pre>
  
  <p>In first call <code>alias_method</code> fails with:</p>
  
  <pre><code>NameError: undefined method `langEN' for class `Country'
  </code></pre>
  
  <p>I mean it fails when I do for example <code>Country.first</code>.</p>
  
  <p>But in console I can call <code>Country.first.langEN</code> successfully, and see that second call also works.</p>
  
  <p>What am I missing?</p>