You're unstoppable, thanks ;-)
I cannot test the changes right now, but have taken a look at the new
code.
I don't understand what happens to the filtered fields now. In
load_workitem they are not added to @fields, so won't be populated in
ruote-web's form, and thus are not available upon submit. Right? If
true, and now that you're no longer merging the preserved fields with
the submitted fields, don't the preserved fields get lost on line 134?
http://github.com/jmettraux/ruote-web/tree/f2cd2b9517debe01c34f8a6f9cdcc050cba92d92/app/controllers/workitem_controller.rb#L134
134 workitem.replace_fields fields
http://github.com/jmettraux/ruote-web/tree/f2cd2b9517debe01c34f8a6f9cdcc050cba92d92/app/controllers/workitem_controller.rb#L237-243
237 def filter_fields (workitem)
238 @workitem.fields_hash.inject({}) do |r, (k, v)|
239 r[k] = v if k[0, 1] != '_'
240 r
241 end
241 end
250 def load_workitem (workitem_id)
:
258 @fields = filter_fields @workitem
Allright, Ruby -- I needed my pink O'Reilly book for that inject
syntax. For a moment I thought using select! or reject! would the same
(wrongly assuming that using the exclamation mark would change
fields_hash), but those methods don't exist or don't work like that :-)
So filter_fields(..) changes @workitem.fields_hash and also yields
that as the return value, right? Or does it return something else?
Shouldn't line 238 refer to parameter "workitem", instead of
"@workitem"? If not, then I assume the parameter is not really
needed :-)
A minor typo:
http://github.com/jmettraux/ruote-web/tree/f2cd2b9517debe01c34f8a6f9cdcc050cba92d92/app/controllers/workitem_controller.rb#L119
119 # gather the 'hash_form_field_X' form entries as well
should read
119 # gather the 'workitem_form_field_X' form entries as well
or, if not, then the REGEX is wrong ;-)
Arjan.
-- major internet problems in the Netherlands, since Monday night :-(
On May 15, 2008, at 4:21 AM, John Mettraux wrote:
>
> On Fri, May 9, 2008 at 12:39 PM, John Mettraux
> <[EMAIL PROTECTED]> wrote:
>> On Fri, May 9, 2008 at 5:30 AM, Arjan van Bentem
>> <[EMAIL PROTECTED]> wrote:
>>>
>>> http://github.com/jmettraux/ruote-web/tree/master/app/controllers/workitem_controller.rb
>
> Hello Arjan,
>
> I came up with a clean up :
> http://github.com/jmettraux/ruote-web/commit/f2cd2b9517debe01c34f8a6f9cdcc050cba92d92
>
> Please tell me if there are other things you'd like to clean up in
> there.
>
>
> Cheers,
>
> --
> John Mettraux - http://jmettraux.wordpress.com
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"OpenWFEru 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/openwferu-users?hl=en
-~----------~----~----~----~------~----~------~--~---