Skip to content

Commit

Permalink
Trim academic group title on save
Browse files Browse the repository at this point in the history
  • Loading branch information
mpugach committed Mar 12, 2023
1 parent 9acbd8d commit bd1307f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/academic_group.rb
Expand Up @@ -17,7 +17,7 @@ class AcademicGroup < ApplicationRecord

has_many :examinations, through: :courses

before_save { |p| p.title = title.mb_chars.upcase.to_s if title.present? }
before_save { |p| p.title = title.mb_chars.upcase.to_s.strip if title.present? }

validates :title, presence: true, uniqueness: true
validates :administrator, presence: true
Expand Down
2 changes: 1 addition & 1 deletion spec/features/academic_groups/edit_academic_group_spec.rb
Expand Up @@ -95,7 +95,7 @@
[
{
field: I18n.t('activerecord.attributes.academic_group.title'),
value: 'БШ99-9',
value: ' бш99-9 ',
test_field: 'БШ99-9'
},
{
Expand Down

0 comments on commit bd1307f

Please sign in to comment.