dang`r`us

Activity Graph

Page 1 of 1

2018-05-17

[21:19:56] dang`r`us: has left #RubyOnRails: ("WeeChat 2.0.1")

2018-05-14

[12:36:05] dang`r`us: deadlock holiday ♪

2018-05-13

[15:00:26] dang`r`us: are there no docs?
[16:16:47] dang`r`us: tuskkk___, have you found https://docs.aws.amazon.com/sdk-for-ruby/v3/developer-guide/welcome.html ?
[16:17:10] dang`r`us: it's linked on that page

2018-05-10

[14:09:14] dang`r`us: oh, interesting

2018-05-09

[08:56:22] dang`r`us: without knowing much of the ruby library world ... what exactly do you want to implement? (given state machines are rather low level)
[09:00:47] dang`r`us: hmm, also maybe search for a job gem instead
[09:01:37] dang`r`us: fair enough
[09:15:40] dang`r`us: jwt is not worth it in most cases
[09:16:11] dang`r`us: I mean, if you do have a complex infrastructure, and use them as kind of a one time ticket, you can

2018-05-08

[15:55:19] dang`r`us: sounds sane to me, but my rails is rusty

2018-05-07

[17:05:11] dang`r`us: nooooode *shakefist*

2018-05-04

2018-05-03

2018-05-02

[10:57:48] dang`r`us: --> use nodejs/express
[10:58:15] dang`r`us: there's also server side rendering support for quite a few things
[10:58:19] dang`r`us: so check that out

2018-04-27

[08:33:53] dang`r`us: you could look at your database schema
[08:33:57] dang`r`us: are you using postgres?
[08:51:01] dang`r`us: check schema.rb
[08:51:10] dang`r`us: but the definitive info is in the database
[08:51:19] dang`r`us: (well, it depends on what you mean by foreign key....)
[08:52:40] dang`r`us: I have no idea what you mean/want
[08:53:25] dang`r`us: Have you looked around for existing software to do that?
[08:54:00] dang`r`us: I suggested that earlier
[08:54:03] dang`r`us: I repeat my suggestion :V
[08:54:51] dang`r`us: you can have a look at https://alexpeattie.com/blog/stop-forgetting-foreign-key-indexes-in-rails-post-migration-script
[08:54:56] dang`r`us: it looks dodgy to me though
[08:55:25] dang`r`us: I still suggest you look around for generator gems
[08:55:59] dang`r`us: bundle exec rake db:schema:dump generates schema.rb
[14:39:14] dang`r`us: usually UTC is better; if you need to store information about time zones (e.g. for users, sites etc.) store the time zone name separately

2018-04-26

[08:53:20] dang`r`us: broadly speaking, threads are often the wrong abstraction
[08:53:23] dang`r`us: (too low level)

2018-04-25

[09:32:01] dang`r`us: sounds interesting
[09:34:47] dang`r`us: dminuoso, the project I'm building replaces one without an ORM ... it's quite the sight
[09:35:06] dang`r`us: lots of core logic in database triggers, which are written in a postgres-typescript extension
[09:35:35] dang`r`us: dminuoso, https://github.com/plv8/plv8
[09:35:41] dang`r`us: what's that, you wanted to debug anything? Oh..
[09:54:43] dang`r`us: dminuoso, this project's old backend is nodejs too, of course. Anything resembling configuration management is a few incoherent bash scripts
[09:56:00] dang`r`us: in fact I'm pretty close to develop a test script that does some sed on a gitlab configuration file (because currently "deploy this commit to the test server" is not a thing this monster can do)
[09:56:41] dang`r`us: my favorite js feature is still 9999999999999999 == 10000000000000000
[09:57:24] dang`r`us: everything is a float
[09:57:48] dang`r`us: was there a conscious design decision?
[09:58:01] dang`r`us: I mean, I find JS actually pretty impressive given it was thrown together in 10 days or so
[09:58:11] dang`r`us: not that this makes it -any good- ..
[09:58:50] dang`r`us: but anyway, no, I guess I don't know the reason behind every number being a float
[09:58:53] dang`r`us: something with dots? :)
[10:00:09] dang`r`us: sounds plausible
[10:00:31] dang`r`us: yup, seen that
[12:00:15] dang`r`us: xco, the '$' is not part of the command you should run
[12:00:23] dang`r`us: so your command starts with 'rails', not with '$ '
[12:00:33] dang`r`us: '$ ' is standard notation for "this is run in a shell prompt"
[12:25:42] dang`r`us: *.net *.split
[12:27:32] dang`r`us: has joined #RubyOnRails
[15:01:12] dang`r`us: *.net *.split
[15:03:06] dang`r`us: has joined #RubyOnRails
[20:40:40] dang`r`us: c0lored, when I google for "cannot load such file -- initializer (LoadError)" I get some info
[20:40:45] dang`r`us: have you checked that?
[20:47:33] dang`r`us: maybe create a fresh project and take it from there
[22:27:03] dang`r`us: kapil___, that's database specific
[22:28:08] dang`r`us: \d table_name
[22:28:59] dang`r`us: why do you want that?
[22:29:46] dang`r`us: I'm sure there is one already
[22:29:55] dang`r`us: anyway, this probably helps: https://stackoverflow.com/a/14949277/1708913
[22:30:01] dang`r`us: but search for gems to do this first.

