mirror of
https://github.com/fspc/BikeShed-1.git
synced 2026-09-16 08:31:36 -04:00
WIP adding user roles view; adding end datetime to user roles
This commit is contained in:
@@ -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
|
||||
+3
-1
@@ -11,7 +11,7 @@
|
||||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20130405012238) do
|
||||
ActiveRecord::Schema.define(:version => 20130419010051) do
|
||||
|
||||
create_table "bike_actions", :force => true do |t|
|
||||
t.string "action", :limit => 128, :null => false
|
||||
@@ -152,6 +152,8 @@ ActiveRecord::Schema.define(:version => 20130405012238) do
|
||||
t.string "role"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.datetime "ends"
|
||||
t.integer "user_id"
|
||||
end
|
||||
|
||||
create_table "users", :force => true do |t|
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
user:
|
||||
id: 1
|
||||
role: user
|
||||
staff:
|
||||
id: 2
|
||||
role: staff
|
||||
admin:
|
||||
id: 3
|
||||
role: admin
|
||||
+2
-1
@@ -21,10 +21,11 @@ end
|
||||
if Rails.env.development?
|
||||
|
||||
#create default admin user
|
||||
if User.all.empty?
|
||||
if UserRole.all.empty? and User.all.empty?
|
||||
FactoryGirl.create(:user)
|
||||
FactoryGirl.create(:staff)
|
||||
FactoryGirl.create(:admin)
|
||||
FactoryGirl.create(:bike_admin)
|
||||
FactoryGirl.create(:user_profile)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user