To the OP in plain english, what are you trying to do?
On 4 March 2010 05:32, ct9a <[email protected]> wrote: > hi there, > How do we share variables in a given data migration? > > For example, > the code below fails to work because "statuses" don't seem to be in > scope for both up and down. > > > class AddDefaultValuesToStatuses < ActiveRecord::Migration > statuses = [ > { > 'details' => 'details', > }, > { > 'fitting_profile' => 'fitting profile', > }, > { > 'live' => 'published on site', > }, > { > 'sold' => 'auction ended', > }, > ] > > > def self.up > statuses.each do |status| > status.each do |name, display_title| > @new_status = Status.new( > :name => name, > :display_title => display_title, > :created_by => 'admin', > :updated_by => 'admin' > ).save > end > end > end > > def self.down > statuses.each do |status| > status.each do |name, display_title| > @status = Status.searchlogic( > :name => name, > :display_title => display_title > ) > @status.delete > end > end > end > end > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<rubyonrails-talk%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- Charles A. Lopez [email protected] What's your vision for your organization? What's your biggest challenge? Let's talk. (IBM Partner) -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

