Permalink
Browse files

Use field_map instead of raw record hash to check for key fields

  • Loading branch information...
1 parent 5bc815f commit 7dd570d66ecad188e94761b767ca5a1df9725883 Avdi Grimm committed Nov 14, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/dm-core/model.rb
View
2 lib/dm-core/model.rb
@@ -495,7 +495,7 @@ def load(records, query)
model = discriminator && record[discriminator] || self
model_key = model.key(repository_name)
- resource = if model_key.valid?(key_values = record.values_at(*model_key))
+ resource = if model_key.valid?(key_values = field_map.values_at(*model_key))
identity_map = repository.identity_map(model)
identity_map[key_values]
end

0 comments on commit 7dd570d

Please sign in to comment.