Skip to content
Snippets Groups Projects
carousel.rb 601 B
Newer Older
# == Schema Information
#
# Table name: carousels
#
#  id                 :integer          not null, primary key
#  title              :string
#  url                :text
#  created_at         :datetime         not null
#  updated_at         :datetime         not null
#  image_file_name    :string
#  image_content_type :string
#  image_file_size    :integer
#  image_updated_at   :datetime
#

Mateus Rambo Strey's avatar
Mateus Rambo Strey committed
class Carousel < ApplicationRecord
  has_attached_file :image, styles: {
    larger: '600x600>',
    thumbnail: '100x100>'
  }
  validates_attachment_content_type :image, content_type: /\Aimage\/.*\Z/
end