title: Magento Rule Model override
body: <p>I've got a little problem overriding the Magento core class: Core/Rule/Model/Rule.php. 
  I think I'm doing everything correctly, but the code just doesn't work (Nothing changes).</p>
  
  <p>My [namespace]/Rule/etc/config.xml:</p>
  
  <pre><code> &lt;?xml version="1.0"?&gt;
  &lt;config&gt;
   &lt;modules&gt;
    &lt;[namespace]_Rule&gt;
     &lt;version&gt;0.1.0&lt;/version&gt;
    &lt;/[namespace]_Rule&gt;
   &lt;/modules&gt;
      &lt;global&gt;
          &lt;models&gt;
              &lt;rule&gt;
                  &lt;rewrite&gt;
                      &lt;rule&gt;[namespace]_Rule_Model_Rule&lt;/rule&gt;
      &lt;/rewrite&gt;
              &lt;/rule&gt;
          &lt;/models&gt;
      &lt;/global&gt;
  &lt;/config&gt;
  </code></pre>
  
  <p>My [namespace]/Rule/Model/Rule.php:</p>
  
  <pre><code>class [namespace]_Rule_Model_Rule extends Mage_Rule_Model_Rule
  {
  
    protected function _beforeSave()
      { 
  
          if ($this-&gt;getConditions()) {
              $this-&gt;setConditionsSerialized(serialize($this-&gt;getConditions()-&gt;asArray()));
              $this-&gt;unsConditions();
          }
          if ($this-&gt;getActions()) {
              $this-&gt;setActionsSerialized(serialize($this-&gt;getActions()-&gt;asArray()));
              $this-&gt;unsActions();
          }
  
          $this-&gt;_prepareWebsiteIds();
  
          if (is_array($this-&gt;getCustomerGroupIds())) {
              $this-&gt;setCustomerGroupIds(join(',', $this-&gt;getCustomerGroupIds()));
          }
          parent::_beforeSave();
      }
  </code></pre>
  
  <p>My app/etc/[namespace]_All.xml:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;config&gt;
      &lt;modules&gt;
      &lt;[namespace]_Rule&gt;
             &lt;active&gt;true&lt;/active&gt;
             &lt;codePool&gt;local&lt;/codePool&gt;
         &lt;/[namespace]_Rule&gt;
  
      &lt;/modules&gt;
  &lt;/config&gt;
  </code></pre>
  
  <p>I would really appreciate some help.</p>