<
FromGitter>
<Blacksmoke16> `in lib/CrSerializer/src/CrSerializer/json/to_json.cr:15: no overload matches 'Granite::Base#to_json' with types JSON::Builder, Array(String), Array(String)` 😕
<
FromGitter>
<Blacksmoke16> this makes no sense
<
FromGitter>
<Blacksmoke16> im serializing another model just fine
<
FromGitter>
<Blacksmoke16> ogh ill worry about it tomorrow
_whitelogger has joined #amber
_whitelogger has joined #amber
feepbot has quit [Ping timeout: 250 seconds]
feepbot has joined #amber
<
FromGitter>
<mixflame> Hello all, I'm back
<
FromGitter>
<Blacksmoke16> o/
<
FromGitter>
<rmarronnier> sorry for the messy markup :-/
<
FromGitter>
<Blacksmoke16> use three ```
<
FromGitter>
<rmarronnier> ok thanks :-)
<
FromGitter>
<Blacksmoke16> but whats the issue? getting an error or just trying to understand what each thing is doing?
<
FromGitter>
<rmarronnier> I'm getting this error : '''app_1 | in src/controllers/user_controller.cr:26: undefined method 'pair=' for User ⏎ app_1 | ⏎ app_1 | user.pair = pair'''
<
FromGitter>
<Blacksmoke16> you would have to add a `has_one :pair` in your `User` model to get the `pair=` method
<
FromGitter>
<Blacksmoke16> but if a user can have many pairs, hrm
<
FromGitter>
<rmarronnier> So what you mean the has_many doesn't generate methods ?
<
FromGitter>
<Blacksmoke16> i dont think it does
<
FromGitter>
<Blacksmoke16> at least not a setter
<
FromGitter>
<Blacksmoke16> so prob have to do it the other way, `pair.user = user`
<
FromGitter>
<Blacksmoke16> then that way you could assign multiple pairs to the same user that would get returned on your `user.pairs` call
<
FromGitter>
<rmarronnier> hmm... Thanks, I'm going to try this
<
FromGitter>
<Blacksmoke16> np, yea associations are so confusing
<
FromGitter>
<Blacksmoke16> just in general, having to think about how everything is related
<
FromGitter>
<rmarronnier> Yeah, Inever though conceptualizing 'being a friend of' in SGBD would be so complex :D