Allow categories with null position, which means sort them based on activity. Mix absolutely positioned (position is not null) categories with null position categories.

This commit is contained in:
Neil Lalonde
2013-12-16 15:13:43 -05:00
parent f1a7b63afc
commit 341adc93a4
11 changed files with 154 additions and 43 deletions

View File

@ -0,0 +1,10 @@
class MakePositionNullableInCategories < ActiveRecord::Migration
def up
change_column :categories, :position, :integer, null: true
end
def down
execute "update categories set position=0 where position is null"
change_column :categories, :position, :integer, null: false
end
end