« Back to channel list

#RubyOnRails - 18 July 2019

« Back 1 day Forward 1 day »
[00:10:34] skryking: has joined #RubyOnRails
[00:20:02] fragamus: has joined #RubyOnRails
[00:42:43] thoraxe: ok this is bizarre. i cannot figure out how to use the elasticsearch model stuff to return ALL the results. it only wants to return ten
[00:42:51] thoraxe: but response.records.total is in the thousands
[00:57:52] hope_canyon: still need help with factorybot self referential associations. much appreciated! https://gist.github.com/newplasticideas/5dc0094752dd0bc40085443c3793dc02
[01:23:58] Linell: thoraxe: are you using searchkick?
[01:28:05] Linell: hope_canyon: http://bit.ly/2Lpkfr1 <- I'm unsure, but does this help at all?
[01:33:40] hope_canyon: Linell: sort of, thanks for sharing. the problem is the nature of the association is a parent of self. it's not a type of user. so creating another factory won't solve the problem because then the second factory needs to deal with its parent somehow.
[01:34:42] Linell: What about defining a :parent_activity factory
[01:34:54] Linell: where you don't set the parent_activity_id
[01:41:58] hope_canyon: hmm... that might have to do. it's not purely how the model works, as a parent can have a parent and so on in the real model. but there doesn't seem to be a way for that to work without creating another factory with instances that aren't persisted or saved to the db.
[01:44:24] Linell: I wonder if there would be a way to randomly select if it's got a parent or not.
[01:47:48] duderonomy: has joined #RubyOnRails
[01:48:08] hope_canyon: Oh shit i figured it out
[01:48:33] hope_canyon: on the activity factory: association :parent_activity_id, factory: :parent_activity
[01:48:39] hope_canyon: and on the parent_activity: association :parent_activity_id, factory: :activity
[01:48:43] hope_canyon: problem solved.
[01:49:15] hope_canyon: i'm putting those inside a :with_parent_activity trait block. so if it doesn't have a parent, i just don't flag the trait.
[01:49:41] hope_canyon: thanks for your help! this is honestly the first time someone has gotten back to me on IRC about something like this, which may be a timezone thing for me. very much appreciated!
[01:49:48] Linell: that sounds like a nice solution
[01:49:55] Linell: lol I'm in here from a question I asked earlier with no response
[01:50:46] Linell: though to be fair, my question was kinda dumb
[01:51:43] hope_canyon: i can't see it. might be from before i joined. but maybe i can help!
[01:52:20] Linell: heh I was trying to create branded error pages easily (like use asset pipeline stylesheets)
[01:52:35] Linell: and stackoverflow had me down a rabbit hole and I was trying to render a view as an html asset
[01:52:51] Linell: although I still don't feel like I'm doing them all the way right
[01:53:01] Linell: the solution I ended up with was just having a controller and views that create error pages
[01:53:04] Linell: but not routing the app there
[01:53:16] Linell: instead I've got a rake task that grabs those from prod and sticks them in the public dir
[01:53:29] Linell: which seems relatively on par for what I can find via google
[01:59:15] hope_canyon: i think if you edit what's in the public directory, you can style and serve those
[02:00:27] Linell: oh for sure, but we've got react components and stuff like that
[02:00:37] hope_canyon: i've never done it myself. the public assets for our site (like a home page with a default subdomain) all live on some other AWS instance where it's literally just four html files. not a rails app. so you could always do that if you have some prod hosting to muck around with
[02:00:43] hope_canyon: ohhh i see. so it's not a full stack thing?
[02:01:49] Linell: it's kinda a mixture
[02:01:57] Linell: rails routing to controllers that create react components
[02:04:27] Linell: but hits a separate rails api for most data
[02:05:27] hope_canyon: woah. so you're building components serverside?
[02:06:15] Linell: https://github.com/reactjs/react-rails
[02:06:18] Linell: not quite that neat
[02:09:58] hope_canyon: yeah i'm not 100% sure. sometimes we will store an entire rendered html as a string in the db
[02:10:12] hope_canyon: but it's usually like... a record of the content that was dynamically served to a user in our chat feature
[02:10:22] hope_canyon: so it's purely retrospective
[02:10:48] hope_canyon: but you could seed a table with a bunch of templates and just return those records when the user does something stupid
[02:11:07] Linell: well the problem there is if the actual app is down, it's not serving any of that up
[02:11:17] Linell: unless you can get it into the public folder
[02:30:45] hope_canyon: yeah that's true. i'll keep brainstorming.
[02:30:47] unixcat: has joined #RubyOnRails
[02:32:24] Saukk: has joined #RubyOnRails
[02:32:31] Linell: I appreciate it! If you come up with anything good pls message me on here.
[02:34:49] unixcat: has joined #RubyOnRails
[02:37:08] unixcat: has joined #RubyOnRails
[02:38:39] unixcat: has joined #RubyOnRails
[02:40:02] unixcat: has joined #RubyOnRails
[02:48:34] _aeris_: has joined #RubyOnRails
[03:54:27] orbyt_: has joined #RubyOnRails
[04:19:33] unixcat: has joined #RubyOnRails
[05:08:44] srinidhi: has joined #RubyOnRails
[05:23:28] conta: has joined #RubyOnRails
[05:33:36] srinidhi: has joined #RubyOnRails
[05:35:36] LightStalker: has joined #RubyOnRails
[05:38:23] conta: has joined #RubyOnRails
[05:50:38] schneider: has joined #RubyOnRails
[06:20:56] corellian: has joined #RubyOnRails
[06:35:46] srinidhi: has joined #RubyOnRails
[06:49:17] lxsameer: has joined #RubyOnRails
[06:57:19] prestorium: has joined #RubyOnRails
[07:20:22] schneider: has joined #RubyOnRails
[07:37:41] snickers: has joined #RubyOnRails
[07:44:45] Ergo: has joined #RubyOnRails
[07:45:00] wopi: has joined #RubyOnRails
[07:45:15] wopi: Hi, it's safe to upgrade from Puma 3.x to Puma 4.x? I can't see any related information. I mean is it a drop in replacement or are there changes I have to do in my application?
[07:47:48] deepreds1: has joined #RubyOnRails
[08:02:46] za1b1tsu: has joined #RubyOnRails
[08:06:05] wopi: has left #RubyOnRails: ("The Lounge - https://thelounge.github.io")
[08:30:03] jefffrails35: has joined #RubyOnRails
[08:30:34] dustinm`: has joined #RubyOnRails
[08:38:37] ZAJDAN: under which user runs puma-server?
[08:38:58] ZAJDAN: apache from default runs under www-data
[08:51:42] srinidhi: has joined #RubyOnRails
[08:52:02] conta: has joined #RubyOnRails
[10:19:49] conta: has joined #RubyOnRails
[10:38:08] Dbugger: has joined #RubyOnRails
[10:58:28] conta: has joined #RubyOnRails
[11:12:52] lankanmon: has joined #RubyOnRails
[11:15:30] dionysus69: so I made a conclusion about my dev cycle. how to make my life easier
[11:15:46] dionysus69: instead of bothering with blueprints and multiple other gems
[11:16:28] dionysus69: I decided to make a rails --full plugin/engine, then import it in a new project and use it as a swiss knife
[11:21:16] codingiscool: has joined #RubyOnRails
[11:38:51] codingiscool: Hi #rubyonrails, I'm looking for help for a PR for rails/action_text. Right now it's not really possible to attach non database-backed Trix content attachments (#35218). I would like to contribute and add support. I already have a sample implementation for a custom Trix attachment and action_text working, but I'm stuck now. Where would be a good place to discuss this?
[13:08:44] safetypin: has joined #RubyOnRails
[13:18:11] deepreds1: has joined #RubyOnRails
[13:30:09] fragamus: has joined #RubyOnRails
[13:43:50] DTZUZO: has joined #RubyOnRails
[13:49:58] deepreds1: has joined #RubyOnRails
[13:57:48] lato_1: has joined #RubyOnRails
[14:18:46] za1b1tsu: has joined #RubyOnRails
[14:47:17] orbyt_: has joined #RubyOnRails
[14:50:28] snowy: has joined #RubyOnRails
[15:01:09] Dbugger: has joined #RubyOnRails
[15:19:05] orbyt_: has joined #RubyOnRails
[15:27:52] emachnic: has joined #RubyOnRails
[15:29:44] Sylario: I have a weird error about a nested controller :
[15:29:45] Sylario: 'marketadmin_api/v1/Invoices/SendMailController' is not a supported controller name. This can lead to potential routing problems. See http://guides.rubyonrails.org/routing.html#specifying-a-controller-to-use
[15:30:19] Sylario: https://www.irccloud.com/pastebin/3JWTSAKH/
[15:32:45] Sylario: Ok found the problem, I should have used 'invoice/send_mail' instead of 'Invoice/SendMail'
[15:35:48] Linell: sylario: glad you figured it out!
[15:39:32] Technodrome: has joined #RubyOnRails
[15:41:22] Sylario: I should have read more carrefully, it mixed _ no maj with no-dash maj syntax
[15:52:22] deepreds1: has joined #RubyOnRails
[15:55:46] fragamus: has joined #RubyOnRails
[16:06:01] Exuma: has joined #RubyOnRails
[16:16:32] emachnic: has joined #RubyOnRails
[16:22:59] SanguineAnomaly: has joined #RubyOnRails
[17:07:03] duderonomy: has joined #RubyOnRails
[17:07:35] defsdoor: has joined #RubyOnRails
[17:27:49] s2013: has joined #RubyOnRails
[17:30:54] safetypin: has joined #RubyOnRails
[17:46:38] Nuck: has joined #RubyOnRails
[17:46:38] fowlduck: has joined #RubyOnRails
[17:48:44] ppl: has joined #RubyOnRails
[18:17:44] Exuma: has joined #RubyOnRails
[18:30:06] s2013: has joined #RubyOnRails
[18:40:22] xco: has joined #RubyOnRails
[18:41:07] xco: Hi how do i access session data from outside the controller? this provides some context https://gist.github.com/xcobar/3e434998ce0188e4f80e600c3ff59338#file-rb-rb-L6
[18:47:30] Linell: xco: http://bit.ly/2XL7zRQ <- could you do something like that?
[18:47:32] snowy: has joined #RubyOnRails
[18:47:37] Linell: I don't think you'll be able to reference it without passing it to there somehow.
[18:50:36] schneider: has joined #RubyOnRails
[18:50:56] srinidhi: has joined #RubyOnRails
[18:55:55] xco: @Linell not sure that would work. in this case i’d have to create a method in the SessionController that will pass the session data i need to it and call that method outside of the controller is that what you mean?
[18:57:30] xco: Linell: this is what you mean i guess https://gist.github.com/xcobar/3e434998ce0188e4f80e600c3ff59338
[19:00:14] Linell: I _think_ you'd have to do it when the controller is running.
[19:00:29] Linell: How're you using the twitter_client?
[19:00:41] Linell: If you need the user's data, why not create a class?
[19:00:53] Linell: TwitterClient.new(user: current_user)
[19:03:20] Linell: Yeah, I'm 99% sure doing what you're going for in an initializer won't work correctly.
[19:03:33] Linell: If you figure it out I'd love to know your solution, though!
[19:06:07] xco: yeah this one is quite tricky… at leat for me
[19:06:22] xco: i know it won’t work in an initializer too
[19:17:27] tdy: has joined #RubyOnRails
[19:19:52] schne1der: has joined #RubyOnRails
[19:20:02] mlt-: has joined #RubyOnRails
[19:39:06] fragamus: has joined #RubyOnRails
[19:39:51] crankharder: has joined #RubyOnRails
[19:48:18] _aeris_: has joined #RubyOnRails
[19:51:34] Technodrome: has joined #RubyOnRails
[20:02:34] xco: has joined #RubyOnRails
[20:22:08] orbyt_: has joined #RubyOnRails
[20:23:13] s2013: has joined #RubyOnRails
[21:14:40] deepreds1: has joined #RubyOnRails
[21:14:42] sameerynho: has joined #RubyOnRails
[21:18:36] snowy: has joined #RubyOnRails
[21:37:22] s2013: has joined #RubyOnRails
[21:42:22] lato_1: has joined #RubyOnRails
[21:50:53] DTZUZO: has joined #RubyOnRails
[21:51:31] Fernando-Basso: has joined #RubyOnRails
[21:51:48] ur5us: has joined #RubyOnRails
[22:15:32] ellcs: has joined #RubyOnRails
[22:50:44] Technodrome: has joined #RubyOnRails
[23:02:07] s2013: has joined #RubyOnRails
[23:02:41] xco: has joined #RubyOnRails
[23:48:07] snowy: has joined #RubyOnRails