#RubyOnRails - 18 July 2019
« Back 1 day Forward 1 day »
[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:57:52] hope_canyon: still need help with factorybot self referential associations. much appreciated! https://gist.github.com/newplasticideas/5dc0094752dd0bc40085443c3793dc02
[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: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: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: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: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:53:01] Linell: the solution I ended up with was just having a controller and views that create error pages
[01:53:16] Linell: instead I've got a rake task that grabs those from prod and sticks them in the public dir
[01:59:15] hope_canyon: i think if you edit what's in the public directory, you can style and serve those
[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: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: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
[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?
[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: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?
[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:32:45] Sylario: Ok found the problem, I should have used 'invoice/send_mail' instead of 'Invoice/SendMail'
[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:37] Linell: I don't think you'll be able to reference it without passing it to there somehow.
[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:03:20] Linell: Yeah, I'm 99% sure doing what you're going for in an initializer won't work correctly.