sorry i missed the
@art.category << @cat

about the same as what you did Jonathan, I have one line more than
you.....prefer yours, thanks!
should have seen your reply earlier, but the moderation on this group
is slow slow. Your message just posted


On Mar 10, 12:31 pm, bertly_the_coder <[email protected]> wrote:
> Disregard...I figured it out
>
> blah blah blah....do what need to be done to instantiate the objects
>
> then relate the two:
> @art << @cat
>
> @art.save
>
> On Mar 8, 3:51 pm, bertly_the_coder <[email protected]> wrote:
>
> > Hey Guys,
>
> > if I create two models like so:
>
> >  class Article
> >     include DataMapper::Resource
>
> >     has n, :categories, :through => Resource
> >   end
>
> >  and
>
> >  class Category
> >     include DataMapper::Resource
>
> >    has n, :articles, :through => Resource
> > end
>
> > I end up with three tables Articles, Categories and Articles_Category.
> > Using Ruby, preferably Sinatra, what object would I need to create to
> > correctly insert the corresponding records into all three tables?,
> > Which is to say an article that belongs to a certain category
>
> > Thnx

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