« Back to channel list

#RubyOnRails - 31 May 2018

« Back 1 day Forward 1 day »
[00:02:09] Technodrome: has joined #RubyOnRails
[00:04:07] rfoust: has joined #RubyOnRails
[00:08:52] SteenJobs: has joined #RubyOnRails
[00:12:16] lxsameer: has joined #RubyOnRails
[00:16:39] cagomez: has joined #RubyOnRails
[00:25:38] orbyt_: has joined #RubyOnRails
[00:34:16] orbyt_: has joined #RubyOnRails
[00:42:46] Technodrome: has joined #RubyOnRails
[00:51:55] dviola: has joined #RubyOnRails
[00:52:05] lxsameer: has joined #RubyOnRails
[01:02:02] lxsameer: has joined #RubyOnRails
[01:11:24] cagomez: has joined #RubyOnRails
[01:11:54] sevenseacat: has joined #RubyOnRails
[01:12:03] lxsameer: has joined #RubyOnRails
[01:22:13] lxsameer: has joined #RubyOnRails
[01:36:19] Jameser: has joined #RubyOnRails
[01:43:58] johndunn: has left #RubyOnRails: ()
[01:48:11] Dimik: has joined #RubyOnRails
[01:56:20] veloutin: has joined #RubyOnRails
[01:58:35] MrCrackPotBuilde: has joined #RubyOnRails
[02:13:46] alfiemax: has joined #RubyOnRails
[02:17:41] hammer065: has joined #RubyOnRails
[02:20:54] quazimodo: has joined #RubyOnRails
[02:24:07] Technodrome: has joined #RubyOnRails
[02:35:58] weaksauce: has joined #RubyOnRails
[02:36:51] lxsameer: has joined #RubyOnRails
[02:39:57] alfiemax: has joined #RubyOnRails
[02:47:11] lxsameer: has joined #RubyOnRails
[02:52:31] Technodrome: has joined #RubyOnRails
[03:17:32] braincrash: has joined #RubyOnRails
[03:25:02] wethu: has joined #RubyOnRails
[03:29:40] cagomez: has joined #RubyOnRails
[03:48:49] wethu: has joined #RubyOnRails
[03:58:11] lxsameer: has joined #RubyOnRails
[04:02:42] tdy: has joined #RubyOnRails
[04:03:18] kapil___: has joined #RubyOnRails
[04:07:01] lxsameer: has joined #RubyOnRails
[04:14:38] Technodrome: has joined #RubyOnRails
[04:22:29] dviola: has joined #RubyOnRails
[04:25:22] vedu_: has joined #RubyOnRails
[04:26:59] Ryzokuken: has joined #RubyOnRails
[04:34:06] jackhum: has joined #RubyOnRails
[04:35:22] catbusters: has joined #RubyOnRails
[04:51:53] lxsameer: has joined #RubyOnRails
[04:52:27] reber: has joined #RubyOnRails
[04:54:27] conta: has joined #RubyOnRails
[04:55:46] psychoslave_: has joined #RubyOnRails
[05:08:32] conta: has joined #RubyOnRails
[05:09:34] alfiemax: has joined #RubyOnRails
[05:14:53] bga57: has joined #RubyOnRails
[05:16:27] eckhardt: has joined #RubyOnRails
[05:19:55] conta: has joined #RubyOnRails
[05:31:57] lxsameer: has joined #RubyOnRails
[05:40:12] duderonomy: has joined #RubyOnRails
[05:42:47] jackhum: has joined #RubyOnRails
[06:12:01] lxsameer: has joined #RubyOnRails
[06:14:52] egray: has joined #RubyOnRails
[06:56:53] lxsameer: has joined #RubyOnRails
[06:59:25] csk157: has joined #RubyOnRails
[07:06:18] chalmagean: has joined #RubyOnRails
[07:08:22] conta: has joined #RubyOnRails
[07:27:02] srinidhi: has joined #RubyOnRails
[07:36:54] lxsameer: has joined #RubyOnRails
[07:40:00] dminuoso: has joined #RubyOnRails
[07:40:04] dminuoso: Hi. How do I even...
[07:41:46] dminuoso: Exceptions for control flow are wonderful,.
[07:41:48] dminuoso: Screw Ruby.
[07:45:57] ellcs: has joined #RubyOnRails
[07:47:28] tbuehlmann: yeah, screw it!
[07:47:33] HappyHotDog: has joined #RubyOnRails
[07:47:59] dminuoso: tbuehlmann: honestly
[07:48:02] dminuoso: https://gist.github.com/dminuoso/d054872bdba82dba9f5db77377cc0297
[07:48:10] sung: has joined #RubyOnRails
[07:48:18] dminuoso: exceptions are a wonderful for control flow
[07:49:18] dminuoso: I just dont know how to express this in a concise manner without an exception
[07:49:29] dminuoso: Or stupid repitition
[07:49:29] xhoy: return false?
[07:49:54] dminuoso: xhoy: but what about the error message
[07:50:07] dminuoso: if you go down that road that ends up doing horrible golang style error handling
[07:50:13] dminuoso: where consumers have to probe and check for error conditions
[07:50:18] dminuoso: its stupid and sucks
[07:50:23] xhoy: dminuoso: http://api.rubyonrails.org/classes/ActiveModel/Errors.html
[07:50:26] dminuoso: because its an honor based contract
[07:50:40] dminuoso: xhoy: my problems are not model related.
[07:50:42] dminuoso: they are processing related.
[07:50:50] dminuoso: I have no model to stuff things into
[07:51:08] xhoy: trailblazer?
[07:51:22] dminuoso: xhoy: Im using cells at least, but no
[07:51:34] dminuoso: contrary to popular belief, not every action you have must represent some CRUD action on a model
[07:51:46] xhoy: yes i know the issue :)
[07:52:06] xhoy: we have the same thing and it gets messy with callbacks and controller stuff etc etc etc
[07:52:07] dminuoso: but exceptions fit the problem domain best
[07:52:45] xhoy: well if you find a fix i am open for it!
[07:52:52] dminuoso: exceptions are the fix.
[07:52:56] xhoy: how does java do that?
[07:53:12] dminuoso: Id encode it the same way in Java.
[07:53:56] dminuoso: but I dont do java so
[08:08:41] tbuehlmann: so you're both redirecting and rendering a cell in case of ActionError?
[08:13:01] lxsameer: has joined #RubyOnRails
[08:14:58] agent_white: has joined #RubyOnRails
[08:15:13] dminuoso: tbuehlmann: if everything works fine, redirect to somewhere else.
[08:15:19] mikecmpbll: has joined #RubyOnRails
[08:15:26] dminuoso: if you get an error, effectively re-render the same form
[08:16:00] tbuehlmann: what about having a method instead of using raise, like `return error_out('deal with it')`? also, couldn't you introduce some kind of object that does your action stuff and return a result on which you can act?
[08:17:01] dminuoso: tbuehlmann: That would be an Either. ;)))
[08:17:14] dminuoso: But the `return error_out('deal with it')` could work
[08:17:25] tbuehlmann: (or left, heh, get it?)
[08:17:45] dminuoso: tbuehlmann: Just funny.
[08:24:13] ur5us: has joined #RubyOnRails
[08:28:33] Terens: has joined #RubyOnRails
[08:28:40] Terens: I am facing a strange issue
[08:31:19] Terens: I have implemented 2FA and in production if you go back and then login as another user 2fa is skipped. But running exact same thing on development machine or staging server even in production mode I cant reproduce
[08:32:18] agent_white: has joined #RubyOnRails
[08:35:03] dminuoso: terens: Also without knowing how your 2FA implementation works, I dont know what help you expect from us.
[08:39:14] Terens: maybe a strategy to find what is going on
[08:40:30] dminuoso: terens: hard to say without knowing anything about how you implement 2FA
[08:41:39] sevenseacat: how would you debug other problems?
[08:42:28] andywww: has joined #RubyOnRails
[08:45:10] NL3limin4t0r: has joined #RubyOnRails
[08:47:49] dminuoso: Debugging heisenbugs is generally hard and requires a mixture of banging your head against the wall, staring at your code, proving properties, increasing test coverage..
[08:48:21] dminuoso: Though in this case you can backtrack by reasoning in what cases 2FA would not trigger.
[08:50:29] Ergo: has joined #RubyOnRails
[08:51:39] dionysus69: has joined #RubyOnRails
[08:59:55] ellcs: has joined #RubyOnRails
[09:05:08] jottr: has joined #RubyOnRails
[09:07:07] lxsameer: has joined #RubyOnRails
[09:07:08] agent_white: has joined #RubyOnRails
[09:07:59] conta1: has joined #RubyOnRails
[09:08:43] mikecmpb_: has joined #RubyOnRails
[09:19:26] andywww: has left #RubyOnRails: ()
[09:33:34] conta1: has joined #RubyOnRails
[09:35:08] conta: has joined #RubyOnRails
[09:38:17] conta1: has joined #RubyOnRails
[09:55:57] roshanavand: has joined #RubyOnRails
[09:59:26] mikecmpbll: has joined #RubyOnRails
[10:03:37] reber: has joined #RubyOnRails
[10:06:35] gregf_: has joined #RubyOnRails
[10:10:18] MrCrackPotBuilde: i've been trying to add an onclick=function to either a link_to or image_tag but i cant get it to work <%=link_to (image_tag "home/termgif.gif", style: "width: 80px;height:80px;"), '#', "javascript:overlay()" %> and <%= image_tag "home/d-link2.png", style: "width: 80px;", "javascript:overlay()" %> neither work nor variations of the two i read link_to_fucntion soewhere but saying its depreciated if so how to call javascript functions on
[10:11:25] uks: has joined #RubyOnRails
[10:11:44] conta: has joined #RubyOnRails
[10:24:11] wethu: has joined #RubyOnRails
[10:24:53] dminuoso: Absolutely brilliant
[10:25:01] dminuoso: http://api.rubyonrails.org/v5.0/classes/ActionView/Helpers/AssetTagHelper.html#method-i-image_tag
[10:25:05] conta: has joined #RubyOnRails
[10:25:10] dminuoso: Cant for my life figure out what options this accepts.
[10:28:29] MrCrackPotBuilde: i looked there for help with mine but people have managed to achieve a onclick with link_to
[10:30:30] GodFather: has joined #RubyOnRails
[10:34:45] dminuoso: MrCrackPotBuilde: just use image_url and write out the markup yourself.
[10:34:56] dminuoso: MrCrackPotBuilde: I found that there's so little value in things like image_tag or link_to
[10:35:11] dminuoso: They just force you to use a shitty-to-not-at-all documented DSL
[10:35:23] dminuoso: (or image_path, depending on whatever)
[10:36:50] dminuoso: <div><img src="<%= image_path(...) %>" onclick="baz"></div>
[10:37:12] apparition: has joined #RubyOnRails
[10:46:51] Saukk: has joined #RubyOnRails
[10:48:14] conta1: has joined #RubyOnRails
[11:04:11] Psy-Q: i found out how to get those url_for helpers to work with jsonapi-rb in Rails API mode
[11:04:59] Psy-Q: @url_helpers is defined inside classes inheriting from JSONAPI::Serializable::Resource, you need to define default_url_options though, otherwise it explodes. then you can use: @url_helpers.server_account_url(@object.server.id, @object.id)
[11:05:11] KeyJoo: has joined #RubyOnRails
[11:05:50] Psy-Q: i haven't found out if and how to make it populate default_url_options itself (from e.g. the request)
[11:13:05] Psy-Q: and defining default_url_options as a method in ApplicationController totes didn't work
[11:38:46] vedu_: has joined #RubyOnRails
[11:41:41] chalmagean: MrCrackPotBuilde: have you tried using a block instead?
[11:42:23] chalmagean: https://mixandgo.com/blog/how-to-use-link_to-in-rails#using-link_to-with-a-block
[11:49:17] mikecmpbll: has joined #RubyOnRails
[11:57:51] deevil: has joined #RubyOnRails
[11:58:19] MrCrackPotBuilde: i went with dminuoso suggestion as everything i found was just way too much work when a simple a href image_tag does the job needed
[12:03:38] dminuoso: MrCrackPotBuilde: The Fairbarn threshold is the metric I program by these days.
[12:05:28] conta: has joined #RubyOnRails
[12:05:44] MrCrackPotBuilde: Refering to ronald ??
[12:06:55] ellcs: has joined #RubyOnRails
[12:09:06] mostlybadfly: has joined #RubyOnRails
[12:13:21] Puffball: has joined #RubyOnRails
[12:19:30] FernandoBasso: has joined #RubyOnRails
[12:29:16] johndunn: has joined #RubyOnRails
[12:38:14] alfiemax: has joined #RubyOnRails
[12:41:35] f3ttX]: has joined #RubyOnRails
[12:42:57] jottr: has joined #RubyOnRails
[13:07:00] Technodrome: has joined #RubyOnRails
[13:07:59] jottr: has joined #RubyOnRails
[13:10:44] bga57: has joined #RubyOnRails
[13:13:49] rfoust: has joined #RubyOnRails
[13:15:02] ams__: has joined #RubyOnRails
[13:20:19] shenghi: has joined #RubyOnRails
[13:32:42] roshanavand: has joined #RubyOnRails
[13:34:43] wethu: has joined #RubyOnRails
[13:35:41] wethu: has joined #RubyOnRails
[13:50:00] dblessing: has joined #RubyOnRails
[13:57:12] jstrong: has joined #RubyOnRails
[14:06:17] johndunn: has left #RubyOnRails: ()
[14:15:36] baash05: has joined #RubyOnRails
[14:17:25] baash05: I'm Sydney based, but I was wondering is there was a good place to find remote jobs
[14:19:36] sandstrom: has joined #RubyOnRails
[14:23:33] dminuoso: baash05: not really
[14:23:44] dminuoso: baash05: You might have more luck on perhaps the gitter channel? *shrugs*
[14:24:32] dminuoso: baash05: https://gitter.im/rails/rails?source=orgpage
[14:26:29] baash05: Humm doesn't seem like a great place.
[14:28:07] dminuoso: baash05: Its a lot more active than this place. I can just tell you from experience there's rarely if ever job postings in here
[14:31:43] Cork: where do one find Arel.sql?
[14:32:06] Cork: i expected it to be somewhere like ActiveRecord::Base::Arel or something but i can't find it
[14:33:53] dminuoso: Cork: Arel.method(:sql).owner
[14:34:26] Cork: gah... na, NOW i see what it was.. i typoed Arel... >_<
[14:34:27] Cork: thx anyway
[14:34:42] Cork: Ariel != Arel XD
[14:37:25] AnotherOne: has joined #RubyOnRails
[14:43:05] deevil: has joined #RubyOnRails
[14:50:06] Tempesta: has joined #RubyOnRails
[14:58:44] chouhoulis: has joined #RubyOnRails
[15:02:04] jstrong: has joined #RubyOnRails
[15:10:30] sandstrom: has joined #RubyOnRails
[15:11:13] DTZUZO: has joined #RubyOnRails
[15:11:46] jottr: has joined #RubyOnRails
[15:17:50] jstrong: has joined #RubyOnRails
[15:20:10] GodFather: has joined #RubyOnRails
[15:20:11] cagomez: has joined #RubyOnRails
[15:20:37] cagomez: has joined #RubyOnRails
[15:25:41] sandstrom: has joined #RubyOnRails
[15:26:47] jstrong: has joined #RubyOnRails
[15:31:52] dbugger_: has joined #RubyOnRails
[15:32:02] SteenJobs: has joined #RubyOnRails
[15:32:44] sandstrom: has joined #RubyOnRails
[15:33:00] conta1: has joined #RubyOnRails
[15:44:13] jstrong: has joined #RubyOnRails
[15:49:33] jstrong: has joined #RubyOnRails
[15:50:01] jcarl43: has joined #RubyOnRails
[16:00:21] SteenJobs: has joined #RubyOnRails
[16:07:05] BloopMonster: has joined #RubyOnRails
[16:11:43] russt: has joined #RubyOnRails
[16:13:32] dbugger_: has joined #RubyOnRails
[16:17:43] eckhardt: has joined #RubyOnRails
[16:17:44] dbugger__: has joined #RubyOnRails
[16:21:03] dbugger_: has joined #RubyOnRails
[16:23:48] GeorgesLeYeti: has joined #RubyOnRails
[16:24:24] GeorgesLeYeti: I don't really know how to express my question but i'll try
[16:26:34] GeorgesLeYeti: I have a function with lot of arguments. Most arguments has a default value for example : hello(a = 1, b ='world', c = true)
[16:27:43] GeorgesLeYeti: When i call my method how can i only set my "c" argument ?
[16:28:12] eelster: has joined #RubyOnRails
[16:28:33] NL3limin4t0r: GeorgesLeYeti: You can't, a better option is to have labeled arguments in that scenario.
[16:28:51] NL3limin4t0r: `def hello(a: 1, b: 2, c:)`
[16:29:02] NL3limin4t0r: `def hello(a: 1, b: 2, c: 3)` *
[16:29:36] NL3limin4t0r: than call the method this way: `hello(c: 5)`
[16:29:37] GeorgesLeYeti: NL3limin4t0r, Ok ty and then I guess i can make hello(c: 4)
[16:31:28] NL3limin4t0r: GeorgesLeYeti: Have a look at: http://ruby-doc.org/core-2.5.1/doc/syntax/methods_rdoc.html#label-Keyword+Arguments
[16:33:24] NL3limin4t0r: The "normal" way uses the argument positions, this means all arguments before the argument you'd like to provide have to be present.
[16:35:10] havenwood: GeorgesLeYeti: Keyword arguments are great. Use more of those!
[16:35:48] havenwood: GeorgesLeYeti: It's often preferable to couple by name rather than position.
[16:38:22] havenwood: Give us --options not arguments, kwargs not args!
[16:39:20] GeorgesLeYeti: Ty a lot for the link and your answers
[16:40:55] havenwood: Even Structs have keyword arguments now: Point = Struct.new :x, :y, keyword_init: true; Point.new y: 2, x: 1 #=> #<struct Point x=1, y=2>
[16:42:29] BloopMonster: Ohhh, I didn't know structs had it too. That's awesome
[16:46:20] BloopMonster: For those that use AWS OpsWorks, are you using Ruby 2.5? Our shop is just now able to upgrade to Ruby 2.3 due to some limitations... I'd have to ask our devops people for a refresher, but I think it's some issue with AWS not supporting 2.4+ yet
[16:46:49] BloopMonster: We're using Chef 10's built-in recipes, so that might be where the issue lies.
[16:49:28] dbugger_: has joined #RubyOnRails
[16:50:21] eckhardt: has joined #RubyOnRails
[16:54:43] fmcgeough: has joined #RubyOnRails
[17:04:54] jscheel: has joined #RubyOnRails
[17:07:01] eckhardt: has joined #RubyOnRails
[17:12:21] chalmagean: has joined #RubyOnRails
[17:13:21] Cache_Money: has joined #RubyOnRails
[17:13:53] sagax: has joined #RubyOnRails
[17:17:00] dviola: has joined #RubyOnRails
[17:18:11] Saukk: has joined #RubyOnRails
[17:24:14] kapil___: has joined #RubyOnRails
[17:27:30] orbyt_: has joined #RubyOnRails
[17:32:40] za1b1tsu: has joined #RubyOnRails
[17:39:01] l1meon: has joined #RubyOnRails
[17:46:18] coolblade: has joined #RubyOnRails
[17:47:33] coolblade: I am interviewing a candidate for a senior RoR role, what are some good interview questions/techniques please?
[17:48:52] coolblade: (Purposely avoiding google since candidate will probably have prepared that way)
[17:49:00] BloopMonster: coolblade: I've always found answers to this one interesting: "When would you use Sinatra rather than Rails?" Seems to help getting an idea for how well they know plain old Ruby
[17:49:18] coolblade: BloopMonster: excellent, thank you
[17:49:35] fryguy: why are you trying to avoid prepared interviewees?
[17:50:06] coolblade: Trying to avoid asking questions where the candidate will give me a boilerplate response without having thought through the problem himself/herself.
[17:51:01] coolblade: I do want to ask questions that someone with a few years of ruby should know.
[17:51:12] fryguy: that's up to you to determine whether it's a boilerplate response or if they actually understand it or not
[17:51:22] fryguy: by asking reasonable follow-up questions
[17:51:42] coolblade: I agree with that fryguy
[17:52:56] coolblade: I am definitely not trying to setup the candidate to fail or anything, just want to ask the experts what has worked and what hasn’t worked to make the interview an overall better experience.
[17:55:25] cagomez: has joined #RubyOnRails
[17:57:19] mtkd: has joined #RubyOnRails
[17:58:15] Technodrome: has joined #RubyOnRails
[17:58:56] l1meon: Hello all. Have someone implemented vuejs with webpack, if yes, how do I correctly send an array of objects to vue component. I can show the code that I have if needed.
[18:00:31] orbyt_: has joined #RubyOnRails
[18:01:30] regedit: has joined #RubyOnRails
[18:04:08] regedit: where do i put a misc/util method that i need to call from various different places in the codebase?
[18:04:48] regedit: in this case: several different Sidekiq workers need to clean up & fix some CSV files before being able to do with them whatever each worker processes
[18:06:27] SteenJobs: has joined #RubyOnRails
[18:10:26] fryguy: 2 options are app/services and lib/ depending on the specific nature of the code
[18:12:16] regedit: these workers do some long running spreadsheet data processing
[18:12:53] regedit: at the beginning of these workers they need to open spreadsheet files of course. Using the 'roo' gem, sometimes it's a xls file, xlsx, csv
[18:13:43] regedit: CSVs are a pain because they often come malformed, including various bad characters, and other problems needing cleaning - otherwise they dont open with roo...
[18:15:43] regedit: right now i have some 10 lines of CSV cleaning code that is repeated identically in 3 distinct worker classes...
[18:17:00] cagomez: has joined #RubyOnRails
[18:17:11] regedit: since they're not really serving the MVC side of the rails app, i guess i should put such generic/utility methods under lib/ ?
[18:22:09] Axsuul: has joined #RubyOnRails
[18:29:49] sandstrom: has joined #RubyOnRails
[18:32:11] cjohnson: I have an application that lives under a path prefix behind a proxy that strips the prefix off, so requests to /api/foo are shown as /foo
[18:32:43] cagomez: has joined #RubyOnRails
[18:32:55] cjohnson: I have config.relative_url_root = '/api', but sidekiq doesn't seem to respect that, it reads from env['SCRIPT_NAME']: https://github.com/mperham/sidekiq/blob/f31ed4e699802c510ecff5a10ff77da623df2b4d/lib/sidekiq/web/helpers.rb#L165-L167
[18:33:26] cjohnson: Any clues how I can modify that variable within my app's config so sidekiq will know where it lives?
[18:33:33] Terens: has joined #RubyOnRails
[18:33:38] cjohnson: When you load sidekiq it tries to load assets at /sidekiq/foo instead of /api/sidekiq/foo
[18:37:23] Terens: is there a reason he calls dynamic actions? https://medium.com/@chrisveleris/dynamic-actions-in-ruby-on-rails-to-dry-and-automate-bc8c88e7cc51
[18:37:50] Terens: I don't get why he just doesnt call the method with the parameter
[18:39:29] cjohnson: terens: described in the first paragraph IMO
[18:40:24] Terens: yes but it is a parameter
[18:40:56] srinidhi: has joined #RubyOnRails
[18:51:50] dblessing: has joined #RubyOnRails
[18:56:06] psychoslave_: has joined #RubyOnRails
[19:00:35] syndikate: If I assign an ENV variable in a before block in a rspec test, does it pollute the whole test session or will it be available only for the specific spec file?
[19:03:08] BloopMonster: syndikate: The ENV setting will only exist within the describe block you put it in
[19:04:31] dminuoso: BloopMonster: I doubt that
[19:04:55] dminuoso: But you could stub ENV
[19:05:19] syndikate: I was wondering if I should add an after block and remove it. I only need it in two spec files. Thought I will add it in manually
[19:06:04] BloopMonster: dminuoso: No? I guess environment variables are global in nature. It could exist for all tests after the first one sets it. That behavior is is different from every other before { ... } stuff I've seen before
[19:06:34] cagomez: has joined #RubyOnRails
[19:06:40] BloopMonster: Does RSpec not wipe all state between tests?
[19:07:45] Technodrome: has joined #RubyOnRails
[19:09:23] dminuoso: BloopMonster: ENV is a global const. If you type `ENV` it will refer to Object::ENV
[19:09:45] dminuoso: BloopMonster: To do that it would have to restart the entire ruby vm between each test.
[19:09:54] dminuoso: Its up to you to clean up
[19:10:53] BloopMonster: dminuoso: Right, but I would have assumed everything that RSpec and Rails doesn't need is wiped. But, I think you're probably right. I'm thinking of things like `before { model_instance }`
[19:11:41] dminuoso: BloopMonster: Well you kind of want that property. So be careful with what you do in your tests.
[19:12:00] dminuoso: If you touch code that mutates globally accessible state, then that could have some weird effects on further tests.
[19:12:46] BloopMonster: dminuoso: You're meaning the `before { ENV['key'] = 'value' }` property? I've never done that :)
[19:13:20] syndikate: Or shall I just add it in env/test.rb config itself?
[19:13:25] BloopMonster: If the tests need some environment variable, I'd probably toss it in `secrets.yml` or something
[19:13:54] BloopMonster: Or, like syndikate said, `env/test.rb` could be an option
[19:14:14] BloopMonster: I'm not sure I'd be setting in in `*_spec.rb`. That just seems wrong
[19:14:20] dminuoso: BloopMonster: No. Stub it.
[19:15:32] syndikate: What's the proper format to stub it?
[19:15:41] syndikate: Also, so adding it in config is wrong?
[19:17:58] BloopMonster: syndikate: This might help https://gist.github.com/weavenet/6171363
[19:18:50] conceivably: has joined #RubyOnRails
[19:18:59] BloopMonster: From that gist, you'd wrap it in your before like: `before { allow(ENV).to receive(:[]).with(name).and_return(value) }`
[19:19:12] syndikate: Okay, let me try that
[19:20:30] conceivably: Hi. Where can I find the documentation for the dynamic url helpers? It appears that they accept some options, but I can't find them documented anywhere :/
[19:20:42] syndikate: BloopMonster, okay it fails in one case. I am having a spec for a service. RSpec.describe QiscusSyncService do
[19:21:12] syndikate: So, when that gets initialised, it fails. It expects it to be present before that I believe
[19:21:23] syndikate: Since that service fetches it
[19:25:14] psychoslave: has joined #RubyOnRails
[19:29:24] BloopMonster: syndikate: Sorry. Stepped away for a minute. It's hard to say without seeing your tests, but maybe try putting the stub in the `it` block
[19:29:41] syndikate: I am gonna put it in env/test.rb for now
[19:32:05] tectonic: has joined #RubyOnRails
[19:35:08] mtkd: has joined #RubyOnRails
[19:41:03] fmcgeough_: has joined #RubyOnRails
[19:43:45] jscheel: has joined #RubyOnRails
[19:49:34] mostlybadfly: has joined #RubyOnRails
[20:05:49] orbyt_: has joined #RubyOnRails
[20:06:43] cagomez: has joined #RubyOnRails
[20:09:48] sandstrom: has joined #RubyOnRails
[20:13:22] za1b1tsu: has joined #RubyOnRails
[20:15:03] chalmagean: has joined #RubyOnRails
[20:16:10] eckhardt: has joined #RubyOnRails
[20:19:30] coolblade: has joined #RubyOnRails
[20:35:53] tdy: has joined #RubyOnRails
[20:37:00] sandstrom: has joined #RubyOnRails
[20:39:35] snickers: has joined #RubyOnRails
[21:00:50] FernandoBasso: has joined #RubyOnRails
[21:04:59] johndunn: has joined #RubyOnRails
[21:05:07] loincloth: has joined #RubyOnRails
[21:06:19] mikecmpbll: has joined #RubyOnRails
[21:06:35] loincloth: hi all... i'm trying to bind a click event to a Rails method: :delete link with UJS active... having no luck... any tricks or advice? i'm about ready to just give up on RESTful conventions and just use a GET endpoint and avoid UJS :\
[21:06:55] loincloth: I was under the impression I could bind to things like ajax:before but I can't get that to work. :\
[21:11:20] BrianJ: has joined #RubyOnRails
[21:12:35] BrianJ: Hi guys. Can anyone point me to a resource for rails 5 about how to use a worker to do a job while the web request is waiting and then returns with a download url for example? not sure how ppl do this in 2018..
[21:13:19] loincloth: Not sure why you would use workers if you are going to tie up the request like that.
[21:14:31] loincloth: If one is using workers, usually the idea is so that they can do work in parallel. i.e. You respond immediately and maybe update the page via AJAX when the job is complete. Or just have the job update some state that the user will discover later when they navigate somewhere relevant if that is appropriate for your case.
[21:15:28] loincloth: If you really want to do synchronous work, I would think there is an API for it, but I don't know what it is offhand.
[21:15:56] loincloth: I would imagine whatever work is being done would be wrapped up in an API you could just call directly then, though, rather than get workers involved.
[21:22:11] cnk: has joined #RubyOnRails
[21:22:24] rfoust: has joined #RubyOnRails
[21:25:42] jane_booty_doe: has joined #RubyOnRails
[21:28:35] orbyt_: has joined #RubyOnRails
[21:34:22] BrianJ: loincloth: yeah sure
[21:34:40] cagomez: if I have a hash with indifferent access, does calling .slice on it work with symbols and strings?
[21:34:44] BrianJ: loincloth: i was unsure wether people would use actioncable, ajax or whatever here in 2018..
[21:35:53] loincloth: oh i dunno... i would just survey relevant solutions and pick the most reasonable one based on context... but that's just me
[21:37:28] ur5us: has joined #RubyOnRails
[21:39:37] brendan-: has joined #RubyOnRails
[21:42:48] uks: has joined #RubyOnRails
[21:50:58] fmcgeough: has joined #RubyOnRails
[21:53:28] blackmesa: has joined #RubyOnRails
[21:56:25] jscheel: has joined #RubyOnRails
[22:06:04] eckhardt_: has joined #RubyOnRails
[22:24:46] Radar: GOOD MORNING
[22:25:24] Radar: brianj: We have a couple of ways of doing that in our app. One of them is easy: we run a background job and at the end of it will email the person who trigged the job the results of the job.
[22:26:00] Radar: brianj: the other one is harder: the job is queued in the same way, but we have to show a progress bar which means updating some record in the database intermittently while the browser makes a request every couple of seconds to an endpoint to request the latest progress bar data. Once that reaches 100, then they're redirected to the results of the job.
[22:26:05] Radar: I prefer the email part ;)
[22:26:16] BrianJ: Oh hi Radar, long fucking time no see :-)
[22:26:23] Radar: brianj: I still exist this is true
[22:27:13] BrianJ: haha, alive and kicking on irc, nice to see. Not many around from that long time ago. I think it must have been atleast 6 years :-)
[22:28:02] Radar: Yup, I'm still here. A few of the others are still, but we get a rotating roster of people here :)
[22:28:49] cschneid: has joined #RubyOnRails
[22:32:16] BrianJ: Radar: So what are you up to now? I presume your no longer working with dr nic ..but are you still in australia?
[22:32:29] Radar: Wow that was a long time ago. 2009. So 9 years!
[22:32:45] BrianJ: Time flies :-)
[22:33:01] BrianJ: I was mostly here when I was a rails noob ;-)
[22:33:15] Radar: I am still in AU. Since then I've worked for a lot of companies. Mostly as a senior Rails developer, but more recently as the "Junior Engineering Program Lead" at Culture Amp where I teach junior developers how to develop web apps using Ruby / Rails / JS / React / etc.
[22:33:25] Radar: I wrote some books: http://ryanbigg.com/books
[22:33:41] BrianJ: yeah I remember your books, the multitenant one ;-)
[22:33:54] BrianJ: where you skipped over the insanely hard parts by purpose..i remember ;-)
[22:34:09] BrianJ: on purpose*
[22:35:15] deevil: has joined #RubyOnRails
[22:35:19] BrianJ: Radar: and currently we do the emailing the result now like you mentioned, but I wanted to do the other option, just not sure which way to go :-)
[22:35:41] Radar: hahahaha you caught me
[22:35:49] quazimodo: has joined #RubyOnRails
[22:36:22] BrianJ: Radar: and the reason I remember you skipping those parts is because I was handling them. Like different views for different customers etc ;-)
[22:37:12] Radar: Oh yeah that's where it gets fun! I think you might be able to handle that by using view extensions in Rails (i.e. index.yourcustomer.html.erb, with a fallback to index.html.erb) but I haven't looked too deeply.
[22:38:46] wethu: has joined #RubyOnRails
[22:40:20] BrianJ: Radar: yeah those are the easy cases..sometimes they have different controllers and you need to keep track of which has to be linked to and not..I use exhibits a lot :-)
[23:03:18] mikecmpbll: has joined #RubyOnRails
[23:16:58] roshanavand: has joined #RubyOnRails
[23:27:36] wethu: has joined #RubyOnRails