Method: Sequel::Dataset#clone

Defined in:
lib/sequel/dataset/query.rb,
lib/sequel/dataset/query.rb

#clone(opts = OPTS) ⇒ Object

:nocov:



90
91
92
93
94
95
96
97
98
99
# File 'lib/sequel/dataset/query.rb', line 90

def clone(opts = nil || (return self))
  # return self used above because clone is called by almost all
  # other query methods, and it is the fastest approach
  c = super(:freeze=>false)
  c.opts.merge!(opts)
  unless opts.each_key{|o| break if COLUMN_CHANGE_OPTS.include?(o)}
    c.clear_columns_cache
  end
  c.freeze
end