#1194 new
Anthony Williams

Removal of repository-specific properties

Reported by Anthony Williams | February 5th, 2010 @ 06:09 PM

My recent post to the mailing list regarding resource properties got a pretty lukewarm response. On top of that, dbussink came up with a pretty compelling use-case for the ability to save a model to multiple repositories: simple sharding.

With that said, all of the examples given suggest that most -- if not all -- users of DataMapper who make use of the ability of save a model to multiple repositories, are using the same properties on each repo.

I've attached two patches for your consideration -- one each for dm-core and dm-more -- removing the ability to define properties which apply to only specific repositories. This means that a Model will have only one set of properties which behave consistently across all repos. It'll also make my AttributeSet refactor possible.

The patches add deprecation warnings when calling Model#properties, #key, #serial, #properties_with_subclasses, or #key_conditions with a repository. The dm-core and dm-more specs all pass, tested with InMemory, Yaml, PostgreSQL, MySQL and SQLite adapters.

If the attached patches meet with your approval, you may prefer to merge the changes in via Github: dm-core commit, dm-more commit.

If you want anything changing, or want me to further justify my reasoning behind the changes, don't hesitate to reply, or ping me on Freenode (where I can normally be found as antw).

No comments found

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.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »