On 12/15/2010 11:44 AM, Chris Lalancette wrote:
On 12/14/10 - 11:31:17PM, Mohammed Morsi wrote:
This is a rework of the original deltacloud rails 3 patch to split changes into multiple patches and add further support and compatability fixes to make the deltacloud aggregator rails 3 compliant.
One thing that is not clear to me; can any of these patches go in without breaking rails 2? Alternatively, would it be relatively easy to split some of these out so that we could apply them without breaking rails 2?
I'm not trying to make a ton more work for you, but if we can slowly feed pieces into the repository, I think that would make it easier than having a flag day. If we can't do this, of course, that's fine; just tell me :).
Patches 1 & 2 - rails 3 specific can't be applied until when we are ready to update the rails rpms, that being said these most likely are set, as they only touch sources which we don't update often (or at all)
Patch 3 - can be applied whenever, doesn't really affect anything until we start using bundler / rails 3
Patch 4 - changes to deltacloud config which are pretty specific to rails 3, shouldn't be applied until rails 3 support is ready to go
Patches 5->7 - these might be able to be made more granular like you suggested. I'm sure some of the changes are rails 3 specific, but some of them may be able to work against rails 2. I should of summarized which changes are in each patch a little more, so here they are (if i send out an updated patchset I'll include these in the patches themselves and/or will do so right before I commit them):
#5 - "filter_parameter_logging" is now being taken care of in the configuration - "master_helper_module.module_eval" has been replaced by "class_eval" and "helper_method" - "log_error" is no longer supported, replaced w/ the rails logger - "request.request_uri" has been replaced w/ "request.fullpath" - "before_filter" no longer takes an array, rather it just needs to be called multiple times - I had to change "dispatch" in our templates controller to "dispatch_action" as the former was conflicting with a method added to all the controllers by rspec (changed in the relevant views as well) - "WillPaginate::LinkRender" is now "WillPaginate::ViewHelpers::LinkRenderer" - "named_scope" is deprecated, now simply use "scope" - overriding the "validate" method is now deprecated, rather custom validation methods need to be registered - "RAILS_ROOT" has now been replaced w/ "::Rails.root.to_s" - I had to add a hack to the UserSession model to fix an issue w/ authlogic and rails 3.0.x (see link in comment there)
#6 - the majority of these changes were to replace the "-" operator in the haml views to "=" as the former is now deprected - form.error_messages_on no longer simply just take text to prepend but rather a hash of which text to prepend/append/etc
#7 - various configuration changes needed for the test frameworks which have been updated to work w/ rails 3 - various changes to paths and urls to work w/ the new routing api - the cucumber and rspec rake tasks have been updated, these may need to be looked at and fixed to readd our custom stuff again - all the specs need to "include Authlogic::TestCase" to make use of authlogic - the "route_for" test helper has been replaced w/ 'route_to' - the activerecord 'destroy' method no longer returns false, but an empty array (at least from my findings) - mock('foo', :null_object => true) has been replaced with mock('foo').as_null_object - activerecord errors do not support the 'on' method anymore (at least its deprected) rather you can access errors on specific fields by passing that field name as a hash key, which will return an array of errors - various other small fixes here and there to get things working
Patch 8 - just a couple small things, can be applied as is right now
Hope this helps.
-Mo