« Back to channel list

#RubyOnRails - 31 October 2018

« Back 1 day Forward 1 day »
[00:01:21] za1b1tsu: has joined #RubyOnRails
[00:06:05] roshanavand: has joined #RubyOnRails
[00:13:02] orbyt_: has joined #RubyOnRails
[00:32:35] argoneus: has joined #RubyOnRails
[00:36:21] kurko_: has joined #RubyOnRails
[00:38:05] wojnar: has joined #RubyOnRails
[00:38:22] roshanavand: has joined #RubyOnRails
[00:42:24] mangold: has joined #RubyOnRails
[00:42:34] bambanx: has joined #RubyOnRails
[00:44:16] bambanx: has joined #RubyOnRails
[00:58:14] kurko_: has joined #RubyOnRails
[01:01:00] funnel: has joined #RubyOnRails
[01:01:40] bambanx: has joined #RubyOnRails
[01:06:32] za1b1tsu: has joined #RubyOnRails
[01:16:57] NpcOrangeManBad: has joined #RubyOnRails
[01:17:48] sevenseacat: has joined #RubyOnRails
[01:34:22] mr-spoon: has joined #RubyOnRails
[01:39:33] ivanskie: has joined #RubyOnRails
[01:59:41] ur5us: has joined #RubyOnRails
[02:11:59] tdy: has joined #RubyOnRails
[02:40:16] Saukk: has joined #RubyOnRails
[02:43:45] fragamus: has joined #RubyOnRails
[02:54:42] za1b1tsu: has joined #RubyOnRails
[03:25:00] kapil____: has joined #RubyOnRails
[03:25:33] orbyt_: has joined #RubyOnRails
[03:29:37] za1b1tsu: has joined #RubyOnRails
[03:36:12] darkhanb: has joined #RubyOnRails
[03:37:35] quazimodo: has joined #RubyOnRails
[03:47:14] srinidhi: has joined #RubyOnRails
[04:09:58] braincrash: has joined #RubyOnRails
[04:26:04] bambanx: has joined #RubyOnRails
[04:29:45] kurko_: has joined #RubyOnRails
[04:41:11] eckhardt: has joined #RubyOnRails
[04:41:54] bambanx: has joined #RubyOnRails
[04:46:17] za1b1tsu: has joined #RubyOnRails
[05:11:20] MoritaShinobu: has joined #RubyOnRails
[05:18:08] bambanx: has joined #RubyOnRails
[05:21:35] ellcs: has joined #RubyOnRails
[05:25:25] conta: has joined #RubyOnRails
[05:32:15] za1b1tsu: has joined #RubyOnRails
[05:36:02] voolik: has joined #RubyOnRails
[05:45:29] dachi: has joined #RubyOnRails
[05:45:33] dachi: Hi. I have a question, I've been working for the while and in vain. May I ask for help?
[05:49:57] dachi: We have a domain and 4 subdomains, I need to isolate one subdomain from others (domain and 3 subdomains), so that it has a separate session-cookie-store.
[05:50:24] dachi: I tried writing a middleware and it looked like specs passed, but from closer look it was not functioning correctly.
[05:51:21] dachi: I mean I need *system.domain.com* to have its own session cookie store and *domain.com*, *docs.domain.com*, *portal.domain.com*, *blog.domain.com* to have own
[06:16:38] za1b1tsu: has joined #RubyOnRails
[06:31:08] gambl0re: has joined #RubyOnRails
[06:40:19] reber: has joined #RubyOnRails
[07:01:22] Dbugger: has joined #RubyOnRails
[07:02:03] mangold: has joined #RubyOnRails
[07:03:52] voolik: has joined #RubyOnRails
[07:09:58] mangold: has joined #RubyOnRails
[07:15:06] sandstrom: has joined #RubyOnRails
[07:15:36] kurko_: has joined #RubyOnRails
[07:17:13] conta: has joined #RubyOnRails
[07:28:00] dachi: How can I dynamically change session key? request.env['rack.session.options'][:key] = does not work in Rails 5
[07:30:38] whysthatso: has joined #RubyOnRails
[07:51:02] srinidhi: has joined #RubyOnRails
[07:52:57] dachi: How can I dynamically change session key? request.env['rack.session.options'][:key] = does not work in Rails 5
[08:04:22] ahartley: has joined #RubyOnRails
[08:18:34] kurko_: has joined #RubyOnRails
[08:26:49] kapil____: has joined #RubyOnRails
[08:32:02] za1b1tsu: has joined #RubyOnRails
[08:38:02] mangold: has joined #RubyOnRails
[08:40:39] srinidhi: has joined #RubyOnRails
[08:53:56] sandstrom: has joined #RubyOnRails
[08:59:06] sandstrom: has joined #RubyOnRails
[09:00:27] lexileo: has joined #RubyOnRails
[09:04:46] mikecmpbll: has joined #RubyOnRails
[09:08:07] cabotto: has joined #RubyOnRails
[09:10:49] srinidhi: has joined #RubyOnRails
[09:28:37] roshanavand: has joined #RubyOnRails
[09:45:41] roshanavand: has joined #RubyOnRails
[09:47:47] kurko_: has joined #RubyOnRails
[09:56:25] gregf_: has joined #RubyOnRails
[10:10:52] kurko_: has joined #RubyOnRails
[10:40:46] quazimodo: has joined #RubyOnRails
[10:43:55] kurko_: has joined #RubyOnRails
[11:02:38] noob69: has joined #RubyOnRails
[11:03:03] noob69: Hi, so I'm using searchkick. I need to know if we can create multiple indexes for the same model.
[11:09:35] lankanmon: has joined #RubyOnRails
[11:16:44] GodFather: has joined #RubyOnRails
[11:17:06] kurko_: has joined #RubyOnRails
[11:23:55] kurko_: has joined #RubyOnRails
[11:27:34] cabotto: has joined #RubyOnRails
[11:35:56] cabotto: has joined #RubyOnRails
[11:36:02] tuor: has joined #RubyOnRails
[11:37:49] kurko_: has joined #RubyOnRails
[11:42:10] JusticeFries: has joined #RubyOnRails
[11:45:18] nexraf1: has joined #RubyOnRails
[11:46:22] cabotto: has joined #RubyOnRails
[11:51:32] quazimodo: has joined #RubyOnRails
[12:04:30] roshanavand: has joined #RubyOnRails
[12:07:27] conta: has joined #RubyOnRails
[12:25:31] cabotto: has joined #RubyOnRails
[12:40:46] dachi: has joined #RubyOnRails
[12:41:00] dachi: Hi. Is there anyone online who I can ask for little help, please?
[12:44:02] jhass: just ask and stick around for an hour or two, if anybody is available with an answer to your question, they'll respond
[12:49:04] Cork: anyone know if there is a way to "unmark_for_destruction" a related active record object?
[12:49:06] cabotto: has joined #RubyOnRails
[12:49:22] Cork: i can only find mark_for_destruction and marked_for_destruction? but i need to reset the state
[12:55:11] dachi: @Cork is not it reload ? Reloads the attributes of the object as usual and clears marked_for_destruction flag.
[12:55:30] Cork: dachi: that would reset the complete state of the object
[12:55:36] dachi: Cork: I see
[12:55:44] Cork: i just want to not remove it :)
[12:56:25] Cork: very hackish but... obj.instance_variable_set("@marked_for_destruction", false) "works", though i would love to have an exposed api...
[12:58:09] dachi: Cork: I don't think it's implemented there yet... But maybe someone knows better than me and will respond
[12:59:39] dachi: I have a question too, I've been working on for quite a while and if anybody has time to listen, please write
[13:01:22] Cork: dachi: follow jhass recommendation
[13:08:00] jhass: Cork: why can't you prevent it from being set in the first place?
[13:09:35] dachi: I was not online, so I probably missed it, I'll try to find logs
[13:10:23] dachi: No logs :(
[13:10:27] quazimodo: has joined #RubyOnRails
[13:10:40] Cork: jhass: it happens as an action of the user on the parent object
[13:10:52] helpa: Check your logs. Namely everything in the log folder of your rails app and the error and access logs from Apache or whatever else you're using.
[13:11:02] Cork: you saw the first line
[13:11:18] Cork: it was 22 mins ago :)
[13:11:40] dachi: I meant freenode logs
[13:11:49] Cork: freenode doesn't keep logs
[13:11:51] dachi: It looks like someone answered my questions when I was not line
[13:13:27] helpa: http://logs.ryanbigg.com/
[13:14:32] dachi: jhass: thanks :)
[13:14:46] jhass: Cork: but I mean it's all your code that calls it, no?
[13:15:11] Cork: jhass: ya, but it states so it need to be able to go in both directions
[13:15:29] Cork: else you can toggle the parent object and then toggle it back and get the wrong result
[13:16:04] Cork: sure i can say "if you toggle this and want to restore it you have to reload the entire object relation"
[13:16:14] Cork: but i would prefer to not have to make sure everyone knows that
[13:16:18] jhass: mh, I guess I'd consider just doing my own flag and doing consistent state with an after_save callback
[13:16:20] Cork: (and remembers)
[13:16:45] Cork: ya, but the problem is we have things hooked into the after_commit hook that needs to get the correct data
[13:16:54] p8m: has joined #RubyOnRails
[13:16:58] Cork: so mark_for_destruction action is important to trigger correctly on .save
[13:17:54] jhass: maybe there's something wrong in the data model, actual terms would help thinking about that point :)
[13:18:53] Cork: jhass: ya, but it is a kinda silly big relation, we have extended active_record quite heavily (it is a relly old project, we hopefully will replace it in about a year)
[13:18:55] jhass: dachi: maybe it would be simpler if you use the same session but different keys within the session?
[13:20:07] dachi: jhass: that's another thing that I wanted to achieve, but request.env['rack.session.options'][:key] = "..." does not work in Rails 5
[13:20:30] dachi: jhass: before I was trying to write a middleware that would dynamically set domains
[13:20:55] jhass: no, I mean instead of using idk, "current_user_id", for the system. part use "current_system_user_id" etc
[13:25:34] dachi: jhass: I have it like that with Devise, User model and AdminUser model
[13:25:55] dachi: but both write to same cookie session.
[13:26:56] ellcs: has joined #RubyOnRails
[13:26:59] dachi: And people around my project demand to get rid of this "dual-system", they want it isolated, because a lot of unwanted things occur
[13:28:04] jhass: does your admin thing even share much domain logic? maybe it could be its own thing?
[13:28:12] jhass: own app that is
[13:30:04] dachi: jhass: I wanted to ask around my project if setting that subdomain from nginx and running another app on it would be a better option, but unfortunately it looks like they want to keep it as it is.
[13:31:10] dachi: I don't know why it even is such a big deal, I was thinking that changing cookie name according to request info would not be that big of a hussle
[13:37:48] JusticeFries: has joined #RubyOnRails
[13:41:49] jhass: maybe you have some luck with deriving your own session store from ActionDispatch::Session::CookieStore and overriding load_session/delete_session to reset options[:key] based on the host in req
[13:42:38] dachi: jhass: i'll try, thanks
[13:44:01] jhass: https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb / https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb / https://github.com/rack/rack/blob/master/lib/rack/session/abstract/id.rb#L202
[13:44:47] jhass: so @key not options[:key]
[13:47:46] dachi: jhass: looks exactly what I need, thanks
[13:53:56] dionysus69: dachi hello from AAT :)
[13:55:47] mangold: has joined #RubyOnRails
[13:56:27] fragamus: has joined #RubyOnRails
[13:58:12] dachi: dionysus69: :)) hi lasha
[13:58:33] dionysus69: how did you guess :D
[13:59:42] dachi: whois :))
[14:00:44] dachi: really miss our school, hope you're doing great
[14:00:54] dionysus69: nice nice, I couldnt help you with that question, I never done such a thing so :)
[14:01:38] dionysus69: yes I am fine, same to you, if you need a rails job give me facebook ping btw, we maybe looking for an extra employee ^.^ if you are in Georgia :)
[14:01:58] dachi: :)) not a problem thanks
[14:03:06] dachi: dionysus69: thanks a lot, currently I work with Iuri, if you remember him
[14:03:22] dachi: btw your math lectures are really missed
[14:04:51] dionysus69: oh yes yes, say hi to him, let's move to #RubyOnRails-offtopic btw before one of the Jedies gives us a notice
[14:10:14] greengriminal: has joined #RubyOnRails
[14:13:09] orbyt_: has joined #RubyOnRails
[14:18:27] cxl: has joined #RubyOnRails
[14:32:08] sandstrom: has joined #RubyOnRails
[14:33:54] voolik: has joined #RubyOnRails
[14:50:10] mangold: has joined #RubyOnRails
[14:50:52] JusticeFries: has joined #RubyOnRails
[14:54:26] tumbacoco: has joined #RubyOnRails
[15:06:05] GodFather: has joined #RubyOnRails
[15:21:03] sandstrom: has joined #RubyOnRails
[15:24:27] jackrandom: has joined #RubyOnRails
[15:28:19] jsc: has joined #RubyOnRails
[15:34:31] wojnar: has joined #RubyOnRails
[15:50:50] conta: has joined #RubyOnRails
[15:55:41] ams__: has joined #RubyOnRails
[15:57:03] GodFather: has joined #RubyOnRails
[16:15:13] darkhanb: has joined #RubyOnRails
[16:17:16] Psy-Q: has joined #RubyOnRails
[16:18:49] Psy-Q: this is just an experimental class i'm throwing together, but why in the world would https://dpaste.de/xO2f#L49 not work? it throws NoMethodError (undefined method `fish' for #<Hosting:0x000056516f27e090>). the "same" methods further up work fine
[16:19:11] Psy-Q: it doesn't matter what i put into errors.add, it's always that error
[16:29:47] apeiros_: has joined #RubyOnRails
[16:29:52] kurko_: has joined #RubyOnRails
[16:33:39] orbyt_: has joined #RubyOnRails
[16:38:28] kurko_: has joined #RubyOnRails
[16:38:29] srinidhi: has joined #RubyOnRails
[16:41:06] mangold: has joined #RubyOnRails
[16:45:07] dachi: jhass: thanks for helping me out. I made it into work your way
[16:46:02] dachi: That's it https://imgur.com/a/p26IaEs
[16:47:30] srinidhi: has joined #RubyOnRails
[16:48:13] jhass: huh, I would think the monkey patch is unecessary/avoidable
[16:48:41] jhass: especially since your custom store redefines one of the redefined methods again
[16:49:13] roshanavand: has joined #RubyOnRails
[16:49:42] dachi: jhass: yeah, you mean Persisted.class_eval, you think @key will be there from custom store already? cool, i'll check
[16:50:16] jhass: yes, CookieStore inherits Peristed
[16:51:00] jhass: so I would imagine just overriding extract_session_id in your custom store is enough
[16:51:57] jhass: not sure how I feel about copying implementation vs just setting @key and calling super, both is hackish but I think personally I'd prefer calling super
[16:57:24] ivanskie: has joined #RubyOnRails
[16:58:21] dachi: jhass: thanks a lot!!
[17:01:36] mwlang: has joined #RubyOnRails
[17:03:46] mwlang: I think I’ve forgotten something subtle about ActiveRecord. Why would deleting a child record that belongs to a parent class issue a DELETE for the parent record? The child class depends on the the parent, so if parent is being destroyed, sure, delete the child, but not the other way around...
[17:12:05] reber: has joined #RubyOnRails
[17:22:24] eckhardt: has joined #RubyOnRails
[17:27:11] apeiros_: has joined #RubyOnRails
[17:29:03] dachi: mwlang: So you delete a record that belongs to some other record from another model and that model's record is destroyed?
[17:29:28] mwlang: I figured it out.
[17:29:51] mwlang: I started a transaction block, deleted all the child records, then deleted the parent record at the end of that transaction block.
[17:30:23] mwlang: it’s the call to delete the parent record that’s triggering the FK constraint on the child table (whose records I’ve already deleted…)
[17:30:52] dachi: mwlang: nice
[17:30:55] mwlang: the DBMS just isn’t seeing the record as deleted yet, so it’s the DBMS raising the FK constraint error, not AR.
[17:32:01] dtzuzu: has joined #RubyOnRails
[17:35:53] JusticeFries: has joined #RubyOnRails
[17:40:57] conta: has joined #RubyOnRails
[17:46:48] za1b1tsu: has joined #RubyOnRails
[17:53:52] hightower3: has joined #RubyOnRails
[17:54:16] eddof13: has joined #RubyOnRails
[17:54:24] hightower3: Hey, I want get(), post() etc. to be available in all rspec tests and not just ones of type: request. How do I do that?
[17:59:52] dachi: hightower3: i don't think it's good way to write specs, but I think you can hack it
[18:00:00] hightower3: Got it, I needed line "config.include RSpec::Rails::RequestExampleGroup" inside RSpec.confgure()
[18:00:55] hightower3: dachi, I want to do it because all my requests need it, and for some which don't (but which aren't that much different) it makes no sense to painstakingly control where do I add type: request and where not
[18:01:49] dachi: hightower3: i see, good that you found a way to do it
[18:04:14] eckhardt: has joined #RubyOnRails
[18:06:03] eddof13: has joined #RubyOnRails
[18:13:08] pLaTo0n: has joined #RubyOnRails
[18:15:16] broppk: has joined #RubyOnRails
[18:15:48] eddof13: has joined #RubyOnRails
[18:16:50] broppk: Hi there. I have a lot of experience with Node and realize it might be faster to get going on a project with that as my first choice. However, I'm growing a little weary with some of the decisions I have to make mapping out a project structure. Is Rails a good solution worth going after in 2018 even if I have limited experience and might have to do a bit of catching up?
[18:20:16] hightower3: broppk, you're asking the question in front of a biased audience :) but sure, start with that video tutorial on rubyonrails.org and the couple intro documents found there
[18:20:53] broppk: i realize there will be a bias in here haha
[18:26:55] broppk: hightower3: which video were you referring to?
[18:28:23] dachi: broppk: I'd suggest taking look at popular gems like Devise, Faraday, Paperclip, Sidekiq, etc. Perhaps understanding how they work might give you a good knowledge
[18:29:08] broppk: cool, thanks dachi
[18:29:10] apeiros: has joined #RubyOnRails
[18:32:27] roshanavand: has joined #RubyOnRails
[18:35:50] za1b1tsu: has joined #RubyOnRails
[18:39:17] apeiros: has joined #RubyOnRails
[18:40:58] kapil____: has joined #RubyOnRails
[18:43:13] dachi: broppk: I also think that after being able to do basic rails-stuff like handling routes, mvc things, assets, environments, initializers
[18:43:29] dachi: It's that you should be able to undestand internals and then I think that's it
[18:44:18] dachi: Things like Rack, ActionDispatch, ActionController, ActiveSupport, AbstractController, ActionView
[18:44:34] srinidhi: has joined #RubyOnRails
[18:45:42] apeiros: has joined #RubyOnRails
[18:45:44] dachi: If I was learning Rails now, I'd probably like to know how Rack apps work
[18:49:48] broppk: cool! thanks
[18:53:29] za1b1tsu: has joined #RubyOnRails
[18:53:59] apeiros__: has joined #RubyOnRails
[19:11:28] nexraf1: has joined #RubyOnRails
[19:11:54] roshanavand: has joined #RubyOnRails
[19:12:18] nexraf1: has joined #RubyOnRails
[19:12:31] eddof13: has joined #RubyOnRails
[19:16:14] mwlang: broppk: 12 years later, Ruby is still my go-to language of choice and I don’t see myself giving it up any time soon. I do some Node JS, but mostly within context of a Rails project, which means React and Webpack, etc. tied into a Rails-driven backend serving the databased JSON to the JS frontends.
[19:16:40] mwlang: In short, my experience is Ruby makes for some pretty good glue.
[19:17:19] dachi: to me rails webpacker is awesome, react works pretty well, incl. serverside rendering
[19:19:57] mwlang: most of the latest JS stuff is still arm’s length for me. I can usually do all the JS I need with simple jQuery widgets written in coffeescript. If I need more, I usually step up to VueJS instead of React, Webpack and all that. Only two projects are utilizing the heavier weight JS tooling.
[19:21:22] mwlang: I guess it all goes back to the RJS days of Rails and since that big ball of mud, I’ve always tried to keep external components to a bare minimum.
[19:22:31] gambl0r3: has joined #RubyOnRails
[19:25:07] srinidhi: has joined #RubyOnRails
[19:29:20] kurko_: has joined #RubyOnRails
[19:30:40] dachi: has joined #RubyOnRails
[19:30:42] apeiros: has joined #RubyOnRails
[19:32:57] GodFather: has joined #RubyOnRails
[19:36:37] eddof13: has joined #RubyOnRails
[19:46:43] orbyt_: has joined #RubyOnRails
[19:52:46] dachi: has joined #RubyOnRails
[19:53:56] dachi: has left #RubyOnRails: ()
[19:57:22] orbyt_: has joined #RubyOnRails
[20:04:09] eddof13: has joined #RubyOnRails
[20:08:46] dachi: has joined #RubyOnRails
[20:19:47] desperek: has joined #RubyOnRails
[20:22:29] sandstrom: has joined #RubyOnRails
[20:28:20] SteenJobs: has joined #RubyOnRails
[20:32:00] dachi: has joined #RubyOnRails
[20:37:27] dachi: has left #RubyOnRails: ()
[20:39:24] eddof13: has joined #RubyOnRails
[20:39:38] defsdoor: has joined #RubyOnRails
[20:42:01] za1b1tsu: has joined #RubyOnRails
[20:50:58] srinidhi: has joined #RubyOnRails
[20:54:18] sandstrom: has joined #RubyOnRails
[20:59:50] roshanavand: has joined #RubyOnRails
[21:02:10] orbyt_: has joined #RubyOnRails
[21:17:02] dachi: has joined #RubyOnRails
[21:30:54] whysthatso: has joined #RubyOnRails
[21:35:46] reber__: has joined #RubyOnRails
[21:42:24] eddof13: has joined #RubyOnRails
[21:45:52] eddof13: has joined #RubyOnRails
[21:47:15] reber: has joined #RubyOnRails
[21:51:45] roshanavand: has joined #RubyOnRails
[21:56:01] orbyt_: has joined #RubyOnRails
[22:00:57] dachi: has joined #RubyOnRails
[22:09:23] JusticeFries: has joined #RubyOnRails
[22:14:54] roshanavand: has joined #RubyOnRails
[22:16:05] ellcs: has joined #RubyOnRails
[22:20:01] eddof13: has joined #RubyOnRails
[22:22:12] Radar: GOOD MORNING
[22:23:05] dachi: Radar Good morning
[22:26:04] bambanx: has joined #RubyOnRails
[22:29:53] za1b1tsu: has joined #RubyOnRails
[22:56:33] snickers: has joined #RubyOnRails
[23:03:49] quazimodo: has joined #RubyOnRails
[23:06:49] za1b1tsu: has joined #RubyOnRails
[23:12:02] dviola: has joined #RubyOnRails
[23:17:13] bmon: has joined #RubyOnRails
[23:41:23] kurko_: has joined #RubyOnRails
[23:52:44] beholders_eye: has joined #RubyOnRails
[23:55:15] bmon: Hi all! I have a model with a jsonb field which is behaving very strangely. When I store an instance of this model into a variable, the attributes value for my jsonb field gets silently mutated! Here's a paste: https://dpaste.de/rU4z
[23:56:16] bmon: I'm pretty confused about what's going on here, has anyone ever encountered something similar?