From f4b624a967784059b97d225f18d1aee4dce524d7 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 13 Jan 2016 11:16:54 +0100 Subject: [PATCH] Improved limitation of tweet title. --- lib/tweet_base.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/tweet_base.rb b/lib/tweet_base.rb index 069f92b07..cb6db1e81 100644 --- a/lib/tweet_base.rb +++ b/lib/tweet_base.rb @@ -121,9 +121,15 @@ class TweetBase UserInfo.current_user_id = user.id + # prepare title + title = tweet.text + if title.length > 80 + title = "#{title[0, 80]}..." + end + Ticket.create( customer_id: user.id, - title: "#{tweet.text[0, 37]}...", + title: title, group_id: group_id, state: Ticket::State.find_by(name: 'new'), priority: Ticket::Priority.find_by(name: '2 normal'),