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

dup the klass config on retrieval so it does not clear between calls #77

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

darinpp
Copy link

@darinpp darinpp commented Dec 20, 2016

The current code modifies the config returned by TablePrint::Config.for so calling TablePrint::Config.set works only once:

pry(main)> TablePrint::Config.set(Entry, include: ['entry_type','account.name'])
=> {:include=>["entry_type", "account.name"]}
pry(main)> tp Entry.last(10)
... shows the entry_type and account.name columns
pry(main)> tp Entry.last(10)
... doesn't show the entry_type and account.name columns anymore

This PR changes the for to return a copy of the config so it doesn't get cleared.

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.

1 participant