« Back to channel list

#RubyOnRails - 04 July 2017

« Back 1 day Forward 1 day »
[00:02:21] xMopxShell: has joined #RubyOnRails
[00:11:26] aperkins81: has joined #RubyOnRails
[00:12:47] delgiudices: has joined #RubyOnRails
[00:14:34] helpa: has joined #RubyOnRails
[00:16:36] helpa: has joined #RubyOnRails
[00:16:58] alfie: has joined #RubyOnRails
[00:21:27] quazimodo: has joined #RubyOnRails
[00:25:23] ascarter: has joined #RubyOnRails
[00:29:26] jhfisc: has joined #RubyOnRails
[00:39:48] duderonomy: has joined #RubyOnRails
[00:53:54] jhfisc: has joined #RubyOnRails
[00:55:45] duderonomy: has joined #RubyOnRails
[01:02:19] sevenseacat: has joined #RubyOnRails
[01:08:33] jhfisc: has joined #RubyOnRails
[01:11:22] jhfisc: has joined #RubyOnRails
[01:18:24] jhfisc: has joined #RubyOnRails
[01:34:44] timdotrb: has joined #RubyOnRails
[01:35:09] jhfisc: has joined #RubyOnRails
[01:41:23] jhfisc: has joined #RubyOnRails
[01:43:49] SteenJobs: has joined #RubyOnRails
[01:51:56] jhfisc: has joined #RubyOnRails
[01:54:33] irishfromua: has joined #RubyOnRails
[01:57:26] jhfisc: has joined #RubyOnRails
[02:02:53] rgiscard: has joined #RubyOnRails
[02:02:55] jhfisc: has joined #RubyOnRails
[02:15:42] jhfisc: has joined #RubyOnRails
[02:15:51] umaaji: has joined #RubyOnRails
[02:18:21] umaaji: has joined #RubyOnRails
[02:21:38] delgiudices: has joined #RubyOnRails
[02:21:42] jhfisc: has joined #RubyOnRails
[02:24:55] quirkycoders: has joined #RubyOnRails
[02:26:41] jhfisc: has joined #RubyOnRails
[02:29:42] jhfisc: has joined #RubyOnRails
[02:35:06] fschuindt: has joined #RubyOnRails
[02:39:54] ascarter: has joined #RubyOnRails
[02:43:45] jhfisc: has joined #RubyOnRails
[02:43:45] ascarter_: has joined #RubyOnRails
[02:48:50] jhfisc: has joined #RubyOnRails
[02:49:41] Jameser: has joined #RubyOnRails
[02:56:07] cerulean: has joined #RubyOnRails
[02:56:10] cerulean: anyone around?
[02:56:27] cerulean: I'm trying to figure out exactly how Rails daemonizes it's server processes in production
[02:56:30] cerulean: does anyone know?
[02:57:07] havenwood: cerulean: http://www.mikeperham.com/2014/09/22/dont-daemonize-your-daemons/
[02:58:23] cerulean: I must be clear on what I'm doing, this isn't for Ruby. I'm trying to add --daemonize to Amber/Crystal (ambercr.io)
[02:58:52] cerulean: I'm reading the article you sent
[03:03:40] cerulean: I was reading the Rails code and couldn't figure out how Rails was doing it
[03:10:50] Saukk: has joined #RubyOnRails
[03:15:55] jhfisc: has joined #RubyOnRails
[03:21:06] rattatmatt: has joined #RubyOnRails
[03:32:02] jhfisc: has joined #RubyOnRails
[03:32:49] knight33: has joined #RubyOnRails
[03:36:58] ascarter: has joined #RubyOnRails
[03:38:25] jhfisc: has joined #RubyOnRails
[03:41:23] quirkycoders: has joined #RubyOnRails
[03:44:38] jhfisc: has joined #RubyOnRails
[03:49:33] fryguy: cerulean: rails doesn't, it depends on what rack server you are using
[03:49:39] ahrs: has joined #RubyOnRails
[03:51:56] cerulean: I saw that. So I should check out puma?
[03:53:02] jhfisc: has joined #RubyOnRails
[03:56:08] Tempesta: has joined #RubyOnRails
[03:58:09] jhfisc: has joined #RubyOnRails
[04:00:08] fryguy: cerulean: if that's what you are going to use in production, yes
[04:01:01] jhfisc: has joined #RubyOnRails
[04:01:12] cerulean: well... this is for Crystal/Amber which I'm a core team member of... So it uses itself as the server... Aka it uses Amber/Crystal to host the server. We just lack --daemonize which I'm trying to add
[04:01:27] cerulean: I'll look at Puma source
[04:01:37] cerulean: if you're unfamiliar with crystal, https://crystal-lang.org
[04:04:55] cerulean: I guess I found https://github.com/puma/puma/blob/f5f23aaac7aaccff1b6b138d93dd4b1755ebf1c2/lib/puma/daemon_ext.rb but it would be nice to have an explanation of it
[04:10:16] fschuindt: ok, now that's funny: admin_supplier_category_supplier_supplier_managers_url, any tips to prevent/solve this ugly thing?
[04:11:03] cerulean: is this because of over-nesting of routes? how does this happen?
[04:11:37] fschuindt: supplier_categories has many suppliers, which has many supplier_managers
[04:11:37] sevenseacat: overnesting of overly-long named routes would certainly contribute to it
[04:11:42] cerulean: my guess would be name the routes saner?... i think with the as: directive you con manually specify the name.. have you tried to do that
[04:11:45] sevenseacat: routes don't need to match model structures
[04:12:08] fschuindt: I just set all RESTful
[04:12:29] sevenseacat: do you need 3 IDs in the URL for this route?
[04:12:36] sevenseacat: or would one or maybe two suffice?
[04:12:53] fschuindt: rsources :supplier_category do resources :supplier do etc
[04:13:27] fschuindt: yea, I already noticed, two is enough
[04:13:42] jhfisc: has joined #RubyOnRails
[04:14:48] fschuindt: I will refactor this stuff, thanks for the light sevenseacat, cerulean :]]
[04:26:41] jhfisc: has joined #RubyOnRails
[04:29:42] jhfisc: has joined #RubyOnRails
[04:35:14] Rodya_: has joined #RubyOnRails
[04:35:42] jhfisc: has joined #RubyOnRails
[04:48:09] duderonomy: has joined #RubyOnRails
[04:50:08] agent_white: has joined #RubyOnRails
[04:56:17] harfangk: has joined #RubyOnRails
[04:57:32] harfangk: what is the current best practie to add a method to a gem? (well, aside from the fact that what i'm doing is not a best practice at all...)
[05:00:59] dminuoso: harfangk: fork and modify.
[05:01:29] dminuoso: And possibly make a pull request if you want this to go upstream.
[05:08:22] harfangk: dminuoso: ok i will do that. thank you!
[05:11:51] SteenJobs: has joined #RubyOnRails
[05:12:03] tens0r: has joined #RubyOnRails
[05:31:20] Technodrome: has joined #RubyOnRails
[05:37:41] Rodya_: has joined #RubyOnRails
[05:39:31] mitt3ns: has joined #RubyOnRails
[05:41:44] srinidhi: has joined #RubyOnRails
[05:45:58] Jameser: has joined #RubyOnRails
[05:53:56] roshanavand: has joined #RubyOnRails
[05:56:09] Hess: has joined #RubyOnRails
[06:00:59] Hess: has joined #RubyOnRails
[06:05:38] xall: has joined #RubyOnRails
[06:19:41] gambl0re: has joined #RubyOnRails
[06:19:56] srinidhi: has joined #RubyOnRails
[06:21:42] barnex: has joined #RubyOnRails
[06:22:21] barnex: I'm having some trouble generating/viewing swagger docs with swagger-docs gem for rails api project. swagger-ui says "No operations defined in spec!".
[06:22:42] ur5us: has joined #RubyOnRails
[06:23:28] barnex: https://gist.github.com/barnaba/d7a8922bb09c66767fd6600b17fcf647 here are the generated json files
[06:24:08] barnex: Seems like it loads the summary ok when accessing with ui from server in the dev mode
[06:27:21] barnex: Googled about this a bit, and it seems like there was a problem with content-type that has been already fixed, and browsers dev console shows 'Content-Type:application/json
[06:27:24] barnex: anyway :<
[06:29:14] Jameser: has joined #RubyOnRails
[06:29:58] jhfisc: has joined #RubyOnRails
[06:31:09] mytrile: has joined #RubyOnRails
[06:32:52] barnex: seems like the gem might be a bit outdated, as swagger is in 2.0 now.
[06:36:29] dionysus69: has joined #RubyOnRails
[06:37:09] jhfisc: has joined #RubyOnRails
[06:39:54] conta: has joined #RubyOnRails
[06:42:41] jhfisc: has joined #RubyOnRails
[06:46:39] quazimodo: has joined #RubyOnRails
[06:54:52] timdotrb: has joined #RubyOnRails
[06:55:08] doublemalt_: has joined #RubyOnRails
[07:08:32] Jameser: has joined #RubyOnRails
[07:10:23] dionysus69: has joined #RubyOnRails
[07:15:08] Pumukel: has joined #RubyOnRails
[07:28:56] mudyc: has joined #RubyOnRails
[07:31:05] Jameser: has joined #RubyOnRails
[07:32:13] mudyc: Hi, I have irritating issue with post form. the params is having only controller and action - missing field values totally. i can see the field values in req.body. any idea where should i look into? form action is /bar_baz/foo and fields are named as foo_form[X]
[07:33:59] helpa: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[07:35:15] jhfisc: has joined #RubyOnRails
[07:37:30] mudyc: what codefile usually reads the params with webrick?
[07:38:43] Rodya_: has joined #RubyOnRails
[07:39:21] AzaToth: has joined #RubyOnRails
[07:45:37] Jameser: has joined #RubyOnRails
[07:47:39] arBmind: has joined #RubyOnRails
[07:53:57] jhfisc: has joined #RubyOnRails
[07:55:05] shilon: has joined #RubyOnRails
[07:58:30] duderonomy: has joined #RubyOnRails
[07:59:01] jhfisc: has joined #RubyOnRails
[08:04:16] jhfisc: has joined #RubyOnRails
[08:05:44] mikecmpbll: has joined #RubyOnRails
[08:07:18] patarr: has joined #RubyOnRails
[08:10:04] jeanre: has joined #RubyOnRails
[08:10:30] Andr3as: has joined #RubyOnRails
[08:10:34] jeanre: whats the prefer ui layer for rails? (angular, react or just stock haml, erb)
[08:11:20] jeanre: and is it now the standard to use rails just as API and not for UI related apps?
[08:16:43] dminuoso: jeanre: No preference, whatever floats your boat.
[08:17:00] dminuoso: jeanre: Most commonly actually the rails view layer is still used, but its crufty and not flexible.
[08:17:27] dminuoso: jeanre: When you turn rails into a pure API, it doesn't matter which frontend you use at all.
[08:18:16] jeanre: I am starting a new app
[08:18:28] jeanre: and thinking that I should just stick to rails view layer + haml
[08:18:38] dminuoso: jeanre: Are you the only developer?
[08:19:03] dminuoso: jeanre: Personally I would recommend to avoid the rails view layer if at all possible then.
[08:19:17] jeanre: so basically have two apps?
[08:19:20] dminuoso: (Unless you have some trivial CRUD application, and don't need a responsive UI)
[08:19:20] jeanre: \ui and api?
[08:19:24] dminuoso: jeanre: Yeah.
[08:19:35] jeanre: then I could just use expressjs and angualr
[08:19:42] dminuoso: jeanre: Indeed you could. ;-)
[08:19:46] quirkycoders: has joined #RubyOnRails
[08:19:57] jeanre: or hapi or some other crap
[08:20:35] dminuoso: jeanre: I guess it boils down whether you are comfortable with what Rails offers in the backend (Ruby, ActiveSupport, ActiveRecord, Rack) with all the libraries around it, or not.
[08:20:47] jeanre: does not really matter to me
[08:20:58] dminuoso: jeanre: Do you want a responsive and dynamic UI?
[08:21:07] jeanre: have done plenty of backends in node, rails etc...
[08:21:11] dminuoso: Or is a simple statically many-site generated UI fine?
[08:21:19] jeanre: dminuoso we might need that in the end
[08:21:32] dminuoso: jeanre: There you go then. ;-)
[08:22:22] dminuoso: jeanre: We have established that the backend is irrelevant, and that you will probably need a modern client-side frontend. I would base the decision based on experience then.
[08:22:42] dminuoso: If your team is more experienced with express, use that rather.
[08:22:58] jeanre: yup thanks
[08:23:55] xall: has joined #RubyOnRails
[08:24:04] matthewd: "we might need ['a responsive and dynamic UI'] in the end" --> We have established that the backend is irrelevant, and that you will probably need a modern client-side frontend
[08:24:25] dminuoso: matthewd: I think you have taken that out of context.
[08:24:42] dminuoso: We have established that the backend is irrelevant -> refers to: 10:20:47 jeanre | does not really matter to me
[08:25:04] dminuoso: [...] and that you will probably need a modern client-side frontend -> refers to: 10:21:19 jeanre | dminuoso we might need that in the end
[08:30:05] jhfisc: has joined #RubyOnRails
[08:35:19] jhfisc: has joined #RubyOnRails
[08:39:38] lxsameer: has joined #RubyOnRails
[08:40:23] xMopxShell: has joined #RubyOnRails
[08:41:15] jhfisc: has joined #RubyOnRails
[08:43:23] marr: has joined #RubyOnRails
[08:43:24] srinidhi: has joined #RubyOnRails
[08:52:21] jhfisc: has joined #RubyOnRails
[08:58:14] jhfisc: has joined #RubyOnRails
[08:59:19] ferr: has joined #RubyOnRails
[09:04:44] jhfisc: has joined #RubyOnRails
[09:04:50] freedrull: has joined #RubyOnRails
[09:08:26] jhfisc: has joined #RubyOnRails
[09:12:35] arBmind: has joined #RubyOnRails
[09:14:22] jhfisc: has joined #RubyOnRails
[09:17:51] freedrull: i have a rails app running on unicorn/nginx , using devise for authentication, sessions#create seems to typically take just over 1000ms. is it reasonable to think that this could be faster? https://gist.github.com/mcfiredrill/f84a16fa6c51dae408f276f3eba431c6
[09:22:46] universa1: freedrull: it took 140ms... so without knowing what your server specs are, etc... hard to tell.
[09:24:04] freedrull: i am actually running a curl command, and timing that i get 1000ms....ill add that to the gist. if the logs say 140ms what is the other time coming from?
[09:24:48] jarr0dsz: has joined #RubyOnRails
[09:25:02] universa1: freedrull: your request needs to travel through the internetz to the server and back from the server to your machine.
[09:25:10] wethu: has joined #RubyOnRails
[09:25:22] jarr0dsz: hi everyone, is there an easy way to add an element to an AR object? say User.first_name, could I add a User.extra in code ?
[09:25:36] universa1: 140ms seems ok, just tried on one of my sites and i got 135ms...
[09:25:36] freedrull: universa1: sure, still though. 1000ms? reasonable?
[09:25:46] mikecmpbll: https://github.com/plataformatec/devise#configuring-models streches?
[09:25:59] freedrull: i see thanks
[09:26:05] universa1: freedrull: we don't know... what is your latency to the server? what is your connection? ...
[09:26:24] mikecmpbll: often password hashing is deliberately slow to prevent bruteforce type stuff
[09:26:38] freedrull: yeah i probably don't want to set that below 10
[09:26:41] universa1: freedrull: the stretches will not speed up the 860ms of the 1000ms ...
[09:26:56] universa1: jarr0dsz: attr_accessor :extra ...
[09:27:00] sekmo: has joined #RubyOnRails
[09:27:03] mikecmpbll: ah, didn't read the interim discussion
[09:27:07] mikecmpbll: was lookin for that option :p
[09:27:08] universa1: ohh my bad, you wanted it on the class: cattr_accessor
[09:27:38] jarr0dsz: universa1 I need to add it a for each loop, i know i can add that to the model. but say I have a User object I just need to insert a custom element
[09:28:05] universa1: jarr0dsz: i don't understand what you are trying to do...
[09:29:02] jarr0dsz: universa1 I want to add a custom value to User object. So If user had only a User.first_name I want , in code, add an extra element say User.mycustomelement = "123"
[09:29:18] matthewd: jarr0dsz: Use a hash (keyed by the model instance), or create a new class (with the model as one member)
[09:29:20] jarr0dsz: So when I do as User.inspect it would like User.first_name, User.mycustomelement
[09:29:41] universa1: jarr0dsz: User is the class... show code... ...sounds like you are trying to do something weird...
[09:29:45] matthewd: You keep saying 'User'. I don't think that means what you think it means.
[09:30:37] jhfisc: has joined #RubyOnRails
[09:31:21] jarr0dsz: like so https://gist.github.com/anonymous/1d685350cb364c2d78d3dee6934186a4
[09:31:38] jarr0dsz: digged the manual really cannot figure it out frustrating as hell, it can't be that hard to just add a object element somehow in rails
[09:32:05] universa1: jarr0dsz: class User < ApplicationRecord; attr_accessor :stupid; end
[09:32:08] matthewd: jarr0dsz: But what are you going to do with it? Why do you want it there?
[09:32:12] helpa: It seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[09:32:20] jarr0dsz: I need an extra value in the user object that is not there normally.
[09:32:23] universa1: jarr0dsz: user.stupid = 'blabla'
[09:34:19] jarr0dsz: ah that is so simple indeed *slams himself thank you very much for pointing me out
[09:34:35] universa1: *cough* look back 8 minutes...
[09:35:15] quirkycoders: has joined #RubyOnRails
[09:35:48] jhfisc: has joined #RubyOnRails
[09:36:52] jarr0dsz: hm only it still does not work I do like https://gist.github.com/anonymous/3c651442653706a31f7c5964fbf9152e
[09:37:07] jarr0dsz: I changed the model with atr uuid
[09:39:30] universa1: jarr0dsz: how long have you been in this channel? make a useful gist or stop wasting peoples time....
[09:45:53] patarr: has joined #RubyOnRails
[09:47:34] jarr0dsz: its just a very simple question with a very simple case.. i could have included the object definition
[09:48:17] jarr0dsz: it still does not work i can set request.uuid = 'xxx' but request would still be the existing object so i need to merge them somehow. seems to be not explained anywhere
[09:48:18] universa1: jarr0dsz: my tablet doesn't work. what is wrong?
[09:48:28] universa1: jarr0dsz: o0
[09:54:06] jhfisc: has joined #RubyOnRails
[09:56:23] doublemalt_: has joined #RubyOnRails
[09:59:05] jarr0dsz: very helpfull yeah
[10:05:49] jhfisc: has joined #RubyOnRails
[10:12:27] jhfisc: has joined #RubyOnRails
[10:17:49] jhfisc: has joined #RubyOnRails
[10:22:04] delgiudices: has joined #RubyOnRails
[10:27:41] shilon: has joined #RubyOnRails
[10:29:42] jhfisc: has joined #RubyOnRails
[10:37:17] arup_r: has joined #RubyOnRails
[10:37:44] alfiemax: has joined #RubyOnRails
[10:38:06] alfiemax: what could be the reason for this error when i try to connect to a websocket channe; :
[10:38:13] alfiemax: Could not execute command from {"command"=>"subscribe", "identifier"=>"{\"channel\":\"ChatChannel\"}"}) [KeyError - key not found: "data"]
[10:40:03] alfiemax: https://www.justbeamit.com/y2d7z
[10:41:29] jhfisc: has joined #RubyOnRails
[10:42:58] alfiemax: here's a screenshot : https://unsee.cc/sipareto/
[10:47:42] jhfisc: has joined #RubyOnRails
[10:53:38] arup_r: has left #RubyOnRails: ()
[10:53:39] arup_r: has joined #RubyOnRails
[10:57:57] shotbug: has joined #RubyOnRails
[10:59:44] jhfisc: has joined #RubyOnRails
[11:06:19] delgiudices: has joined #RubyOnRails
[11:11:46] jhfisc: has joined #RubyOnRails
[11:13:13] workmad3: has joined #RubyOnRails
[11:14:08] arup_r: has joined #RubyOnRails
[11:29:13] xiljin: has joined #RubyOnRails
[11:31:15] xall: has joined #RubyOnRails
[11:39:49] jhfisc: has joined #RubyOnRails
[11:41:04] Cork: active support distance seams to be completely broken in rails 5.1.2 > 167.seconds / 1.minute = 2 seconds
[11:42:32] Cork: (sorry meant duration not distance)
[11:50:40] jhfisc: has joined #RubyOnRails
[12:00:33] DaveTabo_: has joined #RubyOnRails
[12:02:28] DaveTabo_: has joined #RubyOnRails
[12:02:54] Chernobuk: has joined #RubyOnRails
[12:05:47] jhfisc: has joined #RubyOnRails
[12:12:24] jhfisc: has joined #RubyOnRails
[12:12:39] lexileo: has joined #RubyOnRails
[12:16:13] mtkd: has joined #RubyOnRails
[12:17:48] jhfisc: has joined #RubyOnRails
[12:35:33] jhfisc: has joined #RubyOnRails
[12:35:52] DrYockel: has joined #RubyOnRails
[12:39:33] sevenseacat: seems legit - 167 / 60 = 2 in integer division
[12:41:28] gil_: has joined #RubyOnRails
[12:43:19] jhfisc: has joined #RubyOnRails
[12:49:42] jhfisc: has joined #RubyOnRails
[12:54:29] mwlang: has joined #RubyOnRails
[12:59:23] DaveTaboola: has joined #RubyOnRails
[13:00:04] jhfisc: has joined #RubyOnRails
[13:00:33] truenito: has joined #RubyOnRails
[13:00:57] truenito: has joined #RubyOnRails
[13:06:34] cgfbee: has joined #RubyOnRails
[13:09:15] Technodrome: has joined #RubyOnRails
[13:09:30] jhfisc: has joined #RubyOnRails
[13:14:39] jhfisc: has joined #RubyOnRails
[13:14:50] Ergo: has joined #RubyOnRails
[13:19:42] jhfisc: has joined #RubyOnRails
[13:22:06] mwlang: I am using find_in_batches to iterate through records and add them to Solr Sunspot index. However, at random points in the process I get “NoMethodError: undefined method `each' for nil:NilClass” How is that possible? Here’s the gist of the code and error: https://gist.github.com/mwlang/39e8a620cf533afcb45f9a00a937d6b4
[13:25:46] jhfisc: has joined #RubyOnRails
[13:27:39] workmad3: has joined #RubyOnRails
[13:30:36] jhfisc: has joined #RubyOnRails
[13:33:07] dminuoso: mwlang: Please correlate the stack trace to the rake file
[13:34:52] mwlang: Line #105 in the stack trace is line #9 in update.rake file.
[13:35:00] dminuoso: mwlang: Actually: Please upgrade to a supported version of rails.
[13:35:17] dminuoso: mwlang: With such old versions its conceivable that you are stumbling over a bug that may have been fixed along the way.
[13:35:44] mwlang: dminuoso: can’t upgrade, yet. 4.1 series is last series supporting, *gasp* SQL Server 2005.
[13:36:46] dminuoso: mwlang: Surely you can at the very least upgrade the patch version.
[13:37:06] mwlang: dminuoso: yes. Let me see where that’s at.
[13:37:46] mwlang: hmmm…as far as I can tell, I’m on the latest: https://rubygems.org/gems/rails/versions/4.1.16
[13:38:07] dminuoso: mwlang: Somehow I kept reading 4.1.6, my apologies.
[13:39:15] shotbug: has joined #RubyOnRails
[13:40:48] mwlang: Trying a smaller batch size…just saw this comment in the AR source near where the nil error is raised: # Some databases impose a limit on the number of ids in a list (in Oracle it's 1000)
[13:41:31] dminuoso: mwlang: It looks like it might be a bug in your database adapter.
[13:42:06] dminuoso: Though.. no.
[13:43:03] dminuoso: mwlang: I dont want to judge this without fully understanding what your adapter does.
[13:44:48] dminuoso: mwlang: It would be easiest to pry into that method associated_records_by_owner when that access at line 93 fails.
[13:44:58] dminuoso: mwlang: And then look around, see what owner_key is, what owners_map looks like.
[13:46:07] mwlang: dminuoso: I suspect you’re on the right track though. with 2005, limit and offset are basically emulated with some trickery, so I tend to suspect that’s where the real error is occurring.
[13:47:20] mwlang: and good idea about utilizing pry to poke around.
[13:48:41] chouhoulis: has joined #RubyOnRails
[13:50:24] Jameser: has joined #RubyOnRails
[13:57:10] dminuoso: mwlang: If I compare it to languages like C/C++, then it's actually quite sad how we have to debug ruby applications by manually dropping pry. The things that gdb offers are insane.
[13:59:22] mwlang: dminuoso: yeah, I agree. I’ve always likened debugging ruby code to “debugging with blinders on”
[13:59:39] mwlang: That is *one* aspect of compiled languages I do miss.
[14:00:50] dminuoso: mwlang: What is a "compiled language" ?
[14:01:36] Jameser: has joined #RubyOnRails
[14:03:03] mwlang: the contents of owner_keys doesn’t make a whole lotta sense at the moment. It’s mostly the Item ID for the keys, but there’s also other values in there like item_type_names
[14:03:14] mwlang: dminuoso: compilable* C, C++, Pascal, etc.
[14:03:26] mwlang: i.e. languages not interpreted.
[14:03:35] dminuoso: mwlang: The distinction is silly and ill-conceived.
[14:03:59] mwlang: huh? how so?
[14:04:19] dminuoso: mwlang: What is Ruby in your opinion?
[14:04:33] mwlang: runtime interpreted
[14:04:49] dminuoso: mwlang: It doesn't have to be. You can pre-compile ruby code.
[14:05:07] dminuoso: mwlang: And there are C REPL programs.
[14:05:25] mwlang: I thought many were attempting just that, but not yet achieved…hence variations like Crystal.
[14:05:41] mwlang: …or mini-ruby, IIRC
[14:05:57] dminuoso: mwlang: Ruby is compiled to bytecode, which is seperately run on a virtual machine.
[14:06:13] dminuoso: mwlang: You can manually decouple these steps. In Ruby 3.0 we will get extensive support for libraries in this area.
[14:06:19] dminuoso: It's very similar to Java in that aspect
[14:06:41] mwlang: news to me…but then, I haven’t been following the latest Ruby news lately.
[14:06:57] dminuoso: mwlang: I reckon it's mostly an attempt to differentiate between AOT compilation and JIT compilation. But those are not limitations of the language, but features of specific implementations.
[14:07:05] dminuoso: And AOT does not imply improved debuggability.
[14:07:09] dminuoso: gdb can debug java too
[14:07:14] jhfisc: has joined #RubyOnRails
[14:07:30] dminuoso: mwlang: The ruby VM was added in 1.9
[14:07:39] dminuoso: The old AST interpreter died with 1.8
[14:08:49] mwlang: I guess the question is, are we able to debug and think “in Ruby” or are we tracing through the underlying C constructs?
[14:09:06] dminuoso: mwlang: You can actually debug Ruby with gdb
[14:09:55] dminuoso: mwlang: You can even eval ruby things (though you have to very careful there) from within gdb with some minor work.
[14:10:29] jhfisc: has joined #RubyOnRails
[14:13:39] mwlang: reading some blogs on the topic now.
[14:16:34] DLSteve: has joined #RubyOnRails
[14:16:45] cam27: has joined #RubyOnRails
[14:19:44] jhfisc: has joined #RubyOnRails
[14:25:07] Jameser: has joined #RubyOnRails
[14:25:21] jhfisc: has joined #RubyOnRails
[14:29:56] jhfisc: has joined #RubyOnRails
[14:31:57] Aherin: has joined #RubyOnRails
[14:33:31] mikecmpbll: has joined #RubyOnRails
[14:33:53] jphase: has joined #RubyOnRails
[14:34:56] arup_r: has joined #RubyOnRails
[14:42:46] mwlang: dminuoso: It appears the owner_keys is collecting items by the item_type_name field and one key value in particular “bom” is the key that generates the nil error. Which is weird because there’s otherwise nothing special about that key and it’s not a data PK/FK consistency issue as far as I can tell: ItemType.pluck(:name)
[14:42:46] mwlang: => ["bom", "book", "Bundle-Auto", "Bundle-Combo", "Bundle-premade", "E-book", "E-chapter", "E-compendium", "e-item", "E-variant", "item", "service", "Variant”]
[14:44:38] jhfisc: has joined #RubyOnRails
[14:48:27] dminuoso: mwlang: I dont know what that means.
[14:49:04] S007: has joined #RubyOnRails
[14:49:37] dminuoso: mwlang: What does `owners`, `owner_key_name`, `owners_map`, and `owner_keys` give you?
[14:52:30] jhfisc: has joined #RubyOnRails
[14:54:27] arup_r: has joined #RubyOnRails
[15:00:33] matthewd: mwlang: Item.where(name: "bom").pluck(:name).uniq
[15:02:39] jhfisc: has joined #RubyOnRails
[15:06:24] mwlang: owner_key is “bom” owners_map.keys only has “book” => {"book"=>[#<Item id: 9780882665818, item_type_name: "book", ean: "9780882665818", …..
[15:07:19] mwlang: owner_key_name, I didn’t see that one in the source…
[15:08:17] mwlang: essentially what I’m saying is I am getting an owners_map with “book”, “E-book”, “item”, and a few others, but for some reason, it’s consistently missing “bom” as a key.
[15:08:46] mwlang: yet, all these keys exists in the item_types table.
[15:09:58] mwlang: matthewd: Item.where(item_type_name: "bom").pluck(:item_type_name).uniq => ["BOM", "bom"]
[15:10:29] matthewd: Yeah, that's your problem
[15:10:38] mwlang: matthewd: you nailed it, alright!
[15:11:08] mwlang: how’d you deduce that one?
[15:13:23] matthewd: I looked through the code and saw it reduced to the LHS and RHS values not being equal, and then it started to sound familiar
[15:14:23] matthewd: So, the problem is that MySQL and Ruby disagree about whether those strings are equal, because MySQL
[15:15:00] dminuoso: Well SQL Server 2005 in this case I guess
[15:15:01] irishfromua: has joined #RubyOnRails
[15:15:20] dminuoso: matthewd: Which LHS/RHS are you referring to
[15:15:30] matthewd: Oh right, I guess so
[15:16:11] matthewd: The FK & PK in the [equivalent of the] join equality
[15:16:59] mikecmpbll: has joined #RubyOnRails
[15:17:02] mwlang: well, waddya know…found “BOM” as the key in the owners_map: … "BOM"=>[#<Item id: 97807623 …
[15:17:20] jhfisc: has joined #RubyOnRails
[15:18:45] mwlang: I reckon first step is to downcase “BOM” to “bom” in the database, but I may also monkey patch AR to altogether prevent same error until we can get all the legacy code ported.
[15:19:34] dminuoso: matthewd: You lost me with the join.
[15:19:38] matthewd: mwlang: So: [ruby] `"BOM".eql? "bom" # => false`; [SQL] `"BOM" = "bom" -- => true` (apparently?)
[15:20:45] mwlang: yeah, “BOM” == “bom” in SQL Server due to the collation settings chosen.
[15:20:57] mwlang: using a case-insensitive collation.
[15:21:49] mwlang: so monkey patch I’m considering is to patch setting owner_keys to lowercased of the field’s value.
[15:21:51] matthewd: dminuoso: We're processing Item.includes(:item_type), so we're joining items and item_types on (items.item_type_name = item_types.name)
[15:22:42] mwlang: but I’m going to see if I can find where in the old code “BOM” in all caps is being introduced in the data. If I can stop it there, then no patching needed.
[15:22:44] dminuoso: matthewd: Okay, in most my models the includes emit separate queries rather than join queries, which is why I didn't even consider that.
[15:24:36] matthewd: dminuoso: Right, thus "equivalent". If it really did an SQL join, it'd work... but because we're effectively emulating the join in ruby, we trip on differing definitions of equality
[15:27:59] mwlang: this is just another good reason not to go against the grain with AR. original developers avoided auto-incrementing primary key ID columns on nearly 80% of the look tables and try to make joins by “name” and “code” etc. fields. It just doesn’t work all that well.
[15:28:34] jhfisc: has joined #RubyOnRails
[15:29:10] mwlang: the original was built back in 2007, so I can’t say I’m too surprised to see “old school” thinking colliding with how AR was intended to work.
[15:38:33] Technodrome: has joined #RubyOnRails
[15:47:00] renegadeandy: has joined #RubyOnRails
[15:47:13] renegadeandy: why when i run this in my view do i get extra quotes everywhere in the json object? https://gist.github.com/anonymous/a9f37cac3a7c66aca24c39b5347932cd
[15:49:56] conta1: has joined #RubyOnRails
[15:52:34] workmad3: has joined #RubyOnRails
[15:53:35] jhfisc: has joined #RubyOnRails
[15:56:32] cerulean: renegadeandy: what do you mean by "extra quotes everywhere" ?
[15:56:41] cerulean: sample output plz?
[15:57:05] cerulean: here's why probably:
[15:57:17] cerulean: you convert an object to json, store it in an array, and then convert it to json again
[15:57:31] cerulean: therefore, you json encoded a json encoded object
[15:57:48] cerulean: don't call as/to_json until the object is "complete"
[15:58:09] cerulean: ACTION looks for backup from the pro's. right, guys? :D
[16:00:26] quirkycoders: has joined #RubyOnRails
[16:02:08] quirkycoders: has joined #RubyOnRails
[16:04:05] jhfisc: has joined #RubyOnRails
[16:06:00] renegadeandy: cerulean: hey! So this is what you asked for : https://gist.github.com/anonymous/b273536e9cd468148ac10d6f1c4b7bac I also removed the obj.as_json from the input to the array and changed it back to just array << obj
[16:06:16] renegadeandy: still get too many escaped quotations instead of normal quotations
[16:08:19] tbuehlmann: renegadeandy: try <%= @legs_json.html_safe %>
[16:12:19] spastorino: has joined #RubyOnRails
[16:16:24] mwlang: has joined #RubyOnRails
[16:18:00] jhfisc: has joined #RubyOnRails
[16:20:27] Aherin: has joined #RubyOnRails
[16:23:29] jhfisc: has joined #RubyOnRails
[16:29:46] Rodya_: has joined #RubyOnRails
[16:32:12] renegadeandy: tbuehlmann: hey! That gets me : undefined method `html_safe' for #<Array:0x007ff2db65c090>
[16:32:51] tbuehlmann: oh, you return as_json. you want it as a string, right?
[16:35:22] renegadeandy: tbuehlmann: yeah , suppose, so it needs to be legs_array.as_json.to_s
[16:35:27] renegadeandy: then in the view to .html_safe
[16:35:34] DrYockel1: has joined #RubyOnRails
[16:36:54] tbuehlmann: or just to_json instead of as_json
[16:37:32] jhfisc: has joined #RubyOnRails
[16:40:04] quirkycoders: has joined #RubyOnRails
[16:41:11] Aherin: has joined #RubyOnRails
[16:41:57] mtkd: has joined #RubyOnRails
[16:42:50] arup_r: has joined #RubyOnRails
[16:45:07] renegadeandy: tbuehlmann: i read as_json was better than to_json? Whats differnefc/
[16:45:31] tbuehlmann: where do you read that? they are doing different things
[16:46:17] tbuehlmann: I suggest just trying in a rails console
[16:47:38] jhfisc: has joined #RubyOnRails
[16:48:53] workmad3: has joined #RubyOnRails
[16:51:43] renegadeandy: tbuehlmann: it was various SO answers on how to render json from an instance object in rails
[16:51:52] renegadeandy: to_json and html_safe combination worked nicely - thank you!
[17:10:16] kies: has joined #RubyOnRails
[17:17:15] jhfisc: has joined #RubyOnRails
[17:19:46] Rodya_: has joined #RubyOnRails
[17:25:21] Sylario: has joined #RubyOnRails
[17:25:45] Sylario: If someone has action mailer preview skills, I am a bit lost : https://stackoverflow.com/questions/44911339/mailer-preview-not-working
[17:28:56] jhfisc: has joined #RubyOnRails
[17:30:28] Sylario: it's kind of a day off in the US isn't it?
[17:32:00] chouhoulis: has joined #RubyOnRails
[17:39:19] duderonomy: has joined #RubyOnRails
[17:39:33] jhfisc: has joined #RubyOnRails
[17:40:33] irishfromua: has joined #RubyOnRails
[17:41:43] havenwood: sylario Yeah, it's a holiday.
[17:44:11] arup_r: has joined #RubyOnRails
[17:44:41] jhfisc: has joined #RubyOnRails
[17:46:09] tbuehlmann: too bad only people from the US ever help others
[17:46:40] Sylario: rails is harder on non EN speaker than other programming languages
[17:47:06] havenwood: It's hard not being a programming language but having folk always call you one.
[17:48:12] Sylario: yeah sorry, framework
[17:48:16] dionysus69: has joined #RubyOnRails
[17:48:25] Sylario: pluraslisation was crazy when I started
[17:48:57] havenwood: sylario: It's not reliable in English either. What framework has i18n pluralization?
[17:49:02] Sylario: took me hours to realise IES->Y
[17:49:45] havenwood: sylario: A framework really has i18n pluralization???
[17:50:05] Sylario: no, I meant i did not knew english rules for pluralization
[17:50:12] Sylario: i thought it was just +s
[17:51:29] havenwood: 'person'.pluralize #=> "people"
[17:51:38] havenwood: sylario: yeah, weird rules in English, no doubt
[17:51:39] Sylario: Also I think (may be wrong) that the argument around Ruby being almost like natural english played against it
[17:52:02] Sylario: English is super easy
[17:52:04] AckZ: has left #RubyOnRails: ()
[17:53:58] jhfisc: has joined #RubyOnRails
[17:54:04] Sylario: well, maybe I should revise that when I see my friends not even able to do a mail to an online shop when they had 10+ years of english at school
[17:54:11] duderonomy: has joined #RubyOnRails
[17:59:50] Sylario: well it seems my mailer is impossible to access because of rules for locale URL
[18:01:45] renegadeandy: hi everyone. IN a css file, how do i reference the URL of an image - for a background-image rule?
[18:08:09] iamkoaala: has joined #RubyOnRails
[18:10:14] iamkoaala: I keep getting the same error even if I change my ruby-oci8 version, Ruby-oci8 2.2.2 doesn't support Oracle 9iR2. Use ruby-oci8 2.1.x instead. (LoadError), any way I can fix this?
[18:11:30] Sylario: renegadeandy: background-image: url("http://www.example.com/bck.png");
[18:11:38] Sylario: renegadeandy: https://developer.mozilla.org/en-US/docs/Web/CSS/background-image
[18:12:12] Sylario: usual client side relative path applies
[18:15:10] cam27: has joined #RubyOnRails
[18:15:45] jhfisc: has joined #RubyOnRails
[18:20:52] sagax: has joined #RubyOnRails
[18:22:12] renegadeandy: sylario: how does that work with the asset pipeline>?
[18:22:38] Sylario: renegadeandy: it does not
[18:22:54] Sylario: CSS are compiled when you compile assets, usually, at deployment
[18:23:28] Sylario: and by compile, I mean Sass compile or that kind of stuff
[18:23:29] tbuehlmann: renegadeandy: http://guides.rubyonrails.org/asset_pipeline.html#css-and-sass
[18:26:12] renegadeandy: tbuehlmann: ok so I have : background: image-url('/jTLine/cd-arrow.svg') which is not working
[18:26:30] renegadeandy: my image is in assets/images/jTLine/cd-arrow.svg
[18:26:56] Sylario: css syntax is wrong
[18:27:53] Sylario: try to use an editor with css autocompletion and highlighting
[18:32:37] srinidhi: has joined #RubyOnRails
[18:34:46] jhfisc: has joined #RubyOnRails
[18:37:26] renegadeandy: sylario: i don't see what syntax is wrong
[18:37:45] renegadeandy: background: image-url('/jTLine/cd-arrow.svg') no-repeat 0 0;
[18:38:45] tbuehlmann: renegadeandy: what's not working? what is the error?
[18:40:20] jhfisc: has joined #RubyOnRails
[18:45:00] pLaTo0n: has joined #RubyOnRails
[18:46:31] renegadeandy: tbuehlmann: nothing - the image just doesn;t show
[18:49:01] arBmind: has joined #RubyOnRails
[18:49:23] xMopxShell: has joined #RubyOnRails
[18:49:49] jhfisc: has joined #RubyOnRails
[18:52:27] renegadeandy: in the css on the page it renders this css
[18:52:28] renegadeandy: background: image-url('/jTLine/cd-arrow.svg') no-repeat 0 0;
[18:56:29] Sylario: it's background-image: url
[18:56:51] jhfisc: has joined #RubyOnRails
[18:57:04] Sylario: tbuehlmann: cannot find any reference to image-url in CSS
[18:57:27] npgm: has joined #RubyOnRails
[18:57:30] renegadeandy: sylario: thats a rails command - but im not sure it works in css land... tbuehlmann?
[18:58:22] Sylario: rails command use _
[18:58:46] Sylario: and you cannot use ruby syntax in CSS.
[18:58:57] arBmind: has joined #RubyOnRails
[18:59:04] Sylario: AS i said, CSS are generated once, at deployment
[18:59:05] tbuehlmann: renegadeandy: did you forget <%= %>?
[19:00:00] Sylario: what is the file where the CSS is located?
[19:00:23] tbuehlmann: oh wait, we are in scss land, nevermind
[19:00:46] tbuehlmann: renegadeandy: what does the generated css look like? what does your network tab say?
[19:00:53] renegadeandy: tbuehlmann: aha yes
[19:00:57] renegadeandy: didnt realise you needed them in there
[19:01:48] renegadeandy: tbuehlmann: background: <%= image-url('/jTLine/cd-arrow.svg') %> no-repeat 0 0; also doesn't work
[19:02:37] tbuehlmann: yeah, no, <%= not needed
[19:03:03] tbuehlmann: but my questions remain
[19:03:42] renegadeandy: tbuehlmann: we are not in scss land?
[19:03:44] renegadeandy: this is a css file
[19:04:00] renegadeandy: generated css is as I said before
[19:04:07] renegadeandy: background: image-url('/jTLine/cd-arrow.svg') no-repeat 0 0;
[19:04:33] tbuehlmann: if you don't use sass, see http://guides.rubyonrails.org/asset_pipeline.html#css-and-erb
[19:06:44] jhfisc: has joined #RubyOnRails
[19:07:47] renegadeandy: i do use sass
[19:07:51] renegadeandy: but this file is not an scss file
[19:12:04] renegadeandy: this file is located in
[19:12:17] renegadeandy: assets/stylesheets/lib/jTLine/style.css
[19:12:31] fryguy: renegadeandy: right, so read that linked documentation
[19:13:09] gambl0re: has joined #RubyOnRails
[19:15:25] renegadeandy: i rename it to style.css.erb
[19:15:58] renegadeandy: <%= image_url('/jTLine/cd-arrow.svg %>
[19:16:38] renegadeandy: fryguy: leaving me with
[19:16:38] renegadeandy: background: url(<%= image_url('/jTLine/cd-arrow.svg') %>) no-repeat 0 0;
[19:18:23] renegadeandy: which resolves to
[19:18:24] renegadeandy: background: url(/jTLine/cd-arrow.svg) no-repeat 0 0;
[19:18:31] renegadeandy: which doesn't display my image
[19:18:53] renegadeandy: image is in app/assets/images/jTLine/
[19:19:11] fryguy: renegadeandy: what environment are you running this in
[19:19:25] renegadeandy: mac, rails 5.1.1, development
[19:20:59] fryguy: what if you get rid of the leading slash
[19:21:30] renegadeandy: oh how annoying
[19:21:53] renegadeandy: thank you fryguy
[19:22:01] renegadeandy: and tbuehlmann
[19:22:41] tbuehlmann: mind sharing what did it?
[19:25:06] jhfisc: has joined #RubyOnRails
[19:26:51] gamblor3: has joined #RubyOnRails
[19:37:04] jhfisc: has joined #RubyOnRails
[19:38:09] podlech: has joined #RubyOnRails
[19:42:49] jhfisc: has joined #RubyOnRails
[19:48:18] jhfisc: has joined #RubyOnRails
[19:51:15] jhfisc: has joined #RubyOnRails
[19:52:10] delgiudices: has joined #RubyOnRails
[19:54:28] cam27: So I’ve read close to 1500 pages on Ruby/Rails/BDD and would like to finsish a project I started a year ago, but was not good enough at the time to finsih it. (I was following an online tutorial that din’t work) just wondering if anyone would be interested in doing a screen sharing session with and we could get it working. Looking to become a better Rails developer, and I think pair programing with someone with experiecne
[19:54:29] cam27: would help a lot
[19:58:47] jhfisc: has joined #RubyOnRails
[20:01:13] mtkd: has joined #RubyOnRails
[20:07:19] renegadeandy: tbuehlmann: the solution was : change the file name from style.css to style.css.erb and then change the line of code to : background: url(<%= image_url('jTLine/cd-arrow.svg') %>) no-repeat 0 0; in partiular removing the first / in the path which is no longer present :)
[20:07:29] renegadeandy: cam27: i am not a pro by any stretch - but I get by
[20:07:36] renegadeandy: pm me if you like
[20:07:52] cam27: Thank you renegadeandy
[20:09:46] knight33: has joined #RubyOnRails
[20:14:40] jhfisc: has joined #RubyOnRails
[20:23:58] NeutronStarr: has joined #RubyOnRails
[20:25:40] ur5us: has joined #RubyOnRails
[20:26:22] NoGodDamnIdea: has joined #RubyOnRails
[20:27:43] umaaji: has joined #RubyOnRails
[20:32:32] jhfisc: has joined #RubyOnRails
[20:35:43] jhfisc: has joined #RubyOnRails
[20:36:07] ascarter: has joined #RubyOnRails
[20:37:49] netzfisch: has joined #RubyOnRails
[20:43:22] xMopxShell: has joined #RubyOnRails
[20:44:50] Aherin: has joined #RubyOnRails
[20:50:02] jhfisc: has joined #RubyOnRails
[20:50:10] HoierM_: has joined #RubyOnRails
[20:50:32] podlech: has joined #RubyOnRails
[20:55:11] delgiudices: has joined #RubyOnRails
[20:59:48] tofutoon: has joined #RubyOnRails
[21:00:57] jhfisc: has joined #RubyOnRails
[21:04:01] delgiudices: has joined #RubyOnRails
[21:08:54] tofutoon: In the following arel fragment ( https://dpaste.de/bUkj ), how can I construct an arel AST that gives the same SQL? I'm running into a problem with order of operations.
[21:09:36] delgiudices: has joined #RubyOnRails
[21:09:57] tofutoon: I'm hoping to replace the first version of final_window_selector with the second version of final_window_selector.
[21:10:29] jhfisc: has joined #RubyOnRails
[21:12:53] tofutoon: The problem is that Arel::Nodes::Division isn't creating SQL that divides the first argument by the second. It is appending "/ <second argument>", which is somewhat odd behavior.
[21:16:30] jhfisc: has joined #RubyOnRails
[21:16:39] delgiudices: has joined #RubyOnRails
[21:24:27] jhfisc: has joined #RubyOnRails
[21:26:22] tobh: has joined #RubyOnRails
[21:26:38] helpa-bot: has joined #RubyOnRails
[21:26:56] delgiudices: has joined #RubyOnRails
[21:28:19] helpa: has joined #RubyOnRails
[21:29:17] delgiudices: has joined #RubyOnRails
[21:30:32] jhfisc: has joined #RubyOnRails
[21:34:49] xMopxShell: has joined #RubyOnRails
[21:35:30] jhfisc: has joined #RubyOnRails
[21:37:46] delgiudices: has joined #RubyOnRails
[21:47:47] jhfisc: has joined #RubyOnRails
[21:50:39] jhfisc: has joined #RubyOnRails
[21:51:26] ahrs: has joined #RubyOnRails
[21:56:15] jhfisc: has joined #RubyOnRails
[22:04:39] jhfisc: has joined #RubyOnRails
[22:04:39] knight33: has joined #RubyOnRails
[22:05:21] biox: has joined #RubyOnRails
[22:12:32] netzfisch: has joined #RubyOnRails
[22:12:42] jhfisc: has joined #RubyOnRails
[22:17:33] biox: has joined #RubyOnRails
[22:18:41] biox: has joined #RubyOnRails
[22:24:08] tobh: has left #RubyOnRails: ()
[22:24:14] tobh_: has joined #RubyOnRails
[22:33:32] br0d1n: has joined #RubyOnRails
[22:34:41] hive-mind: has joined #RubyOnRails
[22:37:41] ascarter: has joined #RubyOnRails
[23:06:43] wethu: has joined #RubyOnRails
[23:20:26] Technodrome: has joined #RubyOnRails
[23:24:29] Radar: GOOD MORNING
[23:42:03] delgiudices: has joined #RubyOnRails
[23:46:30] delgiudices: has joined #RubyOnRails
[23:46:41] mostlybadfly: has joined #RubyOnRails