Module: ActiveRecord::Delegation::ClassSpecificRelation::ClassMethods

Defined in:
activerecord/lib/active_record/relation/delegation.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#delegate_to_scoped_klass(method) ⇒ Object



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'activerecord/lib/active_record/relation/delegation.rb', line 61

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)\n          scoping { @klass.\#{method}(*args, &block) }\n        end\n      RUBY\n    else\n      define_method method do |*args, &block|\n        scoping { @klass.public_send(method, *args, &block) }\n      end\n    end\n  end\nend\n", __FILE__, __LINE__ + 1

#nameObject



57
58
59
# File 'activerecord/lib/active_record/relation/delegation.rb', line 57

def name
  superclass.name
end