« Back to channel list

#RubyOnRails - 27 November 2018

« Back 1 day Forward 1 day »
[00:00:02] srruby: I want to run Rails system tests on my server. Do I have to install google-chrome as well as chromedriver ?
[00:00:03] gambl0r3: has joined #RubyOnRails
[00:00:30] SteenJobs: we ran the update, and the interpreter is evaluating `0` as truthy, yet in a rails console, the property is correctly evaluated as `false`
[00:17:42] blackmesa: has joined #RubyOnRails
[00:27:27] blackmesa: has joined #RubyOnRails
[00:54:35] SteenJobs_: has joined #RubyOnRails
[01:11:00] sevenseacat: has joined #RubyOnRails
[01:15:12] kapil____: has joined #RubyOnRails
[01:22:54] orbyt_: has joined #RubyOnRails
[01:31:00] brkkyk: has joined #RubyOnRails
[01:32:34] jottr: has joined #RubyOnRails
[01:38:28] SteenJobs: has joined #RubyOnRails
[01:43:21] jottr: has joined #RubyOnRails
[02:00:38] SteenJobs: has joined #RubyOnRails
[02:03:12] Dimik: has joined #RubyOnRails
[02:38:23] tdy: has joined #RubyOnRails
[02:40:36] Saukk: has joined #RubyOnRails
[03:14:56] OrangeManBad: has joined #RubyOnRails
[03:44:20] jottr: has joined #RubyOnRails
[03:55:01] jottr: has joined #RubyOnRails
[04:09:57] braincrash: has joined #RubyOnRails
[04:24:24] Xiti: has joined #RubyOnRails
[04:51:48] sheepman: has joined #RubyOnRails
[04:59:50] sheepman: has joined #RubyOnRails
[05:07:50] sheepman: has joined #RubyOnRails
[05:10:40] Xiti: has joined #RubyOnRails
[05:17:59] lexileo: has joined #RubyOnRails
[05:21:21] sheepman: has joined #RubyOnRails
[05:21:45] Xiti: has joined #RubyOnRails
[05:21:49] uksio: has joined #RubyOnRails
[05:30:23] sheepman: has joined #RubyOnRails
[05:38:53] sheepman: has joined #RubyOnRails
[05:42:20] dtzuzu: has joined #RubyOnRails
[05:43:00] cnsvc: has joined #RubyOnRails
[05:56:01] jottr: has joined #RubyOnRails
[06:12:58] gambl0re: has joined #RubyOnRails
[06:17:54] ariedler: has joined #RubyOnRails
[06:18:08] Milos: has joined #RubyOnRails
[06:18:15] reber: has joined #RubyOnRails
[06:23:55] conta: has joined #RubyOnRails
[06:30:38] cnsvc: has joined #RubyOnRails
[07:25:54] defsdoor: has joined #RubyOnRails
[07:26:23] srinidhi: has joined #RubyOnRails
[07:34:21] buyfn: has joined #RubyOnRails
[07:56:53] jottr: has joined #RubyOnRails
[08:01:32] blackmesa: has joined #RubyOnRails
[08:07:51] jottr: has joined #RubyOnRails
[08:37:28] armyriad: has joined #RubyOnRails
[08:40:27] Exuma: has joined #RubyOnRails
[08:44:23] cnsvc: has joined #RubyOnRails
[08:45:03] Sylario: has joined #RubyOnRails
[08:55:35] mikecmpbll: has joined #RubyOnRails
[09:13:45] snowy: has joined #RubyOnRails
[09:48:20] jottr: has joined #RubyOnRails
[09:55:47] crankhar1er: has joined #RubyOnRails
[10:04:42] evexor: has joined #RubyOnRails
[10:11:15] Guest21835: has joined #RubyOnRails
[10:19:28] ariedler: has joined #RubyOnRails
[10:21:57] gavit: has joined #RubyOnRails
[10:30:57] Sylario: Ok, I already asked the question yesterday but, in AMS, is it possible to nest relation in a JSON payload instead of linking it?
[10:31:49] evexor: I hope someone who knows replies
[10:32:31] Sylario: "operations":{"data":[{"id":"5","type":"invoice/operation"}]} Is the kind of relation i Have currently
[10:33:01] Sylario: And with ember it works fine with another query on invoice/operation/:id that return operation serialized
[10:33:23] Sylario: But it is the API version of the n+1 query problem
[11:08:22] mangold: has joined #RubyOnRails
[11:34:39] lomex: has joined #RubyOnRails
[11:35:53] Dbugger: has joined #RubyOnRails
[11:36:19] lomex: has joined #RubyOnRails
[11:50:34] dviola: has joined #RubyOnRails
[11:55:07] ariedler: has joined #RubyOnRails
[12:03:39] lankanmon: has joined #RubyOnRails
[12:10:04] uks: has joined #RubyOnRails
[12:10:29] pd09041999: has joined #RubyOnRails
[12:41:52] mangold: has joined #RubyOnRails
[12:43:21] reber: has joined #RubyOnRails
[12:44:21] supergeek: has joined #RubyOnRails
[12:57:38] sheepman: has joined #RubyOnRails
[13:05:25] srinidhi: has joined #RubyOnRails
[13:05:47] mangold: has joined #RubyOnRails
[13:09:03] srinidhi: has joined #RubyOnRails
[13:14:38] Guest21835: has joined #RubyOnRails
[13:28:41] gavit_: has joined #RubyOnRails
[13:28:45] za1b1tsu: has joined #RubyOnRails
[13:44:18] Ergo: has joined #RubyOnRails
[14:04:01] lomex: has joined #RubyOnRails
[14:06:24] lankanmon: has joined #RubyOnRails
[14:10:05] eclm: has joined #RubyOnRails
[14:10:56] conta1: has joined #RubyOnRails
[14:15:41] crankhar1er: has joined #RubyOnRails
[14:37:47] sheepman: has joined #RubyOnRails
[14:37:47] lomex: has joined #RubyOnRails
[15:10:46] Jervis_: has joined #RubyOnRails
[15:11:37] lomex: has joined #RubyOnRails
[15:32:20] za1b1tsu: has joined #RubyOnRails
[15:36:06] orcus: has joined #RubyOnRails
[15:44:07] lipoqil: has joined #RubyOnRails
[15:47:28] adgtl: Folks.. how to pass current_user for controller test when we use devise?
[15:48:28] mostlybadfly: has joined #RubyOnRails
[15:50:30] Jervis_: has joined #RubyOnRails
[15:58:19] unreal: has joined #RubyOnRails
[15:58:29] glossybrown: has joined #RubyOnRails
[16:01:16] blackmesa: has joined #RubyOnRails
[16:03:14] tbuehlmann: adgtl, see: https://github.com/plataformatec/devise/wiki/How-To:-Stub-authentication-in-controller-specs
[16:08:02] lomex: has joined #RubyOnRails
[16:13:01] jaddison: has joined #RubyOnRails
[16:13:14] crankharder: has joined #RubyOnRails
[16:15:37] glossybrown: has joined #RubyOnRails
[16:22:22] agent_white: has joined #RubyOnRails
[16:23:15] lomex: has joined #RubyOnRails
[16:24:43] jaddison: has joined #RubyOnRails
[16:31:10] adgtl: tbuehlmann that's for rspect.. I am looking for plain minitest
[16:32:33] tbuehlmann: adgtl: that also works for minitest
[16:32:51] tbuehlmann: https://github.com/plataformatec/devise/blob/v4.5.0/lib/devise/test/controller_helpers.rb
[16:35:10] adgtl: that example has this
[16:35:12] adgtl: # class PostsTest < ActionController::TestCase
[16:35:13] adgtl: # include Devise::Test::ControllerHelpers
[16:35:15] adgtl: but my code has
[16:35:29] adgtl: class CatsControllerTest < ActionDispatch::IntegrationTest
[16:35:50] adgtl: see it's not ActionController::TestCase .. it's ActionDispatch::IntegrationTest
[16:36:07] tbuehlmann: have you tried it?
[16:38:30] adgtl: the class is ActionDispatch::IntegrationTest with Rails 5.1.6
[16:38:39] adgtl: not the ActionController one
[16:39:09] adgtl: so include Devise::Test::ControllerHelpers in controller test throws Error NoMethodError: undefined method `env' for nil:NilClass
[16:45:30] nixroot: has joined #RubyOnRails
[16:50:58] jaddison: has joined #RubyOnRails
[16:53:22] blackmesa: has joined #RubyOnRails
[16:53:52] conta1: has joined #RubyOnRails
[16:53:55] adgtl: tbuehlmann looks like this https://github.com/plataformatec/devise/issues/3913
[16:54:20] adgtl: but this code is not working after adding that snippet in test_helper.rb
[16:54:21] adgtl: user = users(:one)
[16:54:21] adgtl: get pads_url, as: user
[16:54:21] adgtl: assert_response :success
[16:54:42] adgtl: It redirects user to http://www.example.com/users/sign_in
[16:54:58] tbuehlmann: `as` is not for that
[16:57:24] DTZUZO: has joined #RubyOnRails
[16:57:54] tbuehlmann: ah, you intend to use that backdoor thing?
[16:59:01] adgtl: need something simple
[16:59:13] adgtl: like sign_in create(:user)
[16:59:19] adgtl: but that doesn't work either
[17:00:01] adgtl: sign_in create(:user)
[17:00:37] adgtl: basically there is no error for line sign_in ..
[17:00:43] adgtl: but I still get redirected to '<html><body>You are being <a href="http://www.example.com/users/sign_in">redirected</a>'
[17:00:49] adgtl: even before hitting action
[17:00:55] adgtl: isnt' that weird?
[17:04:44] adgtl: so.. sign_in seems not setting proper current_user
[17:10:25] Guest21835: has joined #RubyOnRails
[17:11:06] tbuehlmann: adgtl: try including Warden::Test::Helpers and running `login_as create(:user)`
[17:12:04] adgtl: thunderbirdtr same behaviour
[17:12:19] adgtl: it's getting redirected to /users/sign_in as I have before_authenticate for :index
[17:12:29] adgtl: I expect it to hit :index action and execute code in it
[17:12:51] tbuehlmann: login_as works for me ¯\_(ツ)_/¯
[17:13:05] bambanx: has joined #RubyOnRails
[17:15:16] adgtl: thunderbirdtr :|
[17:15:52] tbuehlmann: ah, there's also Devise::Test::IntegrationHelpers
[17:15:58] tbuehlmann: include that and use sign_in, works for me as well
[17:16:34] tbuehlmann: that is using Warden::Test::Helpers internally
[17:17:16] adgtl: thunderbirdtr yep.. I have included that in test_helper for class class ActionDispatch::IntegrationTest
[17:17:25] adgtl: thunderbirdtr something is wrong.. let me gist you the code
[17:17:39] jaddison: has joined #RubyOnRails
[17:18:38] adgtl: thunderbirdtr https://gist.github.com/4655478286cf10f3a02c00a6556109c3
[17:19:16] adgtl: updated gist with output
[17:21:20] tbuehlmann: looks good to me
[17:21:33] adgtl: thunderbirdtr yeah.. but output is redirecting before hitting action
[17:21:45] adgtl: not sure what's wrong.. I can't fathom
[17:22:08] tbuehlmann: what's in your controller?
[17:23:05] maryo_: has joined #RubyOnRails
[17:24:21] adgtl: thunderbirdtr updated gist with controller code
[17:25:51] tbuehlmann: are you certain you saved the pads_controller_test.rb file? just to be sure
[17:27:27] adgtl: thunderbirdtr yes.. I am using VS Code so it saves files automatically
[17:28:25] tbuehlmann: no idea then
[17:28:33] darkhanb: has joined #RubyOnRails
[17:32:10] agent_white: has joined #RubyOnRails
[17:34:55] adgtl: Devise experts.. can someone help me to fix this issue? https://gist.github.com/4655478286cf10f3a02c00a6556109c3
[17:39:35] maryo__: has joined #RubyOnRails
[17:43:15] maryo_: has joined #RubyOnRails
[17:46:56] maryo__: has joined #RubyOnRails
[17:47:12] Guest21835: has joined #RubyOnRails
[17:52:53] gambl0re: has joined #RubyOnRails
[18:05:22] maryo__: I have written a small application to upload an xlsx file from a given path and here is that code https://dpaste.de/AB6E#L28 -> . And this is what I have it in my views https://dpaste.de/HgvE But I am not sure how to provide route for the same. Any help would be appreciated.
[18:15:02] eckhardt: has joined #RubyOnRails
[18:33:21] NivenHuH: has joined #RubyOnRails
[18:43:17] quarters: something I've been puzzled about is how to improve a web app after having move from from mvp to full implementation of all features. is this stage possible where a web app is bugfree and nothing else is left to implement?
[18:43:45] tubbo: quarters: no
[18:44:59] tubbo: i should clarify...there's almost never a situation where an app is "bugfree" or in its "ideal state", but there might be situations where there is "nothing left to implement"
[18:45:02] borodin: has joined #RubyOnRails
[18:45:28] tubbo: as in, your app does all the things it needs to do
[18:46:02] quarters: like even the basic ruby on rails microblog tutorial app. what would be considered a bug there? if it received traffic that demands the addition of maybe other instances of that microblog webapp?
[18:46:08] quarters: with a load balancer
[18:46:48] quarters: or the final project in the rails tutorial by Hartl
[18:48:09] defsdoor: has joined #RubyOnRails
[18:48:57] maryo__: has joined #RubyOnRails
[18:51:32] mikecmpbll: has joined #RubyOnRails
[18:55:32] tubbo: quarters: i suppose not, but these apps are also lucky enough to not be subject to real-world use cases
[18:56:44] tubbo: for example, the original blog in 15mins tutorial by DHH didn't have a lot of features that people take for granted today
[18:57:13] andrewray_: has joined #RubyOnRails
[18:57:45] quarters: I guess I'm trying to get a high level view of what drives constant refactoring of a web app in the absence of scaling issues or introduction of new features
[18:58:01] quarters: even with desktop software development
[18:58:09] lxsameer: has joined #RubyOnRails
[18:58:14] quarters: I reckon that there's not as much activity in that space?
[18:58:17] tubbo: i see what you mean
[18:58:29] tubbo: yeah i mean, if there's no reason to change the code, why change it?
[19:00:53] jhass: has joined #RubyOnRails
[19:00:59] tubbo: i guess if you wanted to redesign the UI or something, but that's to solve bugs with the user experience right?
[19:23:27] NivenHuH: has joined #RubyOnRails
[19:28:21] defsdoor: has joined #RubyOnRails
[19:30:47] mlt-: has joined #RubyOnRails
[19:37:41] Jon30: has joined #RubyOnRails
[19:39:09] Jon30: hey guys, having issues with eager loading in 5.2 on development. I made a custom class: https://gist.github.com/slavajacobson/5032c56c037f9ea44c5c313fa6dc4700 I tried putting it inside /lib/deep-crawl.rb with "config.eager_load_paths << Rails.root.join('lib')" and also in app/lib/deep-crawl.rb
[19:39:42] Jon30: I am able to initialize the class, but whenever I make changes to the class it won't reload
[19:40:06] Jon30: so basically if i change "testing" to "testing123", it still shows "testing" when I refresh the page
[19:40:31] Jon30: in development.rb I have:
[19:40:31] Jon30: config.cache_classes = false
[19:40:31] Jon30: config.reload_classes_only_on_change = false
[19:40:52] Jon30: ruby 2.3.1 rails 5.2.1
[19:40:57] Jon30: any ideas? :<
[19:42:37] Jon30: i've also tried adding Spring.watch "lib/deep-crawl.rb" and switching to config.file_watcher = ActiveSupport::FileUpdateChecker
[19:55:26] tubbo: Jon30: rails might be expecting that constant to be in `lib/report_services/deep_crawl.rb` based on the name of the class
[19:58:45] glossybrown: has joined #RubyOnRails
[20:00:23] Jon30: ok that worked... thx
[20:00:46] Jon30: didn't realize it compared the filenames to modules/classes :D
[20:02:32] NivenHuH: has joined #RubyOnRails
[20:11:57] tectonic: has joined #RubyOnRails
[20:14:50] quazimodo: has joined #RubyOnRails
[20:18:37] Exuma: has joined #RubyOnRails
[20:29:36] Fernando-Basso: has joined #RubyOnRails
[20:52:48] snowy: has joined #RubyOnRails
[21:03:11] dviola: has joined #RubyOnRails
[21:19:27] Exuma: has joined #RubyOnRails
[21:23:43] Voxxit: has joined #RubyOnRails
[21:25:19] jaddison: has joined #RubyOnRails
[21:32:46] FLeiXiuS: has joined #RubyOnRails
[21:36:40] timdotrb: has joined #RubyOnRails
[21:36:48] timdotrb: Afternoon, all
[21:37:48] timdotrb: With Resque, is there a way to stop working on a job, and have that worker continue to the next one? One of my workers appears to be stuck
[21:38:40] TheNet: won't it time out?
[21:48:32] darkhanb: has joined #RubyOnRails
[21:53:34] darkhanb: has joined #RubyOnRails
[21:53:49] gavit_: has joined #RubyOnRails
[21:56:46] darkhanb: has joined #RubyOnRails
[21:58:19] gavit_: I included jquery-rails in my gem file, and it seems to have installed 4.3.3, but I keep getting couldn't find file 'jquery'
[21:58:53] gavit_: is there soemthing obvious I'm missing?
[22:00:43] andrewray_: has joined #RubyOnRails
[22:00:48] andrewray_: if u were gonna add a core api layer to rails (lol) where would you put the root API namespace in folder structure
[22:01:06] andrewray_: not an OO "services" pattern thing
[22:09:50] cnsvc: has joined #RubyOnRails
[22:16:37] cnsvc: has joined #RubyOnRails
[22:19:28] gavit: guess I had to restart the webserver
[22:25:39] NivenHuH: has joined #RubyOnRails
[22:31:15] tubbo: andrewray_: what does that mean
[22:31:30] mangold: has joined #RubyOnRails
[22:31:33] tubbo: andrewray_: you talking like... app/presenters, app/flagooglebits, etc
[22:36:33] Exuma: has joined #RubyOnRails
[22:37:38] andrewray_: tubbo: no, like API::Domain.do_thing(some_model)
[22:38:42] tubbo: andrewray_: probably `app/services/api/domain.rb` or maybe `app/integrations/api/domain.rb`
[22:42:30] andrewray_: I don't think these are services nor integrations
[22:46:39] tubbo: andrewray_: what are they to you?
[22:46:52] tubbo: anything in app/**/* is valid, so it kinda depends on what makes the most sense for your app
[22:46:58] tubbo: there's no "prescribed folder names" or anything
[22:49:22] tubbo: or you could always use `lib`
[22:54:16] andrewray_: I think app/api makes most
[22:54:38] andrewray_: lib seems like defining modules the api would consume
[22:55:35] andrewray_: they're a nicely defined api so rails garbage only has minimal ability to touch core business concerns
[22:56:12] andrewray_: i'm sure i'm jinxing myself by saying "nicely"
[22:56:25] andrewray_: but as long as it's not rails
[23:07:29] Puffball: has joined #RubyOnRails
[23:19:51] Dimik: has joined #RubyOnRails
[23:20:05] jaddison: has joined #RubyOnRails
[23:23:55] kapil____: has joined #RubyOnRails
[23:26:26] Radar: GOOD MORNING
[23:26:40] quazimodo: has joined #RubyOnRails
[23:42:33] NivenHuH: has joined #RubyOnRails