diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/models/company.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/app/models/company.rb b/app/models/company.rb new file mode 100644 index 0000000..134d8e9 --- /dev/null +++ b/app/models/company.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# Company +# name: string +# short_name: string +# country: string +class Company < ApplicationRecord + validates :short_name, uniqueness: true + validates :short_name, presence: true + validates :name, presence: true + validates :country, presence: true + + has_one_attached :logo + + def to_param + short_name + end +end |