Cool, thanks! This actually makes the code I used cleaner.

On Apr 7, 1:54 pm, Martin Gamsjaeger <[email protected]> wrote:
> Kabari,
>
> Have a look at
>
> https://github.com/datamapper/dm-core/commit/2ffa59f0963c3a33be72ae27...https://github.com/datamapper/dm-core/commit/b3fd21a00c4eaf5fe0b7d4e8...
>
> We've been aware that this change will break code relying on that API. I
> agree that the current implementation probably isn't ideal either (setting
> the const inside the method body), but it's a tricky problem to not have it
> leak otherwise. We've been talking about using weakrefs to solve the
> circular reference issues, but there is no tried and proven gem around that
> implements those across all the rubies we officially support. Actually there
> is one that claims to work, but it's a relatively new project and we've been
> hesitant to just go and use it. Also, that's because using weakrefs would
> probably entail a more elaborate refactoring pass too.
>
> The related LH 
> ticket:http://datamapper.lighthouseapp.com/projects/20609/tickets/1453-each-...
>
> The weakref gem:https://github.com/bdurand/ref
>
> cheers
> snusnu
>
>
>
> On Thu, Apr 7, 2011 at 18:52, RipTheJacker <[email protected]> wrote:
> > While upgrading my gem, dm-is-friendly, for DM 1.1.0 it broke in a way
> > I don't quite understand. In the gem, I create a DM model dynamically
> > like this:
>
> > DataMapper::Ext::Object.full_const_set("SomeClass",
> > DataMapper::Model.new do
> >  # ...stuff...
> > end)
>
> > With the 1.1.0 release, this is broken when more than one class is
> > added in this manner. The previously added class is removed from
> > DataMapper::Model.descendants each time you add a new one.
>
> > This gist shows what happens:https://gist.github.com/908181
>
> > I'll take a crack at it if it's a bug, but it's possible that I'm not
> > using the new API correctly since I haven't really looked into it.
>
> > --
> > 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.

-- 
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