datamapper/dm-core — pull request #185 by MarkusQ (2012-02-20 06:11:01+00:00)
Title: This fixes lighthouse#1475, results incorrectly marked as immutable

Model#load checks the validity of the fields in the PK when determining if the
object returned should be live or immutable. Unfortunately, it checks the raw
values rather than the loaded values, resulting in data incorrectly marked as
immutable if the PK countains fields (Enum, Flag, etc.) that are stored in a
different format than the format in which they are represented within the
application.

This fixes the bug by loading the values that make up the PK before checking their
validity.

For a description of the symptoms, see the thread linked to from:

http://datamapper.lighthouseapp.com/projects/20609/tickets/1475-strange-immutable-error