Improved limitation of tweet title.
This commit is contained in:
parent
7434971416
commit
f4b624a967
1 changed files with 7 additions and 1 deletions
|
@ -121,9 +121,15 @@ class TweetBase
|
||||||
|
|
||||||
UserInfo.current_user_id = user.id
|
UserInfo.current_user_id = user.id
|
||||||
|
|
||||||
|
# prepare title
|
||||||
|
title = tweet.text
|
||||||
|
if title.length > 80
|
||||||
|
title = "#{title[0, 80]}..."
|
||||||
|
end
|
||||||
|
|
||||||
Ticket.create(
|
Ticket.create(
|
||||||
customer_id: user.id,
|
customer_id: user.id,
|
||||||
title: "#{tweet.text[0, 37]}...",
|
title: title,
|
||||||
group_id: group_id,
|
group_id: group_id,
|
||||||
state: Ticket::State.find_by(name: 'new'),
|
state: Ticket::State.find_by(name: 'new'),
|
||||||
priority: Ticket::Priority.find_by(name: '2 normal'),
|
priority: Ticket::Priority.find_by(name: '2 normal'),
|
||||||
|
|
Loading…
Reference in a new issue