From 16cd48e4dc796957b22500d63d10519ca657ed84 Mon Sep 17 00:00:00 2001 From: James Lee Date: Thu, 29 Apr 2010 21:49:18 +0000 Subject: [PATCH] turn constants into class vars, fixes #1767 git-svn-id: file:///home/svn/framework3/trunk@9172 4d416f70-5f16-0410-b530-b9f4589650da --- data/sql/migrate/006_add_timestamps.rb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/data/sql/migrate/006_add_timestamps.rb b/data/sql/migrate/006_add_timestamps.rb index fe83ab2d5a..446a83aa29 100644 --- a/data/sql/migrate/006_add_timestamps.rb +++ b/data/sql/migrate/006_add_timestamps.rb @@ -3,24 +3,24 @@ # class AddTimestamps < ActiveRecord::Migration - TABLES_NEEDING_RENAME = [:clients, :hosts, :notes, :refs, :services, :vulns, :wmap_requests] - TABLES_NEEDING_CREATED_AT = [:wmap_targets] - TABLES_NEEDING_UPDATED_AT = [:clients, :events, :hosts, :notes, :refs, :services, :vulns, :wmap_requests, :wmap_targets] + @@TABLES_NEEDING_RENAME = [:clients, :hosts, :notes, :refs, :services, :vulns, :wmap_requests] + @@TABLES_NEEDING_CREATED_AT = [:wmap_targets] + @@TABLES_NEEDING_UPDATED_AT = [:clients, :events, :hosts, :notes, :refs, :services, :vulns, :wmap_requests, :wmap_targets] def self.up - TABLES_NEEDING_RENAME.each { |t| rename_column t, :created, :created_at } + @@TABLES_NEEDING_RENAME.each { |t| rename_column t, :created, :created_at } - TABLES_NEEDING_CREATED_AT.each { |t| add_column t, :created_at, :datetime } + @@TABLES_NEEDING_CREATED_AT.each { |t| add_column t, :created_at, :datetime } - TABLES_NEEDING_UPDATED_AT.each { |t| add_column t, :updated_at, :datetime } + @@TABLES_NEEDING_UPDATED_AT.each { |t| add_column t, :updated_at, :datetime } end def self.down - TABLES_NEEDING_RENAME.each { |t| rename_column t, :created_at, :created } + @@TABLES_NEEDING_RENAME.each { |t| rename_column t, :created_at, :created } - TABLES_NEEDING_CREATED_AT.each { |t| remove_column t, :created_at } + @@TABLES_NEEDING_CREATED_AT.each { |t| remove_column t, :created_at } - TABLES_NEEDING_UPDATED_AT.each { |t| remove_column t, :updated_at } + @@TABLES_NEEDING_UPDATED_AT.each { |t| remove_column t, :updated_at } end end