16 lines
351 B
Ruby
16 lines
351 B
Ruby
class MultiMediaDescription < ActiveRecord::Base
|
|
belongs_to :item
|
|
belongs_to :media_type
|
|
|
|
|
|
def attributes
|
|
super.merge('resized_url' => self.resized_url)
|
|
end
|
|
|
|
def resized_url
|
|
decoration_slug = item.decoration.present? ? "/#{item.decoration}" : ""
|
|
url.gsub('/upload/v',"/upload/c_lpad,h_281,w_375#{decoration_slug}/v")
|
|
end
|
|
|
|
end
|