Skip to content
Snippets Groups Projects
carousel.rb 646 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: {
Matheus Agio Nerone's avatar
Matheus Agio Nerone committed
    larger: "600x600>",
    thumbnail: "100x100>"
    }, default_url: "/images/:style/missing.png"
  validates_attachment_content_type :image, content_type: /\Aimage\/.*\Z/
end