> and then use:
>
> def update
> user = session[:user]
> workitem_id = session[:workitem]
> workitem = OpenWFE::Extras::Workitem.find workitem_id
> normal_fields, preserved_fields = filter_fields @workitem
Well, without the @-character of course:
normal_fields, preserved_fields = filter_fields workitem
Arjan.
On May 8, 2008, at 9:46 PM, Arjan van Bentem wrote:
>
>
> Just wondering, not an issue at all:
>
> In ruote-web/Densha's WorkItemController I found the following code,
> which ensures that preserved fields are not changed during an update:
>
>
> http://github.com/jmettraux/ruote-web/tree/master/app/controllers/workitem_controller.rb#L252-260
>
> def load_workitem (workitem_id)
> @worklist = Worklist.new(session[:user])
> @workitem = OpenWFE::Extras::Workitem.find workitem_id
> @fields, preserved_fields = filter_fields @workitem
> session[:workitem] = @workitem.id, preserved_fields
>
>
> http://github.com/jmettraux/ruote-web/tree/master/app/controllers/workitem_controller.rb#L100-105
>
> def update
> user = session[:user]
> workitem_id, preserved_fields = session[:workitem]
> workitem = OpenWFE::Extras::Workitem.find workitem_id
>
>
> This makes me wonder: as in the last line the workitem is loaded
> anyway, couldn't one simply not store the preserved fields in the
> session, and then use:
>
> def update
> user = session[:user]
> workitem_id = session[:workitem]
> workitem = OpenWFE::Extras::Workitem.find workitem_id
> normal_fields, preserved_fields = filter_fields @workitem
>
> Here the value of "normal_fields" would not be used (maybe one can
> assign to nil in Ruby?).
>
>
> So, my question: is this is a matter of some performance gain, or just
> something that is not really required, or am I missing something --
> like some concurrency issues?
>
> Arjan
> -- John, note the range you wanted: #L100-105 -- just hold down
> Shift
> when clicking :-)
>
>
> >
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---