From 6cf54e76f0ca4b30f6883f15c3a64aca4f4eddd2 Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Thu, 9 Mar 2023 18:56:25 -0600 Subject: AƱade modelo company MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/company.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 app/models/company.rb (limited to 'app/models') 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 -- cgit v1.2.3