#RubyOnRails - 30 April 2017
« Back 1 day Forward 1 day »
[02:12:34] jon31: how come to_json is so slow?? even oj is not that fast... 20ms to convert an array of 800 hashes
[02:17:19] adambecker: Jon, it's possible that due to lazy loading, the query is not executing in your controller
[03:35:18] Aytan72: Jon31: .includes eager loads the associated records, thus taking more time and memory
[03:37:41] fschuindt: Almost 4 days with no solution: http://stackoverflow.com/questions/43647833/how-to-use-markdown-at-rubydoc-info Any help, folks?
[03:40:30] Aytan72: Jon31: Is it loading a lot of data? It attempts to retrieve the associated record for each parent (600 times), so I would expect that to cause some additional query time.
[03:41:34] jon31: ugh.. i just can't have almost 2 seconds of response time... there must be some way to improve it
[03:43:47] jon31: SQL query takes 50 seconds in total.. but then Rails does its thing to preload all the records for almost 2 seconds.. it doesn't seem right? or is it normal?
[11:39:07] xco: using the new Rails 5.1 how do i start the angular server to view the “hello” message?
[14:42:08] cucho: Hello. Please can you help me with a newbie question? The folder test/helpers is to "test the helpers" or "helpers for tests"?
[14:56:29] tbuehlmann: cucho: "The helpers, mailers, and models directories are meant to hold tests for view helpers, mailers, and models, respectively."
[15:47:51] op84: hey there - what do you guys use for process monitoring? god, bluepill, eye? anything better around?
[16:09:40] yoones: Hi. I'm trying to monkey patch a method provided by a gem (-> replace the behavior of decent_exposure's decorate method). The problem is that when I create lib/decent_exposure/behavior.rb and put just the new method, rails loads only this file and not the original one first, so I end up with all the other module's methods missing. How can I fix this?
[16:57:01] syndikate: Hehe yeah, I figured. I saw it being used everywhere but all the tutorials told to install it seperately. Got me confused.
[16:58:08] syndikate: dminuoso, how should I be versioning my apis? I read about it quite a lot and people prefer different methods. Having namespace in route file is enough or should I have folder structure and modules for the api versions?
[17:04:07] dminuoso: syndikate: Personally I just use a namespace route, because there's no advantage in infesting all my files with that namespace, it's just noise.
[17:07:47] syndikate: I see most of the projects around me having app/controllers/api/v1/..._controller.rb
[17:46:14] syndikate: I am trying to create a controller without model for my api, to test some things - is this a good practice?
[18:54:18] diggitydane: I'm trying to build AR relation from a hash. How do you create a lamba/proc and add it to a scope?
[21:19:08] hnanon_: However, I'm getting the error message "NameError (undefined local variable or method `errors' for #<Class:0x007fb904d56000>):"
[21:20:46] hnanon_: Presumably, this is because I can't do errors.add :base in a class method (self.create_stripe_customer).
[21:23:21] hnanon_: My goal is to add the exception error message to base and display it to the user.
[21:41:51] gabeodess: hey all, I’m having a hell of a time getting ruby 2.4.1 working with RVM. Here’s what I tried: https://gist.github.com/gabeodess/4b410afe2c159b42a55666557b472062
[22:23:55] Radar: Turns out that you spend less time fighting with RVM if it isn't actually installed