"clone" at active_record relation

inside Rails source, at

I found a lot of calls to:

relation = clone

I can understand where id the “relation” call, but… how about “clone”
Perhaps “clone” comes from Ruby1.9-Kernel, but I am not sure.
And github color it in blue, like a class…weird…

def where(opts, *rest)
  relation = clone

  if opts.present? && value = build_where(opts, rest)
    relation.where_values += Array.wrap(value)


Can somebody explain this “clone” ? Where it come from ?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs