Module: Collavre::Creative::Describable
- Extended by:
- ActiveSupport::Concern
- Included in:
- Collavre::Creative
- Defined in:
- app/models/collavre/creative/describable.rb
Instance Method Summary collapse
- #creative_snippet ⇒ Object
-
#effective_description(variation_id = nil, html = true) ⇒ Object
Linked Creative의 description을 안전하게 반환.
Instance Method Details
#creative_snippet ⇒ Object
37 38 39 |
# File 'app/models/collavre/creative/describable.rb', line 37 def creative_snippet CGI.unescapeHTML(ActionController::Base.helpers.(effective_origin.description || "")).truncate(24, omission: "...") end |
#effective_description(variation_id = nil, html = true) ⇒ Object
Linked Creative의 description을 안전하게 반환
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/models/collavre/creative/describable.rb', line 24 def effective_description(variation_id = nil, html = true) if variation_id.present? variation_tag = .find_by(label_id: variation_id) return variation_tag.value if variation_tag&.value.present? end description_val = origin_id.nil? ? description : origin.description if html description_val&.to_s || "" else ActionController::Base.helpers.(description_val&.to_s || "") end end |