faustinoaq changed the topic of #amber to: Welcome to Amber Framework community! | https://amberframework.org | Developer happiness, productivity and bare metal performance | GH: https://github.com/amberframework | Docs: https://docs.amberframework.org | Gitter: https://gitter.im/amberframework/amber | IRC Logger: https://irclog.whitequark.org/amber | Amber::Server.start
alexherbo2 has joined #amber
<FromGitter> <renich_gitlab> Right, so this works in an `amber exec` ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ The first line there causes the issues. basically prospect_params.validate! fails. [https://gitter.im/amberframework/amber?at=6020132a9d5c644f66582979]
<FromGitter> <renich_gitlab> Tried this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/amberframework/amber?at=6020194a063b6c68d545df18]
<FromGitter> <Blacksmoke16> sure seems like a limitation of how amber instantiates the models
<FromGitter> <Blacksmoke16> oh, check to see what the value of `prospect_params.validate!` is
<FromGitter> <Blacksmoke16> might be able to change the value of `date` in that, then pass that to `Prospect.new`
<FromGitter> <renich_gitlab> OK, here's what I did: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/amberframework/amber?at=60202518aa6a6f319d0f5248]
<FromGitter> <Blacksmoke16> can you do the `params["date"] = Time.parse(params["date"], "%F", Time::Location.load("UTC"))`?
<FromGitter> <renich_gitlab> @Blacksmoke16 it fails with the error mentioned on my second to last message.
<FromGitter> <Blacksmoke16> imo i've been against Granite handling conversion of String into stuff
<FromGitter> <Blacksmoke16> thats something the framework should handle, not an ORM
<FromGitter> <renich_gitlab> It's a bit confusing to me.
<FromGitter> <Blacksmoke16> er `value : String, type : Time.class`
<FromGitter> <Blacksmoke16> or `type : Time?.class`
<FromGitter> <Blacksmoke16> something along those lines
<FromGitter> <renich_gitlab> OK, let me try that.
<FromGitter> <renich_gitlab> BTW, this doesn't work: ⏎ ⏎ ``` 27 | def Granite::Type.convert_type(value : String, Time.class) : Time``` [https://gitter.im/amberframework/amber?at=60202706428d9727dd60052b]
<FromGitter> <renich_gitlab> @Blacksmoke16 something like this? ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ At, say: `src/lib/granite/types.cr` and require it in `config/application.cr`? [https://gitter.im/amberframework/amber?at=6020285fa0246860dc3a510b]
<FromGitter> <renich_gitlab> Tried this: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ But, it seems, it's not being applied. [https://gitter.im/amberframework/amber?at=6020292c0eed905f189b09c7]
<FromGitter> <renich_gitlab> Tried this as well: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/amberframework/amber?at=6020297284e66b7f7edac0a1]
<FromGitter> <renich_gitlab> oh, man. This is so complicated... :S
<FromGitter> <renich_gitlab> Corrected it to: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ ... still, not working. [https://gitter.im/amberframework/amber?at=60202a4f84e66b7f7edac31e]
<FromGitter> <renich_gitlab> btw, thanks @Blacksmoke16 for your attention. I appreciate the help so far.
<FromGitter> <renich_gitlab> Hah! It worked! ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Damn thing! Finally! [https://gitter.im/amberframework/amber?at=60202cf955359c58bf2acb89]
<FromGitter> <Blacksmoke16> 🎉 nice!
alexherbo2 has quit [Ping timeout: 246 seconds]
alexherbo2 has joined #amber
alexherbo2 has quit [Ping timeout: 264 seconds]
alexherbo2 has joined #amber
alexherbo23 has joined #amber
alexherbo2 has quit [Ping timeout: 265 seconds]
alexherbo23 is now known as alexherbo2