« Back to channel list

#RubyOnRails - 08 November 2018

« Back 1 day Forward 1 day »
[00:02:13] jesfre: has joined #RubyOnRails
[00:19:03] roshanavand: has joined #RubyOnRails
[00:34:55] beholders_eye: has joined #RubyOnRails
[00:46:07] jesfre: has joined #RubyOnRails
[00:46:34] za1b1tsu: has joined #RubyOnRails
[00:55:05] FCser: has joined #RubyOnRails
[00:59:07] eddof13: has joined #RubyOnRails
[01:07:15] blackmesa: has joined #RubyOnRails
[01:07:21] cnk: has joined #RubyOnRails
[01:11:59] martin1_1: has joined #RubyOnRails
[01:13:28] martin1_1: hello all! quite new to the rails world, quick question.. I have a set of models that are related to each other by associations.. A -> has_many B -> has_many C .. how can I access a property on the model C starting from A?
[01:14:00] martin1_1: A.first().bs.cs.some_attribute doesnt seem to work
[01:14:39] martin1_1: I tried using collect as well.. a.collect(&:bs).collect(&:cs).collect(&:some_property)
[01:15:19] martin1_1: but it raises a "has no method some_property" on something that seems to be a proxy of C
[01:18:22] hightower2: martin1_1, if you just want to get anything working as a proof of concept, then A.first.bs.first.cs.first.some_attribute
[01:19:14] martin1_1: what if it isn't a proof of concept?
[01:19:38] martin1_1: I saw some load_target method around, which as I understood it, it "unproxies" the collection, loading the target model
[01:19:44] sevenseacat: has joined #RubyOnRails
[01:19:44] martin1_1: but I can't seem to make it work
[01:21:25] hightower2: Do you want to find particular Bs and Cs, or you want to start from A and get all Bs and all Cs and some_attribute() on them?
[01:22:08] Radar: a.bs.flat_map(&:cs).map(&:some_property)
[01:22:17] Radar: Your issue is that your 2nd collect is returning an array of arrays.
[01:24:39] martin1_1: \o/ flat_map did it! thanks Radar
[02:09:47] darkhanb: has joined #RubyOnRails
[02:31:29] jetchisel: has joined #RubyOnRails
[02:32:16] martin1_1: one more question.. this time about error handling: where do you usualy define your custom errors? do you create a PORO and define all of them there? what's the good practice in that subject?
[02:34:36] za1b1tsu: has joined #RubyOnRails
[02:35:31] mangold: has joined #RubyOnRails
[02:40:56] Saukk: has joined #RubyOnRails
[02:43:29] za1b1tsu: has joined #RubyOnRails
[03:21:53] mangold: has joined #RubyOnRails
[04:10:05] braincrash: has joined #RubyOnRails
[04:18:41] EXCHGR: has joined #RubyOnRails
[04:24:06] eckhardt_: has joined #RubyOnRails
[04:49:11] Dimik: has joined #RubyOnRails
[04:53:20] Guest53511: has joined #RubyOnRails
[05:34:32] EXCHGR: has joined #RubyOnRails
[05:37:24] dtzuzu: has joined #RubyOnRails
[05:46:51] dachi: As you know
[05:47:01] dachi: If you won't put render method in controller action
[05:47:09] dachi: Rails will try to render a view based on action name
[05:47:39] dachi: What if I want to add to this behavior:
[05:48:15] dachi: If I don't explicitly render anything, try to render my call my render function
[05:48:29] dachi: I was doing this like
[05:48:39] dachi: rescue_from ActionController::UnknownFormat dorender_react unless performed?
[05:49:00] dachi: In application_controller
[05:49:27] dachi: Do you recommend another approach? This can't be done with after_action ...
[05:50:44] gambl0re: has joined #RubyOnRails
[05:53:13] dtzuzu: has joined #RubyOnRails
[06:00:36] SteenJobs: has joined #RubyOnRails
[06:05:54] apparition: has joined #RubyOnRails
[06:41:07] helpa: has joined #RubyOnRails
[06:45:42] mangold: has joined #RubyOnRails
[07:21:11] srinidhi: has joined #RubyOnRails
[07:30:17] conta: has joined #RubyOnRails
[08:00:55] fl4sh_: has joined #RubyOnRails
[08:15:47] Fernando-Basso: has joined #RubyOnRails
[08:34:18] toydestroyer: has joined #RubyOnRails
[08:44:09] drale2k_: has joined #RubyOnRails
[08:53:44] drale2k_: has joined #RubyOnRails
[09:16:27] blackmesa1: has joined #RubyOnRails
[09:29:57] davidh38: has joined #RubyOnRails
[09:38:55] mangold: has joined #RubyOnRails
[09:55:47] Guest53511: has joined #RubyOnRails
[10:18:51] apparition: has joined #RubyOnRails
[10:29:17] JamieD: has joined #RubyOnRails
[10:31:08] srinidhi: has joined #RubyOnRails
[10:51:47] whysthatso: has joined #RubyOnRails
[11:03:00] drale2k_: has joined #RubyOnRails
[11:09:58] supergeek: has joined #RubyOnRails
[11:14:14] davidh38: has joined #RubyOnRails
[11:34:09] GodFather: has joined #RubyOnRails
[11:44:15] cabotto: has joined #RubyOnRails
[12:03:44] lankanmon: has joined #RubyOnRails
[12:04:49] za1b1tsu: has joined #RubyOnRails
[12:07:45] cabotto: has joined #RubyOnRails
[12:14:44] GodFather: has joined #RubyOnRails
[12:16:53] jane_booty_doe: has joined #RubyOnRails
[12:18:16] jane_booty_doe: anyone here have recaptcha working w/ clearance's sessions#create
[12:19:21] Ergo: has joined #RubyOnRails
[12:21:39] za1b1tsu: has joined #RubyOnRails
[12:40:03] roshanavand: has joined #RubyOnRails
[12:42:14] whysthatso: has joined #RubyOnRails
[12:45:43] lexileo: has joined #RubyOnRails
[13:40:59] _cryptosignal_me: has joined #RubyOnRails
[13:44:58] blackmesa1: has joined #RubyOnRails
[13:56:33] Croata: has joined #RubyOnRails
[14:02:57] eean: has joined #RubyOnRails
[14:03:48] Tempesta: has joined #RubyOnRails
[14:04:03] dachi: has joined #RubyOnRails
[14:04:23] LightStalker: has joined #RubyOnRails
[14:04:35] dionysus69: has joined #RubyOnRails
[14:04:37] nickjj: has joined #RubyOnRails
[14:04:40] sonOfRa: has joined #RubyOnRails
[14:05:58] lankanmon: has joined #RubyOnRails
[14:06:30] cnk: has joined #RubyOnRails
[14:06:59] jane_booty_doe: has joined #RubyOnRails
[14:09:18] salasrod: has joined #RubyOnRails
[14:09:36] lexileo: has joined #RubyOnRails
[14:09:50] JamieD: has joined #RubyOnRails
[14:09:59] rodd: has joined #RubyOnRails
[14:13:26] segy: has joined #RubyOnRails
[14:21:27] roshanavand: has joined #RubyOnRails
[14:41:42] za1b1tsu: has joined #RubyOnRails
[14:41:54] gambl0r3: has joined #RubyOnRails
[14:43:47] davidh38: has joined #RubyOnRails
[14:50:27] otherj: has joined #RubyOnRails
[14:50:57] jetchisel: has joined #RubyOnRails
[14:55:03] davidh38: has joined #RubyOnRails
[15:11:04] davidh38: has joined #RubyOnRails
[15:21:50] Inside: has joined #RubyOnRails
[15:29:47] keegnotrub: has joined #RubyOnRails
[15:45:05] jesfre: has joined #RubyOnRails
[15:46:48] srinidhi: has joined #RubyOnRails
[15:57:46] orbyt_: has joined #RubyOnRails
[16:04:05] Dimik: has joined #RubyOnRails
[16:06:44] davidh38: has joined #RubyOnRails
[16:06:47] choke: has joined #RubyOnRails
[16:08:56] choke: has joined #RubyOnRails
[16:16:28] FCser: has joined #RubyOnRails
[16:18:18] choke: has joined #RubyOnRails
[16:18:49] ellcs: has joined #RubyOnRails
[16:19:24] tpendragon: has joined #RubyOnRails
[16:29:23] dachi: Do you use React rails?
[16:29:36] dachi: Say you want to render react path /one
[16:29:41] dachi: from Rails route /two
[16:30:14] dachi: render component: "App", props: { path: "/one" }
[16:30:23] dachi: This does not work, while it looks like it should work
[16:35:53] conta: has joined #RubyOnRails
[16:44:53] blackmesa1: has joined #RubyOnRails
[16:45:14] mangold: has joined #RubyOnRails
[16:46:02] fragamus: has joined #RubyOnRails
[16:50:02] Inside: What does your component look like?
[16:50:52] Inside: oh this is reactor?
[16:59:15] ivanskie: has joined #RubyOnRails
[17:03:31] ivanskie: has joined #RubyOnRails
[17:09:12] blackmesa: has joined #RubyOnRails
[17:13:06] Guest53511: has joined #RubyOnRails
[17:14:43] whysthatso: has joined #RubyOnRails
[17:16:13] Saukk: has joined #RubyOnRails
[17:16:17] eddof13: has joined #RubyOnRails
[17:20:59] darkhanb: has joined #RubyOnRails
[17:23:48] chouhoulis: has joined #RubyOnRails
[17:26:00] blackmesa1: has joined #RubyOnRails
[17:32:17] JamieD: has joined #RubyOnRails
[17:37:09] davidh38: has joined #RubyOnRails
[17:42:46] ivanskie: has joined #RubyOnRails
[17:44:41] eddof13: has joined #RubyOnRails
[17:45:04] davidh38: has joined #RubyOnRails
[17:46:13] orbyt_: has joined #RubyOnRails
[17:57:57] eckhardt_: has joined #RubyOnRails
[17:58:28] reber: has joined #RubyOnRails
[18:01:01] blackmesa1: has joined #RubyOnRails
[18:15:15] davidh38: has joined #RubyOnRails
[18:31:32] blackmesa1: has joined #RubyOnRails
[18:34:00] mlt-: has joined #RubyOnRails
[18:35:08] mlt-: How do I prevent JSONB database type casting into Hash? I thought "attribute attr, ActiveRecord::Type::String.new" added to my Model will do, but it won't. Rails 5.2.1
[18:54:05] blackmesa: has joined #RubyOnRails
[19:00:48] davidh38: has joined #RubyOnRails
[19:04:40] ivanskie: has joined #RubyOnRails
[19:14:01] greengriminal: has joined #RubyOnRails
[19:14:23] greengriminal: Hey all quick question I'm trying to run: Rake::Task['db:schema:load'] and I'm getting: `untimeError: Don't know how to build task 'db:schema:load'`
[19:14:31] davidh38: has joined #RubyOnRails
[19:14:34] greengriminal: db:schema:load is a default task :?
[19:14:51] greengriminal: Better yet even when I try: `Rake::Task['db:migrate']` I get the same error.
[19:14:55] SteenJobs: has joined #RubyOnRails
[19:16:22] cnk: what is the context for `Rake::Task['db:migrate']`? Rake is a command so more normal would be, from the command line: `rake db:migrate`
[19:16:49] greengriminal: X_x I did: `Rails.application.load_tasks` and it works loads.
[19:16:58] greengriminal: I forgot to mention that I'm doing this from a rails console.
[19:17:45] greengriminal: For those who want to run a rake task from the rails console you need to run: `Rails.application.load_tasks` and then `Rake::Task['db:schema:load']` will load
[19:18:07] cnk: OK good to know
[19:18:17] cnk: and that took care of your runtime error?
[19:18:34] wojnar: has joined #RubyOnRails
[19:19:30] greengriminal: It was `Rails.application.load_tasks`
[19:20:07] greengriminal: `load_task` - https://apidock.com/rails/Rails/Application/load_tasks
[19:24:47] cjohnson: When request.path = '/foo/bar/baz', is there a better way to get "foo" than request.path.split('/')[1] ?
[19:24:52] cjohnson: foo is not the controller_name
[19:25:04] cjohnson: Is there an array of the path pieces already baked into request somewhere?
[19:25:15] ivanskie: has joined #RubyOnRails
[19:27:37] cjohnson: pack = request.path.split('/').reject(&:empty?).first
[19:33:40] Karunamon: has joined #RubyOnRails
[19:35:32] Karunamon: Heya folks. Having a really hard time googling this: When doing before/after callbacks on a model using 'has_and_belongs_to_many', which model gets passed into the function you define? The one you're defining the function in, or the one on the other side of that relation?
[19:38:27] andywww: has joined #RubyOnRails
[19:42:11] andywww: ive been watching a few youtube vids recently that have been extremely critical of apple hardware and whilst ive always been fairly hardware agnostic, i do like apples laptops for the form factor, retina screens and the simplicity of os x/brew for setting up the ruby environment
[19:42:41] andywww: i’d be curious to hear what you guys run and if not you think a non apple device with linux is a viable alternative for dev work?
[19:44:11] za1b1tsu: has joined #RubyOnRails
[19:45:47] atrius: has joined #RubyOnRails
[19:49:19] jackhum: has joined #RubyOnRails
[19:54:38] dachi: andywww I'm on MacBook Pro (Retina, 13-inch)
[19:54:56] dachi: I'd prefer to have a bigger display though
[19:55:07] dachi: I'm not doing graphics though, only coding
[19:56:06] dachi: I have 'More space' set in retina display configuration, and I got used to 13-inch, it's not that bad after few months
[19:57:45] dachi: andywww I personaly think apple hardware / macos is best today
[19:57:53] dachi: And I don't want to believe those stories
[20:01:47] davidh38: has joined #RubyOnRails
[20:10:18] OrangeManBad: has joined #RubyOnRails
[20:18:04] mlt-: dachi: he is gone:)
[20:18:56] dachi: i'm leaving too
[20:18:59] dachi: good night :)
[20:19:02] dachi: bye people
[20:21:02] davidh38: has joined #RubyOnRails
[20:28:02] za1b1tsu: has joined #RubyOnRails
[20:33:10] chouhoulis: has joined #RubyOnRails
[20:34:48] davidh38: has joined #RubyOnRails
[20:37:59] za1b1tsu: has joined #RubyOnRails
[20:38:34] chouhoulis: has joined #RubyOnRails
[20:41:06] davidh38: has joined #RubyOnRails
[20:43:07] orbyt_: has joined #RubyOnRails
[20:43:57] chouhoulis: has joined #RubyOnRails
[20:46:57] davidh38: has joined #RubyOnRails
[20:49:01] Fernando-Basso: has joined #RubyOnRails
[20:55:48] chouhoulis: has joined #RubyOnRails
[20:56:33] za1b1tsu: has joined #RubyOnRails
[21:00:35] choke: has joined #RubyOnRails
[21:01:19] chouhoulis: has joined #RubyOnRails
[21:03:54] eckhardt_: has joined #RubyOnRails
[21:06:39] chouhoulis: has joined #RubyOnRails
[21:07:07] SteenJobs: has joined #RubyOnRails
[21:09:19] choke: has joined #RubyOnRails
[21:12:04] chouhoulis: has joined #RubyOnRails
[21:14:33] choke: has joined #RubyOnRails
[21:20:37] OrangeManBad: has joined #RubyOnRails
[21:30:06] orbyt_: has joined #RubyOnRails
[21:36:35] GodFather: has joined #RubyOnRails
[21:38:27] atrius: has joined #RubyOnRails
[22:00:55] chouhoulis: has joined #RubyOnRails
[22:06:01] orbyt_: has joined #RubyOnRails
[22:06:11] chouhoulis: has joined #RubyOnRails
[22:10:35] chouhoulis: has joined #RubyOnRails
[22:15:51] chouhoulis: has joined #RubyOnRails
[22:21:18] chouhoulis: has joined #RubyOnRails
[22:24:18] SteenJobs: has joined #RubyOnRails
[22:26:38] chouhoulis: has joined #RubyOnRails
[22:32:03] chouhoulis: has joined #RubyOnRails
[22:37:33] chouhoulis: has joined #RubyOnRails
[22:42:49] chouhoulis: has joined #RubyOnRails
[22:45:15] ellcs: has joined #RubyOnRails
[22:46:23] hnanon: has joined #RubyOnRails
[22:47:24] hnanon: Is it normal for nested fields to be duplicated on a create (validation) error?
[22:48:33] hnanon: New action has @subscription.notifications.build
[22:50:12] hnanon: Nevermind. It's always a silly mistake.
[22:50:27] hnanon: I was calling fields_for twice in the form.
[22:53:44] chouhoulis: has joined #RubyOnRails
[22:59:03] chouhoulis: has joined #RubyOnRails
[23:04:28] chouhoulis: has joined #RubyOnRails
[23:06:08] ss_much: has joined #RubyOnRails
[23:09:52] chouhoulis: has joined #RubyOnRails
[23:15:01] orbyt_: has joined #RubyOnRails
[23:20:23] orbyt_: has joined #RubyOnRails
[23:20:40] chouhoulis: has joined #RubyOnRails
[23:25:31] nexraf1: has joined #RubyOnRails
[23:26:03] chouhoulis: has joined #RubyOnRails
[23:31:25] chouhoulis: has joined #RubyOnRails
[23:36:43] chouhoulis: has joined #RubyOnRails
[23:43:14] chouhoulis: has joined #RubyOnRails
[23:48:38] chouhoulis: has joined #RubyOnRails
[23:54:00] chouhoulis: has joined #RubyOnRails