This rule was added in rubocop 1.79. We were inconsistent about it, so we're adding it to get more consistency.
15 lines
299 B
Ruby
15 lines
299 B
Ruby
class SDG::Phase < ApplicationRecord
|
|
include Cardable
|
|
|
|
enum :kind, { sensitization: 0, planning: 1, monitoring: 2 }
|
|
validates :kind, presence: true, uniqueness: true
|
|
|
|
def self.[](kind)
|
|
find_by!(kind: kind)
|
|
end
|
|
|
|
def title
|
|
self.class.human_attribute_name("kind.#{kind}")
|
|
end
|
|
end
|