Skip to content
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

Should cast_fns be able to receive options... #26

Closed
Adzz opened this issue Jun 22, 2022 · 1 comment
Closed

Should cast_fns be able to receive options... #26

Adzz opened this issue Jun 22, 2022 · 1 comment

Comments

@Adzz
Copy link
Owner

Adzz commented Jun 22, 2022

Example use case is something like:

field: {:sid, 
  {["Flight"], {:attr, "FlightKey"}}, 
  {StringType, trim: true, blank_as_nil: true}, 
  optional?: true
}

OR

field: {:sid, 
  {["Flight"], {:attr, "FlightKey"}}, 
  StringType, 
  optional?: true,
  cast_options: [trim: true, blank_as_nil: true]
}

This would be a breaking change so we'd need to think about how we could roll it out, especially given that most probably wont need the functionality.

Do we have two behaviours for cast_fns ?

@Adzz
Copy link
Owner Author

Adzz commented Jul 8, 2022

Closing as we can get what we want with the Mod Fun Args syntax right now:

field: {:sid, 
  {["Flight"], {:attr, "FlightKey"}}, 
  {StringType, :cast, [[trim: true, blank_as_nil: true]]}, 
  optional?: true
}

@Adzz Adzz closed this as completed Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant