#RubyOnRails - 17 May 2019
« Back 1 day Forward 1 day »
[00:41:52] IGnorAND: figured it out, my require needs small letters, the code needs capitalized letters
[06:08:17] dionysus69: is it possible to allocate certain number of threads to the sidekiq queues? I have scenarios where I need multiple single threaded queues, but obviously I don't want to launch separate processes for a single thread
[09:57:02] xco: what i’m trying to achieve is to avoid some “AND” clause when the related attribute is not present. Currently when the attribute is not present, as seen on lines 47-49 the AND clause is printed but with empty values. what i want is for those AND clauses to not show at all when the attributes are absent.
[09:58:48] xco: those attributes i’m getting from a form. and i’m trying to do a search in the db, but the search should perform an AND on only the values entered by the user
[10:34:34] xco: tbuehlmann: i’ve tried this https://gist.github.com/xcobar/9a00e350b71bce66d4f9efe68c32882f
[10:35:36] xco: tbuehlmann: and this too https://gist.github.com/xcobar/9a00e350b71bce66d4f9efe68c32882f#file-sql-rb-L52
[10:41:22] xco: what happens is even when i don’t enter a field in the form, all the AND clauses are printed
[10:41:55] xco: tbuehlmann: i only want to append AND clauses to the sql query only if they are filled that is not blank… in other words, present
[10:44:23] xco: tbuehlmann: https://gist.github.com/xcobar/9a00e350b71bce66d4f9efe68c32882f#file-sql-rb-L65
[10:50:41] xco: public_send(meth) invokes the public method “meth” where meth is the symbols from the constant
[10:52:26] tbuehlmann: it invokes the methods, correct. so is this a good place to check for presence?
[10:54:51] tbuehlmann: that would assign `true` or `false` to value, that's probably not what you want, right?
[12:52:05] Jjj: Im trying to run rake tasj that calls external shell script and want it to be multinthreaded
[12:52:34] Jjj: Found out about multitask but not really clear how to implement any experts could give me some advice?
[12:53:06] Jjj: Basically i have a shell command with unique parame that needs to be executed in parallel.
[14:49:05] amperry: hey folks, anyone here use the cocoon gem? I'm trying to add associations calling link_to_add_association multiple times, but when I look at the params, only the last one is passed, rather than an array or other set of them.
[16:42:55] VSpike: Hi! I'm seeing a case where starting `bundle exec rails server puma` will not output any logs on stdout or stderr until I send it a simple curl, at which point it seems to kick into life
[16:44:24] VSpike: Seems to happen with Ruby 2.5.5 but not 2.4.6, doesn't seem to matter what Rails version
[17:20:37] JavaDog: I've been stuck on this thing for almost 2 days. Have a frontend react-native app and I'm trying to hook it up to rails' ActiveStorage with normal http requests. This is what that process should look like: https://github.com/rails/rails/issues/32208#issuecomment-383737803
[17:22:10] JavaDog: On the rails side, specifically on the line linked here, request.content_length is always much shorter than it should be (like 100-200 whereas token[:content_length] is around 22000https://github.com/rails/rails/blob/e4e12185837c1aa9233e4669d0a54b54173e1bf1/activestorage/app/controllers/active_storage/disk_controller.rb#L64
[17:23:41] JavaDog: I don't know where the short number is coming from which causes that conditional to fail. I'm setting the Content-Length header on the client to what it should be.
[18:38:28] timdotrb: Anyone know if it’s possible to pluck an Int field, as well as convert the field to string at the same time? Or would I need to do this separately, after the pluck?
[18:44:08] xco: timdotrb: i just looked the the API now, #pluck returns an array of strings so you could then do a #map! on it?
[21:30:34] IGnorAND: An app has an api which returns a JSON response. I made a gem to send a request to the app and get the response. Now I want to use this gem to return a JSON response in a different app. Does my model do the call to the gem? Do I then convert it to JSON in my controller?