Skip to content

Instantly share code, notes, and snippets.

@dchandekstark
Last active December 8, 2015 19:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dchandekstark/c618b033e90287c85859 to your computer and use it in GitHub Desktop.
Save dchandekstark/c618b033e90287c85859 to your computer and use it in GitHub Desktop.
Auto-versioning for ActiveFedora::File
module ActiveFedora
module Autoversion
def self.included(base)
base.class_eval do
after_save :create_version
end
end
end
end
class AutoversionedFile < ActiveFedora::File
include ActiveFedora::Autoversion
end
class Book < ActiveFedora::Base
contains "content", class_name: "AutoversionedFile"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment