From f16b31f0773c2fd1122ff0ad98cb392e762f0d0b Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 26 Feb 2016 15:28:08 +0100 Subject: Adding a bunch of tests --- app/models/status.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'app/models/status.rb') diff --git a/app/models/status.rb b/app/models/status.rb index d95870393..3ba58cc91 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -54,10 +54,9 @@ class Status < ActiveRecord::Base unless reblog? self.text.scan(Account::MENTION_RE).each do |match| - uri = match.first - username = uri.split('@').first - domain = uri.split('@').size == 2 ? uri.split('@').last : nil - account = Account.find_by(username: username, domain: domain) + uri = match.first + username, domain = uri.split('@') + account = Account.find_by(username: username, domain: domain) m << account unless account.nil? end -- cgit