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
More useful create_with / update_with #153
Comments
I believe it needs a Google Code Info: |
possibly ... but that does assume that you want your params assignment to go ahead even if you have passed I think the case that you bring up is because you are considering parsing in the entire params hash. This is Google Code Info: |
That's right. I was wrong, i should use grouppings. BUT. What if a hacker passes malicious parameters to the group by editing the query I'd check if
Google Code Info: |
I like the checking if method is public... that is a very smart move. But I don't think silently eating errors for at the moment, the #create_with_params method will throw an error if the column doesn't exist.... this is ways to handle evil params: Merb: http://merb.devjavu.com/browser/plugins/merb_param_protection/README Google Code Info: |
+1 Would still be nice to have callbacks trigger on set/update Google Code Info: |
I'd like to keep the current behavior of #create_with_params so it wouldn't throw Google Code Info: |
I think it is a really useful feature to be able to pass params into models that are not neccerserily
directly columns.
I also believe that Sequel:Model is missing a way to update from params that also triggers the
callbacks/hooks.
attached is a monkey-patch that I current run on my version of Sequel:Model to help me out.
I removed the column checking, since this is really the job of your own logic (sometimes I want
params that are not columns) and most web-frameworks have a way to pre-check for valid/safe
parameters.
record.update_with_params( {'name' => 'a' } )
by using method assignments instead of directly filling values, we can have special methods that
can accept parameters and do something useful with them.
This behavior is very desirable when working towards the fat-model-skinny-controller ideal.
Google Code Info:
Issue #: 128
Author: chrisfa...@gmail.com
Created On: 2008-01-17T09:41:11.000Z
Closed On: 2008-01-23T13:45:39.000Z
The text was updated successfully, but these errors were encountered: