Sha256: b342f6776a751e83d2dcfb3494a75b4ddc2a23fcccb3d0775060087342715930

Contents?: true

Size: 512 Bytes

Versions: 17

Compression:

Stored size: 512 Bytes

Contents

class Change < ActiveRecord::Base; end
class EmbedChangesInReleases < ActiveRecord::Migration
  def up
    add_column :releases, :release_changes, :text

    Release.reset_column_information

    Release.find_each do |release|
      release.release_changes = Change.where(release_id: release.id).map do |change|
        ReleaseChange.new(release, change.tag_slug, change.description)
      end
      release.save(validate: false)
    end
  end

  def down
    remove_column :releases, :release_changes
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
houston-core-0.8.0.pre db/migrate/20140425141946_embed_changes_in_releases.rb
houston-core-0.7.0 db/migrate/20140425141946_embed_changes_in_releases.rb
houston-core-0.7.0.beta4 db/migrate/20140425141946_embed_changes_in_releases.rb
houston-core-0.7.0.beta3 db/migrate/20140425141946_embed_changes_in_releases.rb
houston-core-0.7.0.beta2 db/migrate/20140425141946_embed_changes_in_releases.rb
houston-core-0.7.0.beta db/migrate/20140425141946_embed_changes_in_releases.rb
houston-core-0.6.3 db/migrate/20140425141946_embed_changes_in_releases.rb
houston-core-0.6.2 db/migrate/20140425141946_embed_changes_in_releases.rb
houston-core-0.6.1 db/migrate/20140425141946_embed_changes_in_releases.rb
houston-core-0.6.0 db/migrate/20140425141946_embed_changes_in_releases.rb
houston-core-0.5.6 db/migrate/20140425141946_embed_changes_in_releases.rb
houston-core-0.5.5 db/migrate/20140425141946_embed_changes_in_releases.rb
houston-core-0.5.4 db/migrate/20140425141946_embed_changes_in_releases.rb
houston-core-0.5.3 db/migrate/20140425141946_embed_changes_in_releases.rb
houston-core-0.5.2 db/migrate/20140425141946_embed_changes_in_releases.rb
houston-core-0.5.1 db/migrate/20140425141946_embed_changes_in_releases.rb
houston-core-0.5.0 db/migrate/20140425141946_embed_changes_in_releases.rb