diff --git a/script/apply-enterprise-inactive-template b/script/apply-enterprise-inactive-template new file mode 100644 index 0000000..2aa8bd5 --- /dev/null +++ b/script/apply-enterprise-inactive-template @@ -0,0 +1,10 @@ +#!/usr/bin/env ruby +require File.dirname(__FILE__) + '/../config/environment' +include GetText +ActionController::Base.init_gettext 'noosfero' +set_locale_all 'pt_BR' + +e = Environment.default +inactive_enterprises = Enterprise.find(:all, :conditions => ['enabled = ?', false]) - [e.inactive_enterprise_template, e.enterprise_template] +apply_in = inactive_enterprises[$ARGV[0].to_i..$ARGV[1].to_i] +apply_in.each_with_index { |obj,i| obj.apply_template(e.inactive_enterprise_template); puts i.to_s + ' - ' + obj.identifier} -- libgit2 0.21.2