Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

alteração na busca e no armazenamento de links

  • Loading branch information...
commit 39cf24968bcb245dca2a765c1998030cf78af588 1 parent d52edfc
Lucas Souza lucasas authored
Showing with 14 additions and 0 deletions.
  1. +14 −0 db/migrate/20100929175544_remove_quantity_from_links.rb
14 db/migrate/20100929175544_remove_quantity_from_links.rb
View
@@ -0,0 +1,14 @@
+class RemoveQuantityFromLinks < ActiveRecord::Migration
+ def self.up
+ Link.all.each do |link|
+ link.quantity.times do
+ Link.create :url => link.url, :title => link.title
+ end
+ end
+ remove_column :links, :quantity
+ end
+
+ def self.down
+ add_column :links, :quantity, :integer
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.