- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
class UglyColumnsRedefine < ActiveRecord::Migration
def self.up
change_column :variable_sets, :active, :boolean
VariableSet.all.each{|v| v.update_attribute :active, !!v.active}
end
def self.down
end
end
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+62.7
class UglyColumnsRedefine < ActiveRecord::Migration
def self.up
change_column :variable_sets, :active, :boolean
VariableSet.all.each{|v| v.update_attribute :active, !!v.active}
end
def self.down
end
end
Миграция с весёлым названием 20090601130619_ugly_columns_redefine.rb, для рельсового приложения, аля "так делать низя".
guest 25.09.2009 11:06 # 0
IT bag: [url=http://www.christianlouboutinmy.com/yves-saint-laurent-c-27.html]yves saint laurent[/url],
[url=http://www.christianlouboutinmy.com]christian louboutin [/url] for spring,[url=http://www.handbagsboots.com/]louis vuitton handbags[/url] for Summer,[url=http://www.handbagcom.com/loewe-c-13.html]loewe handbags[/url] for autumn,[url=http://www.handbagcom.com/coach-c-15.html]Coach handbags[/url] or other [url=http://www.handbagcom.com/]replica handbags[/url] for Winter.
You have to wear the [url=http://www.christianlouboutinmy.com]christian louboutin[/url] when you go to parties.When you are on a journey,you should wear a pair of [url=http://www.christianlouboutinmy.com/jimmy-choo-shoes-c-21.html]jimmy choo shoes[/url].Nike is very nessisary when you donging sports.You should buy the [url=http://www.bootsluxury.com/]ugg boots[/url]([url=http://www.bootsluxury.com/classic-short-c-5.html]UGG Classic Short[/url] or [url=http://www.bootsluxury.com/classic-tall-c-6.html]UGG Classic Tall[/url]) for your watery foots.
[url=http://www.ptsell.com]nike shoes[/url] [url=http://www.ptsell.com]gucci shoes[/url] [url=http://www.ptsell.com]david yurman[/url][url=http://www.handbagcom.com/]replica handbag[/url]