14 lines
221 B
Ruby
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
|