« Back to channel list

#RubyOnRails - 08 March 2019

« Back 1 day Forward 1 day »
[00:06:13] quazimodo: has joined #RubyOnRails
[00:06:15] quazimod1: has joined #RubyOnRails
[00:06:20] quazimod2: has joined #RubyOnRails
[00:11:34] quazimodo: has joined #RubyOnRails
[00:22:21] davidfetter: has joined #RubyOnRails
[00:27:42] blackmesa: has joined #RubyOnRails
[00:32:26] davidfetter: has joined #RubyOnRails
[00:37:37] orbyt_: has joined #RubyOnRails
[00:45:28] crankharder: has joined #RubyOnRails
[00:56:32] dviola: has joined #RubyOnRails
[01:03:43] conta: has joined #RubyOnRails
[01:06:28] orbyt_: has joined #RubyOnRails
[01:17:24] bambanx: has joined #RubyOnRails
[01:29:37] mlt-: has joined #RubyOnRails
[01:30:02] mlt-: I'm confused about ActiveSupport::TestCase. Wasn't it deprecated?
[01:30:21] mlt-: Is it back?
[01:32:46] mlt-: oops I meant ActionController::TestCase
[01:46:22] s00pcan: has joined #RubyOnRails
[01:54:41] hnanon: has joined #RubyOnRails
[01:55:54] FastJack: has joined #RubyOnRails
[02:06:03] Technodrome: has joined #RubyOnRails
[02:23:38] sevenseacat: has joined #RubyOnRails
[02:33:31] Technodrome: has joined #RubyOnRails
[02:42:26] hnanon: has joined #RubyOnRails
[02:50:59] crankharder: has joined #RubyOnRails
[02:54:28] dachi: has joined #RubyOnRails
[02:55:39] dachi: hello. could you kindly help? I want to declare habtm only if condition on self is true. has_and_belogns_to_many :trucks <<< if self.trucking_broker?
[02:55:59] dachi: on trucks model I have, has_and_belongs_to_many :trucking_brokers, -> { where("supplier_type = ?", Supplier.supplier_types[:trucking_brokers]) }, class_name: "Supplier"
[02:56:05] kvda: has joined #RubyOnRails
[02:56:26] dachi: and it works, but I want to do from the other side now.
[03:01:59] dachi: So maybe anyone knows if it's possible to declare association
[03:02:08] dachi: Only if some criteria is correct on the self
[03:02:12] hnanon: After installing webpacker in an updated 5.2 app, I see a node_modules directory.
[03:02:24] dachi: hnanon: that's fine
[03:02:52] hnanon: That's normal?
[03:03:03] dachi: So let's say I have model A and if @a.role is "X" then A has many Bs
[03:03:07] hnanon: I'm trying to get stimulus working with rails.
[03:03:08] dachi: is this possible?
[03:03:29] hnanon: I'm getting this error: Webpacker::Manifest::MissingEntryError
[03:03:47] bga57: has joined #RubyOnRails
[03:03:50] hnanon: 4. Your webpack configuration is not creating a manifest.
[03:03:51] dachi: hnanon: node_modules is where javascript packages reside right? So it's normal, rails project has npm module dependencies
[03:04:10] hnanon: But doesn't rails use yarn now, not npm?
[03:04:28] hnanon: (I installed yarn)
[03:05:17] dachi: i use yarn too, but packages still come from npm.com
[03:05:51] hnanon: Do you know where the manifest file should be created?
[03:05:55] dachi: they're called npm modules, there's no such thing as yarn modules, you just use yarn
[03:06:03] hnanon: dachi, I see.
[03:06:10] dachi: manifest is automatically created, it's usually in public/packs/manifest.json
[03:06:23] hnanon: It's not being created.
[03:06:47] dachi: I think you have error in js code and it can't create a manifest with all imports
[03:06:52] dachi: so some entry is missing or smth like that
[03:07:03] hnanon: I only have the default rails files in public
[03:07:12] hnanon: no packs directory
[03:07:23] dachi: packs will be created when webpack compiles
[03:07:35] dachi: sorry don't know, i'm very limited in time, maybe someone will help you
[03:07:44] hnanon: Ok, thanks anyway,
[03:09:01] hnanon: I followed instructions from here: https://github.com/rails/webpacker#installation
[03:10:42] v01d4lph4: has joined #RubyOnRails
[03:22:14] defsdoor_: has joined #RubyOnRails
[03:28:13] mlt-: uhm... is there a chance parallel testing might by wonky if my test has self.use_transactional_tests=false ? I feel like it runs another test without cleaning up DB. I'm using plain old minitest along with MyClass.delete_all in teardown block
[03:28:21] mlt-: Rails 5.2.2
[03:29:58] sevenseacat: I think you would need to be using transactional tests unless you want the test data to interfere with other tests running at the same time
[03:30:32] mlt-: sevenseacat: it is a part of integration testing. There is some external tool involved that alters DB
[03:30:55] sevenseacat: then I'm not sure those tests will work in parallel
[03:31:40] mlt-: That is what I'm trying to say. Rails should not attempt to parallelize tests that do not use transactions
[03:31:43] Tempesta: has joined #RubyOnRails
[03:32:58] sevenseacat: I think that's on you to make sure those tests don't run in parallel
[03:33:23] sevenseacat: because a lot of tests that don't use transactions (eg. those that don't rely on the database) can safely do so
[03:34:05] mlt-: sevenseacat: there is no reason to use "self.use_transactional_tests = false" for thos
[03:41:52] hive-mind: has joined #RubyOnRails
[03:44:01] gambl0r3: has joined #RubyOnRails
[03:59:40] duderonomy: has joined #RubyOnRails
[04:03:28] DTZUZO: has joined #RubyOnRails
[04:04:44] v01d4lph4: has joined #RubyOnRails
[04:10:15] braincrash: has joined #RubyOnRails
[04:13:11] crankharder: has joined #RubyOnRails
[04:17:17] mlt-: so how do I disable parallel tests?
[04:28:32] mlt-: ACTION found PARALLEL_WORKERS
[04:41:59] ur5us: has joined #RubyOnRails
[04:43:36] G: Okay, quick question, for ActiveRecord, on a new instance of the model (i.e. create), the only way to get the id of the row is at after_commit, is there a nifty way in calling back to after_commit after it it was during a create?
[04:45:56] hive-mind: has joined #RubyOnRails
[04:59:10] G: ah, think I got it 'after_commit :foo, :on => :create'
[05:02:36] RiPuk: has joined #RubyOnRails
[05:05:42] crankharder: has joined #RubyOnRails
[05:16:32] G: hmm, interesting, that seems to cause an infinite loop with another after_commit call :S
[05:45:17] quazimodo: has joined #RubyOnRails
[06:19:14] bambanx: has joined #RubyOnRails
[06:21:19] conta: has joined #RubyOnRails
[06:37:13] davidfetter: has joined #RubyOnRails
[06:50:10] tdy: has joined #RubyOnRails
[06:55:13] reber: has joined #RubyOnRails
[07:10:30] skryking: has joined #RubyOnRails
[07:13:11] jane_booty_doe: has joined #RubyOnRails
[07:42:50] hahuang6-: has joined #RubyOnRails
[07:47:26] Xiti: has joined #RubyOnRails
[08:08:53] lxsameer: has joined #RubyOnRails
[08:11:38] KeyJoo: has joined #RubyOnRails
[08:12:41] KeyJoo: has joined #RubyOnRails
[08:17:53] tdy1: has joined #RubyOnRails
[08:23:31] KeyJoo: has joined #RubyOnRails
[08:29:22] cnsvc: has joined #RubyOnRails
[09:01:20] jane_booty_doe: has joined #RubyOnRails
[09:02:55] Sylario: has joined #RubyOnRails
[09:07:53] hightower2: has joined #RubyOnRails
[09:46:41] KeyJoo: has joined #RubyOnRails
[10:21:53] DTZUZO: has joined #RubyOnRails
[10:24:30] KeyJoo: has joined #RubyOnRails
[10:27:08] ariedler: has joined #RubyOnRails
[10:44:49] mikecmpbll: has joined #RubyOnRails
[11:16:44] jane_booty_doe: has joined #RubyOnRails
[11:32:30] Ergo: has joined #RubyOnRails
[11:45:36] lankanmon: has joined #RubyOnRails
[11:47:39] conta: has joined #RubyOnRails
[11:55:09] ariedler: has joined #RubyOnRails
[12:21:40] v01d4lph4: has joined #RubyOnRails
[12:42:14] jonno112: has joined #RubyOnRails
[12:46:56] za1b1tsu: has joined #RubyOnRails
[13:44:13] helpa-bot: has joined #RubyOnRails
[13:46:43] helpa: has joined #RubyOnRails
[14:46:38] apparition: has joined #RubyOnRails
[14:52:24] mikecmpb_: has joined #RubyOnRails
[15:04:07] hnanon: has joined #RubyOnRails
[15:10:39] conta: has joined #RubyOnRails
[15:14:18] MrCrackPotBuilde: has joined #RubyOnRails
[15:16:34] conta: has joined #RubyOnRails
[15:45:10] DTZUZO: has joined #RubyOnRails
[15:50:58] v01d4lph4: has joined #RubyOnRails
[16:09:55] conta: has joined #RubyOnRails
[16:14:56] gambl0r3: has joined #RubyOnRails
[16:24:50] [Butch]: has joined #RubyOnRails
[16:26:52] duderonomy: has joined #RubyOnRails
[16:29:21] conta: has joined #RubyOnRails
[16:55:12] mikecmpbll: has joined #RubyOnRails
[17:13:22] roychri: has joined #RubyOnRails
[17:16:13] szulak_: has joined #RubyOnRails
[17:17:34] roychri: has left #RubyOnRails: ()
[17:32:40] gambl0r3: has joined #RubyOnRails
[17:43:46] v01d4lph4: has joined #RubyOnRails
[17:51:26] noob69: has joined #RubyOnRails
[17:52:04] noob69: So, I started using monkey_patched version of pg_search
[17:56:56] noob69: has joined #RubyOnRails
[17:57:44] noob69: Hey, I'm using pg_search but after I did some monkey patching, the performance is low.
[17:57:54] noob69: Any suggestions on improving it?
[17:58:14] noob69: Things that take < 1s takes ~18s now.
[17:59:41] snk: i don't know that i can be of a lot of help, but perhaps link to a pastebin of the patch you made?
[18:00:08] snk: hard to suggest improvements, without seeing the change that resulted in the perf issues
[18:03:08] noob69: To simplify stuff, the perf issues started coming up when I started using `ILIKE` command.
[18:03:20] noob69: Do you know anything around that area?
[18:04:32] ariedler: has joined #RubyOnRails
[18:18:10] v01d4lph4: has joined #RubyOnRails
[18:22:26] jarlopez: has joined #RubyOnRails
[18:23:16] jarlopez: Is it possible to `rake db:structure:load` to a DB not on localhost?
[18:23:35] hnanon: has joined #RubyOnRails
[18:25:33] andywww: has joined #RubyOnRails
[18:26:11] andywww: anyone got any practical tips for getting up to speed when inheriting existing fairly large rails projects?
[18:27:21] snk: noob69: it's not suprising that an ilike query would introduce some performance degradation, depending on what your data looks like and how much data you have
[18:28:16] snk: you can try to get to the bottom of it with EXPLAIN ANALYZE
[18:28:33] snk: https://www.postgresql.org/docs/current/sql-explain.html
[18:28:37] noob69: snk: Where do you query that?
[18:28:46] noob69: andywww: What do you mean "inherit"?
[18:29:21] andywww: when a previous developer has left and you get brought on as the new dev to look after the system
[18:29:22] snk: you'd execute the query from a psql shell, or something
[18:29:32] snk: the rails logs should tell you what query is actually being run
[18:29:51] andywww: 0 documentation, 0 spec, lots of cruft
[18:29:57] andywww: its a bit of a pita
[18:29:58] noob69: andywww: Yikes!
[18:30:10] snk: andywww: i'm in that boat now.. it's quite tough :(
[18:30:24] noob69: snk: Even I have been there.
[18:30:50] noob69: andywww: Are you able to run the app?
[18:31:04] snk: i've started by looking at the highest traffic views, and then reading the code path from the route -> controller -> model -> view
[18:31:13] snk: kind of helps get my bearings
[18:31:14] andywww: i’m currently in the process of getting it running locally
[18:31:42] andywww: but i’ve left it for tonight, the last time i did this it was a nightmare and this time even the client is warning me it is a nightmare
[18:32:04] noob69: andywww: If the client warns, that's DEFINITELY a nightmare!
[18:32:08] andywww: so i thought before immersing i’d ask you guys if you’ve got any decent tips
[18:32:15] andywww: yeah tell me about it
[18:32:38] noob69: andywww: seed data is there?
[18:32:42] andywww: it also gives me the impression they didn’t manage the initial development particularly well
[18:32:47] andywww: yeah luckily
[18:33:00] noob69: andywww: That's a relief
[18:33:39] noob69: And ask snk said, routes -> controller -> model -> view is the way to go,
[18:33:57] hnanon_: has joined #RubyOnRails
[18:34:24] snk: yeah, if i can't start to make heads or tails of the codebase after a week or so... maybe it's time for a rewrite anyway :)
[18:35:11] snk: rails is good at making you keep everything organized. if the code is a mess, there's probably something funny going on, haha
[18:35:38] noob69: snk: Poorly paid or over-worked developers mostly
[18:37:29] noob69: How many years have you guys been working on rails, snk andywww ?
[18:38:18] snk: i was a sysadmin running rails apps for a few years. i started full time developing rails apps back in january :)
[18:38:32] andywww: well, 2 seriously, 1 tinkering
[18:38:52] snk: pagerduty broke my soul
[18:39:37] noob69: andywww: Hahaha almost same here.
[18:39:48] andywww: hah so you decided to fight the good fight from the inside?
[18:40:09] noob69: snk: Hahaha nice.
[18:40:22] noob69: andywww: Freelance?
[18:40:42] andywww: mostly employed but yeah this particular project is freelance
[18:41:06] andywww: are you guys uk based?
[18:41:28] noob69: andywww: India
[18:41:37] snk: i'm in the US
[18:47:08] Technodrome: has joined #RubyOnRails
[18:50:47] elplatt: has joined #RubyOnRails
[18:51:48] sameerynho: has joined #RubyOnRails
[18:53:33] v01d4lph4: has joined #RubyOnRails
[18:54:20] elplatt: Hello! I’m modifying an existing RoR application. I’ve added a new translation string, and it shows the correct translation when I use I18n.t from rails console, but not when I view a page that uses the translation. Any ideas?
[18:55:47] DTZUZO: has joined #RubyOnRails
[18:58:03] [Butch]: has joined #RubyOnRails
[18:58:23] mikecmpbll: has joined #RubyOnRails
[19:16:09] jarlopez: has joined #RubyOnRails
[19:30:28] orbyt_: has joined #RubyOnRails
[19:39:36] ravenousmoose: has joined #RubyOnRails
[19:42:10] orbyt_: has joined #RubyOnRails
[19:52:31] Net: any idea why `default: false` would be appearing in our schema.rb?
[19:55:49] Net: looks like the columns are `default: false` in their original migrations
[19:56:01] Net: question is: why aren't they default: false in our local and production databases then
[19:56:25] noob69: Net: Seems strange
[19:57:00] noob69: Net: Try creating a new object and see?
[19:59:01] Net: noob69: See what?
[20:00:09] noob69: Net: See what the default value is.
[20:01:53] Net: the db has no default. I don't know what the model defaults to, but I'm not sure that matters
[20:05:21] Net: the model default is nil
[20:05:27] ariedler: has joined #RubyOnRails
[20:09:51] noob69: Net: oh wow.
[20:12:07] Dbugger: has joined #RubyOnRails
[20:38:17] borodin: has joined #RubyOnRails
[20:48:08] matcouto: has joined #RubyOnRails
[20:59:06] szulak_: has joined #RubyOnRails
[21:19:51] Fernando-Basso: has joined #RubyOnRails
[21:42:18] FastJack: has joined #RubyOnRails
[21:56:20] atrius: has joined #RubyOnRails
[22:02:44] dviola: has joined #RubyOnRails
[22:13:07] hightower3: has joined #RubyOnRails
[22:23:12] andywww: has joined #RubyOnRails
[22:36:40] gambl0r3: has joined #RubyOnRails
[23:11:15] Technodrome: has joined #RubyOnRails
[23:29:05] hive-mind: has joined #RubyOnRails
[23:34:46] NeXTSUN: has joined #RubyOnRails
[23:35:38] tdy1: has joined #RubyOnRails
[23:40:07] hnanon: has joined #RubyOnRails
[23:46:45] andywww: has joined #RubyOnRails
[23:54:49] cnsvc: has joined #RubyOnRails