From 3ddde8cfbdddda3f4d35a26b5965416ba59ab985 Mon Sep 17 00:00:00 2001 From: Joenio Costa Date: Mon, 15 Dec 2008 23:40:20 -0300 Subject: [PATCH] ActionItem862: script to apply inactive enterprises template --- script/apply-enterprise-inactive-template | 10 ++++++++++ 1 file changed, 10 insertions(+), 0 deletions(-) create mode 100644 script/apply-enterprise-inactive-template 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