From 9a7485d03407b8177a51d900ac9aabbca893a2c1 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 18 Mar 2016 23:23:19 +0100 Subject: Fix typo on /api/accounts/:id/statuses, fix potential case-sensitivity issue when registering incoming status mentions, add Travis CI file --- app/models/account.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/models/account.rb') diff --git a/app/models/account.rb b/app/models/account.rb index e4295d735..06f858c7c 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -104,6 +104,12 @@ class Account < ActiveRecord::Base self.where(table[:username].matches(username)).where(domain: nil).take! end + def self.find_local(username) + self.find_local!(username) + rescue ActiveRecord::RecordNotFound + nil + end + before_create do if local? keypair = OpenSSL::PKey::RSA.new(Rails.env.test? ? 1024 : 2048) -- cgit