Module: SubjModels::VideoModule

Defined in:
lib/subj_models/video.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(including_class) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/subj_models/video.rb', line 7

def self.included(including_class)

  including_class.class_eval do

    include SubjModels::ComprisingExternalId

    belongs_to :document_file
    belongs_to :brand

    scope :brand_id, -> brand { where(brand_id: brand) }
    scope :is_promo, -> condition { where(is_promo: condition) }

  end

end

Instance Method Details

#to_sObject



23
24
25
# File 'lib/subj_models/video.rb', line 23

def to_s
  "#{title1} #{title2}#{' - ПРОМО' if is_promo}"
end