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

Fixes issue with exporting plans as text #1359

Merged
merged 1 commit into from
Apr 9, 2018
Merged

Conversation

briri
Copy link
Contributor

@briri briri commented Apr 9, 2018

Fixes #1358

@@ -30,7 +30,7 @@
<% section[:questions].each do |question| %>
<% if @show_sections_questions %>
<%# text in this case is an array to accomodate for option_based %>
<% if question[:text].length > 1 %>
<% if question[:text].is_a?(Array) %>
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you change it to:

question[:text].respond_to(:each) 

using duck typing is safer because in the case that hash key had an ActiveRecord::Relation, that is not an object of Array class however it responds to each method to iterate the collection.

Copy link
Contributor

@jollopre jollopre left a comment

Choose a reason for hiding this comment

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

@briri, please make the change and merge yourself afterwards.

switched is_a? to respond_to?
@briri briri merged commit b3f4813 into DMPRoadmap:master Apr 9, 2018
@briri briri deleted the issue1358 branch April 9, 2018 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants