samvera / active_fedora

A Rails interface to the Fedora repository, akin to ActiveModel
Other
54 stars 63 forks source link

Conditionally apply monkey patch to handle versions of RDF 3.2.5+ #1468

Closed cjcolvar closed 2 years ago

cjcolvar commented 2 years ago

Resolves #1466

RDF 3.2.5 changed the superclass of DateTime which broke the monkey patch in ActiveFedora. This PR conditionally applies the monkey patch if the class exists.

It appears that the monkey patch might not be necessary with RDF 3.2.5 due to the changes to the class in RDF (see https://github.com/ruby-rdf/rdf/releases/tag/3.2.5) so I didn't attempt to create a new version of the monkey patch. But I removed the monkey patch and all the tests passed locally with RDF 3.2.4 so maybe the changes aren't actually being tested properly or aren't necessary anymore due to improvements in Fedora 4 or ActiveFedora since the monkey patch was applied in 2014? :man_shrugging:

Within the CI environment the monkey patch should still be getting applied for the ruby 2.5 build because RDF 3.2.5 requires 2.6+.

elrayle commented 2 years ago

It looks like the intention of the monkey patch is to add precision to the date for put requests to Fedora. (See Issue #497.)

cjcolvar commented 2 years ago

I believe ActiveFedora only supports Fedora 4 at the moment. I wonder if this issue was encountered during an early version of Fedora 4 and fixed in a subsequent version. The tests including integration tests pass against Fedora 4 so it doesn't seem like #497 is still a problem. The change in rdf 3.2.5 changing the underlying implementation from ::Date to ::DateTime I think should also have brought in the increased precision.