This is bothering me. It doesn't look too DRY. What would be a better implementation? As an aside, how come this ActiveRecord finder doesn't throw an exception when record is not found, but .find does?
def current_account
return @account if @account
unless current_subdomain.blank?
@account = Account.find_by_host(current_subdomain)
else
@account = nil
end
@account
end