From 8afc7c9c93cb9b54c20f3a32cda6aeb1878e874d Mon Sep 17 00:00:00 2001 From: Andreas Haller Date: Wed, 8 Jul 2015 20:04:50 +0200 Subject: [PATCH] Make papers.published_at optional --- app/models/paper.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/paper.rb b/app/models/paper.rb index ee05247..77ac812 100644 --- a/app/models/paper.rb +++ b/app/models/paper.rb @@ -5,7 +5,8 @@ class Paper < ActiveRecord::Base include Elasticsearch::Model include Elasticsearch::Model::Callbacks - validates_presence_of :body, :content, :name, :originator, :paper_type, :published_at, :reference, :url + validates_presence_of :body, :content, :name, :originator, :paper_type, :reference, :url + validates_presence_of :published_at, allow_nil: true validates :url, uniqueness: true class << self