mirror of
https://github.com/fspc/BikeShed-1.git
synced 2026-09-16 08:31:36 -04:00
Merge branch 'master' into denney-new-user-form
Conflicts: db/schema.rb
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
class AlterUserRoles < ActiveRecord::Migration
|
||||
def change
|
||||
rename_table :user_roles, :user_role_joins
|
||||
change_table :user_role_joins do |t|
|
||||
t.rename :role, :role_id
|
||||
t.change :role_id, :integer
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,8 @@
|
||||
class AddRoles < ActiveRecord::Migration
|
||||
def change
|
||||
create_table(:roles) do |t|
|
||||
t.string :role
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class AlterUser < ActiveRecord::Migration
|
||||
def change
|
||||
remove_column :users, :user_role_id
|
||||
end
|
||||
end
|
||||
+10
-5
@@ -97,6 +97,12 @@ ActiveRecord::Schema.define(:version => 20130525143240) do
|
||||
|
||||
add_index "logs", ["loggable_id", "loggable_type", "context"], :name => "index_logs_on_loggable_id_and_loggable_type_and_context"
|
||||
|
||||
create_table "roles", :force => true do |t|
|
||||
t.string "role"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "task_lists", :force => true do |t|
|
||||
t.integer "item_id", :null => false
|
||||
t.string "item_type", :null => false
|
||||
@@ -148,10 +154,10 @@ ActiveRecord::Schema.define(:version => 20130525143240) do
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "user_roles", :force => true do |t|
|
||||
t.string "role"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
create_table "user_role_joins", :force => true do |t|
|
||||
t.integer "role_id", :limit => 255
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.datetime "ends"
|
||||
t.integer "user_id"
|
||||
end
|
||||
@@ -167,7 +173,6 @@ ActiveRecord::Schema.define(:version => 20130525143240) do
|
||||
t.datetime "last_sign_in_at"
|
||||
t.string "current_sign_in_ip"
|
||||
t.string "last_sign_in_ip"
|
||||
t.integer "user_role_id", :default => 1, :null => false
|
||||
t.integer "bike_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
|
||||
@@ -13,3 +13,8 @@ staff:
|
||||
action: STAFF
|
||||
created_at: <%= Time.now %>
|
||||
updated_at: <%= Time.now %>
|
||||
checkin:
|
||||
id: 4
|
||||
action: CHECKIN
|
||||
created_at: <%= Time.now %>
|
||||
updated_at: <%= Time.now %>
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
user:
|
||||
id: 1
|
||||
role: user
|
||||
staff:
|
||||
id: 2
|
||||
role: staff
|
||||
admin:
|
||||
id: 3
|
||||
role: admin
|
||||
+1
-1
@@ -21,7 +21,7 @@ end
|
||||
if Rails.env.development?
|
||||
|
||||
#create default admin user
|
||||
if UserRole.all.empty? and User.all.empty?
|
||||
if User.all.empty?
|
||||
FactoryGirl.create(:user)
|
||||
FactoryGirl.create(:staff)
|
||||
FactoryGirl.create(:admin)
|
||||
|
||||
Reference in New Issue
Block a user