summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorjomo <github@jomo.tv>2015-03-10 00:51:39 +0100
committerjomo <github@jomo.tv>2015-03-10 00:51:39 +0100
commitb601d49fe6dee0e5ab23e8f5f188bb2bde3aa2f0 (patch)
tree21dbb0820eeaf19e12c930799f18c6e255a3cf00 /db
parentd6221ca8d198ace4a6f41f3b12f26a84fc82298c (diff)
add color to roles, improvement in label color detection
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20150309221221_add_color_to_roles.rb5
-rw-r--r--db/schema.rb3
-rw-r--r--db/seeds.rb12
3 files changed, 13 insertions, 7 deletions
diff --git a/db/migrate/20150309221221_add_color_to_roles.rb b/db/migrate/20150309221221_add_color_to_roles.rb
new file mode 100644
index 0000000..6ce4f0e
--- /dev/null
+++ b/db/migrate/20150309221221_add_color_to_roles.rb
@@ -0,0 +1,5 @@
+class AddColorToRoles < ActiveRecord::Migration
+ def change
+ add_column :roles, :color, :string
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index acd47c1..6cf8ed5 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20150117154652) do
+ActiveRecord::Schema.define(version: 20150309221221) do
create_table "blogposts", force: true do |t|
t.string "title"
@@ -83,6 +83,7 @@ ActiveRecord::Schema.define(version: 20150117154652) do
create_table "roles", force: true do |t|
t.string "name"
t.integer "value"
+ t.string "color"
end
create_table "sessions", force: true do |t|
diff --git a/db/seeds.rb b/db/seeds.rb
index 236540e..556d94c 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -2,12 +2,12 @@
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
Role.create!([
- {name: "disabled", value: 1},
- {name: "banned", value: 2},
- {name: "normal", value: 10},
- {name: "mod", value: 100},
- {name: "admin", value: 200},
- {name: "superadmin", value: 500}
+ {name: "disabled", value: 1, color: "#ccc"},
+ {name: "banned", value: 2, color: "#ccc"},
+ {name: "normal", value: 10, color: "#282"},
+ {name: "mod", value: 100, color: "#6af"},
+ {name: "admin", value: 200, color: "#d22"},
+ {name: "superadmin", value: 500, color: "#d22"}
])
userpw = SecureRandom.hex(64)