These are chat archives for waterlock/waterlock

20th
Mar 2015
Will Dent
@WillDent
Mar 20 2015 17:48
Trying to figure how to add beforeCreate on my user Model with waterline. Anyone have an example. beforeCreate: function(values, cb){ values.first_name = values.first_name + '...'; require('waterlock').models.user.beforeCreate cb(values); }, Doesn't seem to work.
David Rivera
@duhruh
Mar 20 2015 17:51
ah yea
so waterlock user overrides the before create method
we probably shouldn't be doing that
maybe emit some event or something
open an issue or pr for it
i don't believe there is a solid work around right now :worried:
which auth method are you using
Will Dent
@WillDent
Mar 20 2015 17:54
OK. I will see if it is something we can tackle and provide a PR . Where does that override happen. We’re using local and soon Facebook as well.
David Rivera
@duhruh
Mar 20 2015 17:54
okay well you can implement your own beforeCreate
and not use waterlocks
just be sure to do this
actually
I don't think waterlock implements a beforeCreate method for the User model
i'm not exactly sure why the template defines one
what happens if you remove it all together and try to create a new user
Will Dent
@WillDent
Mar 20 2015 17:56
Let me check
David Rivera
@duhruh
Mar 20 2015 17:56
i suspect it should just work
Will Dent
@WillDent
Mar 20 2015 18:01
yup. works
David Rivera
@duhruh
Mar 20 2015 18:02
awesome, yea man if you can open a pr or issue to remove before and after create from the templates that would be dope
thanks man!
Will Dent
@WillDent
Mar 20 2015 18:02
OK Will do
Ivan
@listepo
Mar 20 2015 18:51
waterlock/waterlock#41 ?