summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Golm <golm.peter@gmail.com>2014-01-09 14:25:29 +0100
committerPeter Golm <golm.peter@gmail.com>2014-01-09 14:25:29 +0100
commit4eef64bb9a1a7be4d71ba65475e1078f762e62fb (patch)
tree7682e31d8eb9035f5c000f7dfac6c8b71d8e702c
parent1f838a4f98fafa80ae5cfd7759b883b00870072f (diff)
downloadgitlab-ci-4eef64bb9a1a7be4d71ba65475e1078f762e62fb.tar.gz
fix deprections warnings
-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--config/initializers/secret_token.rb10
-rw-r--r--lib/api/builds.rb2
-rw-r--r--lib/api/projects.rb4
7 files changed, 14 insertions, 9 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 1a72f7e..3d495d2 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/config/initializers/secret_token.rb b/config/initializers/secret_token.rb
index ccbda95..de6f772 100644
--- a/config/initializers/secret_token.rb
+++ b/config/initializers/secret_token.rb
@@ -1,8 +1,12 @@
# Be sure to restart your server when you modify this file.
-# Your secret key for verifying the integrity of signed cookies.
+# Your secret key is used for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
+
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
-GitlabCi::Application.config.secret_token = '41cff934d5a788409310b2b4dc931ca9be9c5113ede94f41d44bf71b403f007d8031efa855d6d111393d33ca839722db98445a1a6f020331a3f43bd29a50c93e'
-GitlabCi::Application.config.secret_key_token = '41cff934d5a788409310b2b4dc931ca9be9c5113ede94f41d44bf71b403f007d8031efa855d6d111393d33ca839722db98445a1a6f020331a3f43bd29a50c93e'
+# You can use `rake secret` to generate a secure secret key.
+
+# Make sure your secret_key_base is kept private
+# if you're sharing your code publicly.
+GitlabCi::Application.config.secret_key_base = '41cff934d5a788409310b2b4dc931ca9be9c5113ede94f41d44bf71b403f007d8031efa855d6d111393d33ca839722db98445a1a6f020331a3f43bd29a50c93e'
diff --git a/lib/api/builds.rb b/lib/api/builds.rb
index 0982d7d..811de7c 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