Skip to content

Commit

Permalink
Apply the note filter to Resource.publish!
Browse files Browse the repository at this point in the history
  • Loading branch information
jambun committed Jul 19, 2018
1 parent f360e26 commit 940b473
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions backend/plugin_init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,15 @@
ChildPublishing.add_filter(Note.exclude{Sequel.like(:notes, '%"type":"otherfindaid"%') & Sequel.like(:notes, '%"content":"https://preservica.library.yale.edu%')})

ArchivalObject.include(ChildPublisher)

Resource.class_eval do
def publish!(setting = true)
object_graph = self.object_graph(ChildPublishing.filters)

object_graph.each do |model, ids|
next unless model.publishable?

model.handle_publish_flag(ids, setting)
end
end
end

0 comments on commit 940b473

Please sign in to comment.