Saturday, 15 December 2007

Finished migrating to Rails 2.0

Just a not to say code base is now passing all test with Rails 2.0. Took about 8 hours of effort in the end mostly with scope and SOAP changes.

So feel free to upgrade Biorails and try it out and upgrade local rails if you want. At present environment.rb does not contain a version to will attempt to run on most recent installed rails version.

Expected status:-
  • Units: 353 tests, 668 assertions, 0 failures, 0 errors
  • Functionals: 301 tests, 780 assertions, 0 failures, 0 errors
Have got a simple does it return correctly or throw a exception test on most controller actions now . Only real problem is create/update functional are not really testing all the create/update objects with generation of new records.

Rails 2.0 upgrade produced a lot of donkey work but went smoothly the mains changes needed are shown below:-

1) Paginate.new => model.paginate via will_paginate plugin

Keep a eye of bottom of pages to check new paginate control is coming up ok in visual testing. Buts appears ok on initial pass

2) end_form*

Have had to change a number of forms to block wrappers to
<% form_tag( stuffff ) do %>
<% end %>
3) with_scope

Use this a lot to manage visibility of data. Has gone protected so having to move filters to part of correct model. Model.with_scope => self.with_scope and code moves into correct models and referenced so

On the whole appears a litte faster other then this no real problem seen.
def self.visible(*args)
self.with_scope( :find => {
:conditions=> ['exists (select 1 from memberships m,studies s where m.user_id=? and s.id=study_protocols.study_id and m.project_id=s.project_id)',User.current.id]
}) do
self.find(*args)
end
end
4) Had to Add 3 plugins to externals list in svn to cover bits moved out of core rails:-
script/plugin in_place_editing
script/plugin act_as_tree
script/plugin will_paginate
Need to find if there a Oracle plugin.There is talk that oracle ActiveRecord has moved out to separate gem/plugin could not find this yet. Will have another look later but will not effect development or testing yet.

5) Acton Web Services

Well this was a pain, but changed over to a plugin based on 1.2.6 code under my control at present. Will have to test this with our .net office client to make sure its working well.

No comments: