Skip to content
Snippets Groups Projects
Commit 0a75266f authored by Mateus Rambo Strey's avatar Mateus Rambo Strey
Browse files

validate learning_object's dspace_id only in creation

parent 60ed315d
No related branches found
No related tags found
No related merge requests found
......@@ -59,7 +59,7 @@ class LearningObject < ApplicationRecord
belongs_to :attachment, class_name: 'LearningObject::Attachment'
validates_presence_of :name, :publisher, :object_type, :language, :author, unless: :draft?
validates :id_dspace, presence: true, uniqueness: true
validates :id_dspace, presence: true, uniqueness: true, unless: :published?
default_scope { includes(:object_type, :attachment, :attachments) }
scope :missing_thumbnail, ->() { where(thumbnail_file_name: nil) }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment