
DataMapper.finalize can incorrectly declare a model invalid
Reported by Jonathan Stott (namelessjon) | June 10th, 2010 @ 06:11 AM
When creating an explicitly named join model, it is now possible
to declare multiple belongs_to :parent, :key =>
true
entries. Depending on the require order, it is possible
that the join model will be required (and thus appear in the
descendant set) before either of the parents. In this case the
check for a key will fail, as none of the belongs_to
relationships are initialized
This is fixed in:
Comments and changes to this ticket
-
Dan Kubb (dkubb) June 12th, 2010 @ 04:12 PM
- State changed from accepted to resolved
(from [40ff12ed9dacb4ce005b6bc19e6e1200fd11faac]) Initialize relationships before checking for keys
DataMapper.finalize now initializes all relationships before checking
for keys. This allows a join model which consists entirely of
belongs_to relationships with:key => true' to be considered valid.
[#1313 state:resolved] http://github.com/datamapper/dm-core/commit/40ff12ed9dacb4ce005b6bc...
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
People watching this ticket
Tags
Referenced by
-
1313 DataMapper.finalize can incorrectly declare a model invalid [#1313 state:resolved] http://github.com/datamapper/dm-c...