Module: Decidim::Deprecations

Defined in:
lib/decidim/deprecations.rb

Overview

This class handles all logic regarding deprecated methods.

Instance Method Summary collapse

Instance Method Details

#deprecated_alias(old_name, replacement) ⇒ Object

Define a deprecated alias for a method

Parameters:

  • old_name (Symbol)
    • name of the method to deprecate

  • replacement (Symbol)
    • name of the new method to use



12
13
14
15
16
17
# File 'lib/decidim/deprecations.rb', line 12

def deprecated_alias(old_name, replacement)
  define_method(old_name) do |*args, &block|
    ActiveSupport::Deprecation.warn "##{old_name} deprecated (please use ##{replacement})"
    send replacement, *args, &block
  end
end