rename forbid_to_publish_builds_not_from field to publish_builds_only_from_branch
This commit is contained in:
parent
f30feb1153
commit
d91ceab0a9
|
@ -22,7 +22,7 @@ class Platforms::RepositoriesController < Platforms::BaseController
|
|||
end
|
||||
|
||||
def update
|
||||
if @repository.update_attributes params[:repository].slice(:description, :synchronizing_publications, :forbid_to_publish_builds_not_from).merge(publish_without_qa: (params[:repository][:publish_without_qa] || @repository.publish_without_qa))
|
||||
if @repository.update_attributes params[:repository].slice(:description, :synchronizing_publications, :publish_builds_only_from_branch).merge(publish_without_qa: (params[:repository][:publish_without_qa] || @repository.publish_without_qa))
|
||||
flash[:notice] = I18n.t("flash.repository.updated")
|
||||
redirect_to platform_repository_path(@platform, @repository)
|
||||
else
|
||||
|
|
|
@ -606,12 +606,12 @@ class BuildList < ActiveRecord::Base
|
|||
|
||||
def valid_branch_for_publish?
|
||||
return true if save_to_platform.personal? ||
|
||||
save_to_repository.forbid_to_publish_builds_not_from.blank? ||
|
||||
( project_version == save_to_repository.forbid_to_publish_builds_not_from )
|
||||
save_to_repository.publish_builds_only_from_branch.blank? ||
|
||||
( project_version == save_to_repository.publish_builds_only_from_branch )
|
||||
|
||||
project.repo.git.native(:branch, {}, '--contains', commit_hash).
|
||||
gsub(/\*/, '').split(/\n/).map(&:strip).
|
||||
include?(save_to_repository.forbid_to_publish_builds_not_from)
|
||||
include?(save_to_repository.publish_builds_only_from_branch)
|
||||
end
|
||||
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ class Repository < ActiveRecord::Base
|
|||
validates :description, presence: true
|
||||
validates :name, uniqueness: { scope: :platform_id, case_sensitive: false }, presence: true,
|
||||
format: { with: /\A[a-z0-9_\-]+\z/ }
|
||||
validates :forbid_to_publish_builds_not_from, length: { maximum: 255 }
|
||||
validates :publish_builds_only_from_branch, length: { maximum: 255 }
|
||||
|
||||
scope :recent, -> { order(:name) }
|
||||
scope :main, -> { where(name: %w(main base)) }
|
||||
|
@ -34,7 +34,7 @@ class Repository < ActiveRecord::Base
|
|||
:description,
|
||||
:publish_without_qa,
|
||||
:synchronizing_publications,
|
||||
:forbid_to_publish_builds_not_from
|
||||
:publish_builds_only_from_branch
|
||||
|
||||
attr_readonly :name, :platform_id
|
||||
attr_accessor :projects_list
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
|
||||
- if @platform.main?
|
||||
.both
|
||||
.leftlist= f.label :forbid_to_publish_builds_not_from
|
||||
.rightlist= f.text_field :forbid_to_publish_builds_not_from
|
||||
.leftlist= f.label :publish_builds_only_from_branch
|
||||
.rightlist= f.text_field :publish_builds_only_from_branch
|
||||
|
||||
.both
|
||||
|
||||
|
|
|
@ -71,4 +71,4 @@ en:
|
|||
updated_at: Updated
|
||||
owner: Owner
|
||||
synchronizing_publications: Publish only on success all build_lists for each arch (checking by commit hash)
|
||||
forbid_to_publish_builds_not_from: "Publish builds only from branch"
|
||||
publish_builds_only_from_branch: "Publish builds only from branch"
|
||||
|
|
|
@ -71,5 +71,5 @@ ru:
|
|||
updated_at: Обновлен
|
||||
owner: Владелец
|
||||
synchronizing_publications: Публиковать сборочные листы только при успешной сборке под каждую архитектуру (проверка по хэшу коммита)
|
||||
forbid_to_publish_builds_not_from: "Публикация сборок только из ветки"
|
||||
publish_builds_only_from_branch: "Публикация сборок только из ветки"
|
||||
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
class RenameRepositoriesForbidToPublishBuildsNotFromToPublishBuildsOnlyFromBranch < ActiveRecord::Migration
|
||||
def change
|
||||
change_table :repositories do |t|
|
||||
t.rename :forbid_to_publish_builds_not_from, :publish_builds_only_from_branch
|
||||
end
|
||||
end
|
||||
end
|
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20140530193652) do
|
||||
ActiveRecord::Schema.define(version: 20140602164337) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
@ -529,7 +529,7 @@ ActiveRecord::Schema.define(version: 20140530193652) do
|
|||
t.string "name", null: false
|
||||
t.boolean "publish_without_qa", default: true
|
||||
t.boolean "synchronizing_publications", default: false, null: false
|
||||
t.string "forbid_to_publish_builds_not_from"
|
||||
t.string "publish_builds_only_from_branch"
|
||||
t.index ["platform_id"], :name => "index_repositories_on_platform_id"
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue