Sha256: 18c21365cbb169a3998e5b5b53a8a2867832a9ab76c2de283718fa380effa255

Contents?: true

Size: 421 Bytes

Versions: 2

Compression:

Stored size: 421 Bytes

Contents

module Helena
  class Label
    include Helena::Concerns::ApplicationModel
    include Mongoid::Orderable

    field :text,        type: String
    field :value,       type: String
    field :preselected, type: Boolean, default: false

    embedded_in :question, inverse_of: :labels

    orderable

    validates :text, presence: true
    validates :value, presence: true
    validates :value, uniqueness: true
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
helena-1.0.0.rc1 app/models/helena/label.rb
helena-0.3.3 app/models/helena/label.rb