mirror of https://github.com/fspc/BikeShed-1.git
John N. Milner
12 years ago
10 changed files with 62 additions and 17 deletions
@ -0,0 +1,15 @@ |
|||||
|
class UserRoles < Netzke::Basepack::Grid |
||||
|
|
||||
|
def configure(c) |
||||
|
super |
||||
|
c.model = "UserRole" |
||||
|
c.title = "User Roles" |
||||
|
c.columns = [ :role, :created_at, :updated_at, :ends ] |
||||
|
end |
||||
|
|
||||
|
#override with nil to remove actions |
||||
|
def default_bbar |
||||
|
[ :apply, :add_in_form, :search ] |
||||
|
end |
||||
|
|
||||
|
end |
@ -0,0 +1,7 @@ |
|||||
|
class AddEndsToUserRoles < ActiveRecord::Migration |
||||
|
def change |
||||
|
add_column(:user_roles, :ends, :timestamp) |
||||
|
add_column(:user_roles, :user_id, :integer) |
||||
|
remove_column(:users, :role_id) |
||||
|
end |
||||
|
end |
@ -1,9 +0,0 @@ |
|||||
user: |
|
||||
id: 1 |
|
||||
role: user |
|
||||
staff: |
|
||||
id: 2 |
|
||||
role: staff |
|
||||
admin: |
|
||||
id: 3 |
|
||||
role: admin |
|
@ -0,0 +1,19 @@ |
|||||
|
FactoryGirl.define do |
||||
|
factory :user_role do |
||||
|
factory :role_staff do |
||||
|
role 'staff' |
||||
|
end |
||||
|
|
||||
|
factory :role_admin do |
||||
|
role 'admin' |
||||
|
end |
||||
|
|
||||
|
factory :role_bike_admin do |
||||
|
role 'bike_admin' |
||||
|
end |
||||
|
|
||||
|
factory :role_user do |
||||
|
role 'user' |
||||
|
end |
||||
|
end |
||||
|
end |
Loading…
Reference in new issue