Sha256: c599376fd63cac776aecfd0a00065b8f1d4c466db1f49c0ef5347149e5fb4928

Contents?: true

Size: 581 Bytes

Versions: 60

Compression:

Stored size: 581 Bytes

Contents

# frozen_string_literal: true

module Decidim
  #
  # This class handles all logic regarding deprecated methods.
  #
  module Deprecations
    # Define a deprecated alias for a method
    #
    # @param [Symbol] old_name - name of the method to deprecate
    # @param [Symbol] replacement - name of the new method to use
    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
  end
end

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
decidim-core-0.29.1 lib/decidim/deprecations.rb
decidim-core-0.28.4 lib/decidim/deprecations.rb
decidim-core-0.27.9 lib/decidim/deprecations.rb
decidim-core-0.29.0 lib/decidim/deprecations.rb
decidim-core-0.28.3 lib/decidim/deprecations.rb
decidim-core-0.27.8 lib/decidim/deprecations.rb
decidim-core-0.29.0.rc4 lib/decidim/deprecations.rb
decidim-core-0.29.0.rc3 lib/decidim/deprecations.rb
decidim-core-0.29.0.rc2 lib/decidim/deprecations.rb
decidim-core-0.29.0.rc1 lib/decidim/deprecations.rb
decidim-core-0.28.2 lib/decidim/deprecations.rb
decidim-core-0.27.7 lib/decidim/deprecations.rb
decidim-core-0.28.1 lib/decidim/deprecations.rb
decidim-core-0.27.6 lib/decidim/deprecations.rb
decidim-core-0.26.10 lib/decidim/deprecations.rb
decidim-core-0.26.9 lib/decidim/deprecations.rb
decidim-core-0.28.0 lib/decidim/deprecations.rb
decidim-core-0.27.5 lib/decidim/deprecations.rb
decidim-core-0.28.0.rc5 lib/decidim/deprecations.rb
decidim-core-0.28.0.rc4 lib/decidim/deprecations.rb