osem-fcy/app/models/difficulty_level.rb
Ana 0deaf1abc7 Different colors for new tracks, types and levels
Every time a new track, event type or difficulty level is created, the color picker has a different color by default.

Closes https://github.com/openSUSE/osem/issues/1077
2016-07-11 13:46:01 +02:00

7 lines
195 B
Ruby

class DifficultyLevel < ActiveRecord::Base
belongs_to :program
has_many :events, dependent: :nullify
validates :title, presence: true
validates :color, format: /\A#[0-9a-fA-F]{6}\z/
end