Skip to content

Commit 3debbeb

Browse files
committed
Restore github id
1 parent dd0c1f9 commit 3debbeb

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

lib/travis/errors.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ def initialize(params)
55

66
if id = params[:repository_id] || params[:id]
77
details = "with id=#{params[:repository_id] || params[:id]} "
8+
elsif params[:github_id]
9+
details = "with github_id=#{params[:github_id]} "
810
elsif params[:vcs_id]
911
details = "with vcs_id=#{params[:vcs_id]} "
1012
elsif params.key?(:slug)

lib/travis/model/repository.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ class Repository < Travis::Model
3939
scope :by_params, ->(params) {
4040
if id = params[:repository_id] || params[:id]
4141
where(id: id)
42+
elsif params[:github_id]
43+
where('vcs_id = :id OR github_id = :id_i', id: params[:github_id].to_s, id_i: params[:github_id].to_i)
4244
elsif params[:vcs_id] && params['vcs_type']
4345
where(vcs_id: params[:vcs_id], vcs_type: params['vcs_type'])
4446
elsif params[:vcs_id]

0 commit comments

Comments
 (0)