add color to roles, improvement in label color detection

This commit is contained in:
jomo
2015-03-10 00:51:39 +01:00
parent d6221ca8d1
commit b601d49fe6
9 changed files with 30 additions and 37 deletions

View File

@@ -2,6 +2,8 @@ class Role < ActiveRecord::Base
include Comparable
has_many :users
validates :color, format: {with: /#[0-9a-f]{3,6}/i}
def to_s
self.name