-
-
Notifications
You must be signed in to change notification settings - Fork 519
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
Why insert, update, etc return a ActiveModel instead of Model? #289
Comments
You have made a good point! I agree that the conversion could seem unnecessary. For now, the returned object of 'update' is the input ActiveModel. So may be it makes sense that the return type of 'model.insert()' is Self. And they also trigger the ActiveModelBehavior Do you have new thoughts on it? |
+1 here. So finally we have to make a double |
Thanks for the input. We thought about it, and our plan for now is to introduce a |
* issues-142 full support lock in select * issues-142 Fix struct name * issues-142 Fix test * issues-280 Revert t previous commit
I find it curious, since you can easily go from a model to a activemodel, but not backwards (from what i've seen), and most of the time after a insert i want the Model which i can return from my api.
I've seen the impl of the insert model and it in fact does a query to find the inserted model and then it converts it to a activemodel, I think we should let the end user decide whether to convert it to a activemodel or not and just return a model.
The text was updated successfully, but these errors were encountered: