table_print icon indicating copy to clipboard operation
table_print copied to clipboard

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

Open darinpp opened this issue 8 years ago • 0 comments

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.

darinpp avatar Dec 20 '16 01:12 darinpp