Skip to content

Commit

Permalink
Switch TransferSource has_one :repository relationship to belogs_to
Browse files Browse the repository at this point in the history
  • Loading branch information
elohanlon committed Feb 23, 2024
1 parent 6ef903d commit f01b621
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions app/models/transfer_source.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# frozen_string_literal: true

require 'digest'

class TransferSource < ApplicationRecord
has_one :repository, required: false
validates :path, presence: { strict: true }, on: :create
belongs_to :repository, optional: true
validates :path, presence: { strict: true }, on: :create

validates_with PathValidator, on: :update
validates_with PathHashValidator
validates_with PathValidator, on: :update
validates_with PathHashValidator

include PathHashes
end
include PathHashes
end

0 comments on commit f01b621

Please sign in to comment.