aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/deprecation.rb
diff options
context:
space:
mode:
authorMichael S. Klishin <michael@novemberain.com>2008-12-28 23:47:29 +0300
committerMichael S. Klishin <michael@novemberain.com>2008-12-28 23:47:29 +0300
commit2b8750eba439c4b829b2e8172a1edc0dfa9c532b (patch)
tree1ea12e7fe5ad299119d801c7e7f527f6b7780bc3 /activesupport/lib/active_support/deprecation.rb
parente523b43e202d343912f67b8c8737d9e2e956b31f (diff)
parent0efec64520d5153e5a961f9a759883656b83bb53 (diff)
downloadrails-2b8750eba439c4b829b2e8172a1edc0dfa9c532b.tar.gz
rails-2b8750eba439c4b829b2e8172a1edc0dfa9c532b.tar.bz2
rails-2b8750eba439c4b829b2e8172a1edc0dfa9c532b.zip
Sync with rails/rails/master, merge two metaprogramming annotation efforts
Diffstat (limited to 'activesupport/lib/active_support/deprecation.rb')
-rw-r--r--activesupport/lib/active_support/deprecation.rb15
1 files changed, 9 insertions, 6 deletions
diff --git a/activesupport/lib/active_support/deprecation.rb b/activesupport/lib/active_support/deprecation.rb
index d9bd40199f..202b46ce7a 100644
--- a/activesupport/lib/active_support/deprecation.rb
+++ b/activesupport/lib/active_support/deprecation.rb
@@ -90,12 +90,15 @@ module ActiveSupport
method_names.each do |method_name|
alias_method_chain(method_name, :deprecation) do |target, punctuation|
class_eval(<<-EOS, __FILE__, __LINE__ + 1)
- def #{target}_with_deprecation#{punctuation}(*args, &block) # def multi_with_reprecation(*args, &block)
- ::ActiveSupport::Deprecation.warn( # ::ActiveSupport::Deprecation.warn(
- self.class.deprecated_method_warning(:#{method_name}, #{options[method_name].inspect}), # self.class.deprecated_method_warning(:multi, "this method is deprecated, blah, blah, blah")
- caller) # caller)
- #{target}_without_deprecation#{punctuation}(*args, &block) # multi_without_deprecation(*args, &block)
- end # end
+ def #{target}_with_deprecation#{punctuation}(*args, &block) # def generate_secret_with_deprecation(*args, &block)
+ ::ActiveSupport::Deprecation.warn( # ::ActiveSupport::Deprecation.warn(
+ self.class.deprecated_method_warning( # self.class.deprecated_method_warning(
+ :#{method_name}, # :generate_secret,
+ #{options[method_name].inspect}), # "You should use ActiveSupport::SecureRandom.hex(64)"),
+ caller # caller
+ ) # )
+ #{target}_without_deprecation#{punctuation}(*args, &block) # generate_secret_without_deprecation(*args, &block)
+ end # end
EOS
end
end