1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-07 14:57:48 +00:00

Added team abbreviation

This commit is contained in:
2019-01-24 20:16:43 +00:00
parent 0599faa173
commit 6bbb0b2e2c
11 changed files with 94 additions and 59 deletions

View File

@@ -11,6 +11,15 @@ class School < ActiveRecord::Base
before_destroy do
self.tournament.destroy_all_matches
end
def abbreviation
name_array = self.name.split(' ')
if name_array.size > 1
return "#{name_array[0].chars.to_a.first}#{name_array[1].chars.to_a[0..1].join('').upcase}"
else
return "#{name_array[0].chars.to_a[0..2].join('').upcase}"
end
end
#calculate score here
def page_score_string