summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-01-30 11:40:04 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-01-30 11:40:04 +0200
commite415a84d8faa9c317d34be68a9a2f4c0fc36981c (patch)
tree00045b2d74f99312db04b2b1329d5fa755b0e053
parent58069edbcb14230ffe439a61de40c95e266cba87 (diff)
parent4eef64bb9a1a7be4d71ba65475e1078f762e62fb (diff)
downloadgitlab-ci-e415a84d8faa9c317d34be68a9a2f4c0fc36981c.tar.gz
Merge branch 'fix/deprecations' of github.com:pgolm/gitlab-ci into pgolm-fix/deprecations
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> Conflicts: config/initializers/secret_token.rb
-rw-r--r--app/models/project.rb2
-rw-r--r--app/models/runner.rb2
-rw-r--r--app/views/projects/_form.html.haml2
-rw-r--r--config/application.rb1
-rw-r--r--lib/api/builds.rb2
-rw-r--r--lib/api/projects.rb4
6 files changed, 7 insertions, 6 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 8b21958..80a5b8a 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -44,7 +44,7 @@ class Project < ActiveRecord::Base
if: ->(project) { project.always_build.present? }
- scope :public, where(public: true)
+ scope :public, ->(_) { where(public: true) }
before_validation :set_default_values
diff --git a/app/models/runner.rb b/app/models/runner.rb
index 38b9c6b..9fd1891 100644
--- a/app/models/runner.rb
+++ b/app/models/runner.rb
@@ -15,7 +15,7 @@ class Runner < ActiveRecord::Base
has_many :runner_projects, dependent: :destroy
has_many :projects, through: :runner_projects
- has_one :last_build, class_name: 'Build', order: 'id DESC'
+ has_one :last_build, ->() { order('id DESC') }, class_name: 'Build'
attr_accessible :token, :public_key, :description
diff --git a/app/views/projects/_form.html.haml b/app/views/projects/_form.html.haml
index 752dcbb..8aebe90 100644
--- a/app/views/projects/_form.html.haml
+++ b/app/views/projects/_form.html.haml
@@ -89,4 +89,4 @@
= f.submit 'Save', class: 'btn btn-primary'
= link_to 'Cancel', projects_path, class: 'btn btn-default'
- unless @project.new_record?
- = link_to 'Remove Project', project_path(@project), method: :delete, confirm: 'Project will be removed. Are you sure?', class: 'btn btn-danger right'
+ = link_to 'Remove Project', project_path(@project), method: :delete, data: { confirm: 'Project will be removed. Are you sure?' }, class: 'btn btn-danger right'
diff --git a/config/application.rb b/config/application.rb
index ad29b57..3a57d7c 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -21,6 +21,7 @@ module GitlabCi
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
+ I18n.enforce_available_locales = true
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
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