diff options
author | Ignat Zakrevsky <iezakrevsky@gmail.com> | 2017-11-27 18:51:24 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-27 18:51:24 +0000 |
commit | 7d35a59e221622a0c5257dc5d176a0ef8d32489e (patch) | |
tree | 348f8152d7e879a39f1a2fca893be294f337f580 /activesupport/test/file_update_checker_test.rb | |
parent | fb09e05bdf6b2cd73a19e7a71087130f6b95c961 (diff) | |
download | rails-7d35a59e221622a0c5257dc5d176a0ef8d32489e.tar.gz rails-7d35a59e221622a0c5257dc5d176a0ef8d32489e.tar.bz2 rails-7d35a59e221622a0c5257dc5d176a0ef8d32489e.zip |
[ci skip] Fix documentation for deprecation method_wrappers
Seems like version with class methods doesn't work.
```ruby
require "active_support/deprecation.rb"
module Fred
extend self
def aaa; end
def bbb; end
def ccc; end
def ddd; end
def eee; end
end
ActiveSupport::Deprecation.deprecate_methods(Fred, :aaa, bbb: :zzz, ccc: 'use Bar#ccc instead')
Fred.aaa
Fred.bbb
Fred.ccc
```
# produces nothing
vs
```ruby
require "active_support/deprecation.rb"
class Fred
def aaa; end
def bbb; end
def ccc; end
def ddd; end
def eee; end
end
ActiveSupport::Deprecation.deprecate_methods(Fred, :aaa, bbb: :zzz, ccc: 'use Bar#ccc instead')
Fred.new.aaa
Fred.new.bbb
Fred.new.ccc
```
produces
```
DEPRECATION WARNING: aaa is deprecated and will be removed from Rails 5.2 (called from <main> at deprications.rb:15)
DEPRECATION WARNING: bbb is deprecated and will be removed from Rails 5.2 (use zzz instead) (called from <main> at deprications.rb:16)
DEPRECATION WARNING: ccc is deprecated and will be removed from Rails 5.2 (use Bar#ccc instead) (called from <main> at deprications.rb:17)
```
Diffstat (limited to 'activesupport/test/file_update_checker_test.rb')
0 files changed, 0 insertions, 0 deletions