This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "csv" | |
@query = Model.where(field: "condition") | |
result_csv = CSV.generate(headers: true) do |csv| | |
csv << @query.first.attributes.keys | |
@query.find_each do |row| | |
csv << row.attributes.values | |
end | |
end | |
send_data(result_csv, filename: "model_report_#{Date.current.to_s}.csv") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Pull base image. | |
FROM ubuntu:16.04 | |
MAINTAINER W.Bona Fernando <fernando.bona@hp.com> | |
MAINTAINER Agliardi, Douglas <douglas.agliardi@hp.com> | |
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 | |
RUN echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.2.list | |
RUN apt-get update && apt-get install -y mongodb-org |