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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementing static method from() for models #327

Closed
wants to merge 4 commits into from

Conversation

Frondor
Copy link
Contributor

@Frondor Frondor commented Apr 7, 2018

I find myself doing this lots of times when dealing with raw collections of records

    const result = new Model()
    result.fill(rawData)
    return result

So just like Array.from() works, I thought we can implement a more "functional" approach, like User.from({ email, password }).save()

Feel free to ask for any modification or reject this 馃憤

@coveralls
Copy link

Coverage Status

Coverage increased (+0.007%) to 96.365% when pulling 1dd491e on Frondor:patch-1 into 4481ded on adonisjs:develop.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.007%) to 96.365% when pulling 1dd491e on Frondor:patch-1 into 4481ded on adonisjs:develop.

@Frondor Frondor closed this Apr 8, 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

Successfully merging this pull request may close these issues.

None yet

2 participants