Sha256: ed306be06addddd073f91a9e4149e121bda1f060e39bdf9fb22c1aec1776c3b6

Contents?: true

Size: 525 Bytes

Versions: 50

Compression:

Stored size: 525 Bytes

Contents

require 'subj_models/concerns/comprising_external_id'

module SubjModels

  module VideoModule

    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

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

  end

end

Version data entries

50 entries across 50 versions & 2 rubygems

Version Path
subj_sub_models-0.0.3.29 lib/subj_models/video.rb
subj_sub_models-0.0.3.28 lib/subj_models/video.rb
subj_sub_models-0.0.3.27 lib/subj_models/video.rb
subj_sub_models-0.0.3.26 lib/subj_models/video.rb
subj_sub_models-0.0.3.25 lib/subj_models/video.rb
subj_sub_models-0.0.3.24 lib/subj_models/video.rb
subj_sub_models-0.0.3.23 lib/subj_models/video.rb
subj_sub_models-0.0.3.22 lib/subj_models/video.rb
subj_sub_models-0.0.3.21 lib/subj_models/video.rb
subj_sub_models-0.0.3.20 lib/subj_models/video.rb
subj_sub_models-0.0.3.19 lib/subj_models/video.rb
subj_sub_models-0.0.3.18 lib/subj_models/video.rb
subj_sub_models-0.0.3.17 lib/subj_models/video.rb
subj_sub_models-0.0.3.16 lib/subj_models/video.rb
subj_sub_models-0.0.3.15 lib/subj_models/video.rb
subj_sub_models-0.0.3.14 lib/subj_models/video.rb
subj_sub_models-0.0.3.13 lib/subj_models/video.rb
subj_sub_models-0.0.3.12 lib/subj_models/video.rb
subj_sub_models-0.0.3.11 lib/subj_models/video.rb
subj_sub_models-0.0.3.10 lib/subj_models/video.rb