aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/migration
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2017-04-22 18:29:05 +0900
committerRyuta Kamizono <kamipo@gmail.com>2017-04-22 23:11:15 +0900
commitca9ac310028d0009edf1fbf657541d2dea327535 (patch)
tree83fd7c9fcbe6410ca670ae15439e85fe8c95188e /activerecord/lib/active_record/migration
parent0541a0d5481043a9c78371446389794944daf3f0 (diff)
downloadrails-ca9ac310028d0009edf1fbf657541d2dea327535.tar.gz
rails-ca9ac310028d0009edf1fbf657541d2dea327535.tar.bz2
rails-ca9ac310028d0009edf1fbf657541d2dea327535.zip
`respond_to_missing?` should be private
Follow up of 03d3f036. Some of `respond_to?` were replaced to `respond_to_missing?` in 03d3f036. But the visibility is still public. It should be private.
Diffstat (limited to 'activerecord/lib/active_record/migration')
-rw-r--r--activerecord/lib/active_record/migration/command_recorder.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/migration/command_recorder.rb b/activerecord/lib/active_record/migration/command_recorder.rb
index 03103bba98..f9cf59b283 100644
--- a/activerecord/lib/active_record/migration/command_recorder.rb
+++ b/activerecord/lib/active_record/migration/command_recorder.rb
@@ -92,10 +92,6 @@ module ActiveRecord
send(method, args, &block)
end
- def respond_to_missing?(*args) # :nodoc:
- super || delegate.respond_to?(*args)
- end
-
ReversibleAndIrreversibleMethods.each do |method|
class_eval <<-EOV, __FILE__, __LINE__ + 1
def #{method}(*args, &block) # def create_table(*args, &block)
@@ -225,10 +221,14 @@ module ActiveRecord
[:add_foreign_key, reversed_args]
end
+ def respond_to_missing?(method, _)
+ super || delegate.respond_to?(method)
+ end
+
# Forwards any missing method call to the \target.
def method_missing(method, *args, &block)
- if @delegate.respond_to?(method)
- @delegate.send(method, *args, &block)
+ if delegate.respond_to?(method)
+ delegate.public_send(method, *args, &block)
else
super
end