Class: Spina::Admin::Journal::Authorship

Inherits:
ApplicationRecord
  • Object
show all
Defined in:
app/models/spina/admin/journal/authorship.rb

Overview

Joins Articles and Affiliations

See Also:

Instance Attribute Summary collapse

Instance Attribute Details

#articleActiveRecord::Relation

Returns the associated article.

Returns:

  • (ActiveRecord::Relation)

    the associated article



12
# File 'app/models/spina/admin/journal/authorship.rb', line 12

belongs_to :article

#author_nameActiveRecord::Relation

Returns the associated affiliation of an author of the article.

Returns:

  • (ActiveRecord::Relation)

    the associated affiliation of an author of the article



15
# File 'app/models/spina/admin/journal/authorship.rb', line 15

belongs_to :affiliation

#positionInteger

Returns used to order the affiliations for each article.

Returns:

  • (Integer)

    used to order the affiliations for each article



19
# File 'app/models/spina/admin/journal/authorship.rb', line 19

before_validation :set_default_position, unless: :persisted?