Commit 635884c2 authored by Kaspar Vollenweider's avatar Kaspar Vollenweider

style: order journal model proprieties and method order

parent 95e2f1f6
Pipeline #39371 passed with stage
in 38 minutes and 29 seconds
class Journal < ApplicationRecord
include ImportRelation
belongs_to :user, -> { with_deleted }, inverse_of: 'journals'
belongs_to :assignment, optional: true
belongs_to :journalable, polymorphic: true, required: false
CATEGORIES = [
:telephone,
:conversation,
......@@ -15,6 +10,12 @@ class Journal < ApplicationRecord
:group_offer
].freeze
belongs_to :user, -> { with_deleted }, inverse_of: 'journals'
belongs_to :assignment, optional: true
belongs_to :journalable, polymorphic: true, required: false
validates :category, presence: true
def self.categories_filters
CATEGORIES.map do |category|
{
......@@ -24,6 +25,4 @@ class Journal < ApplicationRecord
}
end
end
validates :category, presence: true
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment