Class: Spina::Admin::Conferences::Institution
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Spina::Admin::Conferences::Institution
- Defined in:
- app/models/spina/admin/conferences/institution.rb
Overview
Instance Attribute Summary collapse
-
#city ⇒ String?
The city of the institution.
-
#delegates ⇒ ActiveRecord::Relation
Directly associated delegates.
-
#logo ⇒ Spina::Image?
Directly associated image.
-
#name ⇒ String?
The name of the institution.
-
#rooms ⇒ ActiveRecord::Relation
Directly associated rooms.
Instance Method Summary collapse
-
#sorted ⇒ ActiveRecord::Relation
All institutions, ordered by name.
Instance Attribute Details
#city ⇒ String?
Returns the city of the institution.
21 |
# File 'app/models/spina/admin/conferences/institution.rb', line 21 translates :name, :city, fallbacks: true |
#delegates ⇒ ActiveRecord::Relation
Note:
This relation accepts nested attributes.
Note:
An institution cannot be destroyed if it has dependent delegates.
Returns directly associated delegates.
39 |
# File 'app/models/spina/admin/conferences/institution.rb', line 39 has_many :delegates, inverse_of: :institution, dependent: :restrict_with_error |
#logo ⇒ Spina::Image?
Returns directly associated image.
28 |
# File 'app/models/spina/admin/conferences/institution.rb', line 28 belongs_to :logo, class_name: 'Spina::Image', optional: true |
#name ⇒ String?
Returns the name of the institution.
21 |
# File 'app/models/spina/admin/conferences/institution.rb', line 21 translates :name, :city, fallbacks: true |
#rooms ⇒ ActiveRecord::Relation
Note:
An institution cannot be destroyed if it has dependent rooms.
Returns directly associated rooms.
33 |
# File 'app/models/spina/admin/conferences/institution.rb', line 33 has_many :rooms, -> { includes(:translations) }, inverse_of: :institution, dependent: :restrict_with_error |
Instance Method Details
#sorted ⇒ ActiveRecord::Relation
Returns all institutions, ordered by name.
24 |
# File 'app/models/spina/admin/conferences/institution.rb', line 24 scope :sorted, -> { i18n.order :name } |