Skip to content
This repository has been archived by the owner on Sep 17, 2019. It is now read-only.

Commit

Permalink
Changes Notes validation to allow blank body.
Browse files Browse the repository at this point in the history
TODO: it would be best if the note required one of :body, :source_url or resource.
  • Loading branch information
joegatt committed Mar 17, 2013
1 parent 8f36f72 commit 18e6268
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/models/note.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ class Note < ActiveRecord::Base
scope :publishable, where("active = ? AND hide = ?", true, false)
default_scope :order => 'external_updated_at DESC'

validates :title, :body, :external_updated_at, :presence => true
# TODO: :body is allowed to be blank - but should make sure that at least an image or embedded media is present.
validates :title, :external_updated_at, :presence => true

# Being activated on create and throws error
# validate :external_updated_at_must_be_latest, :before => :update
Expand Down

0 comments on commit 18e6268

Please sign in to comment.