Defect #13592 ยป fix-not-unique.patch
| app/models/repository.rb | ||
|---|---|---|
|
serialize :extra_info
|
||
|
before_create :check_identifier
|
||
|
before_save :check_default
|
||
|
# Raw SQL to delete changesets and changes in the database
|
||
| ... | ... | |
|
protected
|
||
|
def check_identifier
|
||
|
while self.exists?(:conditions => {:identifier => self.identifier})
|
||
|
self.identifier = "_" + self.identifier
|
||
|
end
|
||
|
end
|
||
|
def check_default
|
||
|
if !is_default? && set_as_default?
|
||
|
self.is_default = true
|
||