Class: ShowcaseDigitalAsset
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- ShowcaseDigitalAsset
- Defined in:
- app/models/showcase_digital_asset.rb
Overview
== Schema Information
Table name: showcase_digital_assets
Database name: primary
id :bigint not null, primary key
is_main :boolean default(FALSE), not null
position :integer
digital_asset_id :bigint not null
room_configuration_id :integer
showcase_id :bigint not null
Indexes
idx_sda_showcase_pos (showcase_id,position)
idx_sv2da_digital_asset_id (digital_asset_id)
idx_sv2da_room_configuration_id (room_configuration_id)
idx_unique_main_image_per_showcase_v2 (showcase_id) UNIQUE WHERE (is_main = true)
Foreign Keys
fk_rails_... (digital_asset_id => digital_assets.id)
fk_rails_... (showcase_id => showcases.id)
Instance Attribute Summary collapse
- #is_main ⇒ Object readonly
- #position ⇒ Object readonly
Belongs to collapse
- #digital_asset ⇒ DigitalAsset
-
#room_configuration ⇒ RoomConfiguration
Optional link to a room configuration if the image was imported from a specific room.
- #showcase ⇒ Showcase
Class Method Summary collapse
-
.main ⇒ ActiveRecord::Relation<ShowcaseDigitalAsset>
A relation of ShowcaseDigitalAssets that are main.
Methods inherited from ApplicationRecord
ransackable_associations, ransackable_attributes, ransackable_scopes, ransortable_attributes, #to_relation
Methods included from Models::EventPublishable
Instance Attribute Details
#is_main ⇒ Object (readonly)
86 |
# File 'app/models/showcase_digital_asset.rb', line 86 validates :is_main, inclusion: { in: [true, false] } |
#position ⇒ Object (readonly)
80 |
# File 'app/models/showcase_digital_asset.rb', line 80 validates :position, presence: true, numericality: { greater_than_or_equal_to: 0 } |
Class Method Details
.main ⇒ ActiveRecord::Relation<ShowcaseDigitalAsset>
A relation of ShowcaseDigitalAssets that are main. Active Record Scope
84 |
# File 'app/models/showcase_digital_asset.rb', line 84 scope :main, -> { where(is_main: true) } |
Instance Method Details
#digital_asset ⇒ DigitalAsset
78 |
# File 'app/models/showcase_digital_asset.rb', line 78 belongs_to :digital_asset |
#room_configuration ⇒ RoomConfiguration
Optional link to a room configuration if the image was imported from a specific room
82 |
# File 'app/models/showcase_digital_asset.rb', line 82 belongs_to :room_configuration, optional: true |