Fixes error initializing database

This commit is contained in:
Alberto Miedes Garcés
2016-11-30 13:38:13 +01:00
parent 0eae2fada6
commit 76dd11631a

View File

@@ -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
end