Skip to content

Commit

Permalink
Moving FileSet definition to specs
Browse files Browse the repository at this point in the history
Before this commit, the file_set.rb was something that all applications
would load into their production code.  Ideally, we don't want to do
that for the primary reason that our file_set directly inherits from
`ActiveFedora::Base`.  If a downstream FileSet were to not inherit from
`ActiveFedora:Base` we would have a mismatch error.

With this commit, we're saying that the IIIF print gem will require a
FileSet that conforms to the PCDM expectations.  But we don't dictate
it's implementation details in the downstream application.  We instead
dictate those implementation details in the test application.

Related to:

- #101
  • Loading branch information
jeremyf committed Feb 6, 2023
1 parent d5de25c commit 66f0077
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
10 changes: 0 additions & 10 deletions app/models/file_set.rb

This file was deleted.

1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
require 'rspec/active_model/mocks'
require 'selenium-webdriver'
require 'webdrivers'
require 'support/models/file_set.rb'

# @note In January 2018, TravisCI disabled Chrome sandboxing in its Linux
# container build environments to mitigate Meltdown/Spectre
Expand Down
7 changes: 7 additions & 0 deletions spec/support/models/file_set.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
##
# iiif_print requires a file set model that is compatible with Hyrax assumptions. We do not want to
# add this to app/models because those are loaded in the downstream application; which can create
# unexpected surprises.
class FileSet < ActiveFedora::Base
include ::Hyrax::FileSetBehavior
end

0 comments on commit 66f0077

Please sign in to comment.