Back looking at this again, I'm trying to understand how methods in
DataMapper::Associations and DataMapper:Model are made available to
classes that include DataMapper::Resource. The methods 'has',
'belongs_to' and 'property' are defined in those modules, but since
those modules are not explicitly included (as far as I can see), I
don't see how they get added to an application's class.
I see comments on the method definitions for append_inclusions in
resource.rb ("Extends the model with this module after
DataMapper::Resource has been included") and append_extensions in
model.rb ("Appends a module for inclusion into the model class after
DataMapper::Resource.") that seem to suggest they might be involved
somehow, but I don't follow the logic of these methods at all.
Can someone explain how the relationship between these modules works?
Mark.
On Nov 24, 6:49 am, MarkMT <[EMAIL PROTECTED]> wrote:
> Thanks Dan. I will continue to trying to improve my understanding of
> this thing and will try to help if I can.
>
> Mark.
>
> On Nov 23, 10:12 pm, "Dan Kubb (dkubb)" <[EMAIL PROTECTED]> wrote:
>
> > Hi Mark,
>
> > > Thanks for the heads-up Dan. Do you have any rough time frame in mind
> > > for the rewrite?
>
> > We're looking at another 1-2 months at least before the code that's in
> > dkubb/dm-core will be merged into the mainline.
>
> > If you or anyone else is interested in speeding this up, they can help
> > with a number of things:
>
> > - Fork dkubb/dm-core, and update the docs for the public classes and
> > send me a pull request.
> > - Review the tickets inhttp://is.gd/8KhG(startingwith the oldest
> > first) and see if they are still applicable to dkubb/dm-core, and
> > dkubb/extlib both of which have alot of improvements and fixes.
> > Either close the tickets (if you have permission) or add a comment
> > that says it's fixed now and I'll close them myself. If there's no
> > specs or stand-alone script showing the problem try adding one.
> > - Try using dkubb/dm-core and dkubb/extlib with your own apps. If
> > you've got a nice suite of specs please run them and report any issues
> > you come across.
>
> > > > In this case it's just a convention that shows the in-between join
> > > > model is an anonymous Resource. You can also use :through
> > > > => :association_name to specify a specific association to traverse.
>
> > > Ok, I think I understand - I was forgetting you could declare :through
> > > => Resource, and assumed that the other case, :through
> > > => :association_name would use ManyToMany as well. But I see now that
> > > it uses OneToMany.
>
> > While I think this was the case before, I've been thinking that using
> > has() and :through means you're using a many to many relationship.
> > I'm not sure the best thing is for OneToMany::Proxy to handle those
> > since it makes the code unnecessarily complex. I'd probably rather
> > have ManyToMany::Proxy handle :through whether it's a :through =>
> > Resource, or :through => :other_association.
>
> > Many to Many associations are going to be rewritten from the ground up
> > (they only pass about 50% of the specs we have written for them) so
> > this and general organization of the associations code will be handled
> > at the same time.
>
> > Dan
> > (dkubb)
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---