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)
end
relation
end
Can somebody explain this “clone” ? Where it come from ?
Thanks
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.