2018-04-23

[12:11:39] dang`r`us: http://www.rubydoc.info/github/plataformatec/devise/master/Devise/Controllers/Helpers:after_sign_in_path_for <- where would "publisher_url" come from?
[12:22:44] dang`r`us: dminuoso, okay thanks. I already have http://guides.rubyonrails.org/routing.html open but can't seem to connect all required dots. let's say I already have a route like get 'customer/dashboard' - how would I reference that?
[12:24:41] dang`r`us: dminuoso, okay, so I just return the prefix there?
[12:25:13] dang`r`us: dminuoso, how do I determine what is needed?
[12:25:28] dang`r`us: I don't understand
[12:26:04] dang`r`us: I have a 'customer/dashboard' url that I can type in the browser that does what I want; how do I refer to that in the after_sign_in_path_for method?
[12:26:30] dang`r`us: https://dpaste.de/UwqO
[12:26:50] dang`r`us: what's the difference?
[12:27:40] dang`r`us: okay, so probably _url in that case. I'll try that. In "rails console" it doesn't work, that should not concern me, yes?
[12:27:45] dang`r`us: okay, _path then ...
[12:28:40] dang`r`us: trying it out now ...
[12:30:42] dang`r`us: so this is my ApplicationController, but it does not do the redirects after signing in, instead I land on the root/home page.. https://dpaste.de/gUhx
[12:31:24] dang`r`us: the method does not seem to get called at all - I intentionally put an error there now and I still land on /
[12:32:12] dang`r`us: probably I need to remove root to: 'home#index' from routes.rb?
[12:33:01] dang`r`us: dminuoso, okay, so the devise docs are wrong in this case..?
[12:33:22] dang`r`us: or rather, they don't mention I should protect the method, I guess
[12:35:07] dang`r`us: Yeah, I removed the root to: 'home#index' and now the method does get called, however I'm fighting a docker issue now so I haven't been able to test it completely
[12:35:16] dang`r`us: some sort of caching seems to have caught my intentional error
[12:35:36] dang`r`us: my next question however will probably be how to get the root route back and only do the customized routing on login
[12:36:03] dang`r`us: yay, now I get redirected to the dashboard
[12:36:35] dang`r`us: dminuoso, fair; I'm a bit bound to the customer's requirements here though
[12:36:42] dang`r`us: it's a good point though
[12:37:14] dang`r`us: anyway, dashboard stuff works now, so yay. How do I get my old root route back?
[12:37:28] dang`r`us: routes.rb: https://dpaste.de/x6X7
[12:38:57] dang`r`us: that question does not seem to apply - let me rephrase my issue
[12:39:14] dang`r`us: I want non logged in users that visit http://site/ to see home#index
[12:39:25] dang`r`us: but on login they should be redirected to their respective dashboard
[12:39:46] dang`r`us: after commenting out the home#index route, ApplicationController#after_sign_in_path_for gets called on login, which is precisely what I want
[12:40:02] dang`r`us: but now when visiting http://site/, I see "congratulations, you are on rails" instead of my HomeController #index
[12:40:39] dang`r`us: dminuoso, https://dpaste.de/bqLi line 6
[12:40:54] dang`r`us: on login I then got the excepted exception that errrorrrrrrr is not defined.
[12:41:18] dang`r`us: the method gets called now for sure though, since I get redirected to the correct dashboard now.
[12:41:22] dang`r`us: only my HomeController is gone.
[12:41:44] dang`r`us: dminuoso, I would assume so, since that's the only change I made. But maybe docker cache issues? I'll restart the whole thing to make sure.
[12:42:11] dang`r`us: FWIW, I'm using an overlay so I don't have to rebuild the file system
[12:42:29] dang`r`us: I'll keep that in mind, yes.
[12:43:07] dang`r`us: although I'd like to know where the issues come from, since the changes get picked up by the overlay anyway...
[12:43:34] dang`r`us: hmm, yeah, when I plug the route back in I get redirect to home now.
[12:43:37] dang`r`us: which I don't want
[12:44:11] dang`r`us: like I said I don't rebuild it because overlay
[12:44:20] dang`r`us: anyway, I have now verified a few times: the root route is the culprit
[12:44:37] dang`r`us: sign in with the route commented out -> dashboard; sign in with the route enabled -> root
[12:45:27] dang`r`us: okay. Thanks for your help so far :) I guess I'll bother the colleague who put devise in.
[12:52:06] dang`r`us: yeah, I would think so too. And after restarting docker-compose -again-, it even works.
[12:52:26] dang`r`us: I don't understand where those issues come from and would really like to, even though I agree that at that point just removing docker from the process is the easiest approach.
[12:52:48] dang`r`us: I have not looked into spring; probably important. Thanks for the pointer
[12:53:51] dang`r`us: it looks like a good culprit
[12:53:54] dang`r`us: I'll remove it.
[12:55:09] dang`r`us: my ruby and rails are okay I guess, but it's been 11 years since I've worked with either
[12:55:22] dang`r`us: dinosaur mode engage..
[13:13:49] dang`r`us: is it ok to use activerecord model instances as hash keys?
[13:20:50] dang`r`us: dminuoso, okay, I should be fine then, my objects all have an ID
[13:21:26] dang`r`us: I use it for grouping: https://dpaste.de/2CUT
[13:22:16] dang`r`us: dminuoso, fair point
[13:23:14] dang`r`us: agree. how would I speed it up?
[13:26:59] dang`r`us: thanks again :)

2018-04-20

[10:52:37] dang`r`us: has joined #RubyOnRails
[10:53:07] dang`r`us: hey there, it seems I cannot do a db:drop while rails is running and has made at least one query. I'm assuming this is because of persistent connections, which make of course sense for production, but can I disable them for development?
[11:01:18] dang`r`us: tbuehlmann, so there is no config setting?
[11:01:33] dang`r`us: unrelated, when I do .create and it results in a ROLLBACK, can I somehow see the reason for that?
[11:03:34] dang`r`us: errors: thx
[11:03:39] dang`r`us: setting: i did not ask for that setting
[11:04:03] dang`r`us: I wanted to know if I can disable persistent connections, like https://docs.djangoproject.com/en/2.0/ref/databases/#persistent-connections in "that other web framework"
[11:04:45] dang`r`us: I mean, -if- my assumption is true.
[11:04:59] dang`r`us: I just observe after at least one db query I cannot do a db:drop anymore
[11:05:08] dang`r`us: ok, I guess I'll try to disconnect via AR
[11:05:53] dang`r`us: is there a generic wrapper for object creation so I get an exception or sth when create fails, and see the errors?
[11:18:45] dang`r`us: ah, cool, thanks!

2018-04-19

[10:51:57] dang`r`us: has joined #ruby
[10:52:07] dang`r`us: what does "reduced accuracy" here mean? https://apidock.com/ruby/DateTime/strftime
[11:40:15] dang`r`us: canton7, thx!
[11:54:35] dang`r`us: has left #ruby: ("WeeChat 2.0.1")

2018-04-17

[01:30:31] dang`r`us: has left #ruby: ("WeeChat 2.0.1")

2018-04-13

[15:01:42] dang`r`us: has joined #ruby
[15:01:56] dang`r`us: I'm having trouble with https://github.com/tzinfo/tzinfo -- https://dpaste.de/KkAj
[15:25:52] dang`r`us: havenwood, oooookay thanks :) can I get the version of a gem inside ruby somehow or do I have to consult the Gemfile?
[15:27:02] dang`r`us: damn ;) well, good to know in general. Thanks again!
[15:28:41] dang`r`us: what does it mean when that lists two versions?
[15:28:54] dang`r`us: like, yeah, apparently I have two installed, but why, and can I specifically import one instead of the other?