method

generate_relation_method

Importance_0
v5.2.3 - Show latest stable - 0 notes - Class: DelegateCache
generate_relation_method(method) private

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