Judge0Tsting / app /models /language.rb
AdityaSharmaTech's picture
Upload 177 files
def1299 verified
raw
history blame contribute delete
522 Bytes
# == Schema Information
#
# Table name: languages
#
# id :integer not null, primary key
# name :string
# compile_cmd :string
# run_cmd :string
# source_file :string
# is_archived :boolean default(FALSE)
#
class Language < ApplicationRecord
validates :name, presence: true
validates :source_file, :run_cmd, presence: true, unless: -> { is_project }
default_scope { where(is_archived: false).order(name: :asc) }
def is_project
name == "Multi-file program"
end
end