« Back to channel list

#RubyOnRails - 22 September 2017

« Back 1 day Forward 1 day »
[00:00:35] jrabe: has joined #RubyOnRails
[00:00:42] kn-928: has joined #RubyOnRails
[00:01:08] Psy-Q: has joined #RubyOnRails
[00:01:54] rgr: has joined #RubyOnRails
[00:04:50] jhfisc: has joined #RubyOnRails
[00:13:52] jhfisc: has joined #RubyOnRails
[00:22:17] cagomez: has joined #RubyOnRails
[00:23:12] hammer065: has joined #RubyOnRails
[00:23:58] jfelchner: has joined #RubyOnRails
[00:27:06] jhfisc: has joined #RubyOnRails
[00:33:36] jhfisc: has joined #RubyOnRails
[00:35:50] hammer065: has joined #RubyOnRails
[00:40:32] ivanskie: has joined #RubyOnRails
[00:46:15] jhfisc: has joined #RubyOnRails
[00:46:49] ivanskie: I think I may have landed my first ruby-on-rails client. yay :) I've found all the gems i'll want to use i've got the app setup and ready to go. and I know I can probably get an mvp ready over a weekend. But my conscience on my shoulder is telling me "NO! Do it right, write acceptance tests first!" does anyone have a fly swatter?
[00:57:12] jhfisc: has joined #RubyOnRails
[01:07:26] jhfisc: has joined #RubyOnRails
[01:15:52] ivanskie: has joined #RubyOnRails
[01:18:31] juggler: has joined #RubyOnRails
[01:19:14] jhfisc: has joined #RubyOnRails
[01:21:56] jhfisc: has joined #RubyOnRails
[01:24:42] knight33: has joined #RubyOnRails
[01:25:07] lektrik: has joined #RubyOnRails
[01:35:21] jphase: has joined #RubyOnRails
[01:35:53] ivanskie: has joined #RubyOnRails
[01:37:03] jphase_: has joined #RubyOnRails
[01:44:03] ivanskie: well since there's no fly swatter to swat at my good conscience, time to start writing some tests. if only they wrote proper user stories. argh
[01:46:32] jphase: has joined #RubyOnRails
[01:48:16] orbyt_: has joined #RubyOnRails
[01:51:46] irishfromua: has joined #RubyOnRails
[01:57:25] andrewray: has joined #RubyOnRails
[01:59:59] jphase: has joined #RubyOnRails
[02:05:42] cagomez: has joined #RubyOnRails
[02:06:55] Jameser: has joined #RubyOnRails
[02:11:29] Jameser: has joined #RubyOnRails
[02:15:06] jhfisc: has joined #RubyOnRails
[02:15:12] knight33: has joined #RubyOnRails
[02:18:43] ivanskie: has joined #RubyOnRails
[02:21:16] jhfisc: has joined #RubyOnRails
[02:25:47] cagomez: has joined #RubyOnRails
[02:26:20] DarkBushido: has joined #RubyOnRails
[02:27:14] jhfisc: has joined #RubyOnRails
[02:35:19] cagomez: has joined #RubyOnRails
[02:35:19] ivanskie: has joined #RubyOnRails
[02:43:09] jobewan: has joined #RubyOnRails
[02:53:25] orbyt_: has joined #RubyOnRails
[02:56:01] cagomez: has joined #RubyOnRails
[03:07:14] beilabs: has joined #RubyOnRails
[03:20:24] jhfisc: has joined #RubyOnRails
[03:24:18] jhfisc: has joined #RubyOnRails
[03:24:28] orbyt_: has joined #RubyOnRails
[03:24:33] mars777: has joined #RubyOnRails
[03:28:24] Saukk: has joined #RubyOnRails
[03:48:04] bronson: has joined #RubyOnRails
[03:49:15] xco: has joined #RubyOnRails
[03:51:23] orbyt_: has joined #RubyOnRails
[03:54:23] beilabs: has joined #RubyOnRails
[04:10:31] jphase: has joined #RubyOnRails
[04:16:36] xco: has joined #RubyOnRails
[04:17:26] xco: has joined #RubyOnRails
[04:18:12] andrewray: has joined #RubyOnRails
[04:18:16] xco: has joined #RubyOnRails
[04:19:01] xco: has joined #RubyOnRails
[04:19:52] xco: has joined #RubyOnRails
[04:22:06] Radar: ivanskie: I wrote a blog post for you 7 years ago: http://ryanbigg.com/2010/02/congratulations
[04:22:49] ivanskie: cool i'll read that :)
[04:23:33] ivanskie: funny the client reached out to me asking the update. so i just told him we can go two routes, the proper way (preferred), or the lets hurry it up and get something out now, and worry about tests later (not recommended).
[04:24:21] ivanskie: he's happy. and i'm happy because he's going to start writing out proper user stories. wee i dont have to write user stories.
[04:48:16] bronson: has joined #RubyOnRails
[04:53:08] ivanskie: dumb question very dumb. whats the best way to ask for their goal launch day, time frame to launch the mvp. my brain isn't working right now
[04:54:57] srinidhi: has joined #RubyOnRails
[04:55:59] jphase: has joined #RubyOnRails
[04:57:05] jphase_: has joined #RubyOnRails
[05:11:46] jphase: has joined #RubyOnRails
[05:13:01] jphase: has joined #RubyOnRails
[05:18:03] jhfisc: has joined #RubyOnRails
[05:18:37] urkle: has joined #RubyOnRails
[05:19:55] guacamole: has joined #RubyOnRails
[05:22:48] jphase: has joined #RubyOnRails
[05:24:00] andrewray: has joined #RubyOnRails
[05:24:18] jphase_: has joined #RubyOnRails
[05:24:38] jhfisc: has joined #RubyOnRails
[05:24:50] andrewray: has joined #RubyOnRails
[05:25:40] andrewray: has joined #RubyOnRails
[05:30:12] kies: has joined #RubyOnRails
[05:30:45] mtkd: has joined #RubyOnRails
[05:33:18] jhfisc: has joined #RubyOnRails
[05:39:08] brent__: has joined #RubyOnRails
[05:40:13] jhfisc: has joined #RubyOnRails
[05:43:15] jhfisc: has joined #RubyOnRails
[05:51:14] jhfisc: has joined #RubyOnRails
[05:52:59] banisterfiend: has joined #RubyOnRails
[05:57:14] jhfisc: has joined #RubyOnRails
[05:59:55] jhfisc: has joined #RubyOnRails
[06:00:48] nickjj: has joined #RubyOnRails
[06:07:35] ur5us: has joined #RubyOnRails
[06:11:06] paranoicsan: has joined #RubyOnRails
[06:14:01] mostlybadfly: has joined #RubyOnRails
[06:41:22] beilabs: has joined #RubyOnRails
[06:45:12] xco: has joined #RubyOnRails
[06:45:16] gusrub_: has joined #RubyOnRails
[06:47:10] s2013: has joined #RubyOnRails
[06:49:10] bronson: has joined #RubyOnRails
[07:01:15] Ag3nt: has joined #RubyOnRails
[07:03:50] DTZUZO: has joined #RubyOnRails
[07:04:12] srinidhi: has joined #RubyOnRails
[07:06:46] f00f[away]: has joined #RubyOnRails
[07:07:36] beilabs: has joined #RubyOnRails
[07:09:53] arathald: has joined #RubyOnRails
[07:19:47] gambl0re: has joined #RubyOnRails
[07:21:18] beilabs: has joined #RubyOnRails
[07:28:10] rgr: has joined #RubyOnRails
[07:31:07] nickjj_: has joined #RubyOnRails
[07:32:26] workmad3: has joined #RubyOnRails
[07:33:00] nadley: has joined #RubyOnRails
[07:44:23] beilabs: has joined #RubyOnRails
[07:44:39] defsdoor: has joined #RubyOnRails
[08:01:26] dionysus69: has joined #RubyOnRails
[08:03:49] glasz: has joined #RubyOnRails
[08:06:10] codelahoma: has joined #RubyOnRails
[08:06:23] ur5us: has joined #RubyOnRails
[08:06:39] manveru: has joined #RubyOnRails
[08:07:13] mtkd: has joined #RubyOnRails
[08:07:19] arBmind: has joined #RubyOnRails
[08:07:24] xhoy: has joined #RubyOnRails
[08:08:51] blitz: has joined #RubyOnRails
[08:09:21] ankhers: has joined #RubyOnRails
[08:10:13] mikecmpbll: has joined #RubyOnRails
[08:11:03] segy: has joined #RubyOnRails
[08:11:13] robnester: has joined #RubyOnRails
[08:11:35] Sirecote: has joined #RubyOnRails
[08:11:39] xibalba: has joined #RubyOnRails
[08:11:46] boxmein: has joined #RubyOnRails
[08:11:57] sinduck: has joined #RubyOnRails
[08:16:49] hervie: has joined #RubyOnRails
[08:18:13] defsdoor: has joined #RubyOnRails
[08:27:18] conta: has joined #RubyOnRails
[08:35:30] jphase: has joined #RubyOnRails
[08:37:43] dminuoso_: has joined #RubyOnRails
[08:42:08] dminuoso_: So. Is there a reason webpacker comes with broken peer dependencies out of the box? https://gist.github.com/anonymous/b253c0545a76a60fe7666dc93f9bd3bb
[08:44:40] jphase: has joined #RubyOnRails
[08:45:04] lxsameer: has joined #RubyOnRails
[08:47:31] dminuoso_: Mmm. Ah well, guess that's a bug from yarn actually.
[08:50:05] bronson: has joined #RubyOnRails
[08:50:47] marr: has joined #RubyOnRails
[08:56:49] tbuehlmann: dminuoso_: your color changed and that bothers me, can you rename please?
[08:58:24] jphase: has joined #RubyOnRails
[09:04:30] dminuoso_: tbuehlmann: No can do.
[09:04:42] dminuoso_: but I gotta rage about how rage inducing this webpacker is.
[09:05:32] dminuoso_: So in order to use webpack, I have to use a magic loader that exports a magical environment object, that is not properly documented?
[09:06:31] dminuoso_: ACTION sighs
[09:07:24] dminuoso_: https://github.com/rails/webpacker/blob/master/docs/webpack.md this is like the only thing that gives examples, but no proper API documentation
[09:12:11] jphase: has joined #RubyOnRails
[09:25:53] jphase: has joined #RubyOnRails
[09:39:40] jphase: has joined #RubyOnRails
[09:41:40] srinidhi: has joined #RubyOnRails
[09:41:48] ams__: has joined #RubyOnRails
[09:48:54] jphase: has joined #RubyOnRails
[09:53:45] dionysus69: has joined #RubyOnRails
[09:55:10] paranoicsan: has joined #RubyOnRails
[09:57:10] dustinm`: has joined #RubyOnRails
[10:02:39] jphase: has joined #RubyOnRails
[10:04:10] rgr_: has joined #RubyOnRails
[10:06:39] bruno-: has joined #RubyOnRails
[10:11:50] jphase: has joined #RubyOnRails
[10:16:13] workmad3: has joined #RubyOnRails
[10:21:00] jphase: has joined #RubyOnRails
[10:21:38] dminuoso_: has joined #RubyOnRails
[10:30:09] jphase: has joined #RubyOnRails
[10:33:19] ferr: has joined #RubyOnRails
[10:39:37] mostlybadfly: has joined #RubyOnRails
[10:51:23] bronson: has joined #RubyOnRails
[10:53:05] jphase: has joined #RubyOnRails
[11:04:06] arBmind: has joined #RubyOnRails
[11:06:52] jphase: has joined #RubyOnRails
[11:20:37] jphase: has joined #RubyOnRails
[11:25:03] lignux: Is there a way to redefine an instance variable in another method for the same controller? I have tried making a private method that takes 1 argument and then assigns an instance variable to that argument and then call that method in two different controller methods in hope to redefine the variable but it doesn't work..
[11:25:58] dminuoso_: Oh gosh. Im not whitelisted.
[11:26:03] dminuoso_: lignux: Gist or it didn't happen.
[11:26:56] tbuehlmann: even the bot wants you to rename
[11:27:31] matthewd: Yeah, I'm not following that description either. Code please.
[11:34:59] lignux: dminuoso, okay i delleted it but ill rewrite my example again
[11:37:37] lignux: dminuoso: https://gist.github.com/Gadzev/047417c0ff585fa3397af5ccec2f221b
[11:38:04] lignux: the helper method is different though i made a mistake
[11:38:12] lignux: but youll get what im trying to do
[11:38:47] lignux: Basically i can't use the "after" variable in the index view from the get_posts method and i want to
[11:39:02] matthewd: lignux: In what way is that not doing what you want?
[11:39:08] matthewd: You mean @after, right?
[11:39:54] lignux: matthewd, Yes. In a way that get_posts doesnt reassign @after. I can only see the @after that the index method assigns and not the get_posts method
[11:40:59] matthewd: Well that doesn't look like an action method
[11:42:12] Ergo: has joined #RubyOnRails
[11:42:28] lignux: matthewd, i am a noob in rails so bare with me. By doesnt look like an action method you mean its not new, create, show etc?
[11:44:08] matthewd: It has an argument, so it can't be invoked by the router
[11:45:08] matthewd: (also yes, it's not one of the standard actions, though they're just convention)
[11:45:42] Chernobuk: has joined #RubyOnRails
[11:45:46] lignux: matthewd: is there a way i can access its instance variables in the index view?
[11:47:43] matthewd: How is this method getting called?
[11:47:57] tcopeland: has joined #RubyOnRails
[11:48:56] lignux: $("<%= escape_javascript(get_posts(test)) %>").appendTo("#data");
[11:49:15] lignux: test being the @after variable
[11:50:02] matthewd: Ohh, okay, it's a helper_method
[11:50:50] matthewd: No; the controller's ivars are copied to the view when it starts to get rendered, but if you then call back to the controller, further changes won't be reflected
[11:51:09] Jameser: has joined #RubyOnRails
[11:51:19] matthewd: I mean, you could presumably controller.instance_variable_get(:@after) or something, but that's not really a sensible approach
[11:52:24] lignux: matthewd: Hmm i don't know what to do in this case then really. The goal is to render content from the api dynamicaly on the front page with infinite scrolling.
[11:52:27] ShalokShalom_: has joined #RubyOnRails
[12:01:02] Jameser: has joined #RubyOnRails
[12:01:22] dminuoso_: Okay, so I have this garbage ldap library that was written in such an unsafe manner, that triggering a race condition permanently fucks up the internal state.
[12:01:36] dminuoso_: How shabby should I feel for running puma in single threaded with multiple workers?
[12:06:27] dionysus69: has joined #RubyOnRails
[12:18:02] truenito: has joined #RubyOnRails
[12:30:50] dminuoso_: has joined #RubyOnRails
[12:32:24] matthewd: dminuoso_: Fairly? :)
[12:32:43] matthewd: dminuoso_: Is the entire app basically a wrapper around said ldap library?
[12:35:21] sonOfRa: dminuoso_: ruby-net-ldap?
[12:35:29] dminuoso_: sonOfRa: Yeah.
[12:35:38] dminuoso_: matthewd: A fair chunk of it is.
[12:35:49] sonOfRa: dminuoso_: I've never encountered any problems with that. Or are you reusing a single ldap object in the scope of several threads?
[12:36:09] dminuoso_: sonOfRa: activeldap seems to be doing just that
[12:36:12] sonOfRa: I have an entire webapp built around that library for managing our institute's internal ldap
[12:36:26] sonOfRa: oh yeah I tried out activeldap at first and then tossed that out and rolled my own models instead
[12:38:10] dminuoso_: sonOfRa: with net/ldap or ruby-ldap?
[12:38:44] sonOfRa: https://github.com/ruby-ldap/ruby-net-ldap
[12:39:15] sonOfRa: Though I do not reuse things across threads, because that seemed like a bad idea. Every user that logs into the webapp has their own ldap connection (with their own user and password)
[12:39:45] sonOfRa: Problem is that ruby-net-ldap seems like it's unmaintained these days
[12:40:08] dminuoso_: sonOfRa: We havent had any problems because I was running on unicorn before. ;-)
[12:40:46] dminuoso_: And I decided to just toss the old app away and rewrite from scratch with all the new bells and whistles, and it didn't even take 20 minutes for me to crash activeldap into "restart the webserver please"
[12:41:49] matthewd: Yeah, I'd start with confirming it's sharing something internally, and not just getting upset because you're making it (by explicitly using the same object on multiple threads)... then consider the single-threading sledgehammer, vs maybe a mutex around LDAP work
[12:42:43] marr: has joined #RubyOnRails
[12:43:43] dminuoso_: matthewd: The only thing I do is re-use the same ActiveLdap model in two threads. A mutex would kind of defeat the point of having multiple workers to begin with, because a large chunk of work revolves around this single model
[12:46:21] matthewd: Right; hence my first question, and then putting the sledgehammer first.. just noting the alternative because it feels less dirty ;)
[12:47:04] dminuoso_: matthewd: Let me just helgrind this..
[12:47:18] dminuoso_: Oh wait! That was for a different language, I remember. ;-)
[12:48:33] brent__: has joined #RubyOnRails
[12:52:35] bronson: has joined #RubyOnRails
[12:52:49] truenito: has joined #RubyOnRails
[12:56:52] jphase: has joined #RubyOnRails
[12:59:04] jphase: has joined #RubyOnRails
[13:00:49] Kilo`byte: has joined #RubyOnRails
[13:02:06] xco: has joined #RubyOnRails
[13:05:48] tHurst0n: has joined #RubyOnRails
[13:05:53] hfp_work: has joined #RubyOnRails
[13:10:44] Sigyn: has joined #RubyOnRails
[13:16:06] k13nox: has joined #RubyOnRails
[13:17:37] apparition: has joined #RubyOnRails
[13:19:03] k13nox: Hello, i would like to disable SQL log from ActionCable. I had try config.log_level, config.active_record.logger, ActionCable.server.config.logger params but no success (I launch ActionCable with puma apart from rails) Any idea ?
[13:21:15] jphase_: has joined #RubyOnRails
[13:26:30] dminuoso_: k13nox: From what I learned, it's borderline impossible to separate SQL logs from different parts.
[13:28:30] dminuoso_: k13nox: But if it runs in a seperate process entirely, I suppose just changing ActiveRecord::Base.logger ought to do the trick
[13:28:58] dminuoso_: i.e. ActiveRecord::Base.logger.level = 0
[13:29:22] k13nox: dminuoso_: ok I'm going to try :)
[13:31:55] k13nox: dminuoso_: ty ActiveRecord::Base.logger = Logger.new(nil) works :)
[13:32:09] dminuoso_: k13nox: You might not want to squelch it entirely. Try setting the logger to 0 like I suggested.
[13:32:17] dminuoso_: That has the benefit of it producing logs should there be a fatal error.
[13:34:02] k13nox: dminuoso_: ActiveRecord::Base.logger.level = 0 Not working :/
[13:35:20] Jameser: has joined #RubyOnRails
[13:36:02] k13nox: dminuoso_: Best place to put this ? initializer/environnement file/config.ru ? If i only want this for ActionCable. ActiveRecord::Base.logger = Logger.new(nil) works fine in config.ru of ActionCable
[13:36:23] dminuoso_: k13nox: Oh I suck. 0 is everything.
[13:36:38] dminuoso_: k13nox: ActiveRecord::Base.logger.level = :error
[13:36:40] dminuoso_: or :fatal depending on your needs
[13:37:07] dminuoso_: k13nox: I dont know what the right place would be, but config.ru is definitely not the right place.
[13:38:29] k13nox: dminuoso_: i had put :warn like other app, thx it's works. yes config.ru very bad place :/
[13:39:20] dminuoso_: k13nox: How exactly do you start actioncable with puma?
[13:40:40] k13nox: dminuoso_: 'bundle exec puma cable/config.ru' and take 'config/puma.rb' as config puma file
[13:42:29] k13nox: dminuoso_: Standalone mode not InApp mode because separate server :)
[13:42:42] dminuoso_: k13nox: What does your config.ru look like?
[13:43:29] k13nox: dminuoso_: like default i.e. http://guides.rubyonrails.org/action_cable_overview.html#standalone
[13:44:41] dminuoso_: k13nox: I would probably just create a config/cable_environment.rb, which in turns does a require_relative 'environment', and then changes the log behavior
[13:44:51] dminuoso_: and then require_relative that file from cable/config.ru
[13:45:21] dminuoso_: But you can do it differently as you see fit
[13:46:28] k13nox: dminuoso_: I will do this, no I have no better option :/
[13:50:22] theunraveler: has joined #RubyOnRails
[13:52:26] cagomez: has joined #RubyOnRails
[13:59:50] truenito: has joined #RubyOnRails
[14:00:56] yehaizi: has joined #RubyOnRails
[14:03:44] EminenceHC: has joined #RubyOnRails
[14:04:29] hfp_work: has joined #RubyOnRails
[14:04:50] yehaizi: is there a systematic way to ensure that children models are saved when the parent is saved? my parent model has_many children, and also accepts_nested_attributes_for children, but saving the parent model only saves changes to the children that were modified "through" the parent (parent.children[0][:attr] = ...)
[14:10:06] Bacta: has joined #RubyOnRails
[14:17:07] Bacta: has left #RubyOnRails: ("Leaving")
[14:17:56] maryo: has joined #RubyOnRails
[14:24:05] gil_: has joined #RubyOnRails
[14:27:19] SirOliver: has joined #RubyOnRails
[14:28:09] francuz: current_page = Page.create(
[14:28:09] francuz: designation: "donation")
[14:28:09] francuz: current_txt = current_page.txts.create(designation: "title")
[14:28:10] francuz: current_txt.translations.create(content: "bla", locale: :fr)
[14:28:10] francuz: current_txt.translations.create(content: "blo", locale: :en)
[14:28:10] francuz: current_txt.translations.create(content: "bli", locale: :de)
[14:28:48] francuz: didn't want to send it ... but ok, this is my seed.rb, and for some reason, only the french version is being set, (using globalize)
[14:29:31] francuz: (wanted to send it but not like that, through a gist)
[14:29:39] SirOliver: has joined #RubyOnRails
[14:30:39] francuz: oh, actually only :en doesn't work, :de works, strange
[14:34:01] chouhoulis: has joined #RubyOnRails
[14:36:05] cagomez: has joined #RubyOnRails
[14:36:13] s2013: has joined #RubyOnRails
[14:38:12] orbyt_: has joined #RubyOnRails
[14:53:22] bronson: has joined #RubyOnRails
[15:00:47] beilabs: has joined #RubyOnRails
[15:02:21] knight33: has joined #RubyOnRails
[15:02:26] AzaToth: has joined #RubyOnRails
[15:08:09] beilabs: has joined #RubyOnRails
[15:08:55] troys: has joined #RubyOnRails
[15:12:12] bruno-: has joined #RubyOnRails
[15:16:01] beilabs: has joined #RubyOnRails
[15:19:24] jottr: has joined #RubyOnRails
[15:20:04] dogweather: has joined #RubyOnRails
[15:24:43] cagomez: has joined #RubyOnRails
[15:27:04] beilabs: has joined #RubyOnRails
[15:28:09] drale2k: has joined #RubyOnRails
[15:30:07] beilabs_: has joined #RubyOnRails
[15:33:10] [Butch]: has joined #RubyOnRails
[15:33:37] mars777: has joined #RubyOnRails
[15:35:57] andrewray: has joined #RubyOnRails
[15:40:14] beilabs: has joined #RubyOnRails
[15:42:57] gregf_: has joined #RubyOnRails
[15:43:21] beilabs: has joined #RubyOnRails
[15:43:44] dminuoso_: Its clear to me now. instance_variable_get/instance_variable_set were made to fix stupid libraries that dont populate their ActiveModel::Errors properly.
[15:53:28] fryguy: has joined #RubyOnRails
[15:56:12] baweaver: So it's an extension to StupidLibrary::Errors then
[16:06:00] dminuoso_: baweaver: Yes.
[16:10:43] mlt-: What is the best practice to solicit user for confirmation for the following? I have a batch action that changes attributes of a few AR objects. Some of them may fail to validate. I would like to check with user if they still wants to apply changes to some shown objects among all requested?
[16:11:17] mlt-: Shall I use extra parameter? Extra action? Form Object?
[16:12:57] orbyt_: has joined #RubyOnRails
[16:18:06] yehaizi: mlt-, why not identify what failed verification in your response, and just handle the rest on the client side? ie, display the response to user, and if user still wants to apply the validated changes, just re-submit the request minus the invalid items?
[16:20:53] knight33: has joined #RubyOnRails
[16:21:26] drale2k: has joined #RubyOnRails
[16:22:49] ResidentBiscuit: has joined #RubyOnRails
[16:23:58] maryo_: has joined #RubyOnRails
[16:27:47] mlt-: yehaizi: And what would be a good approach? Custom JSON response?
[16:28:12] mlt-: It would be nice to make it reusable
[16:30:01] SirOliver: has joined #RubyOnRails
[16:30:54] lignux: has left #RubyOnRails: ("Konversation terminated!")
[16:36:53] yehaizi: mlt-, well, responding with a well-formatted error message seems like a good and reusable approach...
[16:37:18] yehaizi: i expect your client is dealing with error messages anyway
[16:37:47] SirOliver: has joined #RubyOnRails
[16:42:51] mlt-: yehaizi: So you are saying error is just for a user to note and just returning html as usual without failing objects pre-filled would suffice? Shall I use a transaction and apply updates if there was no validation issues and roll back otherwise? And how would I know what failed to update? It seems #update returns resulting object no matter whether it was saved sucessfully
[16:44:21] mlt-: Call #all? and #valid?
[16:44:36] mlt-: on #update result
[16:44:49] mlt-: to decide whether to roll back
[16:45:28] dionysus69: has joined #RubyOnRails
[16:45:34] bruno-_: has joined #RubyOnRails
[16:46:00] yehaizi: yeah, but afaik an entire transaction block will automatically rollback anyway if a transaction fails within in it
[16:49:00] brent__: has joined #RubyOnRails
[16:49:39] mlt-: yehaizi: it seems that I have to fail it based on #all? and #valid? on #update result as I mentioned above. It doesn't look like #update will raise exception if validation fails
[16:50:31] matthewd: update! will raise on failure
[16:51:19] mtkd: has joined #RubyOnRails
[16:52:18] mlt-: matthewd: Thanks! I don't know how I missed it)
[16:54:39] yehaizi: mlt-, are you performing all the updates inside an ActiveRecord::Base.transaction block?
[16:55:01] bronson: has joined #RubyOnRails
[16:56:33] mlt-: yehaizi: Yes, I plan to enclose in transaction block ... it is just update_all as of now O;-)
[17:02:21] mlt-: matthewd: uhm... can I use update! on multiple objects? I'm confused... apparently there is Base::update and Persistence::update
[17:03:18] mlt-: Looks like I have to manually instantiate and update each object with #update!
[17:03:36] mlt-: for the whole idea with a transaction to work
[17:04:57] matthewd: Ah, yes, there's no Relation#update!. Maybe there should be.
[17:05:38] matthewd: You're not missing out on any smarts by doing it yourself, though: https://github.com/rails/rails/blob/0e8d4edd56f44b27f33bd214aa03af60cc5d39ae/activerecord/lib/active_record/relation.rb#L413
[17:05:49] one_zero: has joined #RubyOnRails
[17:06:57] mlt-: Thank you!
[17:09:19] brendan-: has joined #RubyOnRails
[17:10:31] mlt-: Does #each return anything? like number of processed entries?
[17:11:33] ravster: has joined #RubyOnRails
[17:12:48] ravster: I would like to ensure that all I18n.t() calls for my project are referring to keys that exist in the en.yml file. Is there a tool out there that already checks this?
[17:14:55] mlt-: ravster: test suites and raise exceptions https://robots.thoughtbot.com/foolproof-i18n-setup-in-rails
[17:15:09] dminuoso_: ACTION sighs
[17:15:46] dminuoso_: Why is there no elegant way to do <button ... onClick={history.push('/foo')} /> :(
[17:16:06] dminuoso_: <button ... onClick={() => history.push('/foo')} /> I mean
[17:33:49] mlt-: matthewd: though yehaizi is gone... update! and rollback is not gonna help actually... as I do want to know a list of failed and valid objects :-) So I have to #map or something...
[17:34:36] mlt-: I mean I have to process all and then decide on rolling back manually
[17:36:08] beilabs: has joined #RubyOnRails
[17:39:51] dionysus69: has joined #RubyOnRails
[17:42:43] beilabs: has joined #RubyOnRails
[17:43:08] HashNuke: has joined #RubyOnRails
[17:51:20] rfoust: has joined #RubyOnRails
[17:52:08] DBYCZ: has joined #RubyOnRails
[17:52:15] DBYCZ: Hello all
[17:53:07] orbyt_: has joined #RubyOnRails
[17:53:28] DBYCZ: Hello Orby
[18:07:25] dblessing: has joined #RubyOnRails
[18:14:44] jottr: has joined #RubyOnRails
[18:37:11] mikecmpbll: has joined #RubyOnRails
[18:38:32] inchains: has joined #RubyOnRails
[18:38:53] inchains: has left #RubyOnRails: ()
[18:41:44] mlt-: How would I count non-false values in array? I tried count(&:not) but I got NoMethodError: undefined method `not' for true:TrueClass
[18:42:39] jphase: has joined #RubyOnRails
[18:43:03] tbuehlmann: what about this? .count { |element| element != false }
[18:45:05] dminuoso_: mlt-: Does your array ever have nil values?
[18:45:06] elomatreb: Oh, fancy solution:
[18:45:10] elomatreb: >> [1, 2, nil, false, 3].count(&:itself)
[18:45:36] dminuoso_: elomatreb might have beat me to it, but Im waiting for the answer :P
[18:46:03] tbuehlmann: depends on "non-false"
[18:46:05] mlt-: itself did the trick!
[18:46:10] tbuehlmann: might be non-falsy
[18:46:11] elomatreb: I just got excited about finding a good use for an identity function in actual code
[18:46:12] dminuoso_: false != falsey
[18:46:17] dminuoso_: elomatreb: heh
[18:46:39] dminuoso_: elomatreb: Used group_by(&:itself) the other day
[18:47:03] mlt-: I wanted to count collected results on successfully updated AR objects as #update returns false if failed validation
[18:47:21] dminuoso_: elomatreb: okay you are on a roll it seems
[18:47:27] dminuoso_: How do I get ES6 into rails?
[18:47:32] elomatreb: dminuoso_: That seems useful, I'll have to remember that trick
[18:47:37] dminuoso_: I dont even know how to write code without ES6.
[18:47:49] elomatreb: I don't do JS anymore, static pages are the future (and the past)
[18:48:05] dminuoso_: JS is a fancy language
[18:48:27] elomatreb: Hyperbole, but I avoid JS (as in browser/clientside) JS whereever I can because it just ends up annoying either me or the user
[18:48:41] dminuoso_: That's because you haven't tried the "right stuff" yet.
[18:48:43] dminuoso_: elomatreb: https://github.com/calmm-js/partial.lenses
[18:49:02] dminuoso_: If that doesn't get you excited, this might! https://github.com/ramda/ramda-fantasy
[18:53:12] dminuoso_: No honestly, short of using webpacker I dont see a way of getting ES6 in.
[18:53:32] dminuoso_: Or I guess I could just do babel manually?
[18:55:06] arBmind: has joined #RubyOnRails
[18:55:58] bronson: has joined #RubyOnRails
[19:07:01] weaksauce: has joined #RubyOnRails
[19:07:36] dblessing: has joined #RubyOnRails
[19:15:29] jottr: has joined #RubyOnRails
[19:18:26] elcontrastador: has joined #RubyOnRails
[19:19:57] gauravgoyal: has joined #RubyOnRails
[19:31:22] ur5us: has joined #RubyOnRails
[19:32:20] sloggerkhan: has joined #RubyOnRails
[19:32:31] dblessing: has joined #RubyOnRails
[19:32:57] mlt-: uhm... when dealing with self-referencing associations, how do I refer to a columns in particular table in scopes?
[19:33:25] sloggerkhan: What's the proper way of accessing the test helper from a console opened with the test env in rails 5?
[19:35:56] sloggerkhan: Answer to own question: require Rails.root.join('test', 'test_helper.rb') ?
[19:48:17] ResidentBiscuit: has joined #RubyOnRails
[19:48:31] srinidhi: has joined #RubyOnRails
[20:00:43] SirOliver: has joined #RubyOnRails
[20:01:50] ayonkhan: has joined #RubyOnRails
[20:06:42] orbyt_: has joined #RubyOnRails
[20:16:13] jottr: has joined #RubyOnRails
[20:21:00] ur5us: has joined #RubyOnRails
[20:23:00] dviola: has joined #RubyOnRails
[20:26:47] ravster: thanks mlt-
[20:32:24] Psy-Q: has joined #RubyOnRails
[20:41:58] k13nox: has joined #RubyOnRails
[20:56:53] bronson: has joined #RubyOnRails
[20:59:46] mostlybadfly: has joined #RubyOnRails
[21:01:23] knight33: has joined #RubyOnRails
[21:07:36] daydream: has joined #RubyOnRails
[21:09:29] jottr: has joined #RubyOnRails
[21:12:23] chouhoulis: has joined #RubyOnRails
[21:28:43] moei: has joined #RubyOnRails
[21:33:34] lxsameer: has joined #RubyOnRails
[21:33:36] maryo: has joined #RubyOnRails
[21:56:06] orbyt_: has joined #RubyOnRails
[22:10:08] dionysus69: has joined #RubyOnRails
[22:15:41] wethu: has joined #RubyOnRails
[22:34:28] mlt-: Can I use _was in validators?
[22:34:40] mlt-: I want original value for an attribute
[22:36:31] orbyt_: has joined #RubyOnRails
[22:49:47] tcopeland: has joined #RubyOnRails
[22:58:11] bronson: has joined #RubyOnRails
[23:03:23] xco: has joined #RubyOnRails
[23:31:24] bronson: has joined #RubyOnRails
[23:50:52] dionysus69: has joined #RubyOnRails