mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-10 17:39:38 +08:00
14 lines
422 B
Ruby
14 lines
422 B
Ruby
|
class Repository < ActiveRecord::Base
|
||
|
belongs_to :team
|
||
|
belongs_to :created_by, foreign_key: :created_by_id, class_name: 'User'
|
||
|
has_many :repository_columns
|
||
|
has_many :repository_rows
|
||
|
|
||
|
auto_strip_attributes :name, nullify: false
|
||
|
validates :name,
|
||
|
presence: true,
|
||
|
length: { maximum: Constants::NAME_MAX_LENGTH }
|
||
|
validates :team, presence: true
|
||
|
validates :created_by, presence: true
|
||
|
end
|