« Back to channel list

#RubyOnRails - 30 August 2018

« Back 1 day Forward 1 day »
[00:00:01] massover: let me check my version
[00:00:28] massover: let me try downgrading to 1.4.0
[00:00:29] pipework: I used active admin earlier this year with latent rails. I'll check on rails_admin
[00:00:59] pipework: https://github.com/sferik/rails_admin/issues/3060
[00:01:10] massover: and in an attempt to teach, what does 'modifying frozen values' mean to me, in the scope of ruby or rails
[00:01:21] pipework: try dropping to 1.3 until it's fixed.
[00:01:35] massover: my google foo has failed me
[00:01:50] pipework: massover: When you mark an object as frozen, the values the object points to cannot be changed, the references can't be updated to new objects.
[00:03:04] massover: when would you do that? and could you perhaps link to an example line of code in an open source github repo?
[00:03:10] pipework: Ruby is pass by reference, so if you try to take an array `%w|hello my|.freeze` and modify the array object itself by modifying it rather than the string objects inside it, you will get an error. The strings won't be frozen but the object inside is.
[00:03:50] pipework: massover: Something that never changes is known not to change which means not only runtime protections but also optimizations.
[00:04:23] pipework: Here's a few concrete reasons, http://blog.honeybadger.io/when-to-use-freeze-and-frozen-in-ruby/
[00:04:53] massover: appreciate it!
[00:05:59] pipework: the second inside was meant to be an outside, I'm a little delerious atm but if I've fudged I'm sure someone will tell you how it really do
[00:06:07] LiftLeft: has joined #RubyOnRails
[00:30:42] matcouto: has joined #RubyOnRails
[00:41:28] jasmith: has joined #RubyOnRails
[01:19:25] sevenseacat: has joined #RubyOnRails
[01:20:11] darkhanb: has joined #RubyOnRails
[02:03:48] lessless_: has joined #RubyOnRails
[02:08:55] DTZUZO: has joined #RubyOnRails
[02:11:58] matcouto: has joined #RubyOnRails
[02:25:28] Saukk: has joined #RubyOnRails
[02:40:34] beingjohnm: has joined #RubyOnRails
[03:13:26] braincrash: has joined #RubyOnRails
[03:26:48] Mutsuhito: has joined #RubyOnRails
[03:33:02] LambdaSource: has joined #RubyOnRails
[03:55:54] syndikate: Is module or class preferred for creating namespaces models?
[04:01:47] baweaver: syndikate: Module
[04:02:15] syndikate: Alright thanks baweaver, anywhere I can read why that's preferred?
[04:02:33] baweaver: A class is an object that contains something
[04:02:55] baweaver: A module is a namespace, interface, and a few other things really.
[04:06:59] pipework: syndikate: Both are usable, however you only namespace within a class when the class is more appropriate in the first place.
[04:07:51] syndikate: Oh okay, yeah here its' just purely namespacing purpose with not much functionality of it's own, rather than define a self.table_name_prefix
[04:08:12] pipework: syndikate: For example, I may namespace within a class object (assigned to a constant or not) using private constants.
[04:12:44] syndikate: pipework, can you explain that with a gist pleasE?
[04:13:25] eckhardt: has joined #RubyOnRails
[04:13:49] pipework: syndikate: https://stackoverflow.com/a/11885328
[04:14:33] syndikate: Oh, okay TIL thanks pipework
[04:16:39] Technodrome: has joined #RubyOnRails
[04:38:33] syndikate: baweaver, pipework another thing though - I have a table_name_prefix for the intended tables (obviously), so as per Rails 5 convention is it okay to create a module and declare a self.table_name_prefix method in it?
[04:38:50] pipework: syndikate: I don't think that works, but...
[04:38:52] helpa: Why don't you try it and find out for yourself?
[04:39:01] baweaver: Wait, what now?
[04:39:27] syndikate: I tried, it works. I wanted to know if it's a preferred approach to have such a method in module
[04:39:45] baweaver: ACTION reads back over conversation
[04:40:05] baweaver: What exactly are you trying to do here?
[04:41:32] pipework: syndikate: Huh, I would actually imagine it wants a class to call .new on, TIL. That's amusing. I don't know that I'd do it unless there was some compelling reason to. You might confuse some people.
[04:48:04] nashant: https://gist.github.com/nashant/8a7e4e1dfc290561f9c6f04923ed24d1 Hey all. I'm pulling my hair out over how to get this working. I've got a guest_events table with id, guest_id, event_id and response. I have a multiple select in a form which I want to take response as the selected value. Currently if I deselect events then they get deleted, I want it to set response false instead. The gist is a very much simplified version of wh
[04:51:07] syndikate: baweaver, pipework This is the kind of simplified setup I have now - https://hastebin.com/osixisafuk.rb
[04:52:25] syndikate: There is no table for library as such but book and division
[04:53:25] pipework: nashant: look up how the dependent key works in associations, I believe.
[04:55:02] dblessing: has joined #RubyOnRails
[04:57:22] syndikate: Sorry if any confusions were caused, I thank you guys' help. Just wanted to understand if I have any convention to follow
[05:05:09] lessless_: has joined #RubyOnRails
[05:09:17] nashant: pipework: I'm looking but I'm not sure how that helps. I think what I need is to either pass through ALL the select options with the selected/not value, or override the method that is used to update the guest_events to set response=false rather than delete
[05:11:22] Technodrome: has joined #RubyOnRails
[05:16:48] orbyt_: has joined #RubyOnRails
[05:17:23] lessless_: has joined #RubyOnRails
[05:28:44] apeiros: has joined #RubyOnRails
[05:35:15] KeyJoo: has joined #RubyOnRails
[05:36:08] reber: has joined #RubyOnRails
[05:41:06] srinidhi: has joined #RubyOnRails
[05:48:02] Aherin: has joined #RubyOnRails
[05:51:23] srinidhi: has joined #RubyOnRails
[05:56:02] LiftLeft: has joined #RubyOnRails
[06:04:42] apeiros: has joined #RubyOnRails
[06:07:16] LiftLeft: has joined #RubyOnRails
[06:11:22] sandstrom: has joined #RubyOnRails
[06:12:40] apeiros: has joined #RubyOnRails
[06:13:25] nemesit: has joined #RubyOnRails
[06:17:28] s2013: has joined #RubyOnRails
[06:23:53] snickers: has joined #RubyOnRails
[06:33:20] srinidhi: has joined #RubyOnRails
[06:36:26] Andr3as: anyone ever had this issue with rails and js? https://stackoverflow.com/questions/52000505/rails-render-as-js-toggle-modal-unrecognized-expression
[06:37:26] Radar: good morning
[06:37:52] Radar: That's a lot of code.
[06:38:30] Andr3as: i've tried to boil it down to the minimum without losing infos..
[06:38:38] sevenseacat: thats a lot of moving parts
[06:39:51] Andr3as: well, at the end of the day it sends this $('#mainModal').modal('toggle'); in the update.js.erb and chrome argues Uncaught Error: Syntax error, unrecognized expression:
[06:40:18] Andr3as: and i dont know why.. i can execute the same thing from the console and it does work just fine
[06:43:59] rootsudo: has joined #RubyOnRails
[06:44:00] sevenseacat: its hard to diagnose when you've posted a syntax error but you say other code in the file (which you've left out?) works
[06:44:07] sevenseacat: thats not how js works
[06:44:51] Andr3as: no, i say the exact same code which does not work from within update.js.erb work when i post it into the console
[06:45:03] sevenseacat: > however - it does actually do what its supposed to do, it closes the modal and does the other stuff (updating the row, showing the flash message) which isnt included in the js.erb file for clearity's sake...
[06:45:37] Andr3as: i wanted to make it easier to read.. and omited the rest of the code which also works
[06:45:57] Andr3as: "from the console
[06:46:04] sevenseacat: where is this other code that works located? in the update.js.erb file? before/after that modal line?
[06:46:40] Andr3as: and it also works from within the update.js.erb but it still throws that error and after the error, chrome wont deal with js anymore (as expected, unfortunately)..
[06:48:51] Andr3as: i've updated the post with the complete update.js.erb
[06:49:05] Andr3as: though its not that it adds any more value, actually..(?)
[06:49:50] Andr3as: coz it does not work with that modal toggle alone as well
[06:49:51] sevenseacat: well it does, given you've got dodgy syntax before that lin
[06:50:35] Andr3as: well, when it doesnt work with the toggle alone..(?) how could it matter how my final js.erb looks like?
[06:51:16] sevenseacat: if you want to keep arguing when I'm trying to help, good luck
[06:52:14] za1b1tsu_: has joined #RubyOnRails
[06:53:21] Andr3as: what shall i say to this... i just want to clearify that the whole thing does not work with the toggle alone.. to keep things simple.. you guys argue its too much code but ask for more.. anyway.. its ok.. i look somewhere else
[06:53:30] Andr3as: thanks for taking a look
[06:56:20] lessless_: has joined #RubyOnRails
[06:56:45] sevenseacat: what does the update.js.erb file that gets sent to the browser look like? after ERB processing
[06:58:25] Andr3as: $("#mainModal").modal("toggle");
[07:00:20] nemesit: has joined #RubyOnRails
[07:00:50] Andr3as: dev tools network tab looking like this https://www.screencast.com/t/Mf79ZSiiKuAX
[07:01:14] sandstrom: has joined #RubyOnRails
[07:02:11] sevenseacat: sounds like you've found a massive bug in rails, if all the other code in your update.js.erb file just disappears.
[07:02:23] Andr3as: no, i removed it
[07:02:30] Andr3as: to only have the toggle in it
[07:03:05] Andr3as: why overvcomplicate things when the easy stuff isnt working either
[07:03:16] Puffball: has joined #RubyOnRails
[07:03:28] sevenseacat: one could ask why you're overcomplicating stuff indeed
[07:04:02] sevenseacat: humor me and delete and retype that line in your update.js.erb.
[07:05:47] Andr3as: i did that a thousand times... after that i took it out of the js.erb file, pasted it into the chrome console and it closes the modal without an issue
[07:06:00] Andr3as: no error message whatsoever
[07:09:49] Andr3as: see https://www.screencast.com/t/hZiXllnF
[07:09:55] Andr3as: i made a little video
[07:12:22] Andr3as: fwiw, the error in the rubymine server console is an old one.. i scrolled up earlier and it doesnt scroll down automatically
[07:27:27] sandstrom: has joined #RubyOnRails
[07:28:57] blackmesa: has joined #RubyOnRails
[07:31:59] Dbugger: has joined #RubyOnRails
[07:34:34] cabotto: has joined #RubyOnRails
[07:39:21] cabotto: has joined #RubyOnRails
[07:56:26] KevinSjoberg: has joined #RubyOnRails
[07:58:30] bijan_: has joined #RubyOnRails
[07:58:45] lexileo: has joined #RubyOnRails
[08:04:08] mikecmpbll: has joined #RubyOnRails
[08:04:19] Sylario: has joined #RubyOnRails
[08:10:34] Sylario: has joined #RubyOnRails
[08:24:18] bijan__: has joined #RubyOnRails
[08:25:45] cabotto: has joined #RubyOnRails
[08:27:30] lxsameer: has joined #RubyOnRails
[08:34:35] cabotto: has joined #RubyOnRails
[08:35:10] bijan_: has joined #RubyOnRails
[08:36:45] Ergo: has joined #RubyOnRails
[08:42:16] Andr3as: i tried a console.log("Hello"); https://www.screencast.com/t/QENqhKsUGB
[08:46:45] bijan_: has joined #RubyOnRails
[08:48:46] cesario: has joined #RubyOnRails
[08:52:36] Puffball: has joined #RubyOnRails
[08:57:45] bijan_: has joined #RubyOnRails
[09:03:11] rootsudo: has joined #RubyOnRails
[09:14:14] Aherin_: has joined #RubyOnRails
[09:14:27] dionysus69: has joined #RubyOnRails
[09:38:02] bijan_: has joined #RubyOnRails
[09:48:57] bijan_: has joined #RubyOnRails
[09:49:30] lessless_: has joined #RubyOnRails
[09:51:09] LambdaSource: has joined #RubyOnRails
[09:59:16] cabotto: has joined #RubyOnRails
[10:00:22] bijan_: has joined #RubyOnRails
[10:11:55] bijan_: has joined #RubyOnRails
[10:14:55] cabotto: has joined #RubyOnRails
[10:16:39] kapil___: has joined #RubyOnRails
[10:22:59] bijan_: has joined #RubyOnRails
[10:34:32] bijan_: has joined #RubyOnRails
[10:41:05] lankanmon: has joined #RubyOnRails
[10:46:50] bijan_: has joined #RubyOnRails
[10:49:01] cabotto: has joined #RubyOnRails
[10:51:25] bijan_: has joined #RubyOnRails
[10:59:28] bijan_: has joined #RubyOnRails
[11:02:29] bijan__: has joined #RubyOnRails
[11:04:41] sandstrom: has joined #RubyOnRails
[11:13:08] bijan_: has joined #RubyOnRails
[11:18:19] cabotto: has joined #RubyOnRails
[11:22:33] bijan_: has joined #RubyOnRails
[11:39:58] sandstrom: has joined #RubyOnRails
[11:45:30] desperek: has joined #RubyOnRails
[11:48:01] uks: has joined #RubyOnRails
[11:48:01] uksio: has joined #RubyOnRails
[11:50:44] DTZUZO: has joined #RubyOnRails
[11:51:56] quazimodo: has joined #RubyOnRails
[11:55:59] rootsudo: has joined #RubyOnRails
[11:58:39] bijan_: has joined #RubyOnRails
[12:04:01] bijan_: has joined #RubyOnRails
[12:06:17] fmcgeough: has joined #RubyOnRails
[12:24:00] cabotto: has joined #RubyOnRails
[12:25:43] apeiros: has joined #RubyOnRails
[12:29:03] bijan_: has joined #RubyOnRails
[12:36:02] bijan_: has joined #RubyOnRails
[12:37:20] rootsudo: has joined #RubyOnRails
[12:38:08] rootsudo: has joined #RubyOnRails
[12:39:34] bijan__: has joined #RubyOnRails
[12:39:42] rootsudo: has joined #RubyOnRails
[12:45:04] lessless_: has joined #RubyOnRails
[13:02:59] lessless_: has joined #RubyOnRails
[13:04:29] sevenseacat: has joined #RubyOnRails
[13:09:48] fmcgeough: has joined #RubyOnRails
[13:11:43] bijan_: has joined #RubyOnRails
[13:14:12] fmcgeough_: has joined #RubyOnRails
[13:21:06] bijan_: has joined #RubyOnRails
[13:22:49] Technodrome: has joined #RubyOnRails
[13:25:56] bijan_: has joined #RubyOnRails
[13:29:23] bijan_: has joined #RubyOnRails
[13:37:47] knight33: has joined #RubyOnRails
[13:41:32] quazimodo: has joined #RubyOnRails
[13:48:25] mostlybadfly: has joined #RubyOnRails
[13:55:09] za1b1tsu_: has joined #RubyOnRails
[14:05:57] salasrod: has joined #RubyOnRails
[14:14:20] EXCHGR: has joined #RubyOnRails
[14:26:37] blindMoe: has joined #RubyOnRails
[14:27:10] blindMoe: Has anyone ran into issues with rspec not using fallback translations with locales and complaining of missing translations even though they exist in the default locale?
[14:30:26] Sylario: @blindmoe yes
[14:30:34] Sylario: Do you use faker?
[14:30:50] Sylario: and is en in your default locales?
[14:32:27] blindMoe: We use faker and en is in my default locale
[14:33:24] blindMoe: @sylario I saw an article on manually setting the locale with faker and it having issues but did not see anything about it causing the fallbacks to stop working
[14:33:48] Sylario: ok, the issue I have is when en is not a default
[14:33:53] Sylario: so it's not the same
[14:39:01] work_: has joined #RubyOnRails
[14:44:07] roshanavand: has joined #RubyOnRails
[14:50:53] Technodrome: has joined #RubyOnRails
[14:55:22] [Butch]: has joined #RubyOnRails
[14:59:42] apeiros_: has joined #RubyOnRails
[15:09:23] lessless_: has joined #RubyOnRails
[15:19:48] snickers: has joined #RubyOnRails
[15:25:51] tjbp: has joined #RubyOnRails
[15:28:16] andywww: has joined #RubyOnRails
[15:31:04] troys: has joined #RubyOnRails
[15:36:29] lomex: has joined #RubyOnRails
[15:40:04] blindMoe: @sylario I think we might have the same issue. My spec tests are running code that switches the current locale and also uses Faker.
[15:40:19] blindMoe: Did you find a fix for yours?
[15:40:33] Sylario: i added :en to locales for the test env
[15:41:15] blindMoe: sylario: You mean in the initializer?
[15:41:51] blindMoe: I already have 'config.i18n.default_locale = :en' in my environment/test.rb but that doesn't seem to help
[15:43:16] quazimodo: has joined #RubyOnRails
[15:50:09] andywww: has left #RubyOnRails: ()
[16:05:41] lxsameer: has joined #RubyOnRails
[16:14:36] lxsameer: has joined #RubyOnRails
[16:21:49] eddof13: has joined #RubyOnRails
[16:24:53] lxsameer: has joined #RubyOnRails
[16:25:57] xuyuheng: has joined #RubyOnRails
[16:54:04] orbyt_: has joined #RubyOnRails
[16:56:30] orbyt_: has joined #RubyOnRails
[17:01:42] apeiros_: has joined #RubyOnRails
[17:03:08] eckhardt_: has joined #RubyOnRails
[17:10:50] Technodrome: has joined #RubyOnRails
[17:12:36] cr1xu5: has joined #RubyOnRails
[17:14:52] lxsameer: has joined #RubyOnRails
[17:18:14] LambdaSource: has joined #RubyOnRails
[17:18:53] Technodrome: has joined #RubyOnRails
[17:24:57] lxsameer: has joined #RubyOnRails
[17:29:00] apeiros_: has joined #RubyOnRails
[17:34:41] lxsameer: has joined #RubyOnRails
[17:35:52] akaiiro: has joined #RubyOnRails
[17:43:23] sameerynho: has joined #RubyOnRails
[17:44:39] lxsameer: has joined #RubyOnRails
[17:52:39] knight33: has joined #RubyOnRails
[17:54:56] lxsameer: has joined #RubyOnRails
[18:04:45] lxsameer: has joined #RubyOnRails
[18:10:53] tubbo: has joined #RubyOnRails
[18:14:50] lxsameer: has joined #RubyOnRails
[18:15:31] chouhoulis: has joined #RubyOnRails
[18:18:06] chouhoulis: has joined #RubyOnRails
[18:19:07] chouhoulis: has joined #RubyOnRails
[18:24:48] lxsameer: has joined #RubyOnRails
[18:26:56] LambdaSource: has joined #RubyOnRails
[18:31:32] tdy: has joined #RubyOnRails
[18:34:48] lxsameer: has joined #RubyOnRails
[18:44:47] lxsameer: has joined #RubyOnRails
[18:54:42] lxsameer: has joined #RubyOnRails
[19:02:40] mikecmpbll: has joined #RubyOnRails
[19:04:32] Ergo: has joined #RubyOnRails
[19:09:12] srinidhi: has joined #RubyOnRails
[19:18:16] Alchemical: has joined #RubyOnRails
[19:18:43] lexileo: has joined #RubyOnRails
[19:22:40] jtperreault: has joined #RubyOnRails
[19:33:00] gambl0re: has joined #RubyOnRails
[19:35:57] mrbubbles: has joined #RubyOnRails
[19:36:00] mrbubbles: Does anyone have much experience with Active Record Serializers?
[19:36:22] mrbubbles: I have 3 has_many relationships on a model, I'm just trying to wrap them in a key but it's not working :(
[19:37:42] planigan: has joined #RubyOnRails
[19:43:21] rootsudo: has joined #RubyOnRails
[19:46:04] akaiiro: has joined #RubyOnRails
[19:58:03] planigan: has joined #RubyOnRails
[20:00:08] sandstrom: has joined #RubyOnRails
[20:09:43] beingjohnm: running brakeman on my app and getting the warning about mass assignment (https://brakemanscanner.org/docs/warning_types/mass_assignment/index.html). It is catching because I permit :account_id as a parameter for submission of some of my forms. I can't really think of a work around for that though. e.g. when creating a "transaction" I need to pass the account that the transaction is being created
[20:09:49] beingjohnm: for. Any ideas?
[20:22:51] tubbo`: has joined #RubyOnRails
[20:30:00] sandstrom: has joined #RubyOnRails
[20:31:58] mendelssohn: has joined #RubyOnRails
[20:33:54] planigan: has joined #RubyOnRails
[20:34:12] rootsudo: has joined #RubyOnRails
[20:43:06] za1b1tsu_: has joined #RubyOnRails
[20:48:23] gthank: has joined #RubyOnRails
[20:49:43] gthank: Anybody have some experience with backburner as an async job system? I'm having a bit of a problem (under certain circumstances, a worker can't reach the database, at which point it starts reserving oodles of jobs and they all eventually time out, because once it loses DB connectivity, it can't recover)
[20:50:31] gthank: To me, it seems like this is a case where I could just have the error handler do a Kernel.exit (or exit!) to kill the worker process, since they're all under process supervision and a new one will be spawned silently
[20:51:18] gthank: Except putting exit, abort, or exit! in the error handler doesn't actually seem to kill the process
[20:52:10] scrptktty: has joined #RubyOnRails
[20:53:40] tycoon177: beingjohnm: you could have the forms submit to a nested route under the account, but i wouldn't worry too much about that as long as you run verifications that the user should be able to make those changes
[20:58:54] beingjohnm: tycoon177: good point. I should double check that it is looking up only the accounts the user has access to but I'm pretty sure it is.
[20:59:05] lxsameer: has joined #RubyOnRails
[20:59:22] tycoon177: automated checking tools are handy to use but shouldn't be blindly trusted
[21:04:39] beingjohnm: tycoon177: definitely. I feel like I'm adhering to the framework will and not doing anything crazy but I like the additional data point.
[21:06:33] chouhoulis: has joined #RubyOnRails
[21:07:14] snickers: has joined #RubyOnRails
[21:13:01] chouhoulis: has joined #RubyOnRails
[21:19:28] chouhoulis: has joined #RubyOnRails
[21:23:38] mrbubbles: has joined #RubyOnRails
[21:31:45] amperry: has joined #RubyOnRails
[21:45:36] ur5us: has joined #RubyOnRails
[21:54:03] Puffball: has joined #RubyOnRails
[22:01:43] DTZUZO: has joined #RubyOnRails
[22:06:27] jane_booty_doe: has joined #RubyOnRails
[22:32:01] quazimodo: has joined #RubyOnRails
[22:32:35] knight33: has joined #RubyOnRails
[22:36:19] dviola: has joined #RubyOnRails
[22:37:39] tdy: has joined #RubyOnRails
[22:39:06] jasmith: has joined #RubyOnRails
[22:47:39] srruby: has joined #RubyOnRails
[22:48:21] srruby: Question about rates: For remote RoR work, what might the $ range be ? I am in need of some consulting hours so I thought I might come in on the low end.
[22:54:59] baweaver: srruby: What's your profile like?
[22:55:07] baweaver: Junior, Mid, Senior, ...
[22:57:08] baweaver: I've been seeing around 50+
[22:57:20] baweaver: Really Senior is pulling 100+
[22:57:29] baweaver: but I'd google it and look at competition
[22:57:31] srruby: 50$ an hour?
[22:57:43] baweaver: yeah, though that's mostly US based.
[22:59:48] lxsameer: has joined #RubyOnRails
[23:00:15] baweaver: 40k/yr approximates to $20 an hour. $50 would be about 100k, though remember to double that number in context of companies that pay that much.
[23:00:21] baweaver: because health, dental, etc.
[23:01:07] baweaver: A Junior in the SF Bay Area would be around 100 to 120k with maybe 10 to 30k in options or bonus.
[23:01:28] baweaver: So if you're not in the bay, that goes a heck of a lot further.
[23:02:02] baweaver: Then again by the time you get to Senior that goes up to characteristically a base of 150-200k and options that dwarf that amount if you're good.
[23:03:19] baweaver: total comp can range 400k+ easily for very Senior people in this area.
[23:03:49] baweaver: Meaning if they were to freelance $100/hr wouldn't come anywhere close.
[23:04:35] baweaver: because again, remember, double base to get a rough accounting of benefits
[23:19:11] Technodrome: has joined #RubyOnRails
[23:19:59] rootsudo: has joined #RubyOnRails
[23:27:21] Technodrome: has joined #RubyOnRails
[23:35:18] srruby: has joined #RubyOnRails
[23:42:47] fcser_: has joined #RubyOnRails