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

model validations and update callbacks #93

Open
Hellfar opened this issue Dec 4, 2018 · 0 comments
Open

model validations and update callbacks #93

Hellfar opened this issue Dec 4, 2018 · 0 comments

Comments

@Hellfar
Copy link
Collaborator

Hellfar commented Dec 4, 2018

In this type of model files:
https://github.com/foundpatterns/send-file-package/blob/master/models/slide.yaml

Validation fields:
It would be nice to handle fields validations such as (for example):

  • Presence;
  • Range;
  • emptiness;
  • string fitting pattern;
  • ....

Callbacks events:
It would be also nice to define the name of callbacks to call when an item is created or updated or etc...

For example:

fields:
  title:
    type: string
    validation:
      presence: true
  body:
    type: string
    on_create: on_create_my_method

on_create_my_method which is a method defined somewhere by the user of the framework.

Those features in Rails are named Active model and is documented in:
https://guides.rubyonrails.org/active_model_basics.html#model

@Hellfar Hellfar changed the title model verification of number ranges, required, length .... Along with update callbacks model validations update callbacks Dec 4, 2018
@Hellfar Hellfar changed the title model validations update callbacks model validations and update callbacks Dec 4, 2018
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

1 participant