Skip to content

Commit 2435606

Browse files
committed
Allow setting env vars with same name for different branches in v3 API
1 parent c031fb2 commit 2435606

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/travis/api/v3/models/env_var.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class Models::EnvVar < Travis::Settings::Model
1010
validates :name, presence: true
1111
validates_each :id, :name do |record, attr, value|
1212
others = record.repository.env_vars.select { |ev| ev.id != record.id }
13-
record.errors.add(:base, :duplicate_resource) if others.find { |ev| ev.send(attr) == record.send(attr) }
13+
record.errors.add(:base, :duplicate_resource) if others.find { |ev| ev.send(attr) == record.send(attr) && ev.send(:branch) == record.send(:branch) }
1414
end
1515

1616
def repository

0 commit comments

Comments
 (0)