To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / .svn / pristine / 4e / 4e8ea0df2bcad47fe62855e09a9ca0f2f38daa1e.svn-base @ 1297:0a574315af3e

History | View | Annotate | Download (268 Bytes)

1 1296:038ba2d95de8 Chris
class AddRolePosition < ActiveRecord::Migration
2
  def self.up
3
    add_column :roles, :position, :integer, :default => 1
4
    Role.all.each_with_index {|role, i| role.update_attribute(:position, i+1)}
5
  end
6
7
  def self.down
8
    remove_column :roles, :position
9
  end
10
end