[asl-devel 00005] Re: hello and some questions
henrikkroeger at googlemail.com
Sat Jun 9 07:46:27 EDT 2007
Am Samstag, den 09.06.2007, 01:01 +0900 schrieb Kouhei Sutou:
> In <1181298275.8805.30.camel at henriks.kroeger>
> "[asl-devel 00003] Re: hello and some questions" on Fri, 08 Jun 2007 12:24:35 +0200,
> Henrik Kröger <henrikkroeger at googlemail.com> wrote:
> > 1.
> > User.create( attributes ) needs to be called with :group_class => Group
> > (?) even if specifying :group_class by ldap_mapping.
> > When running sth. like User.create :uid => "test" where User inherits
> > ActiveSambaLdap::User with ldap_mapping(:group_class => Group) I get the
> > following error:
> > 2.
> > To circumvent No 1 I simply did sth. like
> > User.create(params[:user].merge(:group_class=>Group)) in my Rails
> > controller but it doesn't work, it still spills the same error like it
> > did in No 1.
> > Putting some debug code telling me the class of the keys of options
> > given to retrieve_default_group, I figured out that all the keys I gave
> > in my controller class where converted to strings, so
> > options[:group_class] could no longer get the option.
> Ah, OK. I'll change ActiveSambaLdap uses normalized option
> key. But could you give me a few days? Two days after I have
> a presentation for RubyKaigi 2007. I need to prepare my
> slides. Sorry.
Hey, no problem, I have time and it's not production specific as I can change
it temporarily for my local code...
So the problem is that all parameters to create will go through
'to_real_attribute_name' where 'name.to_s' converts symbols to strings?
In fact I have no problem with that. The problem is I have to give
':group_class' somewhere as an option to 'retrieve_default_group'. I
would be happy if I didn't had to.
My suggestion would be to provide defaults for :group_class:
options[:group_class] should be populated by the :group_class provided
in ldap_mapping. And if there is no such, it should be populated by a
reasonable default like 'Group'.
But whatever, first create your slides..
Thanks for fixing the problem...
Mobile: +49 151 52274544
Phone: +49 5136 8016588
Fingerprint: B96D ABA8 40BE 2648 4E82 A28E BCBD 4879 47BA 049E
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://rubyforge.org/pipermail/asl-devel/attachments/20070609/792f3aef/attachment.bin
More information about the asl-devel