playlouder/persistence — pull request #2 by timcowlishaw (2012-04-18 13:41:04+00:00)
Title: reject non-symbol property arguments by raising an ArgumentError

Hi there chaps,

I've noticed that calling Persistence::Sequel::IdentitySetRepository#get_by_property (and similar methods) fails in a slightly counter-intuitive way (raising "no such property mapper" if the property name is passed as a string rather than a symbol. To my mind, raising an ArgumentError would be a little more descriptive in this case, please find attached tests and a patch that will do this. Alternatively, it could be possible to allow properties to be passed as strings and convert them silently, I've also got tests and a patch for this behaviour that I'll submit in another pull request.

Cheers,

Tim