-
-
Notifications
You must be signed in to change notification settings - Fork 135
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
Include Types::Params::String
#403
Comments
@adamransom should this be a coercible string? |
Well, a string is a string I guess 😄 but I see the Though perhaps it is purely meant for coercion of things from params, in which case I suppose my work-around is what's intended? But yeah, this issue is mainly just an ergonomics thing when using |
@adamransom I think it should be added as |
Yeah, definitely agree with that, and that's what I use as a workaround for now. |
Though I suppose if we go down this route, we'd need to add ones for array and hash too, in order to be consistent with |
@adamransom good point. This also should be documented so that people don't expect any type of coercion. |
Right, I guess the short description is:
Would we want to use |
Using nominal type won't work, see #394 But I think strict types should work 🤔 |
When including types using
params
as the defaultfor use in form objects for example, it would be nice to be able to define an attribute in a struct as being a regular string
Currently this doesn't work and you instead need to define the
name
attribute withTypes::Nominal::String
which just feels a bit off.I currently work around this by just defining my own
String
inside theTypes
module, but I was just wondering whether it wouldn't make sense inside theParams
namespace.The text was updated successfully, but these errors were encountered: