« Back to channel list

#RubyOnRails - 27 February 2019

« Back 1 day Forward 1 day »
[00:18:11] jane_booty_doe: has joined #RubyOnRails
[00:19:12] ariedler: has joined #RubyOnRails
[00:21:13] orbyt_: has joined #RubyOnRails
[00:54:40] quazimodo: has joined #RubyOnRails
[00:57:09] Caerus: has joined #RubyOnRails
[00:57:25] quazimodo: has joined #RubyOnRails
[01:04:46] orbyt_: has joined #RubyOnRails
[01:16:31] mangold: has joined #RubyOnRails
[01:17:55] kvda: has joined #RubyOnRails
[01:23:43] ariedler: has joined #RubyOnRails
[01:27:15] sevenseacat: has joined #RubyOnRails
[01:29:15] conta: has joined #RubyOnRails
[02:08:33] crankharder: has joined #RubyOnRails
[02:24:01] tweeeaks: has joined #RubyOnRails
[02:32:06] gambl0re: has joined #RubyOnRails
[02:39:49] kvda: has joined #RubyOnRails
[02:41:01] Saukk: has joined #RubyOnRails
[03:17:10] phaul: has joined #RubyOnRails
[03:19:34] kvda: has joined #RubyOnRails
[04:02:32] kvda: has joined #RubyOnRails
[04:05:14] benlieb: has joined #RubyOnRails
[04:08:30] powerbit: has joined #RubyOnRails
[04:09:37] braincrash: has joined #RubyOnRails
[04:33:03] kvda: has joined #RubyOnRails
[04:36:04] MrCrackPotBuilde: has joined #RubyOnRails
[04:41:05] tdy1: has joined #RubyOnRails
[04:42:07] ebsen: has joined #RubyOnRails
[04:42:40] kvda: has joined #RubyOnRails
[04:47:55] cagomez: has joined #RubyOnRails
[04:57:41] pd09041999: has joined #RubyOnRails
[05:09:38] gambl0re: has joined #RubyOnRails
[05:15:35] mikecmpb_: has joined #RubyOnRails
[05:17:08] kvda: has joined #RubyOnRails
[05:28:13] wethu: has joined #RubyOnRails
[05:50:12] uksio: has joined #RubyOnRails
[06:07:25] reber: has joined #RubyOnRails
[06:07:51] reber__: has joined #RubyOnRails
[06:28:20] conta: has joined #RubyOnRails
[06:40:58] TvL2386: has joined #RubyOnRails
[07:00:03] prestorium: has joined #RubyOnRails
[07:26:03] Technodrome: has joined #RubyOnRails
[08:07:14] blackmesa: has joined #RubyOnRails
[08:13:18] Ergo: has joined #RubyOnRails
[08:20:10] prestorium: Hi all. I'm replacing a legacy API with Rails 5.2.2. This API is already being used by a client. I can't change this client. This client does a binary upload on request body. Can I handle that on Rails? I'm googling for "rails binary file upload" without success.
[08:20:25] prestorium: I'm trying to use ActiveStorage, but I'm open to any gem
[08:30:29] blackmesa: has joined #RubyOnRails
[08:59:04] mangold: has joined #RubyOnRails
[09:26:42] blackmesa: has joined #RubyOnRails
[09:37:01] wethu: has joined #RubyOnRails
[09:45:31] conta: has joined #RubyOnRails
[10:03:04] kapil____: has joined #RubyOnRails
[10:12:11] lxsameer: has joined #RubyOnRails
[10:24:26] Ergo: has joined #RubyOnRails
[10:33:13] blackmesa: has joined #RubyOnRails
[10:35:20] mangold: has joined #RubyOnRails
[10:37:33] mangold: has joined #RubyOnRails
[11:03:09] mikecmpbll: has joined #RubyOnRails
[11:10:42] conta: has joined #RubyOnRails
[11:34:21] v01d4lph4: has joined #RubyOnRails
[11:48:01] ariedler: has joined #RubyOnRails
[11:52:22] lankanmon: has joined #RubyOnRails
[12:06:39] mangold: has joined #RubyOnRails
[12:22:54] v01d4lph4: has joined #RubyOnRails
[12:23:48] ariedler: has joined #RubyOnRails
[12:50:37] ariedler: has joined #RubyOnRails
[13:22:16] Arkentias: has joined #RubyOnRails
[13:23:01] v01d4lph4: has joined #RubyOnRails
[13:24:58] Arkentias: Hello ! I have a probably very stupid question but I can't find the answer on Google as surprising as it is. I simply want to find a record and get one of its association with it so that I can just render it right away (It's a show action on a record). How would I do that?
[13:26:09] tbuehlmann: arkentias, YourModel.find(id) will find by id. you can then call association methods on that object to retrieve that association
[13:26:33] Arkentias: Ok so there is no way to do this in one query?
[13:26:42] Arkentias: Maybe with a "where" then?
[13:27:50] tbuehlmann: do you mean finding both records with a single sql query?
[13:29:59] Arkentias: Ok so my Transaction model belongs_to a "Procedure" model. I have a endpoint "GET /transaction/:id" to retrieve the informations of that transaction AND have the information on the procedure in transaction.procedure. So I want my transaction instance to have it's "procedure" field already filled with the procedure informations when I render it in JSON so that it can be retrieved from the API response
[13:30:18] conta1: has joined #RubyOnRails
[13:31:47] Arkentias: The transaction : {"id": 123, "transaction_name": "a transaction", "procedure": {"id": 23, "procedure_name": "a procedure"}}
[13:31:59] tbuehlmann: sure, sounds easy. what's the problem exactly?
[13:32:37] Arkentias: Yes it sure does sound ultra easy but how can I do that in one line? I tried includes, joins, .. and nothing yields the expected result
[13:32:59] Arkentias: Maybe I HAVE to use a serializer to reach the expected result?
[13:33:20] tbuehlmann: how do you render the json right now?
[13:34:50] Arkentias: Right now I just use the "render json: " because the app is still in the building phase
[13:35:13] Arkentias: But I have generalized "respond_ok", "respond_unprocessable" methods etc in my application_controller
[13:35:30] Arkentias: So in my transactionsController I just do "respond_ok @transaction"
[13:36:09] Arkentias: So i'd like to be able to do "respond_ok @transaction.with(:procedure)" or something?
[13:36:24] pavelz: is there a way to -f rake db:migrate:up ?
[13:37:02] pavelz: structure from migration has been wiped and I need to :up data but it just ignores my statements
[13:37:23] pavelz: :down wont work bc there are not columns defined in the migration
[13:38:44] pavelz: does not seem to be so
[13:43:27] tbuehlmann: arkentias, try this: `render json: @transaction.as_json(include: [:procedure])`
[13:45:39] wethu: has joined #RubyOnRails
[13:49:30] Arkentias: Ok thanks a lot! SO I have to do this at serialization time :) I'll just work on my serializer then ! Thank you for taking the time to help me
[13:49:52] tbuehlmann: you're welcome
[14:01:28] mikecmpbll: has joined #RubyOnRails
[14:03:43] Aherin: has joined #RubyOnRails
[14:18:05] srinidhi: has joined #RubyOnRails
[14:23:37] Ergo: has joined #RubyOnRails
[14:49:13] beholders_eye: has joined #RubyOnRails
[14:58:30] randohinn: has joined #RubyOnRails
[15:14:57] blackmesa: has joined #RubyOnRails
[15:21:42] phaul: has joined #RubyOnRails
[15:49:24] benlieb: has joined #RubyOnRails
[15:56:12] orbyt_: has joined #RubyOnRails
[15:58:19] mangold: has joined #RubyOnRails
[16:02:36] mauro1254: has joined #RubyOnRails
[16:03:26] blackmesa1: has joined #RubyOnRails
[16:19:18] mikecmpbll: has joined #RubyOnRails
[16:20:41] Ergo: has joined #RubyOnRails
[16:27:08] mikecmpbll: has joined #RubyOnRails
[16:30:55] tdy1: has joined #RubyOnRails
[16:31:24] agent_white: has joined #RubyOnRails
[16:35:03] KeyJoo: has joined #RubyOnRails
[16:51:34] ivanskie: has joined #RubyOnRails
[16:53:56] defsdoor: has joined #RubyOnRails
[17:06:45] blackmesa1: has joined #RubyOnRails
[17:17:06] Dbugger: has joined #RubyOnRails
[17:37:03] orbyt_: has joined #RubyOnRails
[17:45:30] blackmesa: has joined #RubyOnRails
[17:45:35] orbyt_: has joined #RubyOnRails
[17:45:51] [Butch]: has joined #RubyOnRails
[17:53:05] Saukk: has joined #RubyOnRails
[18:01:37] v01d4lph4: has joined #RubyOnRails
[18:17:06] gambl0re: has joined #RubyOnRails
[18:20:38] sameerynho: has joined #RubyOnRails
[18:46:55] segy: has joined #RubyOnRails
[19:02:46] cnsvc_: has joined #RubyOnRails
[19:12:35] mikecmpbll: has joined #RubyOnRails
[19:33:58] cagomez: has joined #RubyOnRails
[19:51:57] orbyt_: has joined #RubyOnRails
[20:09:55] ur5us: has joined #RubyOnRails
[20:23:06] tdy2: has joined #RubyOnRails
[20:33:48] davidh38: has joined #RubyOnRails
[20:44:08] orbyt_: has joined #RubyOnRails
[20:54:27] prestorium: has joined #RubyOnRails
[21:08:53] kvda: has joined #RubyOnRails
[21:14:01] tdy2: has joined #RubyOnRails
[21:21:40] Radar: GOOD MORNING
[21:33:21] Fernando-Basso: has joined #RubyOnRails
[22:00:57] orbyt_: has joined #RubyOnRails
[22:03:23] wethu: has joined #RubyOnRails
[22:09:55] Inside: RADAR KUN
[22:12:17] orbyt_: has joined #RubyOnRails
[22:24:47] Radar: INSIDE... chan?
[22:24:53] Radar: ACTION is not great with honorifics
[22:26:00] hahuang65: has joined #RubyOnRails
[22:27:58] kvda: has joined #RubyOnRails
[22:33:24] my1es: has joined #RubyOnRails
[22:54:35] hahuang65: has joined #RubyOnRails
[23:00:59] Net: Radar: where are you? australia?
[23:01:10] Radar: Net: Melbourne, specifically.
[23:01:13] Net: ah nice
[23:01:20] Radar: About to jump into a 1-on-1 so I will be disappearing shortly.
[23:03:40] blackmesa: has joined #RubyOnRails
[23:38:32] ellcs: has joined #RubyOnRails
[23:42:17] ariedler: has joined #RubyOnRails
[23:47:00] quazimodo: has joined #RubyOnRails
[23:47:53] SteenJobs: has joined #RubyOnRails
[23:52:11] DoctorMonocular: has joined #RubyOnRails
[23:52:46] DoctorMonocular: hey, I have a tricky problem
[23:53:27] DoctorMonocular: I have something like { '2019-02-27': { ... }, '2019-02-28': { ... }, ... }
[23:53:43] DoctorMonocular: it's a has with keys that are coniguous date strings
[23:53:58] DoctorMonocular: and each value is also a hash about those days
[23:54:49] DoctorMonocular: my goal is to group these keys so they create a sort of logical date span, based on the data inside each date
[23:55:38] DoctorMonocular: it's tricky because it's not a simple group_by operation--how to group the dates is based on weird business logic that has to do with the days before and after, as well as the data from a given day
[23:57:05] DoctorMonocular: but anywhere, there's some logic that I can use to convert that hash, to something like { ['2019-02-27', '2019-03-15']: { ... }, ...} which would just mean that the coniguous date range between the 27th and the 15th are grouped together
[23:57:45] DoctorMonocular: I an imagine funky, imperative array building to make this work, but I'd like something that's functional if possible
[23:58:52] Technodrome: has joined #RubyOnRails