aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/models/refinery/blog/post.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/models/refinery/blog/post.rb b/app/models/refinery/blog/post.rb
index d05cb14..9e69162 100644
--- a/app/models/refinery/blog/post.rb
+++ b/app/models/refinery/blog/post.rb
@@ -21,7 +21,8 @@ module Refinery
validates :title, :presence => true, :uniqueness => true
validates :body, :presence => true
- validates :published_at, :author, :presence => true
+ validates :published_at, :presence => true
+ validates :author, :presence => true, if: :author_required?
validates :source_url, :url => { :if => 'Refinery::Blog.validate_source_url',
:update => true,
:allow_nil => true,
@@ -31,6 +32,11 @@ module Refinery
class Translation
is_seo_meta
end
+
+ # Override this to disable required authors
+ def author_required?
+ true
+ end
# If custom_url or title changes tell friendly_id to regenerate slug when
# saving record