Skip to content
Snippets Groups Projects
Commit fa588b8e authored by Israel Barreto Sant'Anna's avatar Israel Barreto Sant'Anna
Browse files

Fixed submission answer and activity error

parent e4d28d8a
No related branches found
No related tags found
No related merge requests found
......@@ -29,9 +29,9 @@ module Trackable
end
def new_update_activity
return nil if changed.blank?
return nil if previous_changes.blank?
return new_activity(:update) if ignore_changes == %w(updated_at)
filtered = changed.reject { |x| ignore_changes.include?(x) }
filtered = previous_changes.reject { |x| ignore_changes.include?(x) }
new_activity(:update) unless filtered.empty?
end
......
......@@ -79,7 +79,7 @@ class LearningObject < ApplicationRecord
belongs_to :license, optional: true
belongs_to :object_type, optional: true
belongs_to :attachment, class_name: 'LearningObject::Attachment', optional: true
has_one :submission, dependent: :destroy
has_one :submission
validates :name, :publisher, :object_type, :author, presence: true, unless: :draft?
validates :language, unless: :draft?, :length => { :minimum => 1 }
......
......@@ -49,7 +49,7 @@ class Submission < ApplicationRecord
after_update :update_status
def update_status
if curator_id_changed?
if curator_id_previously_changed?
curator_assignments.each do |ca|
if ca.user == curator
ca.answered!
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment