Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add email field to csv presenter #121

Merged
merged 5 commits into from
Feb 15, 2017
Merged

Conversation

lastpotion
Copy link
Contributor

@lastpotion lastpotion commented Feb 15, 2017

🎩 What? Why?

This PR adds the email field to the CSV presenter, so when the admin user'll download the Survey results it will be on it.

📌 Related Issues

  • Fixes #111

📷 Screenshots (optional)

screen shot 2017-02-15 at 14 43 47

👻 GIF

Copy link
Contributor

@oriolgual oriolgual left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update specs

@@ -40,7 +43,10 @@ def headers
def fields
@surveys.map do |survey|
CSV.generate_line(
[survey.categories.map {|c| c.name[I18n.locale.to_s] }.join(";")].concat(
[
survey.user.email,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not all surveys have a user, use survey&.user&.email

@codecov-io
Copy link

Codecov Report

Merging #121 into master will not change coverage.
The diff coverage is 100%.

@@           Coverage Diff           @@
##           master     #121   +/-   ##
=======================================
  Coverage   97.36%   97.36%           
=======================================
  Files          22       22           
  Lines         342      342           
=======================================
  Hits          333      333           
  Misses          9        9
Impacted Files Coverage Δ
...decidim_hospitalet/surveys/survey_csv_presenter.rb 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c5da71a...cab8888. Read the comment docs.

@lastpotion
Copy link
Contributor Author

I proceed to merge this pr, since the test are passing correctly, but codecov is down and breaking travis CI process.

@lastpotion lastpotion merged commit c6c4dfa into master Feb 15, 2017
@lastpotion lastpotion deleted the surveys/csv/missing_email branch February 15, 2017 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants