Activity Graph

Page 1 of 18 | Next »


[02:42:51] chridal: *.net *.split


[11:34:28] chridal: When using webpacker my compiled application.js file is a lot shorter than the one in development
[11:34:55] chridal: Any thoughts? I tried unminifying it, and even then the ration was like 700'000 lines vs 300'000
[11:35:09] chridal: I mean characters, not lines.
[11:35:42] chridal: I'm not getting any errors during compilation, but if I include the minified file in production, nothing renders on screen.
[12:37:21] chridal: has left #RubyOnRails: ("WeeChat 2.2-dev")
[12:39:12] chridal: has joined #RubyOnRails


[12:14:26] chridal: I'm trying to deploy with Webpacker, and I did assets:precompile, all the assets are there and no errors. When I deploy to production, nothing renders in the body.
[12:14:51] chridal: The <head></head> section is fine, and all files are present, both JS and CSS, but the body is empty.
[12:15:51] chridal: Or wait, it gets weirder. If I do 'Show source', the body is there. If I go into Inspect in Chrome, the body is empty in the Elements tab. Nothing renders on screen.
[12:16:03] chridal: No errors in nginx, and no errors in rails server.
[12:16:20] chridal: The body in elements just has this class: "class=" __plain_text_READY__""


[16:19:27] chridal: Any gotchas with deploying with Webpacker? Everything compiles on precompile:assets, and I get no errors; but the page is blank.


[20:58:10] chridal: hahuang65: What's the error?
[20:58:25] chridal: I'm using a COPY, but in a ActiveRecord::Base.connection.execute


[22:38:56] chridal: I don't know what it is about eval() but it always feels hacky to use it
[22:38:57] chridal:
[22:39:15] chridal: What do you think about using it to generate the proper paths, such as on line 2?


[10:40:42] chridal: Is there a way to generate a 'generic' path in Rails? Today I'd do post_path(@post), but is there a way of doing something like path_to(SomeObj) and then have that resolve to `post_path` if I gave it a Post obj?


[09:49:44] chridal: Having some weird issues with paths. Anyone mind having a look?
[10:01:12] chridal: Arkentias: The view is buildings/index.html.erb
[10:01:36] chridal: and the manage_room_path is being run in a @building.rooms.each |room|
[10:02:38] chridal: Oh, right, sorry. it's in buildings/show.html.erb, right
[10:02:57] chridal: Would that be an issue?
[10:07:14] chridal: Arkentias: I forgot that I could check `rake routes`
[10:07:46] chridal:
[10:07:56] chridal: Is it just me, or is this a bug?
[10:08:09] chridal: manage_rooms GET /manage/rooms(.:format) manage/rooms#show
[10:08:18] chridal: shouldn't that path be manage_room?
[10:10:57] chridal: Yes, latest version
[10:11:29] chridal: Or, actually I'm on 5.1.6, should upgrade
[10:22:31] chridal: Radar: Will test with 'resource' instead of resources. Maybe I'm misunderstanding that part.
[10:22:43] chridal: What I want here is to click on one room, and have the show page for that room.
[10:23:03] chridal: I will only be dealing with one room at a time, unless they are being listed in an index or in a buildings show page
[10:26:51] chridal: Radar: Omg. The time I have spent on this bug...
[10:26:52] chridal: Thank you!
[10:33:13] chridal: Sure. Have a coffee :-)


