Files
old-holivud2/app/models/concerns/photoable.rb
2020-05-31 22:38:19 +02:00

14 lines
221 B
Ruby

module Photoable
extend ActiveSupport::Concern
included do
has_many_attached :photos
validates :photos, content_type: ["image/png", "image/jpeg"]
end
def photo
MainPhoto.new(photos.first)
end
end