
[PATCH] working with none default repository requires a default anyways
Reported by kristian | November 5th, 2008 @ 01:52 PM
having a only a named repository does result in an error message Adapter not set: default. Did you forget to setup?
everything works until I create objects in associations or assign them to one.
uncomment either line in the code here http://pastie.org/308154 and you can reproduce the error message.
adding
DataMapper.setup(:default, 'sqlite3::memory:')
DataMapper.auto_migrate!
helps to "remove" the error message.
so illustrate the effects even more another example. http://pastie.org/308163 here the 'user' in the database remains the same after the first save, and the user in memory does follow all the changes.
but commenting in the one line which loads the user fresh before working with it, does "synchronize" the behavior.
Comments and changes to this ticket
-
kristian November 12th, 2008 @ 01:41 PM
- Title changed from working with none default repository requires a default anyways to [PATCH] working with none default repository requires a default anyways
I found the offending line of code, and I wrote a little spec for it (see patch). the fix makes the method "with_repository" in associations/relationship.rb slightly more general.
-
Dan Kubb (dkubb) January 8th, 2009 @ 02:18 PM
- State changed from new to unconfirmed
- Assigned user cleared.
-
Dan Kubb (dkubb) February 21st, 2009 @ 02:11 AM
- State changed from unconfirmed to confirmed
Actually there are quite a few places in the code that make the assumption that there'll be a :default repository. It will probably take some time to remove this expectation from the code base, so I am marking this as confirmed for now.
In the short term the work-around is to make sure you always define a :default repository.
-
Dan Kubb (dkubb) July 22nd, 2009 @ 03:32 PM
- Milestone set to 0.10.1
-
Dan Kubb (dkubb) October 4th, 2009 @ 09:33 PM
- Milestone changed from 0.10.1 to 0.10.2
[project:id#20609 not-tagged:"0.10.0" not-tagged:"0.10.1" milestone:id#51895 bulk edit command]
-
Dan Kubb (dkubb) February 1st, 2010 @ 04:33 PM
- Milestone changed from 0.10.2 to 1.0.0
-
-
Dan Kubb (dkubb) February 5th, 2010 @ 03:19 AM
- State changed from confirmed to not-applicable
Upon reflection, the cost of making it possible to lazily specify an adapter at any point is going to be too high. It is much simpler to just specify that the adapter connection must be made before defining the models.
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.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »