class method self.delegate_to_scoped_klass

Ruby on Rails 3.2.22.5

Since v3.2.22.5 Last seen in v3.2.22.5

Signature

self.delegate_to_scoped_klass(method)

No documentation comment.

Parameters

method req
Source
# File activerecord/lib/active_record/relation/delegation.rb, line 10
    def self.delegate_to_scoped_klass(method)
      if method.to_s =~ /\A[a-zA-Z_]\w*[!?]?\z/
        module_eval <<-RUBY, __FILE__, __LINE__ + 1
          def #{method}(*args, &block)
            scoping { @klass.#{method}(*args, &block) }
          end
        RUBY
      else
        module_eval <<-RUBY, __FILE__, __LINE__ + 1
          def #{method}(*args, &block)
            scoping { @klass.send(#{method.inspect}, *args, &block) }
          end
        RUBY
      end
    end

Defined in activerecord/lib/active_record/relation/delegation.rb line 10 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::Delegation

Type at least 2 characters to search.

↑↓ navigate · open · esc close