From b9fa5a081619b7dc59e7b8b92b97fe33d317656a Mon Sep 17 00:00:00 2001 From: evazion Date: Thu, 5 Jan 2017 14:24:45 -0600 Subject: [PATCH] posts: don't revalidate md5 uniqueness on every update. --- app/models/post.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/post.rb b/app/models/post.rb index 682b5df71..558fab286 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -14,7 +14,7 @@ class Post < ActiveRecord::Base before_validation :parse_pixiv_id before_validation :blank_out_nonexistent_parents before_validation :remove_parent_loops - validates_uniqueness_of :md5 + validates_uniqueness_of :md5, :on => :create validates_inclusion_of :rating, in: %w(s q e), message: "rating must be s, q, or e" validate :post_is_not_its_own_parent validate :updater_can_change_rating