[08:11:24] chridal: What would be some of the differences in HTML/CSS of Production vs Development?
[08:11:40] chridal: I have this weird bug that only comes out in production with my HTML/CSS. Using Bootstrap-gem.
[08:13:05] chridal: It's a weird one. When I click buttons, they expand in a different way and causes overflow-x and y to be activated, showing scrollbars.
[08:13:16] chridal: Locally, this does not happen, and everything looks fine.
[08:14:25] chridal: So it's really annoying, because I have to deploy the entire application every time I want to test it
[08:16:45] chridal: But my CSS actually isn't minified either, it seems. Which is something that I shoud enable.
[08:19:16] chridal: Yes, I'll try that.
[08:20:22] chridal: ariejan: When adding:
[08:20:24] chridal: config.assets.compile = false
[08:20:26] chridal: config.assets.js_compressor = true)
[08:20:36] chridal: To my development.rb, I get an error about assets not being in the asset pipeline.
[08:21:02] chridal: I'm not familiar enough with how everything works with the pipeline in order to get it to work in development.
[08:21:08] chridal: Do you know how to fix that?
[08:29:06] chridal: No diff between the files in dev/prod either
[09:07:42] chridal: ariejan: ariejan Nothing missing from assets.rb
[09:10:15] chridal: but regarding what sevenseacat, my app did tell me when assets weren't being loaded properly
[09:10:42] chridal: That it didn't find the fines in the asset pipeline
[09:10:46] chridal: But that might not be what you meant
[11:18:20] chridal: ariejan: Yes, and everything else that's defined in the CSS works just fine. It's just these buttons.
[11:18:38] chridal: That are different. And it is rightly being caused by them moving, which is causing the X and Y scroll to be shown.
[11:18:45] chridal: The weird part is just that it shows in prod and not in dev.
[11:47:21] chridal: ariejan: Yes, all the contents are the same


[00:07:18] chridal: *.net *.split
[00:15:29] chridal: has joined #RubyOnRails
[00:15:51] chridal: has joined #ruby


[10:27:29] chridal: I'm having this super weird issue. I have two servers (different HW and domains) running the exact same Docker container, one of them is getting issues with the Rails asset pipeline, the other isn't.
[10:27:34] chridal: Any one have any thoughts?
[10:29:38] chridal: [a5d236ad-a2db-49f4-ab48-7fc32d2b58f5] ActionView::Template::Error (The asset "mino-dark.png" is not present in the asset pipeline.)
[10:30:02] chridal: One of the servers give me that error, the other one runs the same view just fine. I tried changing the version of the Rails.application.config.assets.version as well.


[02:47:08] chridal: *.net *.split
[02:47:47] chridal: has joined #RubyOnRails
[02:48:06] chridal: has joined #ruby


[13:11:10] chridal: *.net *.split
[13:11:12] chridal: has joined #ruby
[13:11:12] chridal: Changing host
[13:11:16] chridal: has joined #RubyOnRails
[20:57:27] chridal: Ping timeout: 240 seconds
[20:58:37] chridal: has joined #ruby
[20:58:37] chridal: has joined #RubyOnRails


[12:26:05] chridal: *.net *.split
[12:27:23] chridal: has joined #ruby
[12:27:35] chridal: has joined #RubyOnRails
[15:01:36] chridal: *.net *.split
[15:03:08] chridal: has joined #RubyOnRails
[15:03:32] chridal: has joined #ruby


[12:45:24] chridal: fox_mulder_cp: Where will the dot be?
[12:45:59] chridal: Do you have an example of what you are trying to match? Would it perhaps be possible to have a \.{0} somewhere? And then fail if the RegEx has 0 matches?
[12:47:05] chridal: Yeapp, I saw it
[12:47:08] chridal: Doing some testing
[12:52:34] chridal: (?!.*\.){0}[A-Za-z0-9]
[12:52:39] chridal: This would ignore the dot
[12:52:52] chridal: fox_mulder_cp: Yes, but that will allow underscores as well
[12:53:10] chridal: (?!.*\.){0}[A-Za-z0-9] this will do: "" and capture "foobar"
[12:55:41] chridal: I'm getting a post request to my backend, that has 2100 elements in an array. Each of those correspond to an element in my database. I need to parse all that data, and update my DB records
[12:56:12] chridal: What kind of a performance hit is that? Can I do some batch updating, or should I call one UPDATE for each record?
[12:57:25] chridal: They're not actually records like that, what I'm getting in is data from an IP device, and I'm translating those.
[12:57:58] chridal: So, there's for instance two fields in each of those 2100 elements that I want to update in the DB
[12:58:30] chridal: also, the incoming data does not have the ID of the record, but it has a common name. So I'll have to look each of them up, and then update
[12:58:53] chridal: I'll have a look. Cheers.
[13:00:14] chridal: Still wondering if this would be a big perf hit though: 1. Retrieve item from array 2. Find DB record associated 3. Update DB record -> Next, 2100 times
[13:00:27] chridal: I'm doing this every 5-10 minutes
[13:00:51] chridal: Which makes me thing that this is probably a shitty solution. I need to use SNMP traps instead, probably.
[13:13:59] chridal: SNMP traps can be used for a lot of things :-)


[09:29:18] chridal: How can I use ES6 inside my views in Rails? I'd like to be able to have my files located in the regular views folder, but with Webpacker it seems that I am supposed to put them in app/javascripts?
[09:29:33] chridal: What I'd like to do, is sort of just sprinkle some JS into my already established views
[09:30:00] chridal: If I could do it through a <script>-tag inside my view, like one does in Vue, that would be awesome
[09:32:47] chridal: sylario: Please elaborate
[09:33:07] chridal: so, basically, the JS should always be implemented in separate files, and not live inside 'components', sort of?
[09:34:25] chridal: Alright, so I'll read a bit about that first


[20:08:35] chridal: Ping timeout: 240 seconds
[20:14:57] chridal: has joined #ruby
[20:14:57] chridal: has joined #RubyOnRails


[11:35:23] chridal: I have a 'server' that I've implemented, that's basically a for loop polling AWS SQS. I want to be able to test this with RSpec. If I start my server by running the `server` method, though, I'm not really able to stop it without doing CTRL-c
[11:35:43] chridal: while loop **
[11:36:27] chridal: So my question is; how should I go about controlling this? I probably need some sort of wrapper around the whole thing, that will allow me to stop and start the server or something? A new thread?
[11:37:23] chridal: I will have to daemonize this at some point, and I really dont' want to mess too much with PID files etc.
[14:21:43] chridal: I'm trying to stub out a class (RestClient) in RSpec. Is it possible to 'replace' the RestClient for that file (which is deeply nested beneath this call), or do I have to do dependency injection?
[14:22:17] chridal: I'd rather not inject the dependency, because I'm doing an integration test, and the use of RestClient is 4-5 files away from my current call


[20:31:23] chridal: I have some resources in a folder called `static` in my Rails root folder, how can I link to it?
[20:31:40] chridal: These are PDFs that I need to be able to link to from my application
[20:32:02] chridal: I've tried Googling but searching for static assets just gives me the standard asset pipeline, and routes weren't of too much help either


[11:42:47] chridal: I have some templates written in kramdown (Markdown + some HTML). How can I render this in my erb template?
[11:43:48] chridal:
[11:43:51] chridal: This is my code thusfar
[11:46:43] chridal: I also tried putting everything inside my .erb template, but when used in conjunction with <%= %> it just prints the HTML out
[11:46:49] chridal: instead of rendering it
[11:49:31] chridal: Awesome! Thanks!
[12:02:02] chridal: Yea, I think it's safe_html or something


[04:02:25] chridal: Ping timeout: 256 seconds
[04:11:44] chridal: has joined #ruby
[04:11:44] chridal: has joined #RubyOnRails


[20:43:38] chridal: *.net *.split
[20:44:25] chridal: has joined #ruby
[20:44:25] chridal: has joined #RubyOnRails


[14:48:13] chridal: *.net *.split
[14:54:16] chridal: has joined #ruby


[09:47:58] chridal: has joined #ruby


[18:17:37] chridal: has joined #RubyOnRails


[15:10:53] chridal: *.net *.split


[02:31:02] chridal: item_hash["OfferSummary"]["LowestUsedPrice"]["FormattedPrice"].nil?
[02:31:18] chridal: the_coder ^^
[02:32:12] chridal: So which of them is it that doesn't exist?
[02:32:19] chridal: Can you expect any of those elements to exist?
[02:32:31] chridal: I mean OfferSummary, LowestUsedPrice or FormattedPrice?
[02:32:49] chridal: the_coder: or are none of them guaranteed to be there?
[02:35:45] chridal: It's thumbs up
[02:37:11] chridal: the_coder: I think it originates from MSN/AIM, but it also works on Messenger



[19:40:42] chridal: Ping timeout: 252 seconds
[19:47:22] chridal: has joined #RubyOnRails
[19:47:22] chridal: has joined #ruby


[19:28:40] chridal: Ping timeout: 264 seconds
[19:35:23] chridal: has joined #ruby
[19:35:24] chridal: has joined #RubyOnRails


[10:47:33] chridal: Ping timeout: 258 seconds
[10:58:08] chridal: has joined #RubyOnRails
[10:58:08] chridal: has joined #ruby
[11:06:33] chridal: Ping timeout: 246 seconds
[11:16:39] chridal: has joined #ruby
[11:16:40] chridal: has joined #RubyOnRails


[18:50:41] chridal: Ping timeout: 250 seconds
[18:53:45] chridal: has joined #RubyOnRails
[18:53:45] chridal: has joined #ruby
[18:53:58] chridal: Changing host
[18:53:59] chridal: has joined #ruby
[18:53:59] chridal: has joined #RubyOnRails


[07:11:34] chridal: Ping timeout: 240 seconds
[07:15:42] chridal: has joined #RubyOnRails
[07:15:42] chridal: has joined #ruby
[11:57:34] chridal: Is there a way to stub out something like `sh` in Ruby?
[11:57:37] chridal: I'm trying to write a unit test for a function that runs `sh` to scp something from one server to the scripts directory
[11:57:50] chridal: But I don't want to actually fetch that file from the server in the tests
[11:58:08] chridal: I'd like to stub that out and write / return a separate file from the tests
[14:44:16] chridal: tildes: Is there some other way I should be SCPing from Ruby besides using sh?
[14:44:37] chridal: The way I had written it now it first fetches the file, and then runs on it, and returns the contents.
[14:45:01] chridal: But you basically think I should move the sh-scp into its own function, and just not unit test that function specifically?
[14:45:28] chridal: And then just stub that function for the remaining functions?


[13:56:38] chridal: Is there a way to stub out something like `sh` in Ruby?
[13:57:08] chridal: I'm trying to write a unit test for a function that runs `sh` to scp something from one server to the scripts directory
[13:57:22] chridal: But I obviously don't want to actually fetch that file from the server in the tests


[08:45:40] chridal: Ping timeout: 250 seconds
[08:45:49] chridal: has joined #ruby
[08:45:49] chridal: has joined #RubyOnRails
[08:45:49] chridal: Changing host


[08:38:53] chridal: How do you organize your "helper modules" in Rails? I have some functionality that I want to include in certain classes. Did you make a folder for it? Where? What's it called? etc.
[08:55:04] chridal: elaptics: Actual modules that just contain functionality to be included in models or controllers
[08:55:59] chridal: elaptics: Thanks!
[08:57:42] chridal: elaptics: Very nice.
[09:00:07] chridal: elaptics: Yea, that's what I did for now as well.
[09:00:26] chridal: Will have to see if I can get a use for concerns though. Didn't know about them.


[21:12:27] chridal: Anyone know about a board where a lot of U.S based Ruby on Rails devs hang around?
[21:13:55] chridal: I actually need to sell off a ticket to RailsConf that I sadly won't be able to use. So I was looking for some sort of board where I could post it
[21:17:00] chridal: Yea, tickets are $900 now. I'm selling for 500.
[21:20:27] chridal: I'll try that. Thanks.
[21:21:05] chridal: Hey guys. I'm selling off my ticket to RailsConf. I sadly won't be able to attend this year. The current price for a ticket is $900. Selling mine for $500. Send me a PM if interested. Thanks!


[20:14:18] chridal: Anyone know if it's possible to sell your RailsConf ticket? Couldn't find info on it
[20:18:32] chridal: tubbo: you got my hopes up for a second xD :-D
[20:48:31] chridal: Seems it was OK for me to sell my ticket to RailsConf. Now for where to sell it... :-D
[20:48:46] chridal: Any boards or something like that where a lot of Railsdevs hang out?


[13:53:16] chridal: Any good way to find a list over everything require rails/all requires?
[13:53:22] chridal: `require 'rails/all'`
[13:53:27] chridal: I need to remove ActiveRecord
[13:53:52] chridal: tbuehlmann: Thanks a lot!


[15:18:38] chridal: has joined #ruby
[15:18:38] chridal: Changing host
[15:18:42] chridal: has joined #RubyOnRails
[15:18:46] chridal: has left #RubyOnRails: ("WeeChat 1.5-dev")
[15:19:08] chridal: has joined #RubyOnRails


[08:12:10] chridal: *.net *.split
[11:19:02] chridal: has joined #ruby
[11:19:02] chridal: has joined #RubyOnRails
[11:19:02] chridal: Changing host
[11:19:02] chridal: has joined #RubyOnRails
[11:19:02] chridal: has joined #ruby
[16:31:59] chridal: *.net *.split


[09:05:45] chridal: Can a counter cache in Rails become negative somehow or are there guards against this?
[09:16:33] chridal: Anyone have experience with counter caches becoming stale in Rails?
[09:16:49] chridal: We're really dependent on a counter cache, and I'm really afraid of it becoming stale
[09:17:22] chridal: I tried reading some of the source of AR, but I can't find all the cases where it might happen
[09:17:51] chridal: acosonic: are you setting @data = custom_values[:bobo]?
[09:19:04] chridal: acosonic: And if you do "puts @data[:bobo]" that shows the same information as puts bobo?
[09:19:47] chridal: Also, try using another name than @data to see if something else is writing to that variable
[09:20:09] chridal: I'd also suggest using to poke around


[08:20:40] chridal: People: how many connections do you keep in your PG/MySQL connection pool?
[08:21:01] chridal: Also, how have you set up your Redis connection pool?
[08:21:25] chridal: Also, good morning o/
[08:25:48] chridal: tbuehlmann: what does .to_sql output?
[08:26:08] chridal: Ah, syntax error?
[08:27:30] chridal: tbuehlmann: Yea, tough one. The theoretical max is 5k+ but I don't know the actual one since I'd have to calculate that by dividing a constant by the amount of memory
[08:28:34] chridal: As for workers we're using Resque, so that means processes. Each server (which now has a pool of 5) each have one worker, but we should probably increase the number of workers
[08:29:12] chridal: tbuehlmann: My source right now is a StackOverflow, so this person might be incorrect then


[16:52:37] chridal: Anyone using the Alpine Ruby docker image in prod?


[07:38:46] chridal: Has there been any indication when Ruby 3 might be coming out?
[07:47:55] chridal: Right. They always release at Christmas. Cheers.


[10:46:35] chridal: Yes, indeed.
[10:46:56] chridal: Caerus: I thought ActionCable uses Redis?
[10:47:34] chridal: also, I'm unsure if I see how actioncable would solve this
[10:47:45] chridal: I don't really need the client to tell me whether he has viewed a resource since that GET really is enough
[10:48:00] chridal: Come to think about it I could probably do this with NGINX as well
[10:48:16] chridal: Too bad KONG uses Cassandra or I'd pull that right in.
[10:48:55] chridal: rvanlieshout: Give what a spin? Hitting Redis an extra time for every single GET?
[10:49:08] chridal: vs. writing to a local cache?
[10:49:33] chridal: To be honest I totally am pre-optimizing here...
[10:49:44] chridal: So probably I should just do that untill it becomes a real issue.
[11:59:11] chridal: rvanlieshout: But! We have one counter that is to be incremented every time someone views an image. This means that if we do this syncronously with 5 separate servers and they all try to do an atomic write at the same time they will be stuck waiting for eachother freezing the entire main thread?
[11:59:16] chridal: of all the 5 servers
[12:00:25] chridal: No, I meant what you was referring to. I just wasn't being entirely practical I guess.