def shallow_clone(result)
        case result
        when Array
          result.map {|item| shallow_clone(item)}
        when ActiveRecord::Base
          result.class.send(:instantiate, result.instance_variable_get(:@attributes))
        end
      end
def shallow_clone(result)
        case result
        when Array
          result.map {|item| shallow_clone(item)}
        when ActiveRecord::Base
          result.class.send(:instantiate, result.instance_variable_get(:@attributes))
        end
      end
Generates a copy of the given record(s), keeping intact the original id