Advertisement
jarocki_art

model testimonial

Jul 4th, 2019
2,564
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rails 0.36 KB | None | 0 0
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement