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 option INCLUDE=id #96

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Add option INCLUDE=id #96

wants to merge 7 commits into from

Conversation

ysksn
Copy link

@ysksn ysksn commented Mar 15, 2016

I wanted :id column.

@rroblak
Copy link
Owner

rroblak commented Mar 15, 2016

@ysksn The following should dump the id column along with all of the other colummns:

SeedDump.dump(User, exclude: [])

Does this not work for you?

@ysksn
Copy link
Author

ysksn commented Mar 15, 2016

I want :id, :name, and :age,
but :created_at, :phone, and :updated_at.

Thanks

@rroblak
Copy link
Owner

rroblak commented Mar 15, 2016

So your total set of columns is

[:id, :name, :age, :phone, :created_at, :updated_at]

Correct?

How about SeedDump.dump(User, exclude: [:phone, :created_at, :updated_at])? Does that work?

@ysksn
Copy link
Author

ysksn commented Mar 16, 2016

SeedDump.dump(User, exclude: [:phone, :created_at, :updated_at])

It works, but I want option which explicitly add column(s) :id, :created_at, :updated_at
because they are excluded by default.

A)

SeedDump.dump(User, exclude: [])    # Difficult to know if :id is included
SeedDump.dump(User, include: [:id]) # OK, :id is included

B)

SeedDump.dump(User, exclude: [:phone, :created_at, :updated_at]) # Difficult to know if :id is included
SeedDump.dump(User, exclude: [:phone], include: [:id]) # OK, :id is included

@kofronpi kofronpi added this to the 3.3.0 milestone May 10, 2017
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.

3 participants