mirror of
https://github.com/internetee/registry.git
synced 2025-08-02 16:02:03 +02:00
Lock down the controllers
This commit is contained in:
parent
3045c08b3e
commit
3b1e632ab7
36 changed files with 166 additions and 97 deletions
12
db/migrate/20141218154829_populate_roles.rb
Normal file
12
db/migrate/20141218154829_populate_roles.rb
Normal file
|
@ -0,0 +1,12 @@
|
|||
class PopulateRoles < ActiveRecord::Migration
|
||||
def change
|
||||
rename_column :roles, :name, :code
|
||||
remove_column :users, :admin, :boolean
|
||||
|
||||
Role.create(code: 'admin')
|
||||
Role.create(code: 'user')
|
||||
Role.create(code: 'customer_service')
|
||||
|
||||
User.update_all(role_id: Role.first.id)
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue