From f7ec1826b0b383009fed04e7bce69b61a727c68d Mon Sep 17 00:00:00 2001 From: Arun Kumar Date: Wed, 15 Mar 2017 07:46:07 +0530 Subject: [PATCH] Use presence instead of regex validation --- CONTRIBUTORS.md | 3 ++- app/models/post.rb | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 636c47a39..71cfaaf84 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -77,7 +77,8 @@ submit the change with your pull request. - Jim Stallings / [jestallin](https://github.com/jestallin) - Alyssa Ransbury / [alran](https://github.com/alran) - Thomas Countz / [thomascountz](https://github.com/thomascountz) +- Arun Kumar / [arun1595](https://github.com/arun1595) ## Bots -- Security and Dependency Updates / [deppbot](https://github.com/deppbot) \ No newline at end of file +- Security and Dependency Updates / [deppbot](https://github.com/deppbot) diff --git a/app/models/post.rb b/app/models/post.rb index 4a9f0e864..d16f8ac09 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -39,9 +39,7 @@ class Post < ActiveRecord::Base default_scope { order("created_at desc") } validates :subject, - format: { - with: /\S/ - }, + presence: true, length: { maximum: 255 } def author_date_subject