summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-01-30 10:40:14 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-01-30 10:40:14 +0000
commit15641879c3196f228ccd77d3731c0710ee1c55cf (patch)
tree1ee6fb5299c99c1b2d64195d0fffdb7af2d656e6 /lib/api
parent7e348ca2260ae422ecc333dbb8b81dfcc6e78fbf (diff)
parente415a84d8faa9c317d34be68a9a2f4c0fc36981c (diff)
downloadgitlab-ci-15641879c3196f228ccd77d3731c0710ee1c55cf.tar.gz
Merge branch 'pgolm-fix/deprecations' into 'master'
Fix deprecations Ported from https://github.com/gitlabhq/gitlab-ci/pull/357
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/builds.rb2
-rw-r--r--lib/api/projects.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/api/builds.rb b/lib/api/builds.rb
index 45b2d35..6ecc248 100644
--- a/lib/api/builds.rb
+++ b/lib/api/builds.rb
@@ -14,7 +14,7 @@ module API
required_attributes! [:token]
ActiveRecord::Base.transaction do
- builds = Build.scoped
+ builds = Build.all
builds = builds.where(project_id: current_runner.projects) unless current_runner.shared?
build = builds.first_pending
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index f2334a5..dad783f 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -12,7 +12,7 @@ module API
gitlab_projects = Project.from_gitlab(current_user, nil, nil, :authorized)
ids = gitlab_projects.map { |project| project.id }
- projects = Project.where("gitlab_id IN (?)", ids).all
+ projects = Project.where("gitlab_id IN (?)", ids).load
present projects, with: Entities::Project
end
@@ -24,7 +24,7 @@ module API
gitlab_projects = Project.from_gitlab(current_user, nil, nil, :owned)
ids = gitlab_projects.map { |project| project.id }
- projects = Project.where("gitlab_id IN (?)", ids).all
+ projects = Project.where("gitlab_id IN (?)", ids).load
present projects, with: Entities::Project
end