Skip to content

Commit 5e1c3ca

Browse files
committed
CircleCl build fix: rubocop
1 parent 009028b commit 5e1c3ca

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

app/models/school.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class School < ApplicationRecord
2121
validates :school_roll_number,
2222
uniqueness: { case_sensitive: false, allow_nil: true },
2323
presence: false,
24-
format: { with: /\A[0-9]+[A-Z]+\z/, allow_nil: true, message: 'must be alphanumeric (e.g., 01572D)' }
24+
format: { with: /\A[0-9]+[A-Z]+\z/, allow_nil: true, message: I18n.t('validations.school.school_roll_number') }
2525
validates :creator_id, presence: true, uniqueness: true
2626
validates :creator_agree_authority, presence: true, acceptance: true
2727
validates :creator_agree_terms_and_conditions, presence: true, acceptance: true

config/locales/en.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ en:
1414
validations:
1515
school:
1616
website: "must be a valid URL"
17+
school_roll_number: "must be alphanumeric (e.g., 01572D)"
1718
invitation:
1819
email_address: "'%<value>s' is invalid"
1920
activerecord:

db/migrate/20251128102719_add_school_roll_number_to_schools.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class AddSchoolRollNumberToSchools < ActiveRecord::Migration[7.2]
24
def change
35
add_column :schools, :school_roll_number, :string

0 commit comments

Comments
 (0)