| Total Complexity | 1 |
| Total Lines | 14 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | # frozen_string_literal: true |
||
| 24 | class ResponseScale < ApplicationRecord |
||
| 25 | has_many :choices, inverse_of: :response_scale, dependent: :destroy |
||
| 26 | has_many :items, inverse_of: :response_scale |
||
| 27 | validates :name, presence: true |
||
| 28 | validates_uniqueness_of :name |
||
| 29 | validates_length_of :name, \ |
||
| 30 | within: 2..50, \ |
||
| 31 | too_long: 'pick a shorter name', \ |
||
| 32 | too_short: 'pick a longer name' |
||
| 33 | |||
| 34 | def to_s |
||
| 35 | name |
||
| 36 | end |
||
| 37 | end |
||
| 38 |