I think he means without creating a specific datamapper object and has_many association for it.
No, I think is the answer - if you want to use the 'easy' way, you'll have to stick to how datamapper wants the table named. Which is too bad. Please correct me if there's a way :) But using your own table is just a matter of defining GroupsUsers DM object, setting something like: Groups has n, :groups_users Groups has n, :users, :through => :groups_users Good luck, Kevin On Jul 8, 12:49 pm, Richard Conroy <[email protected]> wrote: > On Thu, Jul 8, 2010 at 7:49 PM, DSpaeth <[email protected]> wrote: > > Hello, > > > ActiveRecord nows :join_table for has_and_belongs_to_many > > associations. > > Does DataMapper also provide a parameter like :join_table for > > anonymous resources? > > > I haven't found anything about this. > > > Hi Dieter, > > in DataMapper I believe the equivalent syntax is: > > has n, :other_resource, :through => Resource #anonymous > > In this case DataMapper creates a join table on your behalf. It uses naming > conventions that wouldn't surprise > anyone used to those in ActiveRecord > > 'Resource' can be replaced by a join table of your own making also. > > Just dug up: the cheat page for > DataMapper:http://cheat.errtheblog.com/s/datamapper/ > > Check under associations. > > Also the main DM page has a mention > here.http://datamapper.org/docs/associations.html > > Example code would be nice of course. I may be in a position to share some > of my own in a couple of days - > doing a project spike with DM that has a couple of many:many relationships. > > --http://richardconroy.blogspot.com -- 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.
