Or you could change to <a with="ModelName.user_new(current_user)" /> if it's a one off type situation.
On Aug 2, 12:01 pm, Nicolas Oury <[email protected]> wrote: > Thanks for your answer. > > > # Link to a new object form > > new_record = target.new > > new_record.set_creator(current_user) > > href = object_url(target, "new", params._?.merge(:subsite => > > subsite)) > > My model uses after_user_new callback to sets some fields of the > model, that are used to pass the create_permitted? of the model. > (It is similar to the event.group example of the Manual about permissions) > > However, here new_record is created from new and not user_new(current_user). > And after_user_new is never called. > > If I override set_creator in my model, to do the work that is in > after_user_new, a manage to find the correct permissions. > But that's not what the permissions manual teach you to do. > > Should I file an enhancement request or am I missing something? > Would it break a lot of thing to replace new_record = target.new by > new_record = target.user_new(current_user)? > > Best regards, > > Nicolas. -- You received this message because you are subscribed to the Google Groups "Hobo Users" 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/hobousers?hl=en.
