lib/vestal_versions/reload.rb in vestal_versions-1.0.2 vs lib/vestal_versions/reload.rb in vestal_versions-2.0.0
- old
+ new
@@ -1,23 +1,16 @@
module VestalVersions
# Ties into the existing ActiveRecord::Base#reload method to ensure that version information
# is properly reset.
module Reload
- def self.included(base) # :nodoc:
- base.class_eval do
- include InstanceMethods
+ extend ActiveSupport::Concern
- alias_method_chain :reload, :versions
- end
- end
-
# Adds instance methods into ActiveRecord::Base to tap into the +reload+ method.
- module InstanceMethods
- # Overrides ActiveRecord::Base#reload, resetting the instance-variable-cached version number
- # before performing the original +reload+ method.
- def reload_with_versions(*args)
- reset_version
- reload_without_versions(*args)
- end
+
+ # Overrides ActiveRecord::Base#reload, resetting the instance-variable-cached version number
+ # before performing the original +reload+ method.
+ def reload(*args)
+ reset_version
+ super
end
end
end