[PATCH conductor] Fix migration after paranoid gem changed the default scope

Tzu-Mainn Chen tzumainn at redhat.com
Tue May 15 13:34:12 UTC 2012


ACK, thanks for catching this.

Mainn

----- Original Message -----
> From: ifarkas at redhat.com
> To: aeolus-devel at lists.fedorahosted.org
> Sent: Tuesday, May 15, 2012 9:30:50 AM
> Subject: [PATCH conductor] Fix migration after paranoid gem changed the	default scope
> 
> From: Imre Farkas <ifarkas at redhat.com>
> 
> ---
>  .../20120227150102_add_pool_family_to_instance.rb  |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git
> a/src/db/migrate/20120227150102_add_pool_family_to_instance.rb
> b/src/db/migrate/20120227150102_add_pool_family_to_instance.rb
> index 00848ba..db2f999 100644
> --- a/src/db/migrate/20120227150102_add_pool_family_to_instance.rb
> +++ b/src/db/migrate/20120227150102_add_pool_family_to_instance.rb
> @@ -5,11 +5,11 @@ class AddPoolFamilyToInstance <
> ActiveRecord::Migration
>      add_column :catalogs, :pool_family_id, :integer
>      add_column :deployables, :pool_family_id, :integer
>  
> -    Deployment.all.each do |deployment|
> +    Deployment.unscoped.each do |deployment|
>        deployment.pool_family_id = deployment.pool.pool_family_id
>        deployment.save!
>      end
> -    Instance.all.each do |instance|
> +    Instance.unscoped.each do |instance|
>        instance.pool_family_id = instance.pool.pool_family_id
>        instance.save!
>      end
> --
> 1.7.6.5
> 
> 



More information about the aeolus-devel mailing list