Guest User

Untitled

a guest
May 31st, 2019
97
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Engine < ApplicationRecord
  2.   belongs_to :brand
  3.   belongs_to :series
  4.   mount_uploaders :images, EngineImageUploader
  5.   validates :name, :article, :catalog_number, :content, :title, :description, :weight, :power_output, :price, :displacement, :model, :producer, :images, presence:true
  6.  
  7.   extend FriendlyId
  8.   friendly_id :permalink, use: :slugged
  9.  
  10.   def should_generate_new_friendly_id?
  11.     permalink
  12.   end
  13. end
RAW Paste Data