relation_selector and has_and_belongs_to_many

5 views
Skip to first unread message

Bernat Ràfales

unread,
Jun 2, 2011, 4:24:10 AM6/2/11
to ubiquo
Hi there,
I've noticed that when building a relation_selector for a many-to-many
association, the selector takes care of allowing the user to introduce
more than one element if the models have the many-to-many association
using the has_many through solution. However, if the
has_and_belongs_to_many relation is used, the relation_selector only
allows a single element on the form.
Shouldn't be desirable to take care of this way of doing a many-to-many
association, too?

Cheers!

--
Bernat R�fales
braf...@gnuine.com

gnuine
www.gnuine.com
C/ Pamplona, 96
Local 17
22@ - 08018 Barcelona

Tel: +34.93.567.94.94
Fax: +34.93.567.94.95

Bernat Foj Capell

unread,
Jun 2, 2011, 9:16:34 AM6/2/11
to ubiquo...@googlegroups.com
Hi Bernat,

This kind of association, although not deprecated, it is not really used very often, since the has_many :through provides the same functionality with several advantages. So there is no plan to support it at this moment. However if someone sends in a tested patch it would be considered.

Cheers,
Bernat

On Thu, Jun 2, 2011 at 10:24 AM, Bernat Ràfales <braf...@gnuine.com> wrote:
Hi there,
I've noticed that when building a relation_selector for a many-to-many association, the selector takes care of allowing the user to introduce more than one element if the models have the many-to-many association using the has_many through solution. However, if the has_and_belongs_to_many relation is used, the relation_selector only allows a single element on the form.
Shouldn't be desirable to take care of this way of doing a many-to-many association, too?

Cheers!

--
Bernat Ràfales

braf...@gnuine.com

gnuine
www.gnuine.com
C/ Pamplona, 96
Local 17
22@ - 08018 Barcelona

Tel: +34.93.567.94.94
Fax: +34.93.567.94.95

--
Heu rebut aquest missatge perquè esteu subscrit al grup "ubiquo" de Grups de Google.
Per publicar a aquest grup, envieu un correu electrònic a ubiquo...@googlegroups.com.
Per anul·lar la subscripció a aquest grup, envieu un correu electrònic a ubiquo-gnuin...@googlegroups.com.
Per obtenir més opcions, visiteu aquest grup a http://groups.google.com/group/ubiquo-gnuine?hl=ca.




--
Bernat Foj Capell
bf...@gnuine.com

Jon de Andrés

unread,
Jun 2, 2011, 5:51:07 PM6/2/11
to ubiquo
Hi,

i sent this patch to lighthouse some months ago :-), i tried it and i
think it worked as wanted. I like sometimes the habtm relation cause
you don't need the join model, but only the table. But i understand
it's not the best way to make this kind of relations.

Here is the patch, very short, of course :-P.
http://ubiquo.lighthouseapp.com/projects/27683/tickets/479-relation_selector-with-has_and_belongs_to_many-relation#ticket-479-1

Regards, see you tomorrow!

On Jun 2, 3:16 pm, Bernat Foj Capell <b...@gnuine.com> wrote:
> Hi Bernat,
>
> This kind of association, although not deprecated, it is not really used
> very often, since the has_many :through provides the same functionality with
> several advantages. So there is no plan to support it at this moment.
> However if someone sends in a tested patch it would be considered.
>
> Cheers,
> Bernat
>
>
>
>
>
>
>
>
>
> On Thu, Jun 2, 2011 at 10:24 AM, Bernat Ràfales <brafa...@gnuine.com> wrote:
> > Hi there,
> > I've noticed that when building a relation_selector for a many-to-many
> > association, the selector takes care of allowing the user to introduce more
> > than one element if the models have the many-to-many association using the
> > has_many through solution. However, if the has_and_belongs_to_many relation
> > is used, the relation_selector only allows a single element on the form.
> > Shouldn't be desirable to take care of this way of doing a many-to-many
> > association, too?
>
> > Cheers!
>
> > --
> > Bernat Ràfales
> > brafa...@gnuine.com
>
> > gnuine
> >www.gnuine.com
> > C/ Pamplona, 96
> > Local 17
> > 22@ - 08018 Barcelona
>
> > Tel: +34.93.567.94.94
> > Fax: +34.93.567.94.95
>
> > --
> > Heu rebut aquest missatge perquè esteu subscrit al grup "ubiquo" de Grups
> > de Google.
> > Per publicar a aquest grup, envieu un correu electrònic a
> > ubiquo...@googlegroups.com.
> > Per anul·lar la subscripció a aquest grup, envieu un correu electrònic a
> > ubiquo-gnuin...@googlegroups.com.
> > Per obtenir més opcions, visiteu aquest grup a
> >http://groups.google.com/group/ubiquo-gnuine?hl=ca.
>
> --
> Bernat Foj Capell
> b...@gnuine.com
>
> gnuinewww.gnuine.com

Bernat Foj Capell

unread,
Jun 3, 2011, 2:36:16 AM6/3/11
to ubiquo...@googlegroups.com
Hi Jon,

I did not know about that ticket, thanks for bringing it to the discussion. I have answered you there.

Cheers,
Bernat

2011/6/2 Jon de Andrés <jonde...@gmail.com>



--
Bernat Foj Capell
bf...@gnuine.com
Reply all
Reply to author
Forward
0 new messages