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

Proposal to set a proc when defining default values #336

Open
code-bunny opened this issue Mar 20, 2019 · 2 comments
Open

Proposal to set a proc when defining default values #336

code-bunny opened this issue Mar 20, 2019 · 2 comments

Comments

@code-bunny
Copy link

When using Virtus.model we are able to set default values for attributes using procs which are currently missing from the properties hash.

Example usage:

property :id, default -> { SecureRandom.uuid }

Just now I have a after_initialize set that accomplishes this in more lines of code.

@senid231
Copy link
Member

PR would be appreciated

@code-bunny
Copy link
Author

I'll hop to it as soon as I can, it shouldn't be too tricky

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

No branches or pull requests

2 participants