Class: ActiveSupport::Inflector::Inflections

Inherits:
Object
  • Object
show all
Defined in:
lib/freedom_patches/inflector_backport.rb

Class Method Summary collapse

Class Method Details

.clear_memoize(*args) ⇒ Object



54
55
56
57
58
59
60
61
62
63
64
# File 'lib/freedom_patches/inflector_backport.rb', line 54

def self.clear_memoize(*args)
  args.each do |method_name|
    orig = "#{method_name}_without_clear_memoize"
    alias_method orig, method_name

    define_method(method_name) do |*arguments|
      ActiveSupport::Inflector.clear_memoize!
      public_send(orig, *arguments)
    end
  end
end