inside Rails source, at
http://github.com/rails/rails/blob/master/activerecord/lib/active_record/relation/query_methods.rb
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)
      end

      relation
    end


Can somebody explain this "clone" ? Where it come from ?
Thanks
-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to