Files
nairobi/app/models/concerns/measurable.rb
Javi Martín 0be6eb9512 Add and apply Style/RedundantParentheses rule
Parentheses make the code harder to read in these cases.
2021-09-03 11:49:52 +02:00

26 lines
487 B
Ruby

module Measurable
extend ActiveSupport::Concern
class_methods do
def title_max_length
@title_max_length ||= columns.find { |c| c.name == "title" }&.limit || 80
end
def responsible_name_max_length
@responsible_name_max_length ||= columns.find { |c| c.name == "responsible_name" }&.limit || 60
end
def question_max_length
140
end
def description_max_length
6000
end
def description_min_length
10
end
end
end