Class: Spina::Admin::Conferences::PresentationAttachmentType

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

Overview

Presentation attachment type records.

Validators

Presence

#name.

Translations

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameString?

Returns the name of the presentation attachment type.

Returns:

  • (String, nil)

    the name of the presentation attachment type



18
# File 'app/models/spina/admin/conferences/presentation_attachment_type.rb', line 18

translates :name, fallbacks: true

#presentation_attachmentsActiveRecord::Relation

Returns directly associated presentation attachments.

Returns:

  • (ActiveRecord::Relation)

    directly associated presentation attachments

See Also:



26
27
28
29
# File 'app/models/spina/admin/conferences/presentation_attachment_type.rb', line 26

has_many :presentation_attachments, class_name: 'Spina::Admin::Conferences::PresentationAttachment',
foreign_key: 'attachment_type_id',
dependent: :destroy,
inverse_of: :attachment_type

Instance Method Details

#sortedActiveRecord::Relation

Returns all presentation attachment types, ordered by name.

Returns:

  • (ActiveRecord::Relation)

    all presentation attachment types, ordered by name



21
# File 'app/models/spina/admin/conferences/presentation_attachment_type.rb', line 21

scope :sorted, -> { i18n.order :name }