Flowdock
method

delegate_to_scoped_klass

Importance_0
Ruby on Rails latest stable (v6.1.7.7) - 0 notes - Class: ClassMethods

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v5.2.3) is shown here.

delegate_to_scoped_klass(method) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/relation/delegation.rb, line 90
        def delegate_to_scoped_klass(method)
          @delegation_mutex.synchronize do
            return if method_defined?(method)

            if /\A[a-zA-Z_]\w*[!?]?\z/.match?(method)
              module_eval                 def #{method}(*args, &block)                  scoping { @klass.#{method}(*args, &block) }                end, __FILE__, __LINE__ + 1
            else
              define_method method do |*args, &block|
                scoping { @klass.public_send(method, *args, &block) }
              end
            end
          end
        end
Register or log in to add new notes.