summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorHombreLaser <sebastian-440@live.com>2023-03-09 18:56:25 -0600
committerHombreLaser <sebastian-440@live.com>2023-03-09 18:56:25 -0600
commit6cf54e76f0ca4b30f6883f15c3a64aca4f4eddd2 (patch)
tree35c8cf7d37d9a70b83e63fb4e327068f405d0833 /app/models
parent09a00d91fae22de6d455eb96b59927dfda320dda (diff)
Añade modelo company
Diffstat (limited to 'app/models')
-rw-r--r--app/models/company.rb18
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