From fb3eda8559bffa8af9cea88e555715fc9fda93b3 Mon Sep 17 00:00:00 2001 From: Jasder <2053003901@@qq.com> Date: Wed, 16 Oct 2019 17:50:17 +0800 Subject: [PATCH] FIX --- app/models/home.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/models/home.rb b/app/models/home.rb index 298eb975f..ae85070c4 100644 --- a/app/models/home.rb +++ b/app/models/home.rb @@ -4,10 +4,7 @@ class Home < ActiveRecord::Base has_one :cover, as: :coverable, dependent: :destroy has_many :banners, dependent: :destroy - validates_presence_of :name, :content, :frendly_id - validates_format_of :friendly_id, :with => /\A[a-z0-9\-]+\z/ - - # before_validation :generate_friendly_id, :on => :create + validates_presence_of :name, :content def more_content? content.html_safe.length > Home::SHOW_CONTENT_LENGTH