To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / db / migrate / 022_serialize_possibles_values.rb @ 912:5e80956cc792
History | View | Annotate | Download (319 Bytes)
| 1 |
class SerializePossiblesValues < ActiveRecord::Migration |
|---|---|
| 2 |
def self.up |
| 3 |
CustomField.find(:all).each do |field| |
| 4 |
if field.possible_values and field.possible_values.is_a? String |
| 5 |
field.possible_values = field.possible_values.split('|')
|
| 6 |
field.save |
| 7 |
end
|
| 8 |
end
|
| 9 |
end
|
| 10 |
|
| 11 |
def self.down |
| 12 |
end
|
| 13 |
end
|