<    March 2017    >
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 23 24 25  
26 27 28 29 30 31
00:01 filterfish joined
02:28 filterfish joined
03:04 filterfish joined
03:09 filterfish joined
03:10 filterfish joined
03:11 filterfish joined
03:12 filterfish joined
03:13 filterfish joined
03:14 filterfish joined
03:14 filterfish joined
03:38 glennpratt joined
03:41 glennpratt joined
03:42 glennpratt joined
03:45 glennpratt joined
04:49 claw joined
04:59 filterfish_ joined
05:17 glennpratt joined
05:18 glennpratt joined
05:19 glennpratt joined
07:00 glennpratt joined
07:07 filterfish joined
07:46 filterfish joined
07:48 aidalgol joined
07:53 ta_ joined
07:54 glennpratt joined
08:27 jaequery joined
09:21 filterfish joined
09:42 glennpratt joined
10:36 glennpratt joined
10:42 schwatvogel joined
10:44 <schwatvogel> hi there, anyone got a hint about problem with migrations? im using ruby 2.4 with sequel 4.44. Trying to run a simple db migration and getting:
10:44 <schwatvogel> Error: NoMethodError: undefined method `>' for nil:NilClass
10:45 <schwatvogel> in migration.rb:536 (looks like it cannot compare the version/index of the migrations
10:54 <schwatvogel> hmm found it: wrong filename for the migration files
11:52 filterfish joined
11:53 filterfish joined
11:54 filterfish joined
11:55 filterfish joined
11:56 filterfish joined
11:57 filterfish joined
11:58 filterfish joined
12:24 glennpratt joined
13:18 glennpratt joined
14:13 glennpratt joined
15:12 glennpratt joined
17:19 jaequery joined
17:32 <adam12> jeremyevans: Is there a nice Sequel way of adding a non-null column with a default that's generated in code, with pre-existing rows? I'm thinking add the column allowing null, updating using the dataset, then setting the null value.
17:36 <jeremyevans> adam12: that's probably the best way to do it
17:37 <adam12> thanks
17:39 <adam12> jeremyevans: you think I'd be safe in a change block, or should I do an up/down?
17:39 <adam12> Actually, I suspect I have no choice and require the up/down.
17:43 <jeremyevans> adam12: up/down required. It's rare that I have something other than a trivial migration where I can use change instead of up/down
17:43 <adam12> Yep. I didn't think before I asked :P
17:48 <adam12> jeremyevans: One last question - what are my options for updating individual records from a dataset, using #each? ds.each {|obj| ... }. Is there a nice way to call update? Looks like obj is a plain Hash.
17:48 <adam12> I looked through docs but only see ds.update - which I guess could work?
17:50 <jeremyevans> adam12: ds.all{|row| ds.where(:id=>row[:id]).update()}
17:50 <jeremyevans> adam12: You want to use all instead of each, because issuing queries inside each is not supported
17:50 <adam12> Perfect. Cheers.
17:50 <adam12> Yeah I saw that noted. Makes sense. I wonder if this proceedure is in the docs anywhere - I didn't notice it.
17:50 <adam12> or if it would make sense documenting it somewhere.
17:52 <jeremyevans> adam12: If you think it should be added, it may make sense to add it here: http://sequel.jeremyevans.net/rdoc/files/doc/migration_rdoc.html#label-Using+models+in+your+migrations
17:52 <adam12> jeremyevans: I'll review and see if it makes sense to submit a PR.
17:53 <adam12> It's possible it's somewhere in the docs already.
18:23 <adam12> jeremyevans: I'm attempting to set a column default in before_create, but I have a feeling autovalidations is firing before hand, causing a validation error (for obv reasons). ... I didn't really want to move it to an after_initialize hook but I could. Can you think of another alternative?
18:25 <adam12> Actually, before_validation fires fine, and I'm not using `validate: false` (as I thought I was).
18:46 iiShrimp joined
18:49 <iiShrimp> Hi! Could someone please help me write following query using sequel? Thanks — http://pastebin.com/T1uV93kG
19:15 <jeremyevans> adam12: You can use _before_validation for this currently. One of the changes in Sequel 5 will be before_validation/after_validation will be called even if not validating
19:15 <adam12> jeremyevans: thnx.
19:16 <jeremyevans> iiShrimp: DB[:table].where(:foo=>1).where([:bar, :baz]=>[[2,3], [4,5]])
19:40 <iiShrimp> jeremyevans: Thanks a lot!
20:13 badeball joined
20:20 filterfish joined
21:59 ta_ joined
23:11 jaequery joined
23:38 glennpratt joined