method
generate_method
rails latest stable - Class:
ActiveRecord::Delegation::GeneratedRelationMethods
generate_method(method)public
No documentation available.
# File activerecord/lib/active_record/relation/delegation.rb, line 72
def generate_method(method)
synchronize do
return if method_defined?(method)
if /\A[a-zA-Z_]\w*[!?]?\z/.match?(method) && !DELEGATION_RESERVED_METHOD_NAMES.include?(method.to_s)
module_eval def #{method}(...) scoping { klass.#{method}(...) } end, __FILE__, __LINE__ + 1
else
define_method(method) do |*args, &block|
scoping { klass.public_send(method, *args, &block) }
end
ruby2_keywords(method)
end
end
end