Last active
December 8, 2015 19:14
-
-
Save dchandekstark/c618b033e90287c85859 to your computer and use it in GitHub Desktop.
Auto-versioning for ActiveFedora::File
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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