parent
fbc4cd1cf1
commit
cc4bf3b328
@ -1,6 +1,6 @@
|
||||
class FirstPage < ActiveRecord::Base
|
||||
attr_accessible :description, :title, :web_title,:page_type
|
||||
validates_presence_of :web_title, :title, :description,:page_type
|
||||
validates_presence_of :web_title, :title, :description,:page_type,:sort_type
|
||||
validates_length_of :web_title,:title, maximum: 30
|
||||
validates_length_of :description, maximum: 100
|
||||
end
|
||||
|
@ -0,0 +1,5 @@
|
||||
class AddColumnForFirstPage < ActiveRecord::Migration
|
||||
def change
|
||||
add_column("first_pages","sort_type",:integer)
|
||||
end
|
||||
end
|
@ -0,0 +1,8 @@
|
||||
class SetSortType < ActiveRecord::Migration
|
||||
def change
|
||||
FirstPage.all.each do |fp|
|
||||
fp.sort_type = 1
|
||||
fp.save
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in new issue