lib/vestal_versions/versioned.rb in vestal_versions-1.0.2 vs lib/vestal_versions/versioned.rb in vestal_versions-2.0.0

- old
+ new

@@ -1,30 +1,27 @@ module VestalVersions # Simply adds a flag to determine whether a model class if versioned. module Versioned - def self.extended(base) # :nodoc: - base.class_eval do - class << self - alias_method_chain :versioned, :flag - end - end - end + extend ActiveSupport::Concern # Overrides the +versioned+ method to first define the +versioned?+ class method before # deferring to the original +versioned+. - def versioned_with_flag(*args) - versioned_without_flag(*args) + module ClassMethods + def versioned(*args) + super(*args) - class << self - def versioned? - true + class << self + def versioned? + true + end end end - end - # For all ActiveRecord::Base models that do not call the +versioned+ method, the +versioned?+ - # method will return false. - def versioned? - false + # For all ActiveRecord::Base models that do not call the +versioned+ method, the +versioned?+ + # method will return false. + def versioned? + false + end end + end end