diff --git a/app/models/user.rb b/app/models/user.rb index 569270a99f6938fb281b3a5944e528b265872dbb..2e984e029737db1b924107b8410611e4ba0c3422 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -57,6 +57,7 @@ # class User < ApplicationRecord include WithAdminTheme + include WithAuthorship include WithAvatar include WithRegistrationContext include WithUniversity diff --git a/app/models/user/with_authorship.rb b/app/models/user/with_authorship.rb new file mode 100644 index 0000000000000000000000000000000000000000..19e47a7abf8397bca21df3247eaa0d0062ad10f9 --- /dev/null +++ b/app/models/user/with_authorship.rb @@ -0,0 +1,10 @@ +module User::WithAuthorship + extend ActiveSupport::Concern + + included do + has_many :research_journal_papers, + class_name: "Research::Journal::Paper", + foreign_key: :updated_by_id, + dependent: :nullify + end +end