Sha256: d81ecb217d4a3722361db68b865c9f4624dbf6ea60ad476bd93890017b2938ba

Contents?: true

Size: 504 Bytes

Versions: 5

Compression:

Stored size: 504 Bytes

Contents

module VestalVersions
  # Ties into the existing ActiveRecord::Base#reload method to ensure that version information
  # is properly reset.
  module Reload
    extend ActiveSupport::Concern

    # Adds instance methods into ActiveRecord::Base to tap into the +reload+ method.
    
    # 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

Version data entries

5 entries across 5 versions & 3 rubygems

Version Path
houston-vestal_versions-3.0.0 lib/vestal_versions/reload.rb
houston-vestal_versions-2.0.1 lib/vestal_versions/reload.rb
houston-vestal_versions-2.0.0 lib/vestal_versions/reload.rb
vestal_versions-2.0.0 lib/vestal_versions/reload.rb
mil_vestal_versions-1.2.6 lib/vestal_versions/reload.rb