Andy

On Mon, Jun 29, 2009 at 12:45, Andy Shipman<[email protected]> wrote:
>
> On 26 Jun 2009, at 20:26, Martin Gamsjaeger wrote:
>> Are you sure you got everything you need for RC1 installed? Did you
>> install from gems.datamapper.org ?
>
> I can run other DM code that isn't running in merb, so I'm sure I've
> got all I need to run DM 0.10RC1
>
>> It also might be a good idea to install everything directly from the
>> github repos and keep them uptodate
>> regularly. If you're willing to use RC1 (out of probably 4-5) maybe
>> you're fine with edge too?
>
> I git cloned your Merb, diff'd the merb_datamapper and made the non-
> Action ORM changes to my local merb_datamapper and my test sqlite3 app
> now works. I _think_ that's down to the changes to the automigration
> using DataMapper.auto_migrate! directly.
>
> With the test app working, I went back to my main development app and
> discovered that I had :nullable => false in my migrations against
> the :id keys, thus:
>
> :id, Serial, :nullable => false
>
> Now, I'm not sure if that is needed or not - obviously you don't want
> null ids, so presumably they're not NULL by default?

Yes, they are not null by default, :id, Serial should be enough

 Anyway,
> removing :nullable => false fixed the INSERT errors that I was seeing
> when creating records. I've now moved on to another set of errors with
> 'cannot modify frozen object' and/or 'stack level too deep'.

It's definitely a good idea to have a look at the tickets!

These could obviously have quite a few reasons, but related to "cannot
modify frozen object" i remember a ticket where the poster was trying
to change already destroyed objects (possibly in the context of
many_to_many). For "stack level too deep", i remember at least one
ticket where the poster was calling #all_valid? on a self referential
many_to_many association, leading to infinite loops (it does a
recursive walk of all associations).

Also, be aware of the fact that dm tries to save "the whole object
tree" for you when you call #save on a resource. This means that dm
will try to save all parent (belongs_to) and child (has) associations
that are loaded at the time you do a #save.

>
> I'll try and come back to this later to review further.
>
>>>> cheers
>>>> snusnu
>
> Thanks for the help thus far.
>
> Andy
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to