jarocki_art

model testimonial

Jul 4th, 2019
666
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Testimonial < ApplicationRecord
  2.   has_one_attached :userpic
  3.   has_one_attached :object_photo_1
  4.   has_one_attached :object_photo_2
  5.   has_one_attached :object_photo_3
  6.  
  7.   validates :name, presence: true
  8.   validates :video, presence: true, if: Proc.new { |t| t.text.blank? }
  9.   validates :text, presence: true, if: Proc.new { |t| t.video.blank? }
  10. end
RAW Paste Data