<    June 2018     >
Su Mo Tu We Th Fr Sa  
                1  2  
 3  4  5  6  7  8  9  
10 11 12 13 14 15 16  
17 18 19 20 21 22 _2_3  
24 25 26 27 28 29 30
00:03 pdrakeweb joined
01:05 pdrakeweb joined
01:31 pdrakeweb joined
12:24 pdrakeweb joined
13:05 pdrakeweb joined
15:11 madtalentz joined
16:39 cptaffe joined
16:39 pdrakeweb joined
17:59 madtalentz78 joined
18:08 pdrakeweb joined
18:28 Linell joined
18:29 <Linell> What's the right way of dealing with something like a "unique" six digit code generated on creation of a model?
18:29 <Linell> As in, when it ends up not being unique trying something new. Can that be done in the model hooks, or would you need to do it around the actual creation logic?
18:55 <jeremyevans> Linell: simplest unique code would just be a autoincrementing sequence value padded to 6 digits. If unique is the only criteria, that should be fine. Obviously with only 6 digits, you are limited to a milions rows, so hopefully you don't plan on exceeding that.
18:56 <Linell> Nah, it honestly shouldn't go over a few thousand at a time. Gracias!
18:59 madtalentz joined
19:24 banditro_ joined
19:53 Norm joined
19:54 <Norm> i’m using the serialization plugin to convert my “ip_address” field from an unsigned integer to Ruby’s IPAddr. works great.
19:55 <Norm> Except that same field is used in an association. It appears that the association is using the IPAddr instead of the integer, producing this error…
19:55 <Norm> Sequel::Error: can't express #<IPAddr: IPv4:> as a SQL literal
19:55 <Norm> any suggestions?
19:57 <jeremyevans> Norm: You could add support for literalizing IPAddr to integer by adding IPAddr#sql_literal_append
19:57 <jeremyevans> Norm: Alternatively, you could add a method that returns the integer instead of the IPAddr, and use that in the association
21:13 cptaffe joined
23:40 cptaffe joined