diff options
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/relation/delegation.rb | 10 | ||||
-rw-r--r-- | activerecord/test/cases/relation/delegation_test.rb | 8 |
2 files changed, 9 insertions, 9 deletions
diff --git a/activerecord/lib/active_record/relation/delegation.rb b/activerecord/lib/active_record/relation/delegation.rb index af6be24351..603e5a9df5 100644 --- a/activerecord/lib/active_record/relation/delegation.rb +++ b/activerecord/lib/active_record/relation/delegation.rb @@ -68,7 +68,7 @@ module ActiveRecord RUBY else define_method method do |*args, &block| - scoping { @klass.send(method, *args, &block) } + scoping { @klass.public_send(method, *args, &block) } end end end @@ -87,10 +87,10 @@ module ActiveRecord def method_missing(method, *args, &block) if @klass.respond_to?(method) self.class.delegate_to_scoped_klass(method) - scoping { @klass.send(method, *args, &block) } + scoping { @klass.public_send(method, *args, &block) } elsif arel.respond_to?(method) self.class.delegate method, :to => :arel - arel.send(method, *args, &block) + arel.public_send(method, *args, &block) else super end @@ -118,9 +118,9 @@ module ActiveRecord def method_missing(method, *args, &block) if @klass.respond_to?(method) - scoping { @klass.send(method, *args, &block) } + scoping { @klass.public_send(method, *args, &block) } elsif arel.respond_to?(method) - arel.send(method, *args, &block) + arel.public_send(method, *args, &block) else super end diff --git a/activerecord/test/cases/relation/delegation_test.rb b/activerecord/test/cases/relation/delegation_test.rb index c5ad1e8976..b56dd5e5db 100644 --- a/activerecord/test/cases/relation/delegation_test.rb +++ b/activerecord/test/cases/relation/delegation_test.rb @@ -10,15 +10,15 @@ module ActiveRecord method_arity = target.to_a.method(method).arity if method_arity.zero? - target.send(method) + target.public_send(method) elsif method_arity < 0 if method == :shuffle! - target.send(method) + target.public_send(method) else - target.send(method, 1) + target.public_send(method, 1) end elsif method_arity == 1 - target.send(method, 1) + target.public_send(method, 1) else raise NotImplementedError end |