Sha256: d016a28c3ed2d68b3a8127c3ef9ba96da3431d4ace716cef17c67ad6aeb52553

Contents?: true

Size: 1.57 KB

Versions: 3

Compression:

Stored size: 1.57 KB

Contents

class UpdateGdshowsdbData < ActiveRecord::Migration
  def up
    # added song_refs <% @added_song_refs.each do |song_ref_spec| %>
    SongRef.create_from(<%= song_ref_spec.inspect %>)
    <% end %>

    # added shows <% @added_shows.each do |show_spec| %>
    Show.create_from(<%= show_spec.inspect %>)
    <% end %>

    # added sets <% @added_sets.each do |set_spec| %>
    ShowSet.create_from(<%= set_spec.inspect %>)
    <% end %>

    # added songs <% @added_songs.each do |set_spec| %>
    Song.create_from(<%= set_spec.inspect %>)
    <% end %>        

    # updated song_refs <% @updated_song_refs.each do |song_ref_spec| %>
    SongRef.update_from(<%= song_ref_spec.inspect %>)
    <% end %>

    # updated songs <% @updated_songs.each do |song_spec| %>
    Song.update_from(<%= song_spec.inspect %>)
    <% end %>

    # updated sets <% @updated_sets.each do |set_spec| %>
    ShowSet.update_from(<%= set_spec.inspect %>)
    <% end %>

    # updated shows <% @updated_shows.each do |show_spec| %>
    Show.update_from(<%= show_spec.inspect %>)
    <% end %>

    
    # removed songs <% @removed_songs.each do |song_spec| %>
    Song.remove_from(<%= song_spec.inspect %>)
    <% end %>

    # removed sets <% @removed_sets.each do |set_spec| %>
    ShowSet.remove_from(<%= set_spec.inspect %>)
    <% end %>
    
    # removed shows <% @removed_shows.each do |show_spec| %>
    Show.remove_from(<%= show_spec.inspect %>)
    <% end %>

    # removed song_refs <% @removed_song_refs.each do |song_ref_spec| %>
    SongRef.remove_from(<%= song_ref_spec.inspect %>)
    <% end %>
    
  end  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gdshowsdb-1.0.0 lib/gdshowsdb/templates/update_migration.rb.erb
gdshowsdb-0.9.1 lib/gdshowsdb/templates/update_migration.rb.erb
gdshowsdb-0.9.0 lib/gdshowsdb/templates/update_migration.rb.erb