Closed stevemadere closed 9 years ago
When I declare a belongs_to association in a model and add the attribute :creator => true to it, the user_create action takes care of setting that association equal to acting_user.
This is well documented here: http://hobocentral.net/manual/permissions#afterusernew----initialise-a-record-using-actinguser
However, if an instance is created through any lifecycle create action, it does not invoke Hobo::Model#set_creator.
This has the unfortunate result of not setting the creator when instances are created through a lifecycle create action.
I am guessing this is not intentional.
It was a pain in the neck to determine this is what was making my validations fail when creating via a lifecycle action.
The problem seems to be in: Hobo::Model::Lifecycles::Creator#run!
I suspect that it should call _lifecycle.model.usernew(user) instead of lifecycle.model.new at the beginning of this method.
When I declare a belongs_to association in a model and add the attribute :creator => true to it, the user_create action takes care of setting that association equal to acting_user.
This is well documented here: http://hobocentral.net/manual/permissions#afterusernew----initialise-a-record-using-actinguser
However, if an instance is created through any lifecycle create action, it does not invoke Hobo::Model#set_creator.
This has the unfortunate result of not setting the creator when instances are created through a lifecycle create action.
I am guessing this is not intentional.
It was a pain in the neck to determine this is what was making my validations fail when creating via a lifecycle action.
The problem seems to be in: Hobo::Model::Lifecycles::Creator#run!
I suspect that it should call _lifecycle.model.usernew(user) instead of lifecycle.model.new at the beginning of this method.