This project is archived and is in readonly mode.

#5927 ✓committed
David Chelimsky

ActiveRecord should favor ActiveModel API

Reported by David Chelimsky | November 7th, 2010 @ 02:20 PM

ActiveModel introduced the persisted? method (inverse of new_record?), but ActiveRecord still uses new_record? internally and across associations. This means that extension libraries sometimes have to be aware of whether they're dealing with ActiveRecord or not.

Fixed in


  • patched against master as of c43d909ee28484c5e7d7d84b1228e10212d20737
  • there was one failing test before this commit, which is still failing:


  • there is one new failing test, but I question its validity. It specifies that to_key should return a non-nil value after destroy is called on a model. This seems like the opposite of what we would want, and this is the only new test failure (so no other code seems to rely on this behavior).


Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>

Referenced by