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
_whitelogger has joined #amber
<FromGitter> <sam0x17> so I have a field `column my_field : Float64?` with sql `my_field DOUBLE PRECISION,`, but granite is throwing an error whenever I try to save the model like "05:08:22 Granite (ERROR) Save Exception: invalid input syntax for type integer: "60000.001" " regarding that field
<FromGitter> <sam0x17> why does it think `my_field` is supposed to be an integer?
<FromGitter> <sam0x17> update: still just as mystified on that
<FromGitter> <sam0x17> `DOUBLE PRECISION` is just the standard for a double float in postgresql btw
<FromGitter> <Blacksmoke16> is the error coming from the pg driver or?
<FromGitter> <sam0x17> `05:07:42 Granite (ERROR) Save Exception: invalid input syntax for type integer: "60000.0"`
<FromGitter> <sam0x17> on a Float64 field
<FromGitter> <Blacksmoke16> right, but does that exception originate from the pg driver, or granite itself?
<FromGitter> <sam0x17> ```code paste, see link``` [https://gitter.im/amberframework/amber?at=5e8e20905b98016d6a2240a4]
<FromGitter> <Blacksmoke16> in the lib code as a `pp exception` before https://github.com/amberframework/granite/blob/master/src/granite/transactions.cr#L192
<FromGitter> <Blacksmoke16> then you can see what ex is actually being raised to cause this
<FromGitter> <sam0x17> `#<DB::Error:invalid input syntax for type integer: "60000.001">` (monkey patched)
<FromGitter> <Blacksmoke16> so yea, its not a granite issue
<FromGitter> <Blacksmoke16> id dig into `crystal-pg` or `crystal-db` to see where exactly its being thrown
<FromGitter> <sam0x17> thx
<FromGitter> <Blacksmoke16> could do like `pp exception.callstack` to get a trace to make figuring out where it originated easier
<FromGitter> <sam0x17> is there a way / guide for writing controller specs somewhere?
<FromGitter> <sam0x17> btw @Blacksmoke16 I didn't have time to debug that any more than I did so I just changed the field to an int and used microseconds which for my purposes was probably better anyway
<FromGitter> <Blacksmoke16> 👍 gotcha
<FromGitter> <sam0x17> controller specs anyone? possible?
<FromGitter> <Blacksmoke16> integration tests would prob be way to go?
<FromGitter> <sam0x17> I could just do that
<FromGitter> <Blacksmoke16> im not familiar enough to know if unit tests are possible tho
<FromGitter> <sam0x17> if it's not a built-in thing it shouldn't be too hard just have to have a fake request object and instantiate an instance of the controller class, call the appropriate method
<FromGitter> <Blacksmoke16> probably doable as well? :shrug: