« Back to channel list

#RubyOnRails - 31 August 2018

« Back 1 day Forward 1 day »
[00:19:37] lessless_: has joined #RubyOnRails
[00:58:29] quazimodo: has joined #RubyOnRails
[00:59:02] akaiiro: has joined #RubyOnRails
[01:00:28] lxsameer: has joined #RubyOnRails
[01:12:55] sevenseacat: has joined #RubyOnRails
[01:28:05] agent_white: has joined #RubyOnRails
[01:35:49] Dimik: has joined #RubyOnRails
[01:37:15] srruby: has joined #RubyOnRails
[01:40:15] orbyt_: has joined #RubyOnRails
[01:44:12] Technodrome: has joined #RubyOnRails
[02:06:53] tdy: has joined #RubyOnRails
[02:32:02] akaiiro: has joined #RubyOnRails
[02:37:51] quazimodo: has joined #RubyOnRails
[02:42:26] sevenseacat: so how're we all doin' today
[02:52:50] quazimodo: has joined #RubyOnRails
[03:01:09] lxsameer: has joined #RubyOnRails
[03:02:45] rootsudo: has joined #RubyOnRails
[03:10:36] braincrash: has joined #RubyOnRails
[03:11:25] akaiiro: has joined #RubyOnRails
[03:17:01] dbugger_: has joined #RubyOnRails
[03:23:39] orbyt_: has joined #RubyOnRails
[03:36:22] kapil___: has joined #RubyOnRails
[03:56:51] lessless_: has joined #RubyOnRails
[04:00:35] DTZUZO: has joined #RubyOnRails
[04:12:21] jane_booty_doe: has joined #RubyOnRails
[04:38:18] quazimodo: has joined #RubyOnRails
[04:38:21] cgfbee: has joined #RubyOnRails
[04:48:06] dogweather: has joined #RubyOnRails
[04:51:58] jjman: has joined #RubyOnRails
[04:53:16] quazimodo: has joined #RubyOnRails
[05:00:38] srinidhi: has joined #RubyOnRails
[05:05:39] dogweather: has joined #RubyOnRails
[05:20:36] Technodrome: has joined #RubyOnRails
[05:23:17] dogweather: has joined #RubyOnRails
[05:25:04] srinidhi: has joined #RubyOnRails
[05:38:27] quazimodo: has joined #RubyOnRails
[05:40:38] dogweather: has joined #RubyOnRails
[05:43:23] sevenseacat: has joined #RubyOnRails
[05:45:07] dionysus69: has joined #RubyOnRails
[05:55:03] nemesit: has joined #RubyOnRails
[06:00:08] orbyt_: has joined #RubyOnRails
[06:03:00] reber: has joined #RubyOnRails
[06:05:04] apeiros: has joined #RubyOnRails
[06:13:59] snickers: has joined #RubyOnRails
[06:24:37] rootsudo: has joined #RubyOnRails
[06:29:58] kotepillar_: has joined #RubyOnRails
[06:37:50] kotepillar_: has joined #RubyOnRails
[06:57:53] baweaver: sevenseacat: woooooo long weekend
[06:58:05] baweaver: So good basically. How's things?
[06:58:24] sevenseacat: not bad, not bad. almost beer o'clock
[06:58:48] baweaver: Might have had several stronger beverages earlier tonight
[07:04:12] sandstrom: has joined #RubyOnRails
[07:12:38] Applitect: has joined #RubyOnRails
[07:14:03] Applitect: What's the easiest way to merge mysql data from one set of tables to another set of tables while keeping any association ids intact?
[07:14:45] sevenseacat: I don't think there is an easy way
[07:16:22] baweaver: You'd have to remap the association ids
[07:17:11] sevenseacat: I've written scripts to do once-off migrations in the past and they're always tricky
[07:17:12] baweaver: The fun part is if you have colliding / non-unique items
[07:17:24] Andr3as: maybe dump it, change the table names in the sql file and reload it?
[07:17:37] Andr3as: if the other table is empty, obviously
[07:18:00] baweaver: As with a lot of things it depends heavily on context and the actual task at hand
[07:18:09] Applitect: I've been writing some once-off merge Ruby scripts but it's getting pretty damn complicated.
[07:18:30] baweaver: ( though I swear one could get away with just repeatedly asking why or what questions and go on for at least 10 messages )
[07:18:42] baweaver: So what's the use case?
[07:18:56] sevenseacat: lol the good old five whys
[07:19:03] baweaver: You have tables A, B, and C but want to move them to be the new tables D, E, and F?
[07:19:16] Applitect: LOL! I'll try to explain... this is gonna get complicated.
[07:19:32] baweaver: Honestly it helps to spell it out sometimes
[07:19:44] baweaver: because I swear the number of times a solution clicked before I pressed enter to ask here...
[07:21:07] baweaver: sevenseacat: We
[07:21:08] dionysus69: moment when you expect implicit return from a js function
[07:21:11] baweaver: 're all quacks here
[07:21:18] Applitect: So I've taken over a project. I need to merge Beta into Production. Beta & Production share many tables in the same database. However, Beta has it's own certain set of tables used to separate data from Production. This "Beta" tables have a prefix of "beta_"
[07:21:24] baweaver: dionysus69: Arrow functions :D
[07:21:47] dionysus69: not really into js that much :)
[07:22:14] Applitect: The tricky part is that the "beta_" tables contain earlier data from when they were duplicated from the Production tables.
[07:22:30] baweaver: [1,2,3].map(x => x * 2) // arrow functions
[07:23:09] baweaver: Applitect: What's saved my sanity in similar migrations was to draw out both and literally draw mappings between the two, explaining the transformations and collisions.
[07:23:24] baweaver: because it's all so varied and chaotic in those types of messes
[07:23:31] baweaver: What works for one table may not for another.
[07:23:37] Applitect: I have to find a way to compare the "beta_" and Production tables... then merge all of the newer data into the Production tables while keeping any association Ids intact
[07:24:11] baweaver: Does beta_x map to x?
[07:24:23] baweaver: or are the names different?
[07:24:48] Andr3as: so, you basically have to skip those id's which are presnet in both tables
[07:24:55] Applitect: The actual row content? Or the column / field names?
[07:25:02] baweaver: I would definitely dry run this to death before trying a full migration
[07:25:03] baweaver: Nothing is worse than failing that.
[07:25:22] Applitect: @Andr3as yes!
[07:25:28] jane_booty_doe: are any of these paas things good
[07:25:47] jane_booty_doe: i tried dokku and it was weird
[07:25:52] baweaver: So production and beta forked at one point?
[07:26:15] jane_booty_doe: sevenseacat, what do you use in production
[07:26:21] baweaver: and now you're resolving them?
[07:26:34] Applitect: Yea sort of
[07:27:09] baweaver: You might RSpec it out
[07:27:13] Andr3as: what about some sql magic? like a full outer join?
[07:27:20] jane_booty_doe: i kind of just want to go off of this since i already use docker-compose https://github.com/ledermann/docker-rails
[07:27:24] baweaver: specify what each migration should look like from A to B, and test that before running it.
[07:27:32] Applitect: Instead of adding a "beta" column which holds a true / false... they chose to make "beta_" tables to keep the data separate.
[07:27:46] Andr3as: or iner join (i think)
[07:28:04] baweaver: I don't envy you
[07:28:55] sevenseacat: yeah its going to be painful
[07:29:00] sevenseacat: no easy way at all.
[07:29:02] baweaver: Step 1) Don't let the person that made that call touch production data for a while
[07:29:06] baweaver: Now then....
[07:29:23] baweaver: What I would do is qualify what makes a matching row. Start with the most central model you have (like User)
[07:29:35] ellcs: has joined #RubyOnRails
[07:29:39] baweaver: resolve that, then keep track of which beta_ rows migrated to which production ones
[07:30:02] sevenseacat: I usually start with the most peripheral model so you don't have to worry about associations just yet
[07:30:05] baweaver: So if you happen to find associations after reconciling dependencies you can map old beta ids to the proper new production ones
[07:30:06] Applitect: I've written a set of Ruby scripts to do the merge. The way I had to code it is highly inefficient. And... I've only tested them for maybe 100 or so entries in each table.
[07:30:13] Andr3as: Full [Outer] Join without Intersection
[07:30:13] Andr3as: This variant of the full outer join (sometimes abbreviated to full join) returns all rows from both tables named in the ON condition where the join condition is not met (excluding NULL values).
[07:30:25] Applitect: Just the 100 limit takes ages to run
[07:30:37] Andr3as: if i understood it correctly, thats the sql join you could use
[07:31:10] Andr3as: and create the records if they arent already existing
[07:31:22] Applitect: Because bascially... every time my scripts have to do a find for something like a Category... it then has to look through any other tables to find something that's associated with that category id
[07:31:25] Andr3as: or even better the Right [Outer] Join without Intersection
[07:31:25] Andr3as: This join is a variant on the basic right outer join, but instead, it returns all rows from the right-hand table specified in the ON condition that also meets the join condition and none of the rows from the left-hand table that match the join condition.
[07:31:48] Andr3as: that gives you only the missing records.. take those and create them
[07:31:50] sevenseacat: you're not going to be reusing all the association IDs
[07:33:20] Andr3as: here's a pic and stuff https://stackoverflow.com/questions/42553844/right-join-without-intersection-and-another-condition
[07:33:34] sevenseacat: eg. beta article 1 corresponds to beta category 2 - create new category record, note the ID mapping, then create new article with new category ID
[07:33:38] sandstrom: has joined #RubyOnRails
[07:35:04] kotepillar_: has joined #RubyOnRails
[07:35:12] baweaver: Outer join won't really help here.
[07:35:26] Andr3as: well, you get the records which are missing
[07:35:30] baweaver: You have duplicate data you need to reconcile.
[07:35:35] baweaver: Not really.
[07:36:16] baweaver: There's going to be a beta and maybe a production value. Ideally the production value and id takes precedence I would guess.
[07:36:36] sevenseacat: if you're merging actual rows its even worse >_<
[07:36:58] Andr3as: yes, and the outer join excludes those from the production table
[07:37:02] baweaver: The reason I mention starting with a central model is that it allows you to make a mapping of all the beta -> production id changes from that central model
[07:37:06] baweaver: Which allows you to, if you store it in a hash, not query against all of that data again
[07:38:55] za1b1tsu_: has joined #RubyOnRails
[07:41:28] kotepillar_: has joined #RubyOnRails
[07:44:00] kotepillar__: has joined #RubyOnRails
[07:45:47] Applitect: baweaver: Yea I'm doing something similar to that in my Ruby scripts.
[07:47:09] Applitect: I'm start with something widely used like a category model first. I loop through the categories and see if they're present in both tables. IF they're not... I store it in a temp table and then proceed to find anything attached to it.
[07:47:33] Applitect: I think I'm just going to have to run my scripts as they are even though it's going to take ages.
[07:48:19] sevenseacat: I'd do the migration one complete table at a time
[07:50:21] cgfbee: has joined #RubyOnRails
[07:52:07] andywww: has joined #RubyOnRails
[07:53:55] kotepillar__: has joined #RubyOnRails
[07:55:26] quazimodo: has joined #RubyOnRails
[07:57:28] lexileo: has joined #RubyOnRails
[08:01:58] lxsameer: has joined #RubyOnRails
[08:07:49] sandstrom: has joined #RubyOnRails
[08:10:13] LambdaSource: has joined #RubyOnRails
[08:10:59] kotepillar_: has joined #RubyOnRails
[08:40:45] bijan_: has joined #RubyOnRails
[08:41:59] bijan_: has joined #RubyOnRails
[08:47:23] uks: has joined #RubyOnRails
[08:47:23] uksio: has joined #RubyOnRails
[08:59:25] Sylario: has joined #RubyOnRails
[09:04:06] dionysus69: I think I found a bug
[09:04:07] dionysus69: http://paste.debian.net/1040055/
[09:05:35] dionysus69: does this error make sense? I can't see why the division would cause that error, very unintuitive
[09:17:24] tbuehlmann: dionysus69: there's no local variable "price"
[09:17:37] desperek: has joined #RubyOnRails
[09:19:10] sevenseacat: the bit in the numerator, not the denominator
[09:20:43] dionysus69: omg, I got lost in the code
[09:20:59] dionysus69: 2 hours straight on the same problem, result <<
[09:21:36] dionysus69: fixed it now :P
[09:29:28] Ecco: has joined #RubyOnRails
[09:30:03] Ecco: Hi! Quick question, that is not strictly Rails-related: what tools do you guys recommend to generate "nice" HTML emails without going through tremendous pain?
[09:30:26] Ecco: I'd happily give up flexibility for ease-of-use (e.g. I don't mind if I can't customize everything)
[09:30:43] sevenseacat: I write them from scratch
[09:31:28] kotepillar_: has joined #RubyOnRails
[09:34:04] Ecco: Seems like an awful lot of trouble. How can you tell it works well given across the different clients?
[09:34:17] sevenseacat: testing and practice
[09:34:19] Ecco: I mean, HTML rendering in email clients looks like it's '98 all over again
[09:34:43] Sylario: the secret to html mail is that you can only do a succession of paragraph
[09:34:57] Sylario: Fancy email are just a collection of pictures
[09:35:17] sevenseacat: and a lot of tables for fancy stuff
[09:36:22] Sylario: Work on the typo settings, put a nice background color, it's a minimalism exercise
[09:36:44] Ecco: Have you guys tried https://github.com/zurb/foundation-emails ?
[09:37:05] Sylario: also, browse your spam box to get good ideas
[09:40:21] quazimod1: has joined #RubyOnRails
[09:45:55] Cork: has joined #RubyOnRails
[10:09:06] Ergo: has joined #RubyOnRails
[10:21:52] kotepillar__: has joined #RubyOnRails
[10:25:25] bijan_: has joined #RubyOnRails
[10:38:52] kotepillar_: has joined #RubyOnRails
[10:44:37] lankanmon: has joined #RubyOnRails
[10:44:39] tbuehlmann: ohai segmentation fault, long time no see \o/
[10:51:04] Puffball: has joined #RubyOnRails
[10:56:26] dogweather: has joined #RubyOnRails
[11:02:31] drale2k_: has joined #RubyOnRails
[11:02:53] drale2k_: how come Rails still doesn't have a default assets "fonts" folder -.-
[11:04:47] sevenseacat: does it need one?
[11:26:20] quazimodo: has joined #RubyOnRails
[11:28:00] dogweather: has joined #RubyOnRails
[11:39:55] dogweather: has joined #RubyOnRails
[11:44:07] dogweather: has joined #RubyOnRails
[11:46:43] jlebrech: has joined #RubyOnRails
[11:47:23] jlebrech: I can't find a way to make integration tests to test angularjs code on ruby. what do you use? teaspoon?
[11:48:39] dogweather: has joined #RubyOnRails
[11:51:02] Ergo: has joined #RubyOnRails
[11:57:19] dogweather: has joined #RubyOnRails
[11:59:23] drale2k_: has joined #RubyOnRails
[12:01:39] dogweather: has joined #RubyOnRails
[12:10:19] dogweather: has joined #RubyOnRails
[12:27:39] dogweather: has joined #RubyOnRails
[12:34:33] Puffball: has joined #RubyOnRails
[12:38:39] bijan_: has joined #RubyOnRails
[12:43:46] fmcgeough: has joined #RubyOnRails
[12:44:58] dogweather: has joined #RubyOnRails
[12:49:22] jottr: has joined #RubyOnRails
[12:52:03] bijan_: has joined #RubyOnRails
[13:02:21] dogweather: has joined #RubyOnRails
[13:07:56] dogweather: has joined #RubyOnRails
[13:12:47] dogweather: has joined #RubyOnRails
[13:16:41] ariedler: has joined #RubyOnRails
[13:17:06] dogweather: has joined #RubyOnRails
[13:27:34] mices: has joined #RubyOnRails
[13:28:31] mices: does anyone know of an auction site solution
[13:33:15] dogweather: has joined #RubyOnRails
[13:37:30] dogweather: has joined #RubyOnRails
[13:41:20] bijan_: has joined #RubyOnRails
[13:41:50] dogweather: has joined #RubyOnRails
[13:46:05] dogweather: has joined #RubyOnRails
[13:46:39] aesthetikx: has joined #RubyOnRails
[13:49:35] Andr3as: mices: http://bfy.tw/Jfe7
[13:54:34] bijan_: has joined #RubyOnRails
[14:00:37] quazimodo: has joined #RubyOnRails
[14:05:40] pLaTo0n: has joined #RubyOnRails
[14:11:42] bijan_: has joined #RubyOnRails
[14:12:12] fryguy: has joined #RubyOnRails
[14:13:26] TvL2386: has joined #RubyOnRails
[14:13:33] kapil___: has joined #RubyOnRails
[14:14:30] mauro1254: has joined #RubyOnRails
[14:21:09] akaiiro: has joined #RubyOnRails
[14:22:41] bijan_: has joined #RubyOnRails
[14:33:43] sidntrivedi: has joined #RubyOnRails
[14:34:06] bijan_: has joined #RubyOnRails
[14:39:17] srinidhi: has joined #RubyOnRails
[14:44:40] [Butch]: has joined #RubyOnRails
[14:45:14] bijan_: has joined #RubyOnRails
[14:51:33] eddof13: has joined #RubyOnRails
[14:52:15] dogweather: has joined #RubyOnRails
[14:59:05] bijan_: has joined #RubyOnRails
[14:59:51] dogweather: has joined #RubyOnRails
[15:02:58] chouhoulis: has joined #RubyOnRails
[15:10:55] bijan_: has joined #RubyOnRails
[15:13:30] beholders_eye: has joined #RubyOnRails
[15:17:58] Tempesta: has joined #RubyOnRails
[15:22:21] bijan_: has joined #RubyOnRails
[15:23:54] lomex: has joined #RubyOnRails
[15:33:18] troys: has joined #RubyOnRails
[15:33:50] bijan_: has joined #RubyOnRails
[15:39:06] srinidhi: has joined #RubyOnRails
[15:45:23] bijan_: has joined #RubyOnRails
[15:52:53] DTZUZO: has joined #RubyOnRails
[15:56:57] bijan_: has joined #RubyOnRails
[15:57:08] Ecco: has left #RubyOnRails: ()
[16:06:14] ariedler: has joined #RubyOnRails
[16:08:40] bijan_: has joined #RubyOnRails
[16:12:19] eckhardt_: has joined #RubyOnRails
[16:12:46] dogweather: has joined #RubyOnRails
[16:16:17] machinewar: has joined #RubyOnRails
[16:17:22] machinewar: why would same ruby version (2.5.1) have different results for "irb" v. "rails console" Rack::Utils.escape_path(":"). rails console URL escapes the value while irb doesnt. Does rails monkey patch rack::utils?
[16:19:31] machinewar: or more likely my ruby installed version is different than my rails projects.....
[16:19:39] bijan_: has joined #RubyOnRails
[16:23:21] orbyt_: has joined #RubyOnRails
[16:23:38] jane_booty_doe: has joined #RubyOnRails
[16:25:41] pLaTo0n: has joined #RubyOnRails
[16:27:21] bijan_: has joined #RubyOnRails
[16:57:04] ShekharReddy: has joined #RubyOnRails
[16:58:41] reber: has left #RubyOnRails: ("Leaving")
[16:59:17] ShekharReddy: Hi guys, I am abit novice to rails.. a quick question -- are params accessible from a method in a module in controller directory (I am invoking that method which is in the module from a controller action method )
[17:07:38] LambdaSource: has joined #RubyOnRails
[17:16:49] ShekharReddy: has joined #RubyOnRails
[17:21:15] siddu: has joined #RubyOnRails
[17:21:39] siddu: ShekharReddy Hi
[17:22:13] LambdaSource: has joined #RubyOnRails
[17:22:48] ariedler: has joined #RubyOnRails
[17:30:35] jane_booty_doe: k changed my mind dokku is awesome
[17:30:54] jane_booty_doe: this is gonna save me so much money
[17:32:47] kapil___: has joined #RubyOnRails
[17:36:06] gambl0re: has joined #RubyOnRails
[17:39:44] lxsameer: has joined #RubyOnRails
[17:49:27] atrius: has joined #RubyOnRails
[17:49:38] lxsameer: has joined #RubyOnRails
[17:59:48] lxsameer: has joined #RubyOnRails
[18:09:47] lxsameer: has joined #RubyOnRails
[18:19:38] lxsameer: has joined #RubyOnRails
[18:29:44] lxsameer: has joined #RubyOnRails
[18:34:10] jane_booty_doe: has joined #RubyOnRails
[18:37:40] fmcgeough: has joined #RubyOnRails
[18:39:54] lxsameer: has joined #RubyOnRails
[18:49:58] lxsameer: has joined #RubyOnRails
[18:59:44] lxsameer: has joined #RubyOnRails
[19:03:17] lemonandroid: has joined #RubyOnRails
[19:09:44] lxsameer: has joined #RubyOnRails
[19:13:42] snickers: has joined #RubyOnRails
[19:19:45] lxsameer: has joined #RubyOnRails
[19:21:20] NoGodDamnIdea: has joined #RubyOnRails
[19:29:58] lxsameer: has joined #RubyOnRails
[19:31:21] dogweather: has joined #RubyOnRails
[19:32:28] cinnamntig3r: has joined #RubyOnRails
[19:39:48] lxsameer: has joined #RubyOnRails
[19:47:57] knight33: has joined #RubyOnRails
[19:49:39] lxsameer: has joined #RubyOnRails
[19:59:54] lxsameer: has joined #RubyOnRails
[20:05:20] dogweather: has joined #RubyOnRails
[20:08:52] eckhardt_: has joined #RubyOnRails
[20:09:46] lxsameer: has joined #RubyOnRails
[20:16:06] JamJam_kid: has joined #RubyOnRails
[20:17:28] knight33: has joined #RubyOnRails
[20:18:15] dogweather: has joined #RubyOnRails
[20:19:48] lxsameer: has joined #RubyOnRails
[20:27:19] uks: has joined #RubyOnRails
[20:32:10] orbyt_: has joined #RubyOnRails
[20:37:44] KeyJoo: has joined #RubyOnRails
[20:38:57] eckhardt_: has joined #RubyOnRails
[20:49:54] lomex: has joined #RubyOnRails
[20:51:50] nottwo_: has joined #RubyOnRails
[21:05:45] ivanskie: has joined #RubyOnRails
[21:09:04] sandstrom: has joined #RubyOnRails
[21:19:55] tdy: has joined #RubyOnRails
[21:20:32] LiftLeft: has joined #RubyOnRails
[21:29:24] LiftLeft2: has joined #RubyOnRails
[21:52:29] akaiiro: has joined #RubyOnRails
[22:10:34] eckhardt_: has joined #RubyOnRails
[22:21:09] Technodrome: has joined #RubyOnRails
[22:27:45] lxsameer: has joined #RubyOnRails
[22:28:17] orbyt_: has joined #RubyOnRails
[22:30:00] quazimodo: has joined #RubyOnRails
[22:33:44] DTZUZO: has joined #RubyOnRails
[22:42:09] apeiros: has joined #RubyOnRails
[22:54:15] sevenseacat: has joined #RubyOnRails
[23:05:18] apeiros: has joined #RubyOnRails
[23:13:40] Nuru: has joined #RubyOnRails
[23:26:19] apeiros: has joined #RubyOnRails
[23:30:49] quazimodo: has joined #RubyOnRails
[23:48:20] apeiros: has joined #RubyOnRails