« Back to channel list

#RubyOnRails - 09 July 2019

« Back 1 day Forward 1 day »
[00:02:36] havenwood: mlt-: You can refine whatever you want!
[00:03:02] havenwood: mlt-: Yeah, it was added in 2.6. (The SO solution you linked to presumes 2.6 it seems.)
[00:03:24] havenwood: mlt-: It was added in this issue: https://bugs.ruby-lang.org/issues/14035
[00:03:26] mlt-: heh...just opened uri.rb .. It is official way to extend it... just monkey patch it :-)
[00:04:29] mlt-: No, SO solution adds that feature so 'FILE' schema would use that new File class
[00:04:46] mlt-: It was enough of messing around... I'll stick to RuboCop exclusion
[00:04:51] mlt-: Thanks again!
[00:12:58] mlt-: 2.6 has more sophisticated URI::File https://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/lib/uri/file.rb?view=markup&pathrev=62767
[00:13:39] skryking: has joined #RubyOnRails
[00:15:03] Exuma: has joined #RubyOnRails
[00:23:27] mlt-: Exuma: hello, fellow PG user :-)
[00:23:38] Exuma: mlt- hahaha
[00:23:46] Exuma: you found me O_O
[00:24:23] mlt-: I thought you missed my message as you just joined... then I realized it was a wrong channel
[00:40:21] mlt-: Exuma: worth mentioning that it is a pain to deal with Rails tests and serializeable transactions in PG
[00:40:34] mlt-: as you cannot use trasnactional fixtures
[00:40:43] Exuma: yeah i am actually using elixir, but its also a huge PITA
[00:41:27] mlt-: it is not PITA... it is just have to be more explicit with tests... I dunno what is coming with elixir... minitest-alike as well?
[01:07:10] emptyfl4sk: has joined #RubyOnRails
[01:14:32] noodle: has joined #RubyOnRails
[01:28:02] molly: has joined #RubyOnRails
[01:29:45] Fenhl_: has joined #RubyOnRails
[01:35:26] lypsis: has joined #RubyOnRails
[01:37:53] c0san0stra: has joined #RubyOnRails
[01:37:54] \13k: has joined #RubyOnRails
[01:47:24] emptyfl4sk: has joined #RubyOnRails
[02:09:36] haxx0r: has joined #RubyOnRails
[02:10:31] haxx0r: i have a rails project and want to listen on a local running RPC client every second for new stuff. i wonder what would be best practice to have this running in a way that it can literally run forever and won't be interrupted
[02:14:07] haxx0r: should i use this gem https://github.com/thuehlinger/daemons ? wonder how to integrate it into rails
[02:18:19] tdy: has joined #RubyOnRails
[02:25:36] Saukk: has joined #RubyOnRails
[02:38:14] DTZUZO: has joined #RubyOnRails
[03:10:28] braincrash: has joined #RubyOnRails
[03:33:26] ephemer0l: has joined #RubyOnRails
[03:46:05] Exuma: has joined #RubyOnRails
[03:48:03] ascarter: has joined #RubyOnRails
[03:54:31] jhass: has joined #RubyOnRails
[04:05:24] emptyfl4sk: has joined #RubyOnRails
[04:50:11] sandstrom: has joined #RubyOnRails
[05:08:15] ur5us: has joined #RubyOnRails
[05:10:26] planigan: has joined #RubyOnRails
[05:11:51] za1b1tsu: has joined #RubyOnRails
[05:14:11] srinidhi: has joined #RubyOnRails
[05:15:56] za1b1tsu: has joined #RubyOnRails
[05:17:50] conta: has joined #RubyOnRails
[05:19:18] ur5us: has joined #RubyOnRails
[05:33:11] alxgsv: has joined #RubyOnRails
[05:38:52] conta: has joined #RubyOnRails
[05:42:27] Tempesta: has joined #RubyOnRails
[05:54:27] mlt-: haxx0r: I'm not sure I quite follow. Just have some glue around RPC stuff to call your Rails endpoint
[05:54:53] haxx0r: i figured already
[05:55:14] haxx0r: Uploaded file: https://uploads.kiwiirc.com/files/31e76e51244189c45ac6ecb582401fc7/pasted.txt
[05:55:32] haxx0r: so i can start and stop it as a background process
[05:56:05] haxx0r: alternatively i could make a cronjob that gets called every minute and the cronjob itself will work 5 times with 10 seconds delays
[05:56:09] haxx0r: no idea which idea is better
[06:00:54] mlt-: you save on overhead with startup by keeping it up running
[06:04:05] schne1der: has joined #RubyOnRails
[06:07:32] molly: has joined #RubyOnRails
[06:10:42] emptyfl4sk: has joined #RubyOnRails
[06:11:10] sandstrom: has joined #RubyOnRails
[06:53:11] schne1der: has joined #RubyOnRails
[06:56:33] DTZUZO: has joined #RubyOnRails
[07:01:49] lankanmon: has joined #RubyOnRails
[07:04:20] jhass: has joined #RubyOnRails
[07:18:05] emptyfl4sk: has joined #RubyOnRails
[07:22:46] jhass|off: has joined #RubyOnRails
[07:25:07] sandstrom: has joined #RubyOnRails
[07:33:30] planigan: has joined #RubyOnRails
[07:50:08] deepredsky: has joined #RubyOnRails
[07:57:05] srinidhi: has joined #RubyOnRails
[07:58:47] MrCrackPotBuilde: has joined #RubyOnRails
[08:25:06] lxsameer: has joined #RubyOnRails
[08:27:11] Ergo: has joined #RubyOnRails
[08:32:03] conta: has joined #RubyOnRails
[08:58:31] Guest42592: has joined #RubyOnRails
[09:19:01] emptyfl4sk: has joined #RubyOnRails
[09:23:20] alexander92: has joined #RubyOnRails
[09:23:50] alexander92: hey, i am making a kinda rails-like framework in a typed language
[09:24:31] alexander92: i guess many people tried that ! what are some usual ways that those typed alternatives/DSL-s disappoint typical rails people?
[09:30:13] jhass: has joined #RubyOnRails
[09:55:48] haxx0r: rails > all
[09:55:53] haxx0r: everybody else is just clickbaiting
[09:56:19] alexander92: i agree , but one can still translate some of the good ideas
[09:56:37] alexander92: not all, a clone is usually not a great idea tho
[10:12:24] Dbugger: has joined #RubyOnRails
[10:34:10] conta: has joined #RubyOnRails
[10:52:08] uksio: has joined #RubyOnRails
[11:01:08] lankanmon: has joined #RubyOnRails
[11:19:56] emptyfl4sk: has joined #RubyOnRails
[11:45:41] snowy: has joined #RubyOnRails
[12:00:49] webdestroya: has joined #RubyOnRails
[12:01:27] dgs: has joined #RubyOnRails
[12:01:27] Norrin: has joined #RubyOnRails
[12:01:27] ferdi2005: has joined #RubyOnRails
[12:01:27] n1v: has joined #RubyOnRails
[12:01:27] siasmj: has joined #RubyOnRails
[12:01:27] kapilp: has joined #RubyOnRails
[12:01:27] DylanJ: has joined #RubyOnRails
[12:01:27] liKe2k1: has joined #RubyOnRails
[12:01:27] Kilo`byte: has joined #RubyOnRails
[12:01:27] iamdevnul: has joined #RubyOnRails
[12:01:27] ppl: has joined #RubyOnRails
[12:01:27] Nuck: has joined #RubyOnRails
[12:01:27] fowlduck: has joined #RubyOnRails
[12:01:27] KevinSjoberg: has joined #RubyOnRails
[12:01:27] Kamuela: has joined #RubyOnRails
[12:01:27] ziyadb: has joined #RubyOnRails
[12:01:27] casdr: has joined #RubyOnRails
[12:03:18] deepredsky: has joined #RubyOnRails
[12:05:14] Kamuela: has joined #RubyOnRails
[12:05:37] kapilp: has joined #RubyOnRails
[12:12:20] xco: has joined #RubyOnRails
[12:14:53] xco: what does Model.validate({}) do in Rails?
[12:16:39] haxx0r: check against ActiveModel Validations
[12:16:53] haxx0r: https://guides.rubyonrails.org/active_record_validations.html
[12:33:13] conta: has joined #RubyOnRails
[13:20:59] emptyfl4sk: has joined #RubyOnRails
[13:30:42] Saukk: has joined #RubyOnRails
[13:58:14] ephemer0l: has joined #RubyOnRails
[14:04:32] DTZUZO: has joined #RubyOnRails
[14:07:49] jtperreault: has joined #RubyOnRails
[14:57:18] deepredsky: has joined #RubyOnRails
[14:58:19] brool: has joined #RubyOnRails
[15:21:50] emptyfl4sk: has joined #RubyOnRails
[15:30:22] deepredsky: has joined #RubyOnRails
[15:48:48] schne1der: has joined #RubyOnRails
[15:51:05] DTZUZO: has joined #RubyOnRails
[15:51:11] jstrong: has joined #RubyOnRails
[15:57:21] snowy: has joined #RubyOnRails
[15:57:40] emptyfl4sk: has joined #RubyOnRails
[16:00:57] sandstrom: has joined #RubyOnRails
[16:09:17] beingjohnm: has joined #RubyOnRails
[16:18:04] deepreds1: has joined #RubyOnRails
[16:20:43] orbyt_: has joined #RubyOnRails
[16:24:19] Dr_MDMA_MD: has joined #RubyOnRails
[16:40:38] maryo: has joined #RubyOnRails
[16:58:34] Guest42592: has joined #RubyOnRails
[16:58:43] tdy: has joined #RubyOnRails
[16:59:00] srinidhi: has joined #RubyOnRails
[17:16:01] DTZUZO: has joined #RubyOnRails
[17:21:45] deepredsky: has joined #RubyOnRails
[17:29:54] uks: has joined #RubyOnRails
[17:30:27] emptyfl41: has joined #RubyOnRails
[17:47:32] snowy: has joined #RubyOnRails
[18:32:44] snowy: has joined #RubyOnRails
[18:37:57] Norrin: NL3limin4t0r_afk that's nice about `foreign_key: {to_table: :segment}`. Where do you find documentation for that?
[18:38:46] tdy1: has joined #RubyOnRails
[18:51:19] algun: has joined #RubyOnRails
[18:52:04] algun: How could I set a custom Reason-Phrase, such as, instead of "200 OK" a "200 I got you"
[18:52:32] algun: Without overriding the default Reason-Phrase for everyone, that is
[18:56:11] dviola: has joined #RubyOnRails
[19:05:04] havenwood: algun: That's not how status codes are supposed to work!
[19:05:41] havenwood: algun: The status code directly corresponds to the reason phrase, and is meant to be static.
[19:06:55] havenwood: algun: RFC-7230: "A client should ignore the reason-phrase content."
[19:12:11] Exuma: has joined #RubyOnRails
[19:16:26] snowy: has joined #RubyOnRails
[19:33:09] sandstrom: has joined #RubyOnRails
[19:41:16] tdy2: has joined #RubyOnRails
[19:49:43] glasz: has joined #RubyOnRails
[19:53:04] snowy: has joined #RubyOnRails
[19:53:35] davidw: has joined #RubyOnRails
[19:53:54] davidw: DATABASE_URL='postgres:///xyz' rails console ... and then I try and run something that requires the DB and I get ActiveRecord::NoDatabaseError (FATAL: database "davidw" does not exist) - why is it ignoring the DATABASE_URL?
[19:54:31] davidw: I also have the database.yml file configured to use DATABASE_URL
[19:56:39] davidw: what's even stranger is that ActiveRecord::Base.establish_connection("postgres:///xyz") functions as expected
[20:08:35] tdy2: has joined #RubyOnRails
[20:17:47] alexander92: has joined #RubyOnRails
[20:40:55] tdy3: has joined #RubyOnRails
[20:41:43] LenPayne: has joined #RubyOnRails
[20:43:34] davidw: now it won't let me edit gems.... :-/ has no effect
[20:44:19] tdy3: has joined #RubyOnRails
[20:56:44] xco: has joined #RubyOnRails
[20:57:12] tf2ftw: has joined #RubyOnRails
[21:04:09] Xiti: has joined #RubyOnRails
[21:04:59] tdy3: has joined #RubyOnRails
[21:06:16] davidw: it's all Spring's fault :-/ what a PITA
[21:14:55] ur5us: has joined #RubyOnRails
[21:19:24] snowy: has joined #RubyOnRails
[21:24:54] MentalPower: Any hints on when 6.0 will be GA? I’ll also take a tracking issue or email thread that comments on what’s missing :)
[21:57:42] snowy: has joined #RubyOnRails
[22:04:27] jstrong: has joined #RubyOnRails
[22:21:26] jstrong: has joined #RubyOnRails
[22:42:43] lannytan: has joined #RubyOnRails
[22:44:31] lannytan: Hello. Anyone ever dealt with polymorphic associates in controllers before? I have some resources that can have parents of different types using polymorphic model associations. It seems like I can go both ways: using a single controller that extracts the parent or separate controllers for each child. Not sure what the best option is.
[22:45:09] lannytan: I do have different logic to execute for each type of association, but I could do that generically by calling a service based on the parent type, which is why I'm leaning towards a single controller.
[22:55:44] xco: has joined #RubyOnRails
[22:57:48] Inside: single controller with a service object
[22:58:32] jstrong: has joined #RubyOnRails
[23:02:36] lannytan: Inside: I think that's what I'm leaning towards
[23:03:00] lannytan: what would the service object be used for?
[23:03:47] Inside: are you doing different stuff depending on the type of the model?
[23:03:48] Exuma: has joined #RubyOnRails
[23:04:47] Inside: I mean it's hard to figure out what to do based on limited info, but I personally like service objects/poros for that kind of stuff
[23:05:10] lannytan: I think what you're saying is: if I have Configs that can have polymorphic parents, I could do something like "#{config.configable.class.name}ConfigUpdated".constantize to execute a service for the parent, so it could handle the update of its config appropriately
[23:05:14] lannytan: did i get it right?
[23:05:48] lannytan: nevermind the syntax, pretty sure that needs some correction :)
[23:06:34] Inside: yeah why not?
[23:06:59] lannytan: i've had some people tell me i should use explicit controllers for more clarity
[23:07:08] lannytan: but i think this way makes sense and keeps things clean
[23:07:08] Inside: but you've only got one resource
[23:07:35] lannytan: no no sorry, configs can be owned by a few different types of resources
[23:07:50] lannytan: and i have a similar child-parent relationship with some other resources
[23:08:27] lannytan: so with your approval i think i'll go the generic way
[23:08:49] Inside: I think you may be doing more advanced things than I'm used to :)
[23:09:07] Inside: but, in the name of the Matz, DHH, and the holy MRI, I grant you permission to use a service object
[23:09:42] lannytan: is it fair to say that a service shouldn't do anything with models?
[23:09:56] lannytan: like the controller should call the service and update the model separately?
[23:10:57] Inside: I've not heard that before
[23:11:08] lannytan: ah okay. all sounds good
[23:11:11] lannytan: thank you very much!
[23:11:39] Inside: typically I use a model to control validation/before/after callbacks
[23:12:06] Inside: if I need to do something special (like calculate some values) - I'll pass stuff from the controller to a service object which will calculate that stuff and then create/update the model
[23:12:50] Inside: but, I'm sure there's a dozen opinions based on that
[23:16:51] lannytan: is it okay if a service object doesn't return a value but calls an api or fires off an active job>?
[23:19:41] jstrong: has joined #RubyOnRails
[23:24:05] jstrong: has joined #RubyOnRails
[23:37:58] jstrong: has joined #RubyOnRails
[23:51:10] jstrong: has joined #RubyOnRails