diff options
Diffstat (limited to 'app/models/airflow/dags.rb')
-rw-r--r-- | app/models/airflow/dags.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/models/airflow/dags.rb b/app/models/airflow/dags.rb new file mode 100644 index 00000000000..d17d4a4f3db --- /dev/null +++ b/app/models/airflow/dags.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Airflow + class Dags < ApplicationRecord + belongs_to :project + + validates :project, presence: true + validates :dag_name, length: { maximum: 255 }, presence: true + validates :schedule, length: { maximum: 255 } + validates :fileloc, length: { maximum: 255 } + + scope :by_project_id, ->(project_id) { where(project_id: project_id).order(id: :asc) } + end +end |