Sha256: a9e353eda51814bc44ab0ec4992dc4bcdad578aaf2f92132348bd8a6b6ed492b
Contents?: true
Size: 319 Bytes
Versions: 19
Compression:
Stored size: 319 Bytes
Contents
module Pulitzer::PostsController::Validations def validate_title if Pulitzer::Post.where(title: @post.title).to_a.any?{|post| (post.post_type_version_id == @post.post_type_version_id)} @post.errors.add(:title, 'Another post already has this title') return false end return true end end
Version data entries
19 entries across 19 versions & 1 rubygems