diff --git a/lib/travis/model/repository.rb b/lib/travis/model/repository.rb
index <HASH>..<HASH> 100644
--- a/lib/travis/model/repository.rb
+++ b/lib/travis/model/repository.rb
@@ -76,8 +76,10 @@ class Repository < ActiveRecord::Base
     def find_by(params)
       if id = params[:repository_id] || params[:id]
         self.find(id)
-      else
+      elsif params.key?(:name) && params.key?(:owner_name)
         self.where(params.slice(:name, :owner_name)).first || raise(ActiveRecord::RecordNotFound)
+      else
+        raise(ActiveRecord::RecordNotFound)
       end
     end
make sure Repository.find_by requires necessary params