apotonick / declarative

DSL for nested schemas.
MIT License
22 stars 8 forks source link

Use Uber::Options for definition options? #4

Open aldesantis opened 6 years ago

aldesantis commented 6 years ago

Is there a reason it is not possible to use Uber::Options for definition options? If I'm not mistaken, this would allow, for instance, to do the following in Reform:

property :title, writeable: -> { model.my_condition? }

I achieved this in my app by overriding sync_options in my form and calling Uber::Option manually, but it would be cool to just have it embedded in the gem (and any other gems using Declarative).

If there's interest, I can try to submit a PR.

aldesantis commented 6 years ago

@apotonick any chance you could jot down your thoughts on this?

apotonick commented 6 years ago

Hi @aldesantis - is that specific to Reform?

aldesantis commented 6 years ago

@apotonick well, I guess generic schema definitions could benefit from it as well, but the use case I have is :writeable. Not sure where we'd want to do this exactly.

apotonick commented 6 years ago

Ah ok. I'm currently working on transform (replacement for Reform) so I'm happy to merge anything into Reform!