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

.create and new hooks offer similar functionality #8

Open
jkanschik opened this issue Nov 30, 2014 · 1 comment
Open

.create and new hooks offer similar functionality #8

jkanschik opened this issue Nov 30, 2014 · 1 comment

Comments

@jkanschik
Copy link
Owner

The new hook functionality by @abraxas potentiall makes the old '.create' method unnecessary.

Idea behind '.create' was to provide a hook by calling 'create' on the new object. With a afterBuild hook, this is not necessary anymore. Maybe it can be removed.

@abraxas
Copy link

abraxas commented Dec 3, 2014

I would rather keep the create functionality. It's the reason I added the
hooks. We use a wrapped copy of the sequelize model so create will work.
The hooks allow us to create related models by acquiring the id after
create finishes. Our test suite is populated by extended base models in a
big json object we just pass to a helper function.
On Nov 30, 2014 6:40 AM, "Jens Kanschik" [email protected] wrote:

The new hook functionality by @abraxas https://github.com/abraxas
potentiall makes the old '.create' method unnecessary.

Idea behind '.create' was to provide a hook by calling 'create' on the new
object. With a afterBuild hook, this is not necessary anymore. Maybe it can
be removed.


Reply to this email directly or view it on GitHub
#8.

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