diff --git a/app/models/concerns/measurable.rb b/app/models/concerns/measurable.rb index 44b7ddabb..5ac2f2a14 100644 --- a/app/models/concerns/measurable.rb +++ b/app/models/concerns/measurable.rb @@ -4,11 +4,11 @@ module Measurable class_methods do def title_max_length - @@title_max_length ||= self.columns.find { |c| c.name == 'title' }.limit || 80 + @@title_max_length ||= (self.columns.find { |c| c.name == 'title' }.limit rescue nil) || 80 end def responsible_name_max_length - @@responsible_name_max_length ||= self.columns.find { |c| c.name == 'responsible_name' }.limit || 60 + @@responsible_name_max_length ||= (self.columns.find { |c| c.name == 'responsible_name' }.limit rescue nil) || 60 end def question_max_length @@ -21,4 +21,4 @@ module Measurable end -end \ No newline at end of file +end