Skip to content

csv export options need to be HashWithIndifferentAccess#2741

Merged
mshibuya merged 3 commits into
railsadminteam:masterfrom
loicginoux:hotfix/export-options
Nov 19, 2016
Merged

csv export options need to be HashWithIndifferentAccess#2741
mshibuya merged 3 commits into
railsadminteam:masterfrom
loicginoux:hotfix/export-options

Conversation

@loicginoux

Copy link
Copy Markdown
Contributor

a correction for this bug.
#2740

end

def to_csv(options = {})
options = HashWithIndifferentAccess.new(options)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Calling symbolize_keys! would be a bit simpler, I guess.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I guess this is easier but I prefered to use the safest option. First, not knowing the rest of the code and the consequences, I prefered to be able to use string and symbol as keys, to be safe. Also, you suggestion would actually be to use .deep_symbolize_keys!
At least using HashWithIndifferentAccess, I am sure I am not introducing any regression.

@mshibuya

mshibuya commented Nov 5, 2016

Copy link
Copy Markdown
Member

Test code needed.

@mshibuya

mshibuya commented Nov 9, 2016

Copy link
Copy Markdown
Member

Can be merged when rubocop offenses are resolved.
https://travis-ci.org/sferik/rails_admin/jobs/174276072#L425-L430

@loicginoux

Copy link
Copy Markdown
Contributor Author

done.

@mshibuya mshibuya merged commit 81f612f into railsadminteam:master Nov 19, 2016
@mshibuya

Copy link
Copy Markdown
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants