adds the maximum length of the comments to settings

This commit is contained in:
palomahnhp
2016-03-03 15:17:36 +01:00
parent 2a4adc2e60
commit d786f9edea
3 changed files with 6 additions and 1 deletions

View File

@@ -95,7 +95,7 @@ class Comment < ActiveRecord::Base
end end
def self.body_max_length def self.body_max_length
1000 Setting['comments_body_max_length'].to_i
end end
def calculate_confidence_score def calculate_confidence_score

View File

@@ -24,6 +24,8 @@ Setting.create(key: 'feature.twitter_login', value: "true")
Setting.create(key: 'feature.facebook_login', value: "true") Setting.create(key: 'feature.facebook_login', value: "true")
Setting.create(key: 'feature.google_login', value: "true") Setting.create(key: 'feature.google_login', value: "true")
Setting.create(key: 'comments_body_max_length', value: '1000')
puts "Creating Geozones" puts "Creating Geozones"
('A'..'Z').each{ |i| Geozone.create(name: "District #{i}") } ('A'..'Z').each{ |i| Geozone.create(name: "District #{i}") }

View File

@@ -57,3 +57,6 @@ Setting['feature.twitter_login'] = true
Setting['feature.facebook_login'] = true Setting['feature.facebook_login'] = true
Setting['feature.google_login'] = true Setting['feature.google_login'] = true
Setting['feature.public_stats'] = true Setting['feature.public_stats'] = true
# Max length for comments
Setting['comments_body_max_length'] = 1000