#RubyOnRails - 14 August 2018
« Back 1 day Forward 1 day »
[04:34:20] machinewar: if I have a JS library that is loading files with paths like /js/myfile.js the asset pipeline breaks all of this when precompiled. Is there a way to just skip asset pipeline precompilation and have those files served separately
[04:36:38] mjacob: Radar: a few weeks ago i asked about a rails routing problem, to which you answered that I should create an issue, which i did: https://github.com/rails/rails/issues/33219
[04:37:13] mjacob: Radar: if i remember correctly, you said that you wrote the routing documentation
[04:38:37] mjacob: Radar: AFAIK the documentation doesn't say anything about which url parameters will stay in the URL if you call url_for
[04:39:27] mjacob: Radar: do you think it would make sense to add this to the documentation? (internally in the code this is called 'recall')
[10:01:39] jlebrech: is there a proxy I can use for Rails env text? for this https://github.com/excon/excon#proxy-support
[12:14:26] chridal: I'm trying to deploy with Webpacker, and I did assets:precompile, all the assets are there and no errors. When I deploy to production, nothing renders in the body.
[12:14:51] chridal: The <head></head> section is fine, and all files are present, both JS and CSS, but the body is empty.
[12:15:51] chridal: Or wait, it gets weirder. If I do 'Show source', the body is there. If I go into Inspect in Chrome, the body is empty in the Elements tab. Nothing renders on screen.
[13:31:54] bonhoeffer: wondering about the ideal behavior -- if i'm logged in as A@gmail.com and attempt to establish an omniauth session as B@gmail.com, I get a CSRF failure
[13:42:51] ShekharReddy: is it possible to insert an object out of the string printed upon doing puts?
[13:47:58] ShekharReddy: i want to insert the same object in another instance of the same application
[21:19:09] molloy: Is there a way to specify that the fields in the scope of an active record validation are case insensitive?
[21:20:32] molloy: I want to validate :billing_address1 with a scope of :billing_address2, :city, :zip, and :country and can specify that :billing_address1 should be case insensitive, but if any of the other fields vary with a case (united states then United States) it'll count as a different scope
[21:55:38] molloy: A senior rails dev didn't know an answer to my question :( But gave me an idea for a hacky workaround
[21:55:39] Radar: molloy: I think you'd have to create your own validation method to do what you're after there.
[21:56:19] Radar: Good thing that "melbourne" and "Melbourne" and "MELBourne" all refer to the same city, hey?
[21:56:56] Radar: molloy: is that to validate a unique address across all other addresses? What's the type of validation that you're applying there?
[21:58:22] Radar: In the past I've used Google Maps Geocoder API to validate addresses. It tends to know better than I could.
[22:00:34] molloy: Radar: https://ghostbin.com/paste/bmvd6 is how it looked when I got access to the repo
[22:01:39] molloy: what they want: all fields to be case insensitive. first thing that came to mind, as a lazy solution, was to validate all of the address fields the same way, putting all other address fields in each scope
[22:04:13] Radar: Ok. You're going to run into potential issues with like "31<Space>Queen" and "31<Space><Space>Queen" being interpreted as unique addresses if you solve it just by case comparison alone.
[22:04:22] molloy: My coworker suggested writing a before_save callback that then validates the uniqueness of every field (perhaps with a custom sql query)
[22:07:53] molloy: I'm not exactly sure why they can't have duplicate addresses, but it's something they're explicitly requesting. I can ask
[22:26:49] Radar: molloy: yeah it sounds like you're going to have to write a custom SQL query then to check that the combination of [billing_address1, billing_address2, ...] does not equal any other combination of the same.
[22:26:52] Radar: I hope you have good data sanitation practices ;) addresses in this format are one of the shittiest things to work with in a database
[22:26:59] Radar: Because: Level 10, 31 Bob Street, BobTown VIC 3001 is the same as Floor 10, 31 Bob Street, BobTown VIC 3001.
[22:27:55] molloy: Thanks Radar, always appreciate how much you help the rails community through this channel. Good to know there aren't any better options