Closed wink closed 11 years ago
If you call Model.columns multiple times, it was adding a new :id field each time. This can happen if you call Model.columns once from the model itself and a second time from an included mixin/module. The respond_to? method currently being used is applied to the class itself, but the class will never respond to :id, because the :id method is on the instance, not the class.
Steve, this is also fixed in my optimizations branch, along with many other things in prep for sql. Sql is actually getting close, I want to discuss with you ramifications of merging that as well.
https://github.com/aceofspades/motionmodel/tree/optimizations does pass specs. Want to have a look at that before deciding whether to merge this one?
I'll get on this by Thursday.
This is merged but there is further comment. I'm going to close it. Reopen if you think it is still unresolved @wink.
Calling Model.serialize_to_file generates the following warning for each and every record being serialized:
*\ NSKeyedArchiver warning: replacing existing value for key 'id'; probable duplication of encoding keys in class hierarchy
This occurs even when I'm writing for the first time to a brand new file, by using Model.serialize_to_file('never_been_used.dat')