Sha256: f7bd20fac6034bb6dc258563e6e94f15719001d40396619d86c23fa266417222

Contents?: true

Size: 242 Bytes

Versions: 4

Compression:

Stored size: 242 Bytes

Contents

module Responders
  module CsvResponder
    def to_csv
      controller.response_body = Enumerator.new do |y|
        controller.send(:end_of_association_chain).pg_copy_to do |line|
          y << line
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
postgres-copy-0.7.0 lib/postgres-copy/csv_responder.rb
postgres-copy-0.6.0 lib/postgres-copy/csv_responder.rb
postgres-copy-0.5.8 lib/postgres-copy/csv_responder.rb
postgres-copy-0.5.7 lib/postgres-copy/csv_responder.rb