title: Overriding initialize method into model in Rails
body: <p>I'm trying to override the initialize method. See below</p>
  
  <pre><code>class Restriction &lt; ActiveRecord::Base
    RESTRICTION_TYPES = {
      less_than: "IND&lt;X", 
      greater_than: "X&lt;IND", 
      between: "X&lt;IND&lt;Y"
    }
  
    def initialize restriction_type_name
      super
      formula = RESTRICTION_TYPES[restriction_type_name]
    end
  
    private
    def formula=f
      self[:formula] = f
    end
  
  end
  </code></pre>
  
  <p>When I run <code>r = Restriction.new(:between)</code> I get the exception:</p>
  
  <pre><code>NoMethodError: undefined method `stringify_keys' for :between:Symbol
  </code></pre>
  
  <p>What am I doing wrong?</p>
  
  <p>BTW I'm doing this due to <code>formula</code> attribute can't be acceded from outside.</p>