Sha256: e2a2734d714d0b6e009de5da4a3dd0d9a76d1e531f20f0b0f2b51c8aa760e192
Contents?: true
Size: 550 Bytes
Versions: 11
Compression:
Stored size: 550 Bytes
Contents
module ActiveSupportHelpers # Helps in removing model, and force-reloading it next time This helper does 2 # things: # * remove from $LOADED_FEATURES so that ruby 'require' reloads file again # * remove the constant from active support dependencies def self.clear_model(model_name) ActiveSupport::Dependencies.remove_constant('Plutus::' + model_name) models_dir = File.dirname(__FILE__) + '/../../app/models/plutus/' path = File.expand_path(models_dir + model_name.downcase + '.rb') $LOADED_FEATURES.delete(path) end end
Version data entries
11 entries across 11 versions & 3 rubygems