json_api_client icon indicating copy to clipboard operation
json_api_client copied to clipboard

Proposal to set a proc when defining default values

Open code-bunny opened this issue 7 years ago • 2 comments

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.

code-bunny avatar Mar 20 '19 16:03 code-bunny

PR would be appreciated

senid231 avatar Mar 21 '19 12:03 senid231

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

code-bunny avatar Mar 26 '19 10:03 code-bunny