#118 ✓resolved
Bernerd Schaefer

[Revision 665] DataMapper::Property

Reported by Bernerd Schaefer | January 1st, 2008 @ 02:14 PM

I went ahead and did the first chunk of work on DataMapper::Property. It replaces the old code in DataMapper::Persistence and all specs pass.

A few issues remain:

1) EmbeddedValue has a ton of duplicated code from the Persistence. It also relied on two property methods on Persistence. For the moment, I've kept those two methods, until EV can be fixed.

2) There are some definite weirdnesses that emerged in the specs regarding the two databases (default and mock). Zoo.properties returns MockAdapter columns because the mock database data gets loaded last; database.table(Zoo) returns Sqlite (etc.) adapter columns. Should Zoo.properties include a full set of MockAdapter and Sqlite adapter columns?

3) The spec saying that it "should have two different sets of mapped properties that point to subsets of the Table columns" (which was and is pending) needs some love. I haven't figured out well enough what STI is doing to figure out why everything is so strange when you run it. For instance: Person.properties uses MockAdapter, SalesPerson.properties uses Sqlite.

Comments and changes to this ticket

  • Sam Smoot

    Sam Smoot January 2nd, 2008 @ 12:22 AM

    • State changed from “new” to “open”

    2) Replied to this over email, but each database gets it's own set of Tables/Columns. So a Property can't have an ivar for it's column because the Column instance it should return changes depending on the current database context.

    3) Eventually the plan is to use something like Property to define the class mappings so that we don't have to keep multiple Table instances in the mappings that point to the same database table, but different classes. Without Property, and using Table#columns to build the queries, we have to keep those multiple instances, and not necessarily just for STI (you could have non STI models mapped to the same database table).

    So this is a big change that will require some more work, but thanks to your efforts we've got the ball rolling now at least. :-)

  • Bernerd Schaefer

    Bernerd Schaefer January 2nd, 2008 @ 10:35 AM

    I changed #2, which seems to have fixed things.

  • Sam Smoot

    Sam Smoot January 2nd, 2008 @ 03:44 PM

    • Assigned user set to “Bernerd Schaefer”
  • Sam Smoot

    Sam Smoot February 4th, 2008 @ 04:21 PM

    • State changed from “open” to “resolved”

    So this is basically done for now... there's more to do "someday", but no need to keep this hanging around.

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 »

People watching this ticket