Files
gitlink-forgeplus/app/forms/contents/create_form.rb
sylor_huang@126.com e15a81a04c 修改create_file
2020-03-26 16:50:31 +08:00

14 lines
363 B
Ruby

class Contents::CreateForm < BaseForm
attr_accessor :filepath, :branch, :new_branch
validates :filepath, presence: true
validate :check_branch
def check_branch
raise "branch和new_branch必须存在一个 " if branch.blank? && new_branch.blank?
# raise "branch和new_branch只能存在一个" if !branch.blank? && !new_branch.blank?
end
end