diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/models/repository.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index 472bf615b..ec7890415 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -30,6 +30,7 @@ class Repository < ActiveRecord::Base serialize :extra_info + before_validation :normalize_identifier before_save :check_default # Raw SQL to delete changesets and changes in the database @@ -469,6 +470,10 @@ class Repository < ActiveRecord::Base end end + def normalize_identifier + self.identifier = identifier.to_s.strip + end + def check_default if !is_default? && set_as_default? self.is_default = true |