hey all - in the docs for `update_all`, https://apidock.com/rails/v4.2.7/ActiveRecord/Relation/update_all, it mentions the values won’t go through AR’s type-casting behavior - would this cause an issue if updating a bool property when using mysql?
Hi all - been reading through the various different ways to execute system/shell commands, and I still can’t quite figure out which methods execute the given commands in a subshell vs as a subprocess (akin to python’s `shell=false`), so was hoping someone could help me clear things up
al2o3-cr: Great, thanks! - so in my script, i want to run a couple git commands, (1) `git fetch` and (2) `git pull`, and then (3) check `git status` - it seems like Open3#capture2 is a great candidate for (3), but for (1) and (2) I see no reason to execute in a subshell, but `exec` will replace the current process rather than creating a subprocess, so what would be a good option for (1) and (2)?
al2o3-cr: my understanding is the parent process will inherit stderr when using Open3.capture2e/3, and i don’t really need to do anything with stderr other than display it and exit the script (which I understand I can do using the status object)
as for Process.spawn, it looks like the execution is done asynchronously without explicitly calling Process.wait, is that correct?
al2o3-cr: i’ll look thru the docs - it does seem that Kernel#system is probably the most straightforward way for (1) and (2) above, and since there’s no input, i guess there’s no potential issue with running a subshell
al2o3-cr: do any of the methods for executing commands bubble up exceptions such that the parent process will simply fail and terminate execution without explicitly checking the Process::Status object?
al2o3-cr: for either Open3 or Kernel (are Kernel#spawn and Process#spawn identical?)
i guess for example if the subprocess executes a `git fetch` and for whatever reason origin doesn’t exist or something occured that would cause `git fetch` to fail, would all the methods we discussed require explicitly checking the status object?
Ok cool - oneeee last q - with Open3.capture*, if stderr is inherited, what exactly does that mean? I assume it means that the subprocess shares the same stderr as the parent process, so in the `git fetch` case, if the child process has a non-zero exit status, would that cause the parent process (the containing script) to stop execution?