Skip to content

Commit

Permalink
Restore callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
cldambrosio committed Jul 12, 2018
1 parent e6a358a commit 9650e54
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/importer/factory/object_factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ def run
def update
raise "Object doesn't exist" unless object
@attr = update_attributes
work_actor.update(environment(@attr))
run_callbacks(:save) do
work_actor.update(environment(@attr))
end
destroy_existing_file_set if object.file_sets.present?
attach_file_to_work
log_updated(object)
Expand Down Expand Up @@ -67,7 +69,11 @@ def search_by_identifier
def create
@attr = create_attributes
@object = klass.new
klass == Collection ? create_collection(@attr) : work_actor.create(environment(@attr))
run_callbacks :save do
run_callbacks :create do
klass == Collection ? create_collection(@attr) : work_actor.create(environment(@attr))
end
end
attach_file_to_work
log_created(object)
end
Expand Down

0 comments on commit 9650e54

Please sign in to comment.