Sha256: 6613fdd899356811b96d352dd35982223d4f50b85b743644c48c1fa4de1a7939

Contents?: true

Size: 609 Bytes

Versions: 10

Compression:

Stored size: 609 Bytes

Contents

require "progressbar"

class MoveAdapterNamesToProps2 < ActiveRecord::Migration[5.0]
  def up
    projects = Project.unscoped
    pbar = ProgressBar.new("projects", projects.count)
    projects.find_each do |project|
      project.update_props!(
        "adapter.ciServer" => project.read_attribute(:ci_server_name),
        "adapter.ticketTracker" => project.read_attribute(:ticket_tracker_name),
        "adapter.errorTracker" => project.read_attribute(:error_tracker_name),
        "adapter.versionControl" => project.read_attribute(:version_control_name))
      pbar.inc
    end
    pbar.finish
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
houston-core-0.9.2 db/migrate/20170116210225_move_adapter_names_to_props2.rb
houston-core-0.9.1 db/migrate/20170116210225_move_adapter_names_to_props2.rb
houston-core-0.9.0 db/migrate/20170116210225_move_adapter_names_to_props2.rb
houston-core-0.9.0.rc1 db/migrate/20170116210225_move_adapter_names_to_props2.rb
houston-core-0.8.4 db/migrate/20170116210225_move_adapter_names_to_props2.rb
houston-core-0.8.3 db/migrate/20170116210225_move_adapter_names_to_props2.rb
houston-core-0.8.2 db/migrate/20170116210225_move_adapter_names_to_props2.rb
houston-core-0.8.1 db/migrate/20170116210225_move_adapter_names_to_props2.rb
houston-core-0.8.0 db/migrate/20170116210225_move_adapter_names_to_props2.rb
houston-core-0.8.0.pre2 db/migrate/20170116210225_move_adapter_names_to_props2.rb