diff --git a/Gemfile b/Gemfile index 94f82222..5e7fc255 100644 --- a/Gemfile +++ b/Gemfile @@ -12,11 +12,11 @@ gemspec # Git. Remember to move these dependencies to your gemspec before releasing # your gem to rubygems.org. -gem 'blacklight', '~> 6.25.0' +gem 'blacklight' gem 'bootstrap-sass', '~> 3.0' gem 'coderay' gem 'factory_bot_rails' -gem 'hyrax', '>= 2.3' +gem 'hyrax', '>= 2.3', '< 4.999' gem 'oai' gem 'rsolr', '>= 1.0' gem 'rspec-rails' @@ -28,6 +28,7 @@ group :development, :test do gem 'database_cleaner' gem 'pry-byebug' gem 'solr_wrapper', '>= 0.3' + gem 'sqlite3', '~> 1.4' end group :lint do diff --git a/app/factories/bulkrax/object_factory.rb b/app/factories/bulkrax/object_factory.rb index ed6e2e4c..7c0b7153 100644 --- a/app/factories/bulkrax/object_factory.rb +++ b/app/factories/bulkrax/object_factory.rb @@ -117,7 +117,7 @@ def search_by_identifier def create attrs = transform_attributes @object = klass.new - object.reindex_extent = Hyrax::Adapters::NestingIndexAdapter::LIMITED_REINDEX if object.respond_to?(:reindex_extent) + object.reindex_extent = Hyrax::Adapters::NestingIndexAdapter::LIMITED_REINDEX if defined?(Hyrax::Adapters::NestingIndexAdapter) && object.respond_to?(:reindex_extent) run_callbacks :save do run_callbacks :create do if klass == Collection diff --git a/app/jobs/bulkrax/create_relationships_job.rb b/app/jobs/bulkrax/create_relationships_job.rb index 77d1baa2..b6f1dd2f 100644 --- a/app/jobs/bulkrax/create_relationships_job.rb +++ b/app/jobs/bulkrax/create_relationships_job.rb @@ -114,7 +114,8 @@ def process(relationship:, importer_run_id:, parent_record:, ability:) end def add_to_collection(child_record, parent_record) - parent_record.try(:reindex_extent=, Hyrax::Adapters::NestingIndexAdapter::LIMITED_REINDEX) + parent_record.try(:reindex_extent=, Hyrax::Adapters::NestingIndexAdapter::LIMITED_REINDEX) if + defined?(Hyrax::Adapters::NestingIndexAdapter) child_record.member_of_collections << parent_record child_record.save! end diff --git a/app/services/bulkrax/remove_relationships_for_importer.rb b/app/services/bulkrax/remove_relationships_for_importer.rb index 784b5ed0..10fa92e4 100644 --- a/app/services/bulkrax/remove_relationships_for_importer.rb +++ b/app/services/bulkrax/remove_relationships_for_importer.rb @@ -63,7 +63,8 @@ def break_relationships! remove_relationships_from_work(obj) end - obj.try(:reindex_extent=, Hyrax::Adapters::NestingIndexAdapter::LIMITED_REINDEX) if defined?(Hyrax) + obj.try(:reindex_extent=, Hyrax::Adapters::NestingIndexAdapter::LIMITED_REINDEX) if + defined?(Hyrax::Adapters::NestingIndexAdapter) obj.save! end end diff --git a/spec/test_app/app/controllers/application_controller.rb b/spec/test_app/app/controllers/application_controller.rb index 354ff36d..62e30895 100644 --- a/spec/test_app/app/controllers/application_controller.rb +++ b/spec/test_app/app/controllers/application_controller.rb @@ -5,7 +5,7 @@ class ApplicationController < ActionController::Base include Blacklight::Controller include Hyrax::ThemedLayoutController with_themed_layout '1_column' - skip_after_action :discard_flash_if_xhr + skip_after_action :discard_flash_if_xhr if + Rails.version.split('.').first.to_i < 6 protect_from_forgery with: :exception - end diff --git a/spec/test_app/config/application.rb b/spec/test_app/config/application.rb index 16c5c5d6..af0ed095 100644 --- a/spec/test_app/config/application.rb +++ b/spec/test_app/config/application.rb @@ -19,7 +19,6 @@ module TestApp class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. config.load_defaults 5.1 - config.active_record.sqlite3.represent_boolean_as_integer = true # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded.