Chaining datamapper relationships across different repositories?

You found a bug actually. It's been fixed in master. You can try grabbing sources from git and see if it works.

Your code works fine for me. Irb(main):001:0> A.first.b. C DEBUG - "(0.001168) SELECT "aid", "bid" FROM "as" ORDER BY "aid" LIMIT 1" DEBUG - "(0.000337) SELECT "bid", "cid" FROM "bs" WHERE "bid" = 2 LIMIT 1" DEBUG - "(0.000046) SELECT "cid" FROM "cs" WHERE "cid" = 3 LIMIT 1" => # My gem is dm-core-1.1.0, you should check your version.

That's odd... I have the same version and it's not working.... – hsiu Apr 21 at 14:09.

It turns out this was a small issue with DataMapper chaining across repositories. Submitted to them and it's allegedly been fixed already! datamapper.lighthouseapp.com/projects/20....

That's where the error is raised. Indeed, in this case klass is a DataMapper Integer property, and it's initialize method only accepts three options (model, name, and an options hash). This whole block is only executed because I'm using more than one repository, though B and C are in the same one so I don't know if that sheds any light on why it's erroring on the cid property.

I have tried all permutations, and it appears that when you're chaining, once you cross a database-boundary, that must be the end of the chain. For example, since A is :alt_db and B is :default, B is as deep as I can go, regardless of whether C is :default, :alt_db, or a third option. If instead both A and B were :default, or both were :alt_db, and then C were the opposite one, C would be as deep as I could go.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions