Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove actor customizations #758

Merged
merged 1 commit into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions app/actors/hyrax/actors/asset_actor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ def create(env)
add_date_types(env)
set_validation_status(env)

# queue indexing if we are importing
env.curation_concern.reindex_extent = "queue#{env.importing.id}" if env.importing
if App.rails_5_1?
# queue indexing if we are importing
env.curation_concern.reindex_extent = "queue#{env.importing.id}" if env.importing
end
save_aapb_admin_data(env) && super && create_or_update_contributions(env, contributions)
end

Expand All @@ -26,8 +28,10 @@ def update(env)
add_date_types(env)
set_validation_status(env)

# queue indexing if we are importing
env.curation_concern.reindex_extent = "queue#{env.importing.id}" if env.importing
if App.rails_5_1?
# queue indexing if we are importing
env.curation_concern.reindex_extent = "queue#{env.importing.id}" if env.importing
end
save_aapb_admin_data(env) && super && create_or_update_contributions(env, contributions)
end

Expand Down
11 changes: 8 additions & 3 deletions app/actors/hyrax/actors/contribution_actor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@ module Hyrax
module Actors
class ContributionActor < Hyrax::Actors::BaseActor
def create(env)
# queue indexing if we are importing
env.curation_concern.reindex_extent = "queue#{env.importing.id}" if env.importing
if App.rails_5_1?
# queue indexing if we are importing
env.curation_concern.reindex_extent = "queue#{env.importing.id}" if env.importing
end
super
end

def update(env)
env.curation_concern.reindex_extent = "queue#{env.importing.id}" if env.importing
if App.rails_5_1?
# queue indexing if we are importing
env.curation_concern.reindex_extent = "queue#{env.importing.id}" if env.importing
end
super
end
end
Expand Down
12 changes: 8 additions & 4 deletions app/actors/hyrax/actors/digital_instantiation_actor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ def create(env)
pbcore_doc = PBCore::InstantiationDocument.parse(xml_file)
set_env_attributes_from_pbcore(env, pbcore_doc)

# queue indexing if we are importing
env.curation_concern.reindex_extent = "queue#{env.importing.id}" if env.importing
if App.rails_5_1?
# queue indexing if we are importing
env.curation_concern.reindex_extent = "queue#{env.importing.id}" if env.importing
end

if env.attributes['bulkrax_identifier'].present?
save_instantiation_aapb_admin_data(env) && super
Expand All @@ -21,8 +23,10 @@ def create(env)
def update(env)
xml_file = file_uploaded?(env) ? uploaded_xml(env) : env.attributes.delete(:pbcore_xml)

# queue indexing if we are importing
env.curation_concern.reindex_extent = "queue#{env.importing.id}" if env.importing
if App.rails_5_1?
# queue indexing if we are importing
env.curation_concern.reindex_extent = "queue#{env.importing.id}" if env.importing
end

if env.curation_concern&.bulkrax_identifier
save_instantiation_aapb_admin_data(env) && super
Expand Down
1 change: 1 addition & 0 deletions app/actors/hyrax/actors/environment.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true

# OVERRIDE Hyrax 2.9 to add in import flag
# TODO: Remove this with if App.rails_5_1? cleanup
module Hyrax
module Actors
class Environment
Expand Down
11 changes: 8 additions & 3 deletions app/actors/hyrax/actors/essence_track_actor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,18 @@ module Actors
class EssenceTrackActor < Hyrax::Actors::BaseActor

def create(env)
# queue indexing if we are importing
env.curation_concern.reindex_extent = "queue#{env.importing.id}" if env.importing
if App.rails_5_1?
# queue indexing if we are importing
env.curation_concern.reindex_extent = "queue#{env.importing.id}" if env.importing
end
super
end

def update(env)
env.curation_concern.reindex_extent = "queue#{env.importing.id}" if env.importing
if App.rails_5_1?
# queue indexing if we are importing
env.curation_concern.reindex_extent = "queue#{env.importing.id}" if env.importing
end
super
end
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# deal with fact that this class creates a brand new environment and does not pass
# any added arguments down to the new version. For importer flag compatibility

# TODO: Remove with if App.rails_5_1? cleanup
module Hyrax
module Actors
module InterpretVisibilityActorDecorator
Expand Down
12 changes: 8 additions & 4 deletions app/actors/hyrax/actors/physical_instantiation_actor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@ module Hyrax
module Actors
class PhysicalInstantiationActor < Hyrax::Actors::BaseActor
def create(env)
# queue indexing if we are importing
env.curation_concern.reindex_extent = "queue#{env.importing.id}" if env.importing
if App.rails_5_1?
# queue indexing if we are importing
env.curation_concern.reindex_extent = "queue#{env.importing.id}" if env.importing
end

save_instantiation_aapb_admin_data(env) && super
end

def update(env)
# queue indexing if we are importing
env.curation_concern.reindex_extent = "queue#{env.importing.id}" if env.importing
if App.rails_5_1?
# queue indexing if we are importing
env.curation_concern.reindex_extent = "queue#{env.importing.id}" if env.importing
end
save_instantiation_aapb_admin_data(env) && super
end

Expand Down
Loading