« Back to channel list

#RubyOnRails - 09 August 2018

« Back 1 day Forward 1 day »
[00:00:47] alfiemax: has joined #RubyOnRails
[00:01:47] Psy-Q: has joined #RubyOnRails
[00:02:19] spohnz: has joined #RubyOnRails
[00:02:22] felix_vs: has joined #RubyOnRails
[00:03:33] spohnz: has joined #RubyOnRails
[00:05:35] spohnz: has joined #RubyOnRails
[00:11:22] prettybTech: has joined #RubyOnRails
[00:12:05] lxsameer: has joined #RubyOnRails
[00:12:23] eckhardt: has joined #RubyOnRails
[00:16:47] this_dude: has joined #RubyOnRails
[00:22:20] za1b1tsu: has joined #RubyOnRails
[00:24:10] mroutis: has joined #RubyOnRails
[00:24:46] eckhardt_: has joined #RubyOnRails
[00:25:27] apparition47: has joined #RubyOnRails
[00:27:16] lxsameer: has joined #RubyOnRails
[00:30:18] hahuang65: Radar: sorry I had to step away to cook too, thanks for picking it back up
[00:30:27] Radar: it's what I do
[00:30:39] Radar: hahuang65: what'd you make?
[00:31:28] hahuang65: Radar: some sirloin steak, corn, and scallops
[00:31:58] Radar: hahuang65: mmmmm. Love me some steak and corn
[00:32:48] hahuang65: Radar: I'd invite you over... but IIRC you live in AUS or something.
[00:32:58] Radar: yeah steak might be too cold before then
[00:34:16] SunWuKung: has joined #RubyOnRails
[00:35:22] s2013: has joined #RubyOnRails
[00:36:19] baweaver: Radar: There's so much at steak
[00:42:18] hahuang65: baweaver: lol
[00:43:10] baweaver: Too much corn?
[00:46:54] s2013: has joined #RubyOnRails
[00:50:10] lemur: I am the lemur
[00:52:50] spohnz: has joined #RubyOnRails
[00:56:42] hahuang65: haha lemur you're silly.
[00:56:58] lemur: The lemurs are now out in the wild: https://medium.com/@baweaver/creating-reducing-enumerable-an-illustrated-adventure-c6adfcc30d5b
[00:58:32] chouhoulis: has joined #RubyOnRails
[01:00:59] sevenseacat: has joined #RubyOnRails
[01:07:38] za1b1tsu: has joined #RubyOnRails
[01:11:58] lxsameer: has joined #RubyOnRails
[01:13:49] Technodrome: has joined #RubyOnRails
[01:18:15] mroutis: who don't use scaffold on a daily base?
[01:18:39] mroutis: uhm, I mean, who don't like scaffolding?
[01:18:48] mroutis: why, sevenseacat ?
[01:19:19] sevenseacat: because it generates a lot of unnecessary junk that I end up having to rewrite anyway
[01:19:29] sevenseacat: so I may as well just write the code I want from scratch
[01:21:03] baweaver: ACTION writes his own scaffolds for funsies
[01:21:53] sevenseacat: the amount of time they would save me would be either negligible or negative
[01:22:15] mroutis: baweaver, I also write my own scaffolds, found them super useful
[01:22:15] lxsameer: has joined #RubyOnRails
[01:22:50] baweaver: Then again I also write out a quick manifest type file for bootstrapping new apps according to an idea
[01:23:05] mroutis: templates, baweaver ?
[01:23:16] baweaver: basically YAML that specifies entities, and additions to a page.
[01:23:42] mroutis: mhm, haven't seen one before, do you have something "shareable"
[01:23:58] baweaver: I may OSS it later when I get time and actually codeify it.
[01:29:43] kapil___: has joined #RubyOnRails
[01:33:24] Radar: mroutis: fun fact: getting started guide used to use scaffold until I rewrote to not.
[01:33:29] Radar: I agree with sevenseacat.
[01:34:51] mroutis: (thanks for taking care of the docs, Radar, I've spent a lot of time reading them)
[01:35:17] mroutis: have you tried writing your own generators, Radar, sevenseacat?
[01:35:54] sevenseacat: yeah. fun for an exercise, but really I spend so little time generating new swathes of code that it really doesnt matter
[01:37:01] lxsameer: has joined #RubyOnRails
[01:38:37] mroutis: truedat, sevenseacat
[01:40:11] johndunn: has left #RubyOnRails: ()
[01:43:03] dr_blackjack: has joined #RubyOnRails
[01:44:39] gerep: has joined #RubyOnRails
[01:45:51] wmoxam: has joined #RubyOnRails
[01:47:01] lxsameer: has joined #RubyOnRails
[01:47:30] markh: has joined #RubyOnRails
[01:49:07] chouhoulis: has joined #RubyOnRails
[01:49:14] gerep: Hi. I am using Devise and I want my admin user to be able to create new users. To achieve that, is it required for me to make my UsersController#new load the Devise view?
[01:49:46] gerep: I want to take advantage of Devise so I don't have to worry about validations, password etc.
[01:52:40] mroutis: gerep, I remember devise's wiki having some good content for that, https://github.com/plataformatec/devise/wiki
[01:53:03] Radar: gerep: You could copy over the devise view's code.
[01:53:26] sirensari2: has joined #RubyOnRails
[01:54:11] sevenseacat: depending on your requirements, you might want to look at something like devise invitable - because your admins setting new user passwords and the like might be a bit weird
[01:55:57] mroutis: gerep, also, validations occur on the model (the weird line `devise :database_authenticatable, :registable, ...`)
[01:56:47] gerep: mroutis, I did but I could not find any, maybe I am being too specific while looking for it.
[01:56:54] gerep: Radar, That is a good option.
[01:57:24] gerep: sevenseacat, indeed, I will take a look at invitable.
[01:57:42] spohnz: has joined #RubyOnRails
[01:57:49] gerep: mroutis, so I should not be worried about the validation, right?
[01:58:11] gerep: Since the model is the same.
[01:58:50] Saukk: has joined #RubyOnRails
[02:02:00] lxsameer: has joined #RubyOnRails
[02:02:10] prettybTech: has joined #RubyOnRails
[02:12:13] lxsameer: has joined #RubyOnRails
[02:14:55] za1b1tsu: has joined #RubyOnRails
[02:17:42] alfiemax: has joined #RubyOnRails
[02:18:01] Technodrome: has joined #RubyOnRails
[02:23:22] s2013: has joined #RubyOnRails
[02:50:08] mroutis: yes, gerep, you can try that by creating a user within rails console
[02:52:00] lxsameer: has joined #RubyOnRails
[02:55:38] orbyt_: has joined #RubyOnRails
[02:56:40] samort7: has joined #RubyOnRails
[03:01:13] alfiemax_: has joined #RubyOnRails
[03:11:44] braincrash: has joined #RubyOnRails
[03:15:25] prettybTech: has joined #RubyOnRails
[03:26:28] s2013: has joined #RubyOnRails
[03:32:02] lxsameer: has joined #RubyOnRails
[03:35:47] hahuang65: sevenseacat: how did you come up with your handle
[03:36:01] sevenseacat: its part of a misheard song lyric
[03:36:56] hahuang65: interesting
[03:36:57] duderonomy: has joined #RubyOnRails
[03:37:03] lxsameer: has joined #RubyOnRails
[03:37:49] lexileo: has joined #RubyOnRails
[03:39:26] s2013: has joined #RubyOnRails
[03:47:02] lxsameer: has joined #RubyOnRails
[03:52:05] lxsameer: has joined #RubyOnRails
[04:00:03] prettybTech: has joined #RubyOnRails
[04:02:56] za1b1tsu: has joined #RubyOnRails
[04:07:13] lxsameer: has joined #RubyOnRails
[04:07:39] reber: has joined #RubyOnRails
[04:08:12] reber__: has joined #RubyOnRails
[04:17:21] lxsameer: has joined #RubyOnRails
[04:27:34] tfitts: Anyone here using the fastjson_api gem from netflix? I'm wondering if there's a way to probably set the model type for records that use single table inheritance? ActiveModelSerializer did it automatically but I don't see anything about it for fastjson_api
[04:31:06] alfiemax: has joined #RubyOnRails
[04:42:23] eckhardt: has joined #RubyOnRails
[04:50:03] Technodrome: has joined #RubyOnRails
[04:57:02] lxsameer: has joined #RubyOnRails
[05:02:02] lxsameer: has joined #RubyOnRails
[05:07:02] lxsameer: has joined #RubyOnRails
[05:19:30] s2013: has joined #RubyOnRails
[05:22:18] lxsameer: has joined #RubyOnRails
[05:23:29] quazimodo: has joined #RubyOnRails
[05:32:02] lxsameer: has joined #RubyOnRails
[05:36:42] apeiros_: has joined #RubyOnRails
[05:40:25] za1b1tsu: has joined #RubyOnRails
[05:40:44] Tempesta: has joined #RubyOnRails
[05:42:16] lxsameer: has joined #RubyOnRails
[05:52:06] lxsameer: has joined #RubyOnRails
[06:02:58] blackmesa1: has joined #RubyOnRails
[06:10:28] Croata: has joined #RubyOnRails
[06:20:54] snickers: has joined #RubyOnRails
[06:23:41] srinidhi: has joined #RubyOnRails
[06:31:57] srinidhi: has joined #RubyOnRails
[06:33:08] Tempesta: has joined #RubyOnRails
[06:37:01] lxsameer: has joined #RubyOnRails
[06:43:45] hays: has joined #RubyOnRails
[06:44:11] pwnd_nsfw: has joined #RubyOnRails
[06:46:56] lexileo: has joined #RubyOnRails
[06:47:00] lxsameer: has joined #RubyOnRails
[06:58:17] drale2k_: has joined #RubyOnRails
[07:01:30] alfiemax: has joined #RubyOnRails
[07:02:11] lxsameer: has joined #RubyOnRails
[07:03:04] orbyt_: has joined #RubyOnRails
[07:12:02] lxsameer: has joined #RubyOnRails
[07:13:34] alfiemax: has joined #RubyOnRails
[07:14:46] za1b1tsu: has joined #RubyOnRails
[07:15:45] dionysus69: has joined #RubyOnRails
[07:22:17] lxsameer: has joined #RubyOnRails
[07:23:50] alfiemax_: has joined #RubyOnRails
[07:24:18] desperek: has joined #RubyOnRails
[07:41:24] srinidhi: has joined #RubyOnRails
[07:50:59] za1b1tsu: has joined #RubyOnRails
[07:51:45] Sylario: has joined #RubyOnRails
[07:57:40] Striking7: has joined #RubyOnRails
[07:57:55] za1b1tsu: has joined #RubyOnRails
[07:58:14] apeiros_: has joined #RubyOnRails
[07:58:24] DoubleMalt: has joined #RubyOnRails
[08:05:23] lxsameer: has joined #RubyOnRails
[08:05:48] mikecmpbll: has joined #RubyOnRails
[08:21:26] apeiros__: has joined #RubyOnRails
[08:44:16] mojtaba: has joined #RubyOnRails
[08:46:27] za1b1tsu: has joined #RubyOnRails
[09:03:41] drale2k_: has joined #RubyOnRails
[09:29:57] sunya7a: hi all. I'm having trouble with validating a new child record before allowing it and its parent to save. specifically, when using a custom method validator within the child model the newly created record fields are all nil and so I cannot validate any of the fields. Here's the relevant code: https://gist.github.com/sunya7a/6a14ed35cbfca5765688f940d614b33a please let me know if you want to see other parts that would help cleariify this
[09:31:03] alfiemax: has joined #RubyOnRails
[09:34:44] dionysus69: as for the first notice, add on: :create to the validate line
[09:37:30] ciro: has joined #RubyOnRails
[09:41:15] sunya7a: dionysus69: thanks...i've added that but the result is the same
[09:42:37] sunya7a: dionysus69: i made a toy app to test the behavior, and as I expected, usually at that exact point the child element should have fields filled, except the id, since it is a new object and not saved yet. but in my app, everything is nil, which is confusing me
[09:43:11] sunya7a: if I let it continue though both the child and parent objects save correctly with all the information
[09:43:52] sunya7a: so it seems somehow the validator is run early? not sure why or how to delay it until the fields are filled in with the parameters coming from the form
[09:46:53] dionysus69: Can't really understand what's your problem :S
[09:51:12] drale2k_: has joined #RubyOnRails
[09:52:16] Andr3as: sunya7a: what does the server log say when you create a child?
[09:53:34] sunya7a: Andr3as: it simply creates the child object. somehow it fills in the information after the validator call
[09:53:57] sunya7a: dionysus69: i'm trying to formulate a better explanation...it's a bit complicated
[09:54:42] Andr3as: so you create the child and at your byebug the values are empty, if you move on the values are there?
[09:57:04] sunya7a: the order of events is: i submit the form and I don't see any db insertions before hitting my byebug within the validator. at this point self properties are all nil. then I continue and I see all the insertions into db and child is created including the join records
[09:58:35] sunya7a: I tried putting a byebug statement inside th econtroller and calling the update manually to see what happens...it also stops at the byebug line in the validator with self properties being nil
[10:01:05] lunarkitty7: has joined #RubyOnRails
[10:01:43] sunya7a: dionysus69: hopefully this explains the issue: https://gist.github.com/sunya7a/b3d8377bec8b00684dcf3e3be0f6372a
[10:17:27] Psy-Q: let's say you're building a API following JSON-API, in order to update relationships, would you accept a POST or PATCH to e.g. authors/1/books with the changed relationships as payload?
[10:17:50] Psy-Q: the spec always talks about an explicit relationships URL but that seems cumbersome with rails
[10:26:19] blackmesa1: has joined #RubyOnRails
[10:35:50] srinidhi: has joined #RubyOnRails
[10:36:53] ur5us: has joined #RubyOnRails
[10:37:04] lupine: http://help.rubygems.org/discussions/problems/32656-reporting-abuse-on-active-support ^^
[10:44:46] za1b1tsu: has joined #RubyOnRails
[11:00:56] lxsameer: has joined #RubyOnRails
[11:16:26] srinidhi: has joined #RubyOnRails
[11:17:26] srinidhi: has joined #RubyOnRails
[11:20:53] KevinSjoberg: has joined #RubyOnRails
[11:28:27] ur5us: has joined #RubyOnRails
[11:40:51] hbs: has joined #RubyOnRails
[11:42:09] hbs: has left #RubyOnRails: ()
[11:50:57] pulkit4tech: has joined #RubyOnRails
[11:51:07] pulkit4tech: has left #RubyOnRails: ()
[11:52:44] za1b1tsu: has joined #RubyOnRails
[11:55:27] za1b1tsu_: has joined #RubyOnRails
[11:57:03] dionysus69: so I have this cool scope
[11:57:06] dionysus69: http://paste.debian.net/1037255/
[11:57:24] dionysus69: and I am trying to cache it using a scoped .cache_key
[11:58:02] dionysus69: am I doing this right? initially I know it makes two queries one of them is for generating a cache_key, but I couldn't find a more efficient way to achieve this
[11:58:03] apeiros_: has joined #RubyOnRails
[11:58:36] dionysus69: if I just use cache_key, it takes cache_key of all records, which is not efficient
[12:27:26] Dbugger: has joined #RubyOnRails
[12:27:50] tbuehlmann: not sure I'd keep the caching in the model. I'd at least think about having it in the controller
[12:42:49] dr_blackjack: has joined #RubyOnRails
[12:43:21] fmcgeough: has joined #RubyOnRails
[12:46:23] dionysus69: tbuehlmann: why though, that's not DRY, I use that scope at multiple places
[12:47:02] dionysus69: it's normal to have low-level caching in the model, it affects the model directly
[12:48:56] snuz: has joined #RubyOnRails
[12:50:58] snuz: has joined #RubyOnRails
[13:06:48] Saukk: has joined #RubyOnRails
[13:07:52] Ergo: has joined #RubyOnRails
[13:19:20] apeiros__: has joined #RubyOnRails
[13:26:15] HoierM: has joined #RubyOnRails
[13:27:41] KevinSjoberg: has joined #RubyOnRails
[13:34:49] sevenseacat: has joined #RubyOnRails
[13:39:52] spohnz: has joined #RubyOnRails
[13:41:14] blackmesa1: has joined #RubyOnRails
[13:43:01] drale2k_: has joined #RubyOnRails
[13:43:49] tbuehlmann: dionysus69: then at least rename the method so you don't forget it's caching
[13:48:28] Sylario: Theory question : Why do service object are object and not class? THey have one method most of the time anyway? I don't see how it would be detrimental to have one public class method
[13:55:41] Dbugger: has joined #RubyOnRails
[13:55:49] tbuehlmann: sylario: you don't have to use such "service classes/objects", it just settled to be some useful thing
[13:58:03] pwnd_nsfw: has joined #RubyOnRails
[13:58:14] Sylario: I don't question the utility of service object, it's just that I was reading a post about them, and they insisted against on init+ 1 public method, and I started wondering why it needed to be an object, and it seems there is a consensus on having one action one service
[13:58:29] Sylario: WHat I am wondering is, why an object
[13:58:38] xhoy: has joined #RubyOnRails
[13:58:43] jottr: has joined #RubyOnRails
[13:58:45] Sylario: WHy not a class and a class method without instanciation
[13:59:13] Sylario: The object just kind of break down var initialization in the init, that's all
[13:59:31] dblessing: has joined #RubyOnRails
[13:59:48] Sylario: I don't get what I am missing
[13:59:51] mojtaba: has joined #RubyOnRails
[14:01:33] tbuehlmann: ah, well, instance variables
[14:01:56] tbuehlmann: I want to memoize heavy calculations, and for that I use instance variables
[14:02:01] tbuehlmann: using class instance variables would be wrong
[14:11:04] augcesar: has joined #RubyOnRails
[14:11:49] quazimodo: has joined #RubyOnRails
[14:12:59] Technodrome: has joined #RubyOnRails
[14:14:05] pulkit4tech: has joined #RubyOnRails
[14:14:17] pulkit4tech: has left #RubyOnRails: ()
[14:24:20] akaiiro: has joined #RubyOnRails
[14:24:32] lexileo: has joined #RubyOnRails
[14:53:09] akaiiro: has joined #RubyOnRails
[15:06:53] apeiros_: has joined #RubyOnRails
[15:11:51] za1b1tsu_: has joined #RubyOnRails
[15:14:39] HoierM: has joined #RubyOnRails
[15:19:43] apeiros_: has joined #RubyOnRails
[15:28:08] Cache_Money: has joined #RubyOnRails
[15:30:05] ur5us: has joined #RubyOnRails
[15:30:44] snuz: has joined #RubyOnRails
[15:31:00] apeiros_: has joined #RubyOnRails
[15:53:27] reber: has joined #RubyOnRails
[15:54:25] s2013: has joined #RubyOnRails
[16:07:44] _Caerus: has joined #RubyOnRails
[16:19:58] KevinSjoberg: has joined #RubyOnRails
[16:20:32] KevinSjoberg: has joined #RubyOnRails
[16:22:50] mikecmpbll: has joined #RubyOnRails
[16:38:58] orbyt_: has joined #RubyOnRails
[16:39:37] Puffball: has joined #RubyOnRails
[16:40:58] s2013: has joined #RubyOnRails
[16:41:18] akaiiro: has joined #RubyOnRails
[16:46:48] HoierM: has joined #RubyOnRails
[16:49:24] Ergo: has joined #RubyOnRails
[16:54:58] orbyt_: has joined #RubyOnRails
[17:07:07] snickers: has joined #RubyOnRails
[17:09:20] akaiiro: has joined #RubyOnRails
[17:14:15] s2013: has joined #RubyOnRails
[17:16:24] dblessing: has joined #RubyOnRails
[17:19:28] mojtaba: has joined #RubyOnRails
[17:23:34] za1b1tsu: has joined #RubyOnRails
[17:26:00] andywww: has joined #RubyOnRails
[17:30:49] ur5us: has joined #RubyOnRails
[17:34:50] Caerus: has joined #RubyOnRails
[17:43:58] rfoust: has joined #RubyOnRails
[17:56:23] jottr: has joined #RubyOnRails
[17:58:58] kapil___: has joined #RubyOnRails
[17:59:52] Technodrome: has joined #RubyOnRails
[18:01:45] darkhanb: has joined #RubyOnRails
[18:02:56] blackmesa1: has joined #RubyOnRails
[18:03:10] ArTiSTiX: has joined #RubyOnRails
[18:09:26] prettybTech: has joined #RubyOnRails
[18:11:19] eckhardt: has joined #RubyOnRails
[18:14:08] sameerynho: has joined #RubyOnRails
[18:15:15] jottr: has joined #RubyOnRails
[18:40:00] srinidhi: has joined #RubyOnRails
[18:47:28] mojtaba: has joined #RubyOnRails
[18:48:29] IanMalcolm: has joined #RubyOnRails
[18:52:45] nottwo: has joined #RubyOnRails
[18:53:49] tdy: has joined #RubyOnRails
[18:55:07] dblessing: has joined #RubyOnRails
[18:57:54] prettybTech: has joined #RubyOnRails
[19:01:31] mroutis: has joined #RubyOnRails
[19:21:12] dtzuzu: has joined #RubyOnRails
[19:28:36] ur5us: has joined #RubyOnRails
[19:29:04] jottr: has joined #RubyOnRails
[19:34:21] blackmesa1: has joined #RubyOnRails
[19:35:47] Dbugger: has joined #RubyOnRails
[19:36:05] eckhardt: has joined #RubyOnRails
[19:38:34] akaiiro: has joined #RubyOnRails
[19:45:34] blackmesa: has joined #RubyOnRails
[19:51:12] orbyt_: has joined #RubyOnRails
[19:56:06] blackmesa: has joined #RubyOnRails
[20:08:43] blackmesa1: has joined #RubyOnRails
[20:20:19] lexileo: has joined #RubyOnRails
[20:22:28] mikecmpbll: has joined #RubyOnRails
[20:31:59] mroutis: has joined #RubyOnRails
[20:32:47] duderonomy: has joined #RubyOnRails
[20:33:21] prettybTech: has joined #RubyOnRails
[20:35:02] dionysus69: has joined #RubyOnRails
[20:56:48] hahuang65: Radar: what you been working on these days?
[20:58:19] cagomez: has joined #RubyOnRails
[21:01:48] blackmesa1: has joined #RubyOnRails
[21:04:05] eckhardt: has joined #RubyOnRails
[21:13:21] spohnz_: has joined #RubyOnRails
[21:33:19] eckhardt: has joined #RubyOnRails
[21:41:57] akaiiro: has joined #RubyOnRails
[21:43:04] defsdoor: has joined #RubyOnRails
[21:53:06] eckhardt: has joined #RubyOnRails
[21:58:07] Caerus: has joined #RubyOnRails
[22:01:19] beowuff: has joined #RubyOnRails
[22:07:45] improv42: has joined #RubyOnRails
[22:10:25] mroutis: has joined #RubyOnRails
[22:12:27] apeiros: has joined #RubyOnRails
[22:23:24] orbyt_: has joined #RubyOnRails
[22:31:30] chouhoulis: has joined #RubyOnRails
[22:31:30] fot: has joined #RubyOnRails
[22:49:13] uks: has joined #RubyOnRails
[22:52:10] za1b1tsu: has joined #RubyOnRails
[22:58:10] mroutis: has left #RubyOnRails: ()
[22:59:03] duderonomy: has joined #RubyOnRails
[23:24:32] fot: has joined #RubyOnRails
[23:25:43] ur5us: has joined #RubyOnRails
[23:54:20] Hexafox[I]: has joined #RubyOnRails