Module: ActiveAdmin::Deprecation
- Extended by:
- Deprecation
- Included in:
- Deprecation
- Defined in:
- lib/active_admin/deprecation.rb
Instance Method Summary (collapse)
-
- (Object) deprecate(klass, method, message)
Deprecate a method.
- - (Object) warn(message, callstack = caller)
Instance Method Details
- (Object) deprecate(klass, method, message)
Deprecate a method.
Example:
class MyClass
def my_method
# ...
end
ActiveAdmin::Deprecation.deprecate self, :my_method,
"MyClass#my_method is being removed in the next release"
end
25 26 27 28 29 30 31 32 33 |
# File 'lib/active_admin/deprecation.rb', line 25 def deprecate(klass, method, ) klass.class_eval <<-EOC, __FILE__, __LINE__ alias_method :"deprecated_#{method}", :#{method} def #{method}(*args) ActiveAdmin::Deprecation.warn('#{}', caller) send(:deprecated_#{method}, *args) end EOC end |
- (Object) warn(message, callstack = caller)
5 6 7 |
# File 'lib/active_admin/deprecation.rb', line 5 def warn(, callstack = caller) ActiveSupport::Deprecation.warn "Active Admin: #{}", callstack end |