Bug with nested.add_link and has_one association

57 views
Skip to first unread message

Differenthink

unread,
Oct 6, 2011, 9:12:07 AM10/6/11
to actives...@googlegroups.com
Hello,

In my process migration to Rails 3 i've found a bug in AS on has_one conditions and nested.add_link.
I've two models, 

class Abonnement
     belongs_to :desabonnement

class Desabonnement
      has_one :abonnement

if i set something like : config.nested.add_link(:abonnement, {:label => "Voir Abonnement associé"})
i've got a nice error : AbstractController::ActionNotFound (The action 'none' could not be found for Www::Admin::AbonnementController):

If y change my has_one to has_many then it works.

Regards.

Sergio Cambra .:: entreCables S.L. ::.

unread,
Oct 7, 2011, 5:00:26 AM10/7/11
to actives...@googlegroups.com
I have never used nested.add_link with singular associations, and I'm not sure
it was supported anytime, but it's working now (with git master, it's not
released yet)

--
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) ser...@entrecables.com

Differenthink

unread,
Oct 7, 2011, 5:22:19 AM10/7/11
to actives...@googlegroups.com
Well it worked great for me with an old rails 2.3 version... 
Do you have any release date ? and also will it be merge into 3.0 branch or only 3.1 ?

thanx.

Sergio Cambra .:: entreCables S.L. ::.

unread,
Oct 7, 2011, 11:07:00 AM10/7/11
to actives...@googlegroups.com

I will release it today, I'm waiting in case of I find another bug.

I have backported it to rails 3.0, but it's not tested.

Differenthink

unread,
Oct 11, 2011, 6:19:41 AM10/11/11
to actives...@googlegroups.com
Hi Sergio,

I did test your commit, it works one way but not the other.
If i m on the model which has the foreign key the association works, but not on the other one.
For a better usage i think it should works both ways.

For now i've got this error which is pretty straightforward
NoMethodError (undefined method `foreign_key' for #<ActiveRecord::Reflection::AssociationReflection:0x007fa066fb3ac0>):

Thanks.

Atastor

unread,
Oct 13, 2011, 9:24:53 AM10/13/11
to actives...@googlegroups.com
Just so you know you are not alone..not 6 days later I am hitting the same road block :-)

Regards
Michael

Differenthink

unread,
Oct 13, 2011, 11:28:40 AM10/13/11
to actives...@googlegroups.com
Lets hope sergio find us a nice patch :)

Sergio Cambra .:: entreCables S.L. ::.

unread,
Oct 18, 2011, 3:38:16 AM10/18/11
to actives...@googlegroups.com
On Jueves, 13 de Octubre de 2011 17:28:40 Differenthink escribió:
> Lets hope sergio find us a nice patch :)

I was on holidays.

Could you put a sample application in github? Or send it to me?

Reply all
Reply to author
Forward
0 new messages