about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-01-13 03:24:41 +0100
committerEugen Rochko <eugen@zeonfederated.com>2017-01-13 03:24:41 +0100
commite25170f960bdc890e4f8a6b1373ab55192669629 (patch)
tree6a08f8020ede5457a276d99a6c146354eed4db60 /app/models
parent2939e9898b1e0e7da6db802a00e594be4c85499d (diff)
Add extended about page stub
Diffstat (limited to 'app/models')
-rw-r--r--app/models/account.rb1
-rw-r--r--app/models/setting.rb5
-rw-r--r--app/models/web.rb2
3 files changed, 5 insertions, 3 deletions
diff --git a/app/models/account.rb b/app/models/account.rb
index ec0e81f7c..5f07615fc 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -159,6 +159,7 @@ class Account < ApplicationRecord
     end
 
     def find_remote!(username, domain)
+      return if username.blank?
       where(arel_table[:username].matches(username.gsub(/[%_]/, '\\\\\0'))).where(domain.nil? ? { domain: nil } : arel_table[:domain].matches(domain.gsub(/[%_]/, '\\\\\0'))).take!
     end
 
diff --git a/app/models/setting.rb b/app/models/setting.rb
index f3c65c054..3796253d4 100644
--- a/app/models/setting.rb
+++ b/app/models/setting.rb
@@ -9,10 +9,9 @@ class Setting < RailsSettings::Base
   end
 
   class << self
-
     def [](key)
       return super(key) unless rails_initialized?
-      
+
       val = Rails.cache.fetch(cache_key(key, @object)) do
         db_val = object(key)
 
@@ -25,7 +24,7 @@ class Setting < RailsSettings::Base
           default_settings[key]
         end
       end
-      
+
       val
     end
 
diff --git a/app/models/web.rb b/app/models/web.rb
index 3c6eebbe2..58654fd77 100644
--- a/app/models/web.rb
+++ b/app/models/web.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
 module Web
   def self.table_name_prefix
     'web_'