title: How to access class variable in Model class
body: <p>I want to define the class variable <code>test</code>, <code>threshold</code></p>
  
  <p>so that I can use  <code>Order.test, Order.threshold</code> in my Rails app</p>
  
  <p>but I can not access the class variable when using the rails console</p>
  
  <p>I must misunderstand something, where's the problem? Thanks.</p>
  
  <pre><code>class Order &lt; ActiveRecord::Base
    @@test=123
    @@threshold = {
      VIP: 500,
      PLATINUM: 20000
    }
  </code></pre>
  
  <p>Here is the <code>rails console</code></p>
  
  <pre><code>irb(main):001:0&gt; Order.class_variables
  =&gt; [:@@test, :@@threshold]
  irb(main):002:0&gt; Order.test
  NoMethodError: private method `test' called for #&lt;Class:0x007fe5a63ac738&gt;
  </code></pre>