« Back to channel list

#RubyOnRails - 29 March 2017

« Back 1 day Forward 1 day »
[00:00:15] blackmes1: has joined #RubyOnRails
[00:04:23] Technodrome: has joined #RubyOnRails
[00:05:05] pwnd_nsfw`: has joined #RubyOnRails
[00:08:04] chouhoulis: has joined #RubyOnRails
[00:11:24] rakm: has joined #RubyOnRails
[00:13:41] username2: has joined #RubyOnRails
[00:19:18] Gaelan: has joined #RubyOnRails
[00:20:33] patarr: has joined #RubyOnRails
[00:20:50] fcser__: has joined #RubyOnRails
[00:24:07] fcser_: has joined #RubyOnRails
[00:24:59] blackmesa: has joined #RubyOnRails
[00:32:57] patarr: has joined #RubyOnRails
[00:34:04] dionysus69: has joined #RubyOnRails
[00:36:18] roamingdog: has joined #RubyOnRails
[00:37:51] Technodrome: has joined #RubyOnRails
[00:40:05] Robtop__: has joined #RubyOnRails
[00:42:45] c0dy: has joined #RubyOnRails
[00:51:04] Rodya_: has joined #RubyOnRails
[00:53:34] drale2k: has joined #RubyOnRails
[00:53:56] Technodrome: has joined #RubyOnRails
[00:54:40] patarr: has joined #RubyOnRails
[00:59:07] r3vDev: has joined #RubyOnRails
[01:01:12] GodFather_: has joined #RubyOnRails
[01:01:13] GodFather: has joined #RubyOnRails
[01:07:49] Jameser: has joined #RubyOnRails
[01:11:54] jusa: has joined #RubyOnRails
[01:13:39] jenrzzz: has joined #RubyOnRails
[01:15:09] s2013: has joined #RubyOnRails
[01:15:28] romeoh: has joined #RubyOnRails
[01:17:31] agent_white: has joined #RubyOnRails
[01:18:08] Mia: has joined #RubyOnRails
[01:18:44] romeoh: has joined #RubyOnRails
[01:20:09] buckrockwell: has joined #RubyOnRails
[01:24:12] Kallis: has joined #RubyOnRails
[01:24:34] knight33: has joined #RubyOnRails
[01:27:16] irishfromua: has joined #RubyOnRails
[01:29:12] rakm_: has joined #RubyOnRails
[01:30:06] irishfromua: has joined #RubyOnRails
[01:31:43] aperkins81: has joined #RubyOnRails
[01:35:23] willardg: has joined #RubyOnRails
[01:36:36] irishfromua: has joined #RubyOnRails
[01:40:16] hoodow: has joined #RubyOnRails
[01:40:50] willardg: If you want to have a user's location available in a rails controller what way have you guys gone about doing it? So far I keep finding Ajax as a solution, but I haven't played around with that much.
[01:41:52] Didac: has joined #RubyOnRails
[01:43:27] DoctorMonocular: willardg: like, gps location? IP based location?
[01:43:33] DoctorMonocular: or just something they input?
[01:44:18] willardg: I've already implemented ip based location and it doesn't look like it works well if you're not on wifi, like any cell user.
[01:44:42] DoctorMonocular: so what data source do you plan to use?
[01:44:46] DoctorMonocular: or is that your question?
[01:45:37] willardg: sorry, I'm planning on showing results in order based on closest to the users location to furthest
[01:46:22] willardg: I have an addresses model with lat and lon geocoded.
[01:47:35] DoctorMonocular: yeh so, probably the info is going to come from the browser, assuming you have permission from the user, in which case, yes, I think ajax is the way to handle htat
[01:47:45] DoctorMonocular: javascript will get the location, then send it to the server
[01:49:46] patarr: has joined #RubyOnRails
[01:52:44] willardg: Thanks Doctor. I'll take a stab at it.
[01:55:33] gusrub: has joined #RubyOnRails
[02:05:35] libastral: has joined #RubyOnRails
[02:13:17] TheMoonMaster: has joined #RubyOnRails
[02:21:18] irishfromua: has joined #RubyOnRails
[02:26:55] Nuck: has joined #RubyOnRails
[02:31:27] sypheren: has joined #RubyOnRails
[02:35:20] greenhat: has joined #RubyOnRails
[02:37:09] rakm: has joined #RubyOnRails
[02:37:12] JoshL: has joined #RubyOnRails
[02:38:37] D9: has joined #RubyOnRails
[02:41:27] xnxq: has joined #RubyOnRails
[02:41:30] nertzy: has joined #RubyOnRails
[02:42:34] bheesham: has joined #RubyOnRails
[02:47:51] xnxq: has joined #RubyOnRails
[02:47:51] Gaelan: has joined #RubyOnRails
[02:52:25] krzysztoff: has joined #RubyOnRails
[02:52:40] hakash: has joined #RubyOnRails
[02:52:57] nekomune: has joined #RubyOnRails
[02:55:14] futilegames: has joined #RubyOnRails
[02:56:04] Jayson_Virissimo: has joined #RubyOnRails
[02:57:45] brendan6: has joined #RubyOnRails
[03:03:29] nertzy: has joined #RubyOnRails
[03:06:27] bpmedley: has joined #RubyOnRails
[03:10:38] bawsky: has joined #RubyOnRails
[03:12:27] Gaelan: has joined #RubyOnRails
[03:12:39] sunya7a: Radar: =) no worries...it was worth a shot. It does seem like my setup should be fairly common, so I think it's a simple mistake in my setup. Would you mind taking a quick look?
[03:12:51] Radar: sunya7a: I do not do any work on paranoia at the moment.
[03:13:00] Radar: I'm also currently at work.
[03:13:10] Radar: I can send through my freelancing contract if you'd like? $150USD/hr.
[03:13:18] Radar: Could probably find some time Saturday morning.
[03:15:49] sunya7a: Radar: thanks for the offer...I'll bang my head on it for a few more hours and will get back to you. Could you answer one thing though if you have a second. Is the expected behavior to to be able to restore entries in the join table or is it not meant to do that?
[03:16:00] Haydos: has joined #RubyOnRails
[03:16:00] Haydos: has joined #RubyOnRails
[03:16:08] irishfromua: has joined #RubyOnRails
[03:16:29] sunya7a: also what time zone are you? so i know what saturday morning is for you
[03:17:53] Radar: sunya7a: Australian Eastern, Melbourne.
[03:18:07] Radar: sunya7a: tbh it's been so long since I've worked on paranoia that I would need to look at the code again to refresh my memory.
[03:18:11] Radar: I don't have any time right now to do that.
[03:18:49] agent_white: Radar: Do you still work on Spree? Also, hello \o :) Long time no see.
[03:19:32] Radar: agent_white: Hey o/ I haven't worked on Spree for almost as long now as I worked on it ;) I quit July 2014.
[03:20:15] agent_white: Oh I had no idea! Consulting now?
[03:21:39] marcdel: has joined #RubyOnRails
[03:21:52] sunya7a: Radar: no problem...i appreciate taking the time to reply
[03:22:07] daed: has joined #RubyOnRails
[03:22:13] Radar: agent_white: Since then I worked on lifx.co's cloud infra, bikeexchange.com.au (and its related sites) and now I'm at cultureamp.com
[03:24:57] agent_white: Wonderful :) I hope you are enjoying all the adventures. I'm coaxing a colleague into wearing a Rubycape/gloves with your book.
[03:25:45] agent_white: Do you think you will do another like R4iA for Rails 5?
[03:27:40] Radar: I am enjoying them all indeed :)
[03:27:43] agent_white: ACTION realizes books released since then
[03:27:45] Radar: I should really write a blog post about Rails 5 in Action.
[03:27:55] Radar: TL;DR: Manning are jerks, so no.
[03:28:07] agent_white: Yeah I remember that whole dealer :(
[03:30:27] agent_white: Anyways, just wanted to hello and cheers! :)
[03:30:44] Radar: How are things going for you?
[03:31:59] agent_white: Well I think! Doing NOC work, but for a Rails platform. Fun excuse to write my own tooling in ruby. :)
[03:32:56] agent_white: Lots of places to learn, and I'm allowed to get some dirt under my nails I would've have elsewhere.
[03:34:18] agent_white: I got a tiny keyboard also.
[03:34:19] agent_white: Which is nice.
[03:34:37] agent_white: How about you?
[03:37:25] agent_white: I need to find pontiki for a highfive, too.
[03:41:03] Gaelan: has joined #RubyOnRails
[03:41:49] jane_booty_doe: has joined #RubyOnRails
[03:43:06] Radar: Glad to hear you're doing more Rails stuff :) Writing tooling in Ruby is great fun. I started https://github.com/radar/twist 6 years ago and I'm sure one day I'll finish it.
[03:43:28] Radar: I've been doing a lot of Elixir dev at work recently. It's a really fun language. Less footguns than Ruby, or perhaps it's because I haven't found them all yet.
[03:43:40] Radar: I don't know where pontiki is these days
[03:44:29] bazzy: has joined #RubyOnRails
[03:52:02] brendan6: has joined #RubyOnRails
[03:57:03] djbkd: has joined #RubyOnRails
[03:59:15] irishfromua: has joined #RubyOnRails
[04:02:13] marcdel: has joined #RubyOnRails
[04:02:33] _djbkd: has joined #RubyOnRails
[04:04:10] agent_white: I saw that you had written about it! :) I've only dabbled, but just got Dave's book to crack into. Erlang's OTP seems neat to say the least!
[04:04:18] agent_white: Maybe sevenseacat knows
[04:11:10] Technodrome: has joined #RubyOnRails
[04:11:58] s2013: has joined #RubyOnRails
[04:15:22] bheesham: has joined #RubyOnRails
[04:15:27] Gaelan: has joined #RubyOnRails
[04:16:48] Duckily: has joined #RubyOnRails
[04:16:52] Gaelan: has joined #RubyOnRails
[04:17:22] wethu: has joined #RubyOnRails
[04:26:06] quazimodo: has joined #RubyOnRails
[04:34:47] xnxq: has joined #RubyOnRails
[04:42:26] keerthana: has joined #RubyOnRails
[04:44:21] krzysztoff: has joined #RubyOnRails
[04:49:27] xall: has joined #RubyOnRails
[04:53:46] armyriad: has joined #RubyOnRails
[04:58:21] Technodrome: has joined #RubyOnRails
[05:02:02] lessless: has joined #RubyOnRails
[05:08:36] xpl0iter: has joined #RubyOnRails
[05:18:54] patarr: has joined #RubyOnRails
[05:20:25] jsilver: has joined #RubyOnRails
[05:20:25] ChanServ: +b *!*@gateway/web/freenode/ip.174.29.46.3
[05:20:25] ChanServ: ChanServ kicked jsilver: Known troll (jsilver)
[05:27:47] willardg: has joined #RubyOnRails
[05:38:53] Maja: has joined #RubyOnRails
[05:56:07] xMopxShell: has joined #RubyOnRails
[05:57:57] iamayam: has joined #RubyOnRails
[06:01:18] agent_white: Radar: Probably out doing fun things!
[06:07:21] fernandomm: has joined #RubyOnRails
[06:11:14] username1: has joined #RubyOnRails
[06:11:17] username1: has joined #RubyOnRails
[06:16:48] naprimer: has joined #RubyOnRails
[06:30:19] bronson: has joined #RubyOnRails
[06:33:11] aganov: has joined #RubyOnRails
[06:33:50] JDeen: has joined #RubyOnRails
[06:33:59] arBmind: has joined #RubyOnRails
[06:37:29] JDeen: I am trying to create some nested sresources in rails5, `Organization.create(address: { city: 'abc' })` and this fails. how can we in one line create nested resources. (organization has one address - addressable - polymorphic association)
[06:37:36] JDeen: the error cited is type mismatch
[06:38:13] Andr3as: probably Organization.adress.create
[06:40:43] JDeen: Andr3as: hm... hopefully nested forms didn't go away :D is this new to Rails 5?
[06:41:14] JDeen: or wonder if it is because i have done some thing silly with polymorphic associations which is the first time for me
[06:41:21] JDeen: what you suggests works
[06:42:00] Andr3as: not that i am aware of.. this is how it works for associations, afaik - its not specific to polymorphic associations
[06:42:13] Andr3as: but dont take me too serious.. am still learning
[06:42:55] Andr3as: as address is another model and not an attribute of organization
[06:43:47] Andr3as: and a gotcha, would it be a has_many it would be Organization.addresses.create
[06:45:11] Technodrome: has joined #RubyOnRails
[06:46:51] JDeen: Andr3as: thanks
[06:49:03] WinterBluFox: has joined #RubyOnRails
[06:49:13] Andr3as: jdeen: if you could take a look at this http://stackoverflow.com/questions/43065782/rails-nested-form-2-levels-in-one-table - maybe you got an idea what my issue is
[06:51:21] drale2k: has joined #RubyOnRails
[06:54:52] pickle_: has joined #RubyOnRails
[06:55:50] mark_66: has joined #RubyOnRails
[06:56:25] nyaa: has joined #RubyOnRails
[06:57:16] alfie: has joined #RubyOnRails
[07:00:26] Technodrome: has joined #RubyOnRails
[07:02:48] pickle_: has joined #RubyOnRails
[07:03:04] itsgokul: has joined #RubyOnRails
[07:03:12] fmartingr: has joined #RubyOnRails
[07:03:44] pulkit4tech: has joined #RubyOnRails
[07:07:44] conta: has joined #RubyOnRails
[07:09:40] snickers: has joined #RubyOnRails
[07:11:46] brent__: has joined #RubyOnRails
[07:13:08] pwnd_nsfw: has joined #RubyOnRails
[07:14:41] darutoko: has joined #RubyOnRails
[07:16:01] tvw: has joined #RubyOnRails
[07:18:13] JDeen: Andr3as: not tried some thing like that, not entirely sure, sorry
[07:18:29] Andr3as: no worries
[07:18:40] Andr3as: thanks for looking, though
[07:19:42] patarr: has joined #RubyOnRails
[07:21:25] JDeen: i will be curous about that answer too... if i had some time would have tried it out... bottlenecked here...
[07:22:23] zpe: has joined #RubyOnRails
[07:25:14] neal__: has joined #RubyOnRails
[07:25:26] neal__: Good morning, is there anyone with experience with using Select2?
[07:25:57] JDeen: a general question... i have `Organization` `User` `Address`. i think its probably common sense... is it Organization/User belongs to Address or Address belongs to them (polymorphic association) :D
[07:26:37] JDeen: neal__: i have some, whats your issue
[07:26:53] neal__: @jdeen, nice! I’m using Select2 with multiple set to true. This works perfectly, saves all the data in de DB etc. But now if I go to the edit view, the input fields shows empty. How can I fill this with the data in my DB?
[07:27:04] Qchmqs: has joined #RubyOnRails
[07:27:08] artto: has joined #RubyOnRails
[07:27:22] JDeen: neal__: you mean they are not selected?
[07:27:36] pLaTo0n: has joined #RubyOnRails
[07:27:56] drale2k: has joined #RubyOnRails
[07:28:14] neal__: Well I can select them when im on my 'new' page. It also saves them in the database so that's good, but when I go to my 'edit' view the input field is not filled in with the user I just selected
[07:28:24] neal__: Am I explaining it clear?
[07:29:09] JDeen: neal__: yes... i think you need to give the selected values in the view
[07:29:27] neal__: Can I post the code I'm using in the _form?
[07:29:39] artto: has joined #RubyOnRails
[07:29:49] _djbkd: has joined #RubyOnRails
[07:29:58] JDeen: neal__: checking docs...
[07:30:45] Andr3as: neal__: post it on gist.github.com
[07:31:54] JDeen: neal__: if you are using options for select, you can give a collection of selected as i remember, http://apidock.com/rails/ActionView/Helpers/FormOptionsHelper/options_for_select
[07:31:59] JDeen: ya a gist would help
[07:32:06] neal__: @jdeen: https://gist.github.com/anonymous/2099573ff69a959b35755402d5f6edb4
[07:32:31] neal__: Good morning andr3as
[07:34:29] Jameser`: has joined #RubyOnRails
[07:34:57] JDeen: neal__: you are setting options but not marking them as selected
[07:35:18] JDeen: i think ideally it will give all users + the selected
[07:35:52] JDeen: for example in edit view you might need to add/remove users, so you will need to give the whole collection there, with the selected values to mark the existing relationships selected
[07:36:05] neal__: In my new view I would like to show it all relationships current_user has. And in my edit view I would like to show the selected ones from the new and the ones u wish to add new etc.
[07:36:41] neal__: Could you point me a bit in the right direction in the Gist?
[07:38:15] JDeen: some thinig like this - collection_select(:post, :author_id, Author.all, :id, :name_with_initial, {:selected => current_book.authors.map(&:id)})
[07:38:31] JDeen: since you are working with a collection it might be easy
[07:39:38] doublemalt_: has joined #RubyOnRails
[07:40:07] neal__: {:selected => current_book.authors.map(&:id)}, Does that go in the options '{}'?
[07:44:39] JDeen: collection_select is similar to select
[07:45:58] JDeen: so it will be f.collection_select :relationships, User.all, :id, :name, {selected: @user.map...} I think
[07:46:38] JDeen: i have some snippets, they have eroded my memory
[07:46:45] JDeen: which i don't have access now
[07:47:06] JDeen: some thing like that should work
[07:48:37] AzaToth: has joined #RubyOnRails
[07:52:13] dionysus69: has joined #RubyOnRails
[07:53:01] igniting: has joined #RubyOnRails
[07:56:29] artto_: has joined #RubyOnRails
[07:57:08] jdm: has joined #RubyOnRails
[08:00:56] DrYockel1: has joined #RubyOnRails
[08:02:41] zero1one0: has joined #RubyOnRails
[08:04:00] artto: has joined #RubyOnRails
[08:06:02] xall: has joined #RubyOnRails
[08:07:08] jsrn_: has joined #RubyOnRails
[08:07:37] neal__: @jdeen; I current have: <%= f.collection_select :external_users, @user.relationships.map{ |p| p }, { selected: @application.people.map(&:id) }, class: "select-users ignore-validation", multiple: true %>. Sort of works so thanks for that! But now I get {:class=>"select-users ignore-validation", :multiple=>true} is not a symbol nor a string).Any tips?
[08:08:06] brendan6: has joined #RubyOnRails
[08:10:49] mikecmpbll: has joined #RubyOnRails
[08:11:23] sevenseacat: has joined #RubyOnRails
[08:12:25] nyaa: has joined #RubyOnRails
[08:13:01] marr: has joined #RubyOnRails
[08:14:54] spicerack: has joined #RubyOnRails
[08:16:03] pwnd_nsfw`: has joined #RubyOnRails
[08:18:23] armyriad: has joined #RubyOnRails
[08:26:45] wethu: has joined #RubyOnRails
[08:27:20] jane_booty_doe: has joined #RubyOnRails
[08:28:10] spicerack: has joined #RubyOnRails
[08:29:38] arBmind: has joined #RubyOnRails
[08:31:23] gloscombe: has joined #RubyOnRails
[08:31:51] Jameser: has joined #RubyOnRails
[08:32:59] jenrzzz: has joined #RubyOnRails
[08:33:07] nyaa: has joined #RubyOnRails
[08:35:09] jeyraof^mbpr: has joined #RubyOnRails
[08:37:43] vasilakisFiL: has joined #RubyOnRails
[08:38:00] vasilakisFiL: is there a way to get a list of before_actions defined in a controller ?
[08:40:08] Andr3as: vasilakisfil: this is from rails 3 but you might get an ida https://gist.github.com/scottwb/1851142
[08:40:15] Andr3as: tbuehlmann: r u there?
[08:42:00] tvw: has joined #RubyOnRails
[08:47:30] vasilakisFiL: perfect it worked
[08:47:53] vasilakisFiL: some stuff haven't changed in Rails source many years now
[08:48:07] vasilakisFiL: I guess they were really good that's why
[08:49:57] srinidhi: has joined #RubyOnRails
[08:50:45] tbuehlmann: Andr3as: am! hey
[08:51:22] Andr3as: sry to bother.. but have you by chance took a look at this issue? http://stackoverflow.com/questions/43065782/rails-nested-form-2-levels-in-one-table
[08:51:45] Andr3as: i am really stuck and you as the wizard in person might have a tip...(?)
[08:52:03] Andr3as: im wrestling with it for a while and cant figure out a solution
[08:53:00] Andr3as: and hi! - first things first..
[08:53:21] lxsameer: has joined #RubyOnRails
[08:53:34] artto: has joined #RubyOnRails
[08:59:41] jokke: i just upgraded to sprockets 4 and try to migrate to the manifest.js
[08:59:56] jokke: i have multiple js bundles in my project
[09:00:31] jokke: different layouts use them (application.js, admin.js etc.) how do i realize this in the manifest?
[09:00:35] Andr3as: tbuehlmann: yeah.. i though using polymorphic associations would be better than doing dirty hiddenfield tricks to get in a domain_id but now i am somewhat screwed...
[09:01:03] Andr3as: and it all works great.. except that one thing where all of the actions / achievements have to be in that table
[09:01:06] arBmind: has joined #RubyOnRails
[09:01:40] jusa: has joined #RubyOnRails
[09:01:42] tbuehlmann: so, at first, is there an Achievement with ID=10?
[09:02:04] Andr3as: and only the update fails.. so maybe there is some trick.. to somehow magically tell it, that its ok, it does not need to be a domain's achievement
[09:02:14] Andr3as: yes, its an achievement of an actionfield
[09:02:20] Andr3as: of that domain
[09:02:35] naprimer: has joined #RubyOnRails
[09:03:02] tbuehlmann: rails tries to find the achievement by id, for the given domain
[09:03:15] tbuehlmann: as I understand you, the achievements belongs to an action field, not to the domain
[09:03:25] jokke: hm i see from the doc's that it's just multiple link directives
[09:03:49] Andr3as: exactly.. see the image..https://i.stack.imgur.com/W6x7M.png
[09:04:10] Andr3as: achievement / action more or less the same
[09:04:24] Andr3as: so achievements are modeled exactly like actions
[09:04:44] Andr3as: except the belongs_to is :achievementable, ofc
[09:04:49] tbuehlmann: well, that's the error I suppose
[09:05:01] tbuehlmann: rails tries to find the achievement, but it's not associated to the domain
[09:05:29] tbuehlmann: you actually want to update the achievement for the action field, so you'd need the action field in the form
[09:05:37] Andr3as: right, i am aware of it.. however, that view should contain achivements of that domain AND all the achivements of all actionfields of that domain
[09:06:07] Andr3as: so, is there a way to tell rails that it needs to look up "actionfield-achievements" kinda differently?
[09:06:15] username1: has joined #RubyOnRails
[09:06:42] tbuehlmann: either have a different setter for that case, similar to achievements_attributes=, or have the form be correct
[09:07:02] tbuehlmann: naw, there's no way I know of
[09:07:18] _Sypheren_: has joined #RubyOnRails
[09:07:57] Andr3as: right now the form is like this https://www.screencast.com/t/z2GeHQ0y2
[09:08:29] fxa90id: has joined #RubyOnRails
[09:08:54] Cork: is there a way to "reset" content_for?
[09:08:55] Andr3as: i have all the actionfields in it as well... but somewhat isolated
[09:09:06] Cork: i'm calling multiple partials with the same partial layout
[09:09:07] ReBa_: has joined #RubyOnRails
[09:09:13] Cork: but when i render the next partial it "remembers" the content_for from the last partial
[09:10:30] tbuehlmann: Cork: there's `flush: true`. if that's not enough, temper with @view_flow /o\
[09:10:38] tbuehlmann: see http://api.rubyonrails.org/classes/ActionView/Helpers/CaptureHelper.html#method-i-content_for
[09:11:45] tbuehlmann: Andr3as: well, as said, either correct the form so the field names are right, or define a custom setter doing the thing you want
[09:11:55] Andr3as: so, tbuehlmann "either habe a different setter" - can you elaborate on that a little further..? is i doubt i can relate the achievements to the actionfields in my form..(or am i wrong?)
[09:12:28] Ergo: has joined #RubyOnRails
[09:12:29] tbuehlmann: `accepts_nested_attributes_for :achievements` in your model defines an achievements_attributes= method that handles the form input
[09:12:42] jokke: hmm i get the following error when trying to precompile assets on rails 4.2.8 with sprockets from git master branch: https://p.jreinert.com/rwboX/
[09:12:55] tbuehlmann: like, finding the right records using the id, considering _destroy, that things
[09:13:26] tbuehlmann: you could define your own custom setter, like, foo_attributes= that does the same thing, but different, so it works for your usecase
[09:14:01] tbuehlmann: you'd then rename the form input fields to domain[foos_attributes] or something
[09:14:22] neal__: has joined #RubyOnRails
[09:14:35] neal__: @Andr3as u there?
[09:14:38] Andr3as: so, in that custom method i should check if its a domain achievement or actionfield achievement..? and "hier geschieht ein wunder" and boom, it found the correct one..?
[09:14:59] Andr3as: neal__: yeah
[09:15:13] Cork: tbuehlmann: sadly that means i have to add <% content_for(:header, "", flush: true) %> to each partial that doesn't provide the content
[09:15:31] Cork: there isn't a way to get content_for to flush it when it renders in the layout=
[09:15:39] neal__: @Andr3as: I current have: <%= f.collection_select :external_users, @user.relationships.map{ |p| p }, { selected: @application.people.map(&:id) }, class: "select-users ignore-validation", multiple: true %>. Sort of works so thanks for that! But now I get {:class=>"select-users ignore-validation", :multiple=>true} is not a symbol nor a string).Any tips?
[09:16:30] Cork: heh adding that line at the end of the layout works... a bit hacky but...
[09:16:34] Cork: tbuehlmann: thx for the help
[09:16:56] tbuehlmann: Andr3as: yes. or have the form be correct :P
[09:18:04] Andr3as: tbuehlmann: how? i am totally lost
[09:18:22] Andr3as: its like brain fireworks atm
[09:18:44] artto: has joined #RubyOnRails
[09:18:53] Andr3as: neal__: sry.. am totally confused by my issue right now.. cant even think anymore.. maybe someone else in here has an idea
[09:20:09] tbuehlmann: Andr3as: you would need two nested forms there, one for achievements, one for action fields, right?
[09:20:33] Andr3as: yeah.. i'll post my current one for reference
[09:20:34] patarr: has joined #RubyOnRails
[09:20:51] ReBa_: I'm having trouble permitting my nested hashed field: https://gist.github.com/RemiBa/a18358c0ff66f7415b01cde97d83323e - How do I allow the "columns" attribute to be allowed with strong parameters? http://api.rubyonrails.org/classes/ActionController/Parameters.html#method-i-permit doesn't make me any wiser :s
[09:21:44] pulkit4tech: has joined #RubyOnRails
[09:22:20] Andr3as: tbuehlmann: this is how it is right now https://gist.github.com/awunder/1d91a9d8476034be9c98899d9a1c4886
[09:27:38] tbuehlmann: Andr3as: domain.fields_for :achievements part has to be two parts. one for the domain's achievements, one for the action fields achievements
[09:28:23] Andr3as: can i get them into the same table and sort them, afterwards? somehow?
[09:29:46] tbuehlmann: you could even have them in the same @achievements variable, but then you'd change the code depending on the achievementable type
[09:30:18] tbuehlmann: like, iterate over that collection and check the type. depending on the type, render the correct form fields
[09:31:20] Andr3as: i already have them in the same @achievements variable, btw.. - @achievements = Achievement.where(achievementable: [@domain, *@action_fields])
[09:31:26] tbuehlmann: yeah, I know
[09:31:41] jokke: what exactly do i have to do to get sprockets to generate source maps?
[09:31:43] Andr3as: ah, right, the stackexchange post.. i forgot that one
[09:31:53] jokke: i updated uglifier to > 3
[09:32:18] jokke: so https://github.com/rails/sprockets/blob/543c5497cfb548ce15564c6ee3fd1a23710ad38a/lib/sprockets/uglifier_compressor.rb#L53
[09:32:27] jokke: from that i gather it would generate source maps
[09:33:01] Andr3as: i dont really get it, tbuehlmann.. i mean, the form-fields are the same.. regardless the "parent"
[09:33:56] tbuehlmann: yep, that's why you need domain.fields_for :achievements for the domain's achievements and domain.fields_for(:action_fields) { |f| f.fields_for :achievements } for the other achievements
[09:34:12] tbuehlmann: (or similar)
[09:35:06] Andr3as: thats what i got but how do i combine those 2 forms into one? thats what i dont understand
[09:35:19] Andr3as: to have those all in the same table
[09:35:45] Andr3as: and sorted by a rank which is set via drag&drop inside the form
[09:36:59] tbuehlmann: http://api.rubyonrails.org/classes/ActionView/Helpers/FormBuilder.html#method-i-fields_for and search for "It's also possible to specify the instance to be used:"
[09:39:42] doublemalt_: has joined #RubyOnRails
[09:40:55] Andr3as: tbuehlmann: thank you for this.. - i dont get it.. hmpf
[09:43:12] rgr: has joined #RubyOnRails
[09:44:33] GodFather_: has joined #RubyOnRails
[09:44:38] GodFather: has joined #RubyOnRails
[09:46:38] jusa: has joined #RubyOnRails
[09:51:43] drale2k: has joined #RubyOnRails
[09:59:53] opus: has joined #RubyOnRails
[10:00:32] workmad3: has joined #RubyOnRails
[10:14:07] ferr1: has joined #RubyOnRails
[10:14:16] camilasan: has joined #RubyOnRails
[10:19:28] srinidhi: has joined #RubyOnRails
[10:20:58] zpe: has joined #RubyOnRails
[10:30:20] bawsky: has joined #RubyOnRails
[10:32:16] fxa90id: has joined #RubyOnRails
[10:32:21] Guest41456: has left #RubyOnRails: ("Leaving")
[10:33:07] gloscomb1: has joined #RubyOnRails
[10:43:02] r3vDev: has joined #RubyOnRails
[10:46:55] Fernando-Basso: has joined #RubyOnRails
[10:49:14] Fernando-Basso: has joined #RubyOnRails
[10:54:15] kratos_: has joined #RubyOnRails
[11:01:40] nyanz: has joined #RubyOnRails
[11:03:03] nyaa: has joined #RubyOnRails
[11:06:08] rgr_: has joined #RubyOnRails
[11:07:05] r3vDev: has joined #RubyOnRails
[11:08:14] drale2k: has joined #RubyOnRails
[11:08:21] xall_: has joined #RubyOnRails
[11:10:11] GodFather: has joined #RubyOnRails
[11:17:30] arBmind1: has joined #RubyOnRails
[11:19:19] drale2k: has joined #RubyOnRails
[11:21:52] patarr: has joined #RubyOnRails
[11:24:05] DaveTaboola: has joined #RubyOnRails
[11:28:43] arBmind: has joined #RubyOnRails
[11:29:34] doublemalt_: has joined #RubyOnRails
[11:35:28] mikecmpbll: anyone used sidekiq with redis sentinel?
[11:43:39] DaveTaboola: has joined #RubyOnRails
[11:44:04] brent__: has joined #RubyOnRails
[11:46:56] byteflame: has joined #RubyOnRails
[11:46:57] byteflam1: has joined #RubyOnRails
[11:49:49] jusa: has joined #RubyOnRails
[11:52:08] lessless: has joined #RubyOnRails
[11:52:43] lessless: has joined #RubyOnRails
[11:55:42] pLaTo0n: has joined #RubyOnRails
[11:57:30] Velizar: has joined #RubyOnRails
[11:58:05] Velizar: pg gem doesn't offer changes. Any experience with version 0.20? Should I expect difficulties?
[11:58:29] Velizar: I only interact with the DB via Rails, and not directly.
[12:01:02] HoierM: has joined #RubyOnRails
[12:01:02] User458764: has joined #RubyOnRails
[12:01:42] arup_r: has joined #RubyOnRails
[12:02:57] Elenaltarien: has joined #RubyOnRails
[12:03:10] arup_r: Hi all. Need some ideas about how to get rid of these `sleep` ( https://gist.github.com/aruprakshit/43c836e8ff2df10134b3b7908d80dc2d ). There are some Async JS is happening which is why I put sleep 4. But is there any other way to achieve the same ?
[12:07:04] bawsky: has joined #RubyOnRails
[12:10:29] xall_: has joined #RubyOnRails
[12:11:18] brent__: has joined #RubyOnRails
[12:11:29] conta: guys, I have helper A helper B (so basically A::B) and inside I use ::ModelC.all. Why rails complains (undefined method `all' for A::B:Module ?
[12:11:35] conta: rails 5.0.2
[12:12:05] conta: sorry (undefined method `all' for A::ModelC:Module
[12:12:34] arBmind1: has joined #RubyOnRails
[12:14:21] unmanbearpig: has joined #RubyOnRails
[12:17:08] antgel: has joined #RubyOnRails
[12:19:14] alibby1: has joined #RubyOnRails
[12:19:38] patarr: has joined #RubyOnRails
[12:21:12] dionysus69: has joined #RubyOnRails
[12:22:42] unmanbearpig: Hi! Does anyone know if it's possible to resize and compress image assets as a part of rake assets:precompile? I have a bunch of high-res images that I want to have in standard and retina sizes. It would've been nice if I could tell Rails the sizes I want and it generated them for me
[12:25:54] Guest96: has joined #RubyOnRails
[12:26:57] bauruine: has joined #RubyOnRails
[12:37:45] drale2k: has joined #RubyOnRails
[12:37:47] handicraftsman: has joined #RubyOnRails
[12:40:25] zpe: has joined #RubyOnRails
[12:43:07] bawsky: has joined #RubyOnRails
[12:44:19] arBmind: has joined #RubyOnRails
[12:45:59] Jameser: has joined #RubyOnRails
[12:47:42] DaveTaboola: has joined #RubyOnRails
[12:50:45] brendan6: has joined #RubyOnRails
[12:52:35] keerthana: has joined #RubyOnRails
[12:52:51] bauruine: has joined #RubyOnRails
[12:57:32] zel: has joined #RubyOnRails
[12:57:36] ramortegui: has joined #RubyOnRails
[12:59:09] gamut: has joined #RubyOnRails
[13:00:56] raz: has left #RubyOnRails: ("*fump*")
[13:01:02] Or1on: has joined #RubyOnRails
[13:06:12] Terens: has joined #RubyOnRails
[13:11:19] username1: has joined #RubyOnRails
[13:11:20] username2: has joined #RubyOnRails
[13:16:43] nOwz: has joined #RubyOnRails
[13:25:13] nyaa: has joined #RubyOnRails
[13:25:39] dminuoso: ACTION sighs
[13:26:00] dminuoso: Has anyone have any experience with serializing CanCanCan ability objects to reuse them in client-side SPAs?
[13:26:37] DLSteve: has joined #RubyOnRails
[13:26:51] dminuoso: Any non-trivial ability just bursts in infinite recursion on #as_json calls, and #to_yaml sucks because you can't just simply reuse it in JavaScript.
[13:27:21] epochwolf: None of my cancancan things have been serializable.
[13:27:55] dminuoso: epochwolf: What do you mean by that?
[13:28:10] dminuoso: I mean Im so close to simply talking the #to_yaml and un-rubyfying it in my react app.
[13:28:32] dminuoso: (The thing I want to avoid is duplicating the abilities just for reacts sake)
[13:31:00] handicraftsman: has joined #RubyOnRails
[13:31:00] handicraftsman: has joined #RubyOnRails
[13:31:06] adlerdias__: has joined #RubyOnRails
[13:35:48] chouhoulis: has joined #RubyOnRails
[13:37:39] jose_leeto: has joined #RubyOnRails
[13:37:46] DLSteve: has joined #RubyOnRails
[13:38:26] jose_leeto: there is a default way to prevent change a model attribute once it is different than nil?
[13:44:58] solars: has joined #RubyOnRails
[13:45:12] zpe: has joined #RubyOnRails
[13:45:41] GodFather: has joined #RubyOnRails
[13:45:50] Jameser`: has joined #RubyOnRails
[13:46:20] solars: hi, I've got a running rails app and now need to connect to a queue to poll events. Is it a good practise to do this in the app (schedule a background job that does this) or would you create a separate daemon?
[13:46:47] jgpawletko: has joined #RubyOnRails
[13:47:28] croberts: has joined #RubyOnRails
[13:52:56] Rodya_: has joined #RubyOnRails
[13:56:01] Jameser: has joined #RubyOnRails
[13:58:10] bawsky: has joined #RubyOnRails
[13:58:37] keerthana: has joined #RubyOnRails
[14:00:02] chouhoulis: has joined #RubyOnRails
[14:00:38] rocco88: has joined #RubyOnRails
[14:02:16] r3vDev: has joined #RubyOnRails
[14:06:09] byteflam1: has joined #RubyOnRails
[14:18:40] patarr: has joined #RubyOnRails
[14:19:53] snickers: has joined #RubyOnRails
[14:24:50] naprimer: has joined #RubyOnRails
[14:26:01] adavia: has joined #RubyOnRails
[14:26:38] nyaa: has joined #RubyOnRails
[14:29:03] chouhoul_: has joined #RubyOnRails
[14:33:25] handicraftsman: has joined #RubyOnRails
[14:33:25] handicraftsman: has joined #RubyOnRails
[14:34:12] s2013: has joined #RubyOnRails
[14:34:25] handicraftsman: has joined #RubyOnRails
[14:34:25] handicraftsman: has joined #RubyOnRails
[14:35:05] xall_: has joined #RubyOnRails
[14:37:12] ekinmur: has joined #RubyOnRails
[14:38:24] ldnunes: has joined #RubyOnRails
[14:39:08] alibby: has joined #RubyOnRails
[14:39:10] buckrockwell: has joined #RubyOnRails
[14:43:40] choke: has joined #RubyOnRails
[14:43:56] shinnya: has joined #RubyOnRails
[14:44:17] Technodrome: has joined #RubyOnRails
[14:45:23] jgpawletko: has joined #RubyOnRails
[14:45:31] akshat: has joined #RubyOnRails
[14:46:21] clair13: has joined #RubyOnRails
[14:47:39] clair13: i have to make an api client that fetch data from another api
[14:49:16] clair13: do i have that the api client has the same classes and attributes?in virtus model?
[14:49:41] xall: has joined #RubyOnRails
[14:51:35] clair13: or can i have my own class model and other relations om my client api
[14:51:53] tbuehlmann: clair13: you could create one virtus model per API resource
[14:52:21] centrx: has joined #RubyOnRails
[14:52:21] centrx: has joined #RubyOnRails
[14:52:45] clair13: so you mean not the same?
[14:52:52] tbuehlmann: what do you mean?
[14:53:38] clair13: for exmple tha api that i get the data has a lot of models students classes etc
[14:53:57] clair13: but i need to display in json only a few of them
[14:54:15] clair13: and some of the relations
[14:54:21] tbuehlmann: so have one model per API resource that you need
[14:55:51] clair13: per api resource what do you mean?
[14:56:25] clair13: from each api?
[14:56:43] tbuehlmann: when the API has a resource for students, have one virtus model "Student". when it has a resource for classes, have one virtus model "Class"
[14:57:27] clair13: yes but it has a lot of models but i don't need all these and also have relations
[14:57:45] clair13: and i need to display slightly different
[14:57:59] tbuehlmann: so what's the problem exactly?
[14:58:36] clair13: can i have models and relations that are not exactly the same as the api?
[14:58:44] tbuehlmann: sure, it's totally up to you
[14:59:05] clair13: and just the attributes that i don't want not display
[14:59:19] clair13: will get ignored from virtus gem
[15:00:32] tbuehlmann: yes, if you don't define an attribute, it will just ignore it
[15:00:51] clair13: and the relations?
[15:00:59] polishdub: has joined #RubyOnRails
[15:01:03] clair13: on virtus models?
[15:01:17] irishfromua: has joined #RubyOnRails
[15:01:29] clair13: array[students]?
[15:01:34] clair13: for example?
[15:01:43] tbuehlmann: Array[Student] works, yeah
[15:01:44] clair13: for has many
[15:02:08] clair13: ok thank you ,i got it
[15:02:09] tbuehlmann: assuming you get the data as {"students" => [{…}, {…}]}
[15:02:28] tbuehlmann: yep, should work
[15:02:30] clair13: have a nice date
[15:02:54] clair13: have a nice day
[15:03:09] tbuehlmann: thanks, you too :)
[15:05:16] uks: has joined #RubyOnRails
[15:09:25] benlieb: has joined #RubyOnRails
[15:11:31] ResidentBiscuit: has joined #RubyOnRails
[15:13:03] djbkd: has joined #RubyOnRails
[15:13:07] patarr1: has joined #RubyOnRails
[15:17:48] doublemalt_: has joined #RubyOnRails
[15:18:16] igniting: has joined #RubyOnRails
[15:18:24] srinidhi: has joined #RubyOnRails
[15:22:41] Rodya_: has joined #RubyOnRails
[15:29:38] mrgreenfur: has joined #RubyOnRails
[15:30:18] brent__: has joined #RubyOnRails
[15:31:21] djbkd: has joined #RubyOnRails
[15:32:23] dionysus70: has joined #RubyOnRails
[15:33:57] FCser: has joined #RubyOnRails
[15:36:32] snickers: I have problem. I need to calculate free IP address by anallising one table where I have used addresses(this is not a problem) but i don't know how to prohibit other user that connect in the same time to not get the same address
[15:36:42] aajjbb: has joined #RubyOnRails
[15:37:48] codelahoma: has joined #RubyOnRails
[15:38:04] snickers: Singelton model for that calculation will do that? Or it will be one singelton instance per request?
[15:41:38] irishfromua: has joined #RubyOnRails
[15:42:34] willardg: has joined #RubyOnRails
[15:43:04] username1: has joined #RubyOnRails
[15:43:16] username2: has joined #RubyOnRails
[15:51:13] nicolasb: has joined #RubyOnRails
[15:51:15] Jayson_Virissimo: has joined #RubyOnRails
[15:52:18] rakm: has joined #RubyOnRails
[15:55:41] planigan: has joined #RubyOnRails
[15:56:30] fcser_: has joined #RubyOnRails
[15:58:34] inerkick: has joined #RubyOnRails
[15:59:21] nOwz: has joined #RubyOnRails
[16:01:33] hndk: has joined #RubyOnRails
[16:02:05] [Butch]: has joined #RubyOnRails
[16:02:07] mary: has joined #RubyOnRails
[16:04:29] armyriad: has joined #RubyOnRails
[16:08:23] adavia: So i have this code that exports my survey. I am trying to match each question in the headers with its corresponding answer and it works fine if all answers for each question are present. The problem is when theres no answer present then question headers are not matching correctly. Any suggestion? https://gist.github.com/adavia/ea821e3dd09fba7fa7590c5c69baca2d
[16:11:27] marcelo_: has joined #RubyOnRails
[16:13:02] keerthana: has joined #RubyOnRails
[16:14:32] xall: has joined #RubyOnRails
[16:21:22] MittelDank: has joined #RubyOnRails
[16:24:05] kus_ubuntui686: has joined #RubyOnRails
[16:24:57] byteflam1: has joined #RubyOnRails
[16:26:24] byteflame: has joined #RubyOnRails
[16:28:28] zpe: has joined #RubyOnRails
[16:31:25] NoGodDamnIdea: has joined #RubyOnRails
[16:31:26] NoGodDamnIdea: has joined #RubyOnRails
[16:32:45] gusrub: has joined #RubyOnRails
[16:34:58] chouhoulis: has joined #RubyOnRails
[16:40:36] centrx: adavia: I'm not clear on what the problem is
[16:41:56] centrx: adavia: It looks like when there is no answer, there is a nil placeholder there
[16:44:36] Rodya_: has joined #RubyOnRails
[16:45:14] mrgreenfur: has joined #RubyOnRails
[16:45:25] patarr: has joined #RubyOnRails
[16:46:00] drale2k: has joined #RubyOnRails
[16:46:22] adavia: centrx: if i have 4 questions and i only answer 2 of them then i get ["Foo", "Bar"] which will always match the first and second question header
[16:46:53] marr: has joined #RubyOnRails
[16:47:50] adavia: centrx: I need a way to match ["foo", "bar"] with the appropriate question header
[16:48:21] Duckily: has joined #RubyOnRails
[16:50:00] agent_white: has joined #RubyOnRails
[16:51:44] agent_white: Mornin' folks
[16:52:32] adavia: centrx: i believe i would need something like ["foo", nil, "bar", nil]
[16:53:29] keerthana: has joined #RubyOnRails
[16:56:39] Or1on: has joined #RubyOnRails
[17:05:35] benlieb: has joined #RubyOnRails
[17:05:45] mostlybadfly: has joined #RubyOnRails
[17:05:46] sodapop: has joined #RubyOnRails
[17:05:57] sodapop: has left #RubyOnRails: ("Leaving")
[17:08:49] polar_ice: has joined #RubyOnRails
[17:08:54] centrx: adavia: But show_answeres hould be returning ["foo", nil, "bar", nil]
[17:09:04] polar_ice: has left #RubyOnRails: ()
[17:09:13] centrx: adavia: Can you verify that?
[17:09:14] polar_ice: has joined #RubyOnRails
[17:09:16] adavia: centrx: no
[17:09:41] gusrub: has joined #RubyOnRails
[17:09:51] adavia: centrx: it returns ["foo", "bar"]
[17:10:25] centrx: adavia: So at the top of show_answeres, answers is an array with four entries, but at the end there's only two entries?
[17:11:08] patarr: has joined #RubyOnRails
[17:11:42] adavia: centrx: no, it could be an array of 1, 2, 3, 4 entries. Depends what i have answered
[17:12:27] centrx: adavia: But the number of entries in answers at the top of show_answers, should be the same as the number of entries returned by show_answeres
[17:12:31] centrx: adavia: That's what the code you gave shows
[17:13:15] jose_leeto: there is a default way to prevent change a model attribute once it is different than nil?
[17:14:11] adavia: centrx: ohh yes
[17:15:46] adavia: centrx: but i guess the number of entries returned should be the same number of questions in the header
[17:16:14] Duckily: has joined #RubyOnRails
[17:16:52] adavia: centrx: that match if all answers are returned
[17:17:05] adavia: Otherwise not
[17:17:43] centrx: adavia: It's hard for me to debug without running the actual program. You have to isolate where the problem is occurring in your code
[17:18:28] gusrub: has joined #RubyOnRails
[17:20:35] Rodya_: has joined #RubyOnRails
[17:23:04] adavia: centrx: check at the end https://gist.github.com/adavia/ea821e3dd09fba7fa7590c5c69baca2d
[17:23:10] polar_ice: has left #RubyOnRails: ()
[17:24:30] pupsicle: has joined #RubyOnRails
[17:25:42] centrx: adavia: have show_answers loop through the questions instead of the answers
[17:26:06] centrx: adavia: then get each corresponding answer for the question. If there's no answer, set it to nil
[17:26:28] adavia: centrx: well thats what im trying to find out how to do it
[17:26:43] renegadeandy: has joined #RubyOnRails
[17:27:24] jnj: has joined #RubyOnRails
[17:27:31] centrx: loop through questions
[17:28:05] jnj: Hey guys, how do I reset connections between two habtm tables in seeds.rb? For example each room has tools and each tool has multiple rooms, I just want to make it so that the room has no tools tied to it and the tools have no rooms tied to it.
[17:31:31] gusrub: has joined #RubyOnRails
[17:33:26] h7br1x: has joined #RubyOnRails
[17:34:31] adavia: centrx: inside show answers?
[17:34:39] Aherin: has joined #RubyOnRails
[17:34:42] centrx: adavia: right
[17:35:03] centrx: adavia: the answers association (has_many answers) is only retrieving answers that exist
[17:35:14] centrx: adavia: It has no knowledge of non-existent answers that map to questions somewhere else
[17:35:45] adavia: centrx: well each answer also belongs_to question
[17:36:26] centrx: adavia: sure, but the answers don't exist, so when you loop through the answers, they aren't there
[17:36:39] centrx: adavia: when you loop through the questions, you are using the questions as your basis of what fields to include
[17:37:32] centrx: jnj: without destroying the records themselves, just the association?
[17:38:41] jnj: jnj: I want to destroy the records, I want the association in place. Basically I'm testing out a seeds rb file that will add in all the records, i.e. what room has what tools, etc - but I keep on getting repeats in the records from previous runs of seeds.rb. So I don't want to get rid of the relation, just empty out the records.
[17:39:03] buckrockwell: has joined #RubyOnRails
[17:40:26] centrx: jnj: truncate rooms and truncate tools
[17:40:26] pLaTo0n: has joined #RubyOnRails
[17:40:37] centrx: jnj: truncate will clear the records in a table
[17:40:38] adavia: centrx: i tried this https://gist.github.com/adavia/ea821e3dd09fba7fa7590c5c69baca2d
[17:41:14] centrx: adavia: that's looping through every answer for every question, even if the answer is not associated with the question
[17:42:03] cnk: has joined #RubyOnRails
[17:42:15] keerthana: has joined #RubyOnRails
[17:42:27] jnj: centrx: So would this work?: ActiveRecord::Base.connection.execute("TRUNCATE TABLE #{table_name}"), and would I do it on the tables rooms, tools, and room_tools?
[17:42:33] jnj: centrx: i.e. on the join table?
[17:42:49] centrx: jnj: exactly
[17:42:59] jnj: centrx: Awesome, thank you so much!
[17:43:15] centrx: jnj: there is a Rails method for it to, that's just: truncate my_table_name
[17:43:49] adavia: centrx: How should i loop then
[17:44:40] jnj: centrx: that makes things os much easier! thank you
[17:45:52] centrx: adavia: Look up "nested loops"
[17:45:58] defsdoor: has joined #RubyOnRails
[17:46:52] adavia: Thought that was a nested loop
[17:47:14] jnj: centrx: If I only wanted to get rid of the relations, I'd just truncate the join table right? So that rooms would have no tools and tools would have no rooms (for a habtm relation)
[17:47:28] jnj: centrx: er, or get rid of the records of that relation
[17:47:38] centrx: adavia: You could put at the top: answers_by_question_id = answers.index_by(&:question_id)
[17:48:04] centrx: adavia: that will make a hash with one value for each question, which you can access within like: answers_by_question_id[q.id]
[17:48:16] centrx: jnj: yes that works
[17:48:32] jnj: jnj: ah ok, so something like truncate(rooms_tools) ?
[17:48:38] centrx: jnj: it's all stored in DB, no magic (unless cached)
[17:48:39] jnj: centrx: ^^
[17:48:49] jnj: Thanks!
[17:49:35] pwnd_nsfw: has joined #RubyOnRails
[17:50:48] eckesicle: has joined #RubyOnRails
[17:51:12] adavia: will try that
[17:51:58] jusa: has joined #RubyOnRails
[17:52:22] eckesicle: hi. I am using rails 4 and I want to define a has_many relation that does not have a foreign key (I have a custom sql query that I want to run). In Rails 3 you could do this with the :finder_sql option, but that is no longer available in Rails 4. How would I go about doing this in rails 4?
[17:54:13] MasterAsia: has joined #RubyOnRails
[17:54:28] MasterAsia: Is the naming convention for a has_many through the same as a normal model?
[17:55:00] eckesicle: it could be
[17:55:19] eckesicle: I want something like
[17:55:42] eckesicle: has_many :files, -> (node) { where('realy complex sql LIKE ?', node.id) }
[17:55:58] eckesicle: but, using a scope just chains the where after the join on the foreign key
[17:56:02] eckesicle: i dont want that join
[17:57:18] Duckily: has joined #RubyOnRails
[17:57:37] arBmind: has joined #RubyOnRails
[17:59:41] planigan: has joined #RubyOnRails
[18:00:54] moresilenter: has joined #RubyOnRails
[18:00:57] Duckily: has joined #RubyOnRails
[18:01:11] moresilenter: hello! I had a rails routing question
[18:01:37] moresilenter: I am trying to serve my entire rails app off of a "/rails" path because it is going to sit behind a apache proxypass that usually serves to php
[18:01:39] rakm_: has joined #RubyOnRails
[18:02:30] moresilenter: I attempted to set "config.relative_url_root" but that doesn't appear to be prepending my assets with the "/rails" root that I want
[18:02:41] mikecmpbll: has joined #RubyOnRails
[18:02:47] moresilenter: and also, the generated route helpers doesn't appear to have it attached
[18:02:51] moresilenter: does anybody know what I am doing wrong?
[18:04:19] Or1on: has joined #RubyOnRails
[18:04:34] adavia: centrx: Awesome! That really worked
[18:04:38] adavia: centrx: Thanks
[18:05:22] nOwz: has joined #RubyOnRails
[18:05:23] centrx: hash maps very useful
[18:06:31] polishdub: has joined #RubyOnRails
[18:07:28] pupsicle: @moresilenter: did you restart the server after modifying the relative_url_root?
[18:07:36] cnk: moresilenter: apache + what? proxy to app server or are you using passenger?
[18:08:22] arBmind1: has joined #RubyOnRails
[18:08:58] moresilenter: no, we are using puma
[18:09:13] moresilenter: we are using ProxyPass from apache to puma
[18:11:11] jenrzzz: has joined #RubyOnRails
[18:13:04] arBmind: has joined #RubyOnRails
[18:13:20] ajruiz_: has joined #RubyOnRails
[18:13:31] cnk: OK Then I don't know. The passenger docs covered that situation but don't know that the info is releveant to a proxy situation
[18:14:09] moresilenter: ok, well thanks anyways!
[18:14:14] moresilenter: can you point me to the passenger docs?
[18:15:37] cnk: https://www.phusionpassenger.com/library/deploy/apache/deploy/ruby/#deploying-an-app-to-a-sub-uri-or-subdirectory
[18:17:36] futilegames: has joined #RubyOnRails
[18:18:22] jnj: centrx: How should I use truncate in the seeds.rb file? Is it ActiveRecord::ConnectionAdapters::DatabaseStatements.truncate(table_name)?
[18:23:50] jnj: centrx: Hmm, actually it turns out that truncate is not implemented
[18:24:06] jnj: centrx: https://github.com/rails/rails/blob/8f3178f3132f618d982e71554e192f6282fcb159/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb#L103
[18:24:36] centrx: jnj: That's the abstract adapter. It's implemented in the specific adapter for your database (e.g. Postgresql)
[18:25:02] jnj: centrx: Ah ok, so how would I use truncate if my db is sqlite?
[18:27:48] centrx: jnj: I guess it's not supported in SQLite
[18:28:01] centrx: jnj: You can do "DELETE FROM #{table}" though
[18:28:03] jnj: centrx: Ah yeah, I just found that out. Thanks for all of your help though!
[18:28:56] jenrzzz: has joined #RubyOnRails
[18:29:45] patarr: has joined #RubyOnRails
[18:41:45] buckrockwell: has joined #RubyOnRails
[18:43:27] planigan: has joined #RubyOnRails
[18:44:49] tvw: has joined #RubyOnRails
[18:45:10] rakm: has joined #RubyOnRails
[18:46:14] h7br1x: has joined #RubyOnRails
[18:49:40] gambl0re: has joined #RubyOnRails
[18:51:55] nOwz: has joined #RubyOnRails
[18:54:49] IRCFrEAK: has joined #RubyOnRails
[18:55:12] IRCFrEAK: has left #RubyOnRails: ()
[18:55:51] zpe: has joined #RubyOnRails
[18:56:24] planigan: has joined #RubyOnRails
[18:56:45] zpe: has joined #RubyOnRails
[18:59:41] centrx: has joined #RubyOnRails
[18:59:42] centrx: has joined #RubyOnRails
[19:00:39] arBmind1: has joined #RubyOnRails
[19:03:24] benlieb: has joined #RubyOnRails
[19:03:35] futilegames: has joined #RubyOnRails
[19:04:28] planigan: has joined #RubyOnRails
[19:07:42] patarr: Is there any way to take advantage of the Rails asset pipeline for caching static files? Instead of placing a website directory into ./public, I'd like to somehow leverage the fingerprinting capabilities of the asset pipeline so our load balancer can cache it
[19:07:46] NoGodDamnIdea: has joined #RubyOnRails
[19:09:06] IRCFrEAK: has joined #RubyOnRails
[19:10:06] IRCFrEAK: has left #RubyOnRails: ()
[19:11:01] epochwolf: patarr: You can... if you're okay with fingerprint urls.
[19:11:26] planigan: has joined #RubyOnRails
[19:16:01] camonz: has joined #RubyOnRails
[19:17:19] camonz: how can I turn an Arel::SelectManager instance into something I can further compose via a regular WhereChain?
[19:19:30] planigan: has joined #RubyOnRails
[19:19:50] patarr: Now I have a different question.. lol. It seems that relative links are breaking if i access the directory like so /thedir. But when I access /thedir/ it works. What gives :(
[19:20:50] pLaTo0n: has joined #RubyOnRails
[19:21:33] epochwolf: patarr: http://stackoverflow.com/questions/5457885/relative-urls-and-trailing-slashes
[19:23:07] centrx: camonz: SelectManager already has .where right?
[19:23:21] centrx: camonz: and .where returns self
[19:23:22] patarr: epochwolf: so it seems like.. I can't solve the problem?
[19:23:46] camonz: centrx: yes, but it's not as simple as composing with a regular AR::Base instance
[19:23:47] epochwolf: patarr: nope, use a full url or root relative path.
[19:24:03] centrx: camonz: WhereChain is only used for the where.not() construct
[19:24:13] camonz: for example, MyClass.custom_query_done_with_arel.find(1)
[19:24:18] patarr: epochwolf: is there any way to create a route that will append the slash?
[19:24:20] chrisgopher: has joined #RubyOnRails
[19:24:42] camonz: centrx: the idea being the my custom query is a scope
[19:24:50] patarr: Ah, there is, but only for links.
[19:24:54] patarr: Ugh. This sorta sucks.
[19:25:14] epochwolf: patarr: add a rewrite url to nginx.
[19:25:22] centrx: camonz: I don't know, arel just doesn't have a lot of ActiveRecord things
[19:25:24] epochwolf: rewrite rule*
[19:25:36] centrx: camonz: That's why we use ActiveRecord :)
[19:25:48] patarr: I think I'll create a route that matches /foo and it will redirect to public/foo/index.html
[19:26:11] camonz: centrx: sure but AR throws an error when handling 2 left outer joins with an OR clause :)
[19:26:20] DLSteve: has joined #RubyOnRails
[19:26:30] camonz: across a polymorphic relation
[19:26:56] goldpank: has joined #RubyOnRails
[19:27:06] epochwolf: camonz: ah, the solution to that is... don't do that. :D
[19:27:24] camonz: fwiw here's my query builder https://gist.github.com/CamonZ/65acb2cb748ec4c5b6a668e0e1512bc8
[19:27:26] camonz: that works
[19:27:49] goldpank: has left #RubyOnRails: ()
[19:27:51] epochwolf: Once you start dropping into complex query terroritory, you're dropping active record's stuff and doing raw sql or AREL.
[19:27:55] camonz: problem is I'd like in my controller to simply say `Task.for_user(current_user).find(params[:id])`
[19:28:40] camonz: epochwolf: I know :( it's a last resort
[19:28:43] epochwolf: camonz: Can you show us some code? :)
[19:28:44] centrx: camonz: I would make a scope with finder_sql
[19:29:02] patarr: Hm. Seems to have no effect.
[19:29:21] centrx: camonz: or just define a method
[19:29:21] camonz: I tried regular `Task.left_joins([:checklists, :trip_checklists]).where(...)`
[19:30:01] dionysus69: has joined #RubyOnRails
[19:30:04] epochwolf: patarr: you have 2 options, either fix all the urls OR add a rewrite to nginx (or whatever your front end webserver is)
[19:30:25] dminuoso: Okay folks. I want to normalize my JSON API jbuilder endpoints in such a way, that I can re-use existing jbuilder partials for nested attributes... but without the stupid overhead of jbuilder calling each partial.
[19:30:31] epochwolf: static files are picked up before routes.
[19:30:48] dminuoso: Because if you start nesting partials and do this on a list of items, things get unbelievably slow because invoking jbuilder is slow.
[19:30:52] camonz: epochwolf: model, query builder, and controller on this gist https://gist.github.com/CamonZ/65acb2cb748ec4c5b6a668e0e1512bc8
[19:31:02] dminuoso: I would really like to avoid AMS because jbuilder is much faster :|
[19:31:48] camonz: centrx: do you mean ActiveRecord::Base.find_by_sql ?
[19:31:49] dminuoso: I guess I could write a preprocessor that automatically generates jbuilder templates... mmmmm.
[19:32:03] epochwolf: camonz: that's a lot easier to do in rails with a raw sql join snippet.
[19:32:21] centrx: camonz: yup
[19:32:53] centrx: camonz: in associations, the option is called "finder_sql"
[19:32:59] camonz: epochwolf: that was my first attempt, though the raw sql is unmaintainable
[19:33:11] dminuoso: camonz: How is raw sql unmaintainable?
[19:33:23] dminuoso: You mean because you have to learn a proper domain specific language for retrieving data? :S
[19:33:40] centrx: It's uglier, and so forth but
[19:33:41] dminuoso: It's better than some exotic highly verbose and un-expressive and limited DSL such as arel.
[19:33:50] dminuoso: It's better than arel by a huge huge margin.
[19:34:34] zpe: has joined #RubyOnRails
[19:34:39] camonz: Idminuoso: I know how you feel, why use abstractions right. let's just drop AR altogether
[19:35:03] camonz: in all seriousness, Arel is highly verbose and very specific
[19:35:06] dminuoso: camonz: AR is fine if you use it when your more focused on model interaction than retrieval.
[19:35:09] epochwolf: camonz: that's what you're supposed to do in AR if the query builders don't work.
[19:35:13] camonz: but it does allow a bit more maintainability over a raw sql string
[19:36:18] dminuoso: camonz: For example I have started using a lot of aggregation and window functions because they are just immensely useful.
[19:36:38] dminuoso: camonz: No.
[19:36:47] epochwolf: What parts of a schema can you change that isn't going to require changes in AR verses a raw query?
[19:36:49] dminuoso: camonz: The maintainability drops for complex things because you cant express things trivially without SQL.
[19:37:00] clair13: has joined #RubyOnRails
[19:37:11] dminuoso: If your column names change, you have to touch all your .where clauses *anyway*.
[19:37:15] epochwolf: The only thing I can think of is data types and table name.
[19:37:37] dminuoso: And table names can be hidden if you use .table_name
[19:37:45] dminuoso: data types are a valid point, but those really rarely change.
[19:38:01] epochwolf: data type changes tend to break lots of little things.
[19:38:14] marcelo_: has joined #RubyOnRails
[19:38:56] epochwolf: Using Arel gives you composibility but code reuse for complex queries isn't as big as you'd like it to be.
[19:39:19] epochwolf: And as you're finding out, Arel composibility isn't AR composibility.
[19:40:31] epochwolf: Whatever bits don't work in AR, just slap raw sql on it and it'll compose just find.
[19:40:36] futilegames: has joined #RubyOnRails
[19:40:37] dminuoso: And SQL is actually quite elegant if you learn the relational model of Codd.
[19:40:50] dminuoso: It forces you to think about your data in a different perspective.
[19:40:53] epochwolf: SQL is kind of neat.
[19:41:21] epochwolf: The problem is making sql optimized.
[19:41:27] epochwolf: That gets fugly.
[19:42:05] dminuoso: epochwolf: Actually you suddenly are able to make changes to optimize it.
[19:42:12] dminuoso: With AR/Arel you are left helpless.
[19:42:26] dminuoso: If it generates shitty or multiple queries? Well pray or you are out of luck.
[19:42:31] _I_R_C_F_R_E_A_K: has joined #RubyOnRails
[19:42:37] benlieb: has joined #RubyOnRails
[19:43:02] epochwolf: Oh look, the optimizer shit the bed and the DB server hit swap like yo momma at the titty bar.
[19:43:04] dminuoso: Though it's a fair point, understanding things like postgresql explain analyze requires experience and some deeper knowledge.
[19:43:09] h7br1x: has joined #RubyOnRails
[19:43:25] dminuoso: Though at the very least SQL can be heavily optimized. :-)
[19:43:43] futilegames_: has joined #RubyOnRails
[19:44:44] dminuoso: epochwolf: Some things are unrelated to the optimizer though. A popular case is COUNT(*) on large (and Im not talking about "100,000 rows large") tables.
[19:45:17] epochwolf: dminuoso: I'm aware. I just wanted to make a yo mamma joke. :D
[19:45:55] dminuoso: I like high performance databases. One of mine is performing between 2 and 10 million transactions every day.
[19:46:07] dminuoso: It's respectable. :)
[19:46:35] camonz: sorry, back
[19:47:15] epochwolf: dminuoso: the only thing high preformance at my current job is my reddit karma. :/
[19:48:20] epochwolf: camonz: come to the dark side, raw sql is love, raw sql is raw... savage... and beautiful
[19:48:49] jphase: has joined #RubyOnRails
[19:48:59] chrisgopher: dat reddit karma
[19:49:45] epochwolf: chrisgopher: I've got 34.
[19:50:00] epochwolf: I've posted like once in the last 6 years.
[19:50:44] _I_R_C_F_R_E_A_K: has left #RubyOnRails: ()
[19:50:46] patarr: What's the idiomatic rails way of adding a "build
[19:51:18] patarr: build step to the project? Like checkout out a git project and insert the files into the public folder.
[19:51:25] chrisgopher: ¯\_(ツ)_/¯ so much for high performance
[19:51:40] Jasaka: has joined #RubyOnRails
[19:51:49] epochwolf: chrisgopher: unless comments count as shitposts, I got nothing.
[19:51:54] cnk: patarr: capistrano, vlad, or one of the other dozen deployer gems
[19:53:04] cnk: https://www.ruby-toolbox.com/categories/deployment_automation
[19:53:06] chrisgopher: epochwolf: its k, I got nothing for online fame points t-t
[19:53:11] Rodya_: has joined #RubyOnRails
[19:53:15] agent_white: has joined #RubyOnRails
[19:56:05] sonOfRa: has joined #RubyOnRails
[19:58:24] s2013: has joined #RubyOnRails
[19:58:59] kb1ibt: has joined #RubyOnRails
[19:59:31] epochwolf: chrisgopher: yeah, if I see someone's reddit karma score on a resume and their username isn't GallowBoob, it's going in the trash.
[20:01:46] dminuoso: patarr: What do you mean by build?
[20:01:57] dminuoso: patarr: Are you talking about deploying? Testing? Deploying for development?
[20:02:33] NoGodDamnIdea: has joined #RubyOnRails
[20:02:34] NoGodDamnIdea: has joined #RubyOnRails
[20:04:25] DoctorMonocular: has joined #RubyOnRails
[20:06:02] kb1ibt: I am reverse engineering a database into a rails (read-only) app to allow a school district to access old SIS data. is there any way to know which relation type to use has_one vs has_many
[20:06:06] chrisgopher: epochwolf: the guy posts 6x per day, too -productive- for me to compete with lul
[20:06:45] epochwolf: chrisgopher: it's literally his job, if you can compete with him, you're not doing yours. XD
[20:06:48] dminuoso: kb1ibt: that depends on your datamodel.
[20:07:06] kb1ibt: I only have the database to reference not the original application
[20:07:14] dminuoso: kb1ibt: A has_one B models a (A) 1:1 (B) relationship
[20:07:27] dminuoso: Klumben: A has_many B models a (A) 1:m (B) relationship
[20:07:27] toydestroyer: has joined #RubyOnRails
[20:07:34] dminuoso: has_many speaks for itself.
[20:07:38] chrisgopher: epochwolf: that job description....a little jell.
[20:08:00] camonz: dminuoso, epochwolf: I have joined the dark side https://gist.github.com/CamonZ/1746a1a82009a13fbfe01778ae446bb9
[20:08:10] camonz: considerably much simpler
[20:08:30] dminuoso: camonz: One last fix, please use proper SQL interpolation with ?
[20:08:39] camonz: and it's AR-composable
[20:09:22] Radar: xGOOD MORNING
[20:09:25] kb1ibt: dminuoso: i get that but is there any way to test query the database to verify that there isn’t a case where what I think would be a 1:1 is actually a 1:m
[20:09:29] Radar: where did that x come from? Who cares. It's yours free.
[20:10:23] kb1ibt: or visaversa somethign I would expect to be a 1:m but is only ever used as a 1:!
[20:10:35] camonz: dminuoso: nice catch, thanks!
[20:10:39] epochwolf: camonz: where("checklists.user_id = :user_id OR trip_checklists.user_id = :user_id", user_id: user.id)
[20:10:54] dminuoso: Radar: Since you asked.. I can give you a complete physical description that begins with a keystroke, covers the IRQ landing on your APIC and ends with the x appearing on my screen.
[20:11:08] Radar: dminuoso: pass sorry maybe some other time
[20:11:18] baweaver: x marks the spot
[20:11:24] workmad3: has joined #RubyOnRails
[20:12:04] epochwolf: kb1ibt: yes, you can count the number of records on the other side of a join using count and group by
[20:12:07] dminuoso: epochwolf: That is neat, I did not know you could do that kind of interpolation.
[20:12:15] dminuoso: ACTION starts a new commit
[20:12:21] epochwolf: dminuoso: this is why I'm a senior developer.
[20:13:00] dminuoso: epochwolf: I guess I should take that last offer as a lead developer just so I can respond to that in kind.
[20:13:15] epochwolf: and yet I still feel like a failure most days.
[20:13:38] Technodrome: has joined #RubyOnRails
[20:13:43] epochwolf: dminuoso: haha, I'm also a lead developer. (By default... I'm the only one)
[20:14:18] epochwolf: Maybe in a few years I'll be worthy of my title.
[20:14:46] dminuoso: epochwolf: Though honestly my focus has drifted away from Rails entirely.
[20:14:58] epochwolf: I'm currently a director of operations at a convention and I'm in charge of a team and all the related logistics.
[20:15:08] dminuoso: All I now care about is writing stupidly fast rails APIs because all my attention is on awesome immutable and purely functional client side code. :-)
[20:15:13] Radar: I'm a senior developer and yesterday it took me 30 minutes to figure out that I had written "expect(value).not_to be_blank" when I really meant to use "be_present" instead.
[20:15:23] netzfisch: has joined #RubyOnRails
[20:15:25] dminuoso: Radar: Haha. :-)
[20:15:30] epochwolf: Radar: we all have that problem.
[20:15:38] Radar: "wtf test is failing but the link is _definitely_ there!!1 one"
[20:15:47] Radar: It helps if you read the error message sometimes.
[20:15:47] gheegh: has joined #RubyOnRails
[20:15:50] epochwolf: dminuoso: yeah, I haven't gotten into as much front end lately.
[20:16:05] epochwolf: Radar: Step 1. Read. I always start with that when troubleshooting.
[20:16:16] dminuoso: epochwolf: It's super fun. I suddenly grokked why everybody is telling that object oriented programming is inherently poor and error prone.
[20:16:18] mlt-: has joined #RubyOnRails
[20:16:19] jenrzzz: has joined #RubyOnRails
[20:16:36] dminuoso: And writing tests is easier than ever if all your things are pure functions.
[20:16:47] epochwolf: My boss, our system admin, panicked when he saw empty log files. Took 10 minutes for us to discover he was in the wrong folder.
[20:16:48] br0d1n: has joined #RubyOnRails
[20:17:01] dminuoso: It's one of the things that really tires me with ruby rspec -> test setups.
[20:17:14] Radar: epochwolf: lol
[20:17:39] epochwolf: I don't know if I'm just shitty at tests or if tests are just shitty. :(
[20:18:00] Radar: dminuoso: Something has to test that all the functions work together though, right?
[20:18:10] epochwolf: Or maybe it's just that our shitty code isn't testable in a non-shitty way.
[20:18:23] Radar: You can't just ensure that a & b & c work correctly, you have to ensure that a -> b -> c works too?
[20:19:14] dminuoso: Radar: Yeah. Do you folks use redux heavily?
[20:19:20] Radar: dminuoso: yes we do
[20:19:28] epochwolf: Radar: that... always that. If you haven't tested a -> b, your tests on a and b won't be enough come production.
[20:19:31] dminuoso: It's been a blast for me to dive into it.
[20:21:23] knight33: has joined #RubyOnRails
[20:21:30] baweaver: dminuoso: http://randycoulman.com/blog/categories/thinking-in-ramda/
[20:21:31] dminuoso: Radar: This separation of between state and representation allows you to test your actions/reducers and the rest of your application in complete separation and that's kind of what I implied by not worrying about mocking/test setups too much.
[20:21:46] baweaver: http://randycoulman.com/blog/2016/02/16/using-ramda-with-redux/
[20:22:22] baweaver: I'm just a developer. Don't have any fancy titles on me
[20:22:57] Radar: dminuoso: From my understanding, Redux works similarly to GenServers in Elixir. You have a state that you modify with actions.
[20:23:29] Radar: This is how I tend to think of testing these days: https://goo.gl/XX7uvU. Vertical lines are unit tests, horizontal lines are integration tests.
[20:23:33] dminuoso: Well you derive new state rather than modifying it but yeah.
[20:24:01] Radar: dminuoso: oops, yes. That's how Elixir does it too.
[20:25:10] planigan: has joined #RubyOnRails
[20:27:06] _Sypheren: has joined #RubyOnRails
[20:27:09] mlt-: I have 3 kinds of Operations that have different fixed attributes (1+3 DB tables) and I can't wrap my head around how to approach this with Rails. I mean I can generate a form for common stuff + operation kind, and, depending on operation kind selection, I can render other html pieces via ajax and autosubmission. However I'm not sure when and how to create records in DB. I mean I don't want to create temporary records in common table
[20:27:10] mlt-: every time user changes their mind selecting different operation kind. But if I want all attributes in a single form, I wouldn't be able to use form helpers. Shall I create 3 AR models with complete attributes for that? I would prefer a single page for new operation instead of 3 different controllers etc. I feel like I'm about to invent a wheel. How is it usually approached?
[20:29:22] drale2k: has joined #RubyOnRails
[20:29:41] Scient: has joined #RubyOnRails
[20:29:57] nahtnam: has joined #RubyOnRails
[20:30:03] masscrx: has joined #RubyOnRails
[20:31:47] Dfoolz: has joined #RubyOnRails
[20:39:36] drale2k: has joined #RubyOnRails
[20:44:49] fulcan: has joined #RubyOnRails
[20:47:12] fulcan: I tried laravel but in order to 'use it' you have to pull is a full second computer. I couldn't get the crap to turn on anyways. So I deleted it. Next I tried Django but refuses to talk to apache so it just got deleted. Now I am looking at ruby. Is there a 'hello world' doc RoR that won't break me or my system?
[20:48:04] P0w3r3d: has joined #RubyOnRails
[20:48:40] fulcan: I have Ubuntu and/or FreeBSD ready for the cooker.
[20:49:25] jdm: has joined #RubyOnRails
[20:49:45] tbuehlmann: if you want to be ready for development, this is a good read: http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you
[20:49:57] tbuehlmann: after that the official guide got you covered: http://guides.rubyonrails.org/getting_started.html
[20:50:21] drale2k: has joined #RubyOnRails
[20:51:15] adavia: can i group like this? @submissions.map { |submission| submission.questions.group(:id) }
[20:56:38] Rodya_: has joined #RubyOnRails
[20:57:33] duderonomy: has joined #RubyOnRails
[20:58:13] pupsicle: fulcan: Pretty good resource https://www.railstutorial.org/book/beginning#sec-up_and_running
[21:00:17] ProofTechnique: has joined #RubyOnRails
[21:00:27] loglaunch: has joined #RubyOnRails
[21:01:16] jusa: has joined #RubyOnRails
[21:02:11] duderono_: has joined #RubyOnRails
[21:02:17] rakm: has joined #RubyOnRails
[21:02:25] jdm: has joined #RubyOnRails
[21:02:26] jenrzzz_: has joined #RubyOnRails
[21:03:07] duderono_: has joined #RubyOnRails
[21:03:41] jdm: has joined #RubyOnRails
[21:03:44] SteenJobs: has joined #RubyOnRails
[21:04:06] nOwz: has joined #RubyOnRails
[21:04:46] Didac: has joined #RubyOnRails
[21:10:31] brent__: has joined #RubyOnRails
[21:14:25] superlou: has joined #RubyOnRails
[21:17:52] brent__: has joined #RubyOnRails
[21:18:43] snickers: Can i change behavior of accept_nestet_atributes_of :foo that will no't required using suffix _attributes in passing hash?
[21:19:38] snickers: example by specific custom name for hash key for that attributes?
[21:23:18] tenderlo_: has joined #RubyOnRails
[21:26:37] Radar: Snickers: why would you want to do that?
[21:26:56] Radar: Snickers: that alters the behaviour of what your model does when it receives a *_attributes key/value pair.
[21:28:07] brendan6: has joined #RubyOnRails
[21:28:27] snickers: I do a REST api, so it will be look beter if I do not need append this suffix in JSON
[21:28:40] Didac: has joined #RubyOnRails
[21:34:57] snickers: ok I know. I Can set alias_attributes :foo_bar, :foo_attributes
[21:40:28] Radar: I would suggest an alternative, like manually processing the nested attributes in the JSON body.
[21:40:38] Radar: nested attributes was not built with JSON APIs in mind, I am pretty sure.
[21:42:50] helpa: Rails 5 in Action won't be published. More info here: http://ryanbigg.com/2017/03/rails-5-in-action
[21:42:54] Radar: Good bot.
[21:42:56] Radar: !botsnack
[21:42:56] helpa: Nom nom. Thanks, Radar!
[21:45:34] WinterBluFox: has joined #RubyOnRails
[21:49:37] arBmind: has joined #RubyOnRails
[21:51:01] snickers: Radar I could manulay processing parameters that I get, but IMHO it give only more logic to controller
[21:51:03] mrgreenfur: has joined #RubyOnRails
[21:51:18] Radar: Snickers: The controller is not the only place where that kind of logic can live.
[21:51:33] superlou: has joined #RubyOnRails
[21:52:11] snickers: Radar so where I should do that?
[21:52:49] benlieb: has joined #RubyOnRails
[21:53:02] bazzy: has joined #RubyOnRails
[21:53:15] Radar: Snickers: The code really is taking a Hash and then creating database records from that. It's something that could live separate from the controller.
[21:55:00] snickers: So I should create class that will get that hash and set all model with association?
[21:57:00] Radar: Snickers: yeah, that's what I was suggesting.
[21:57:12] Radar: Then you'd call that class from the controller.
[21:59:15] snickers: Ok, thank you
[22:00:26] nfsnobody: has joined #RubyOnRails
[22:06:24] mr_foobar: has joined #RubyOnRails
[22:07:55] mr_foobar: Hi, do you know how to get Rails to use "ID" instead of "id" as the primary key? I have self.primary_key = "ID" and alias_attribute :id, :ID in my model, but MyModel.create! still results in: PG::UndefinedColumn: ERROR: column "id" does not exist
[22:12:43] mr_foobar: MyModel.new.attributes contains both ID and id
[22:13:05] mr_foobar: but i dont know where the lower case id is coming from and how to disable it
[22:15:51] matthewd: mr_foobar: `id` is automatically aliased to the named primary_key
[22:18:59] mr_foobar: matthewd, yes, the .id method. but it should use my custom primary key column behind the scenes?
[22:18:59] mr_foobar: Anyways, I think I found the problem which was probably caused by some of my own stuff that I forgot to remove.
[22:19:37] netzfisch: has joined #RubyOnRails
[22:26:04] netzfisch: has joined #RubyOnRails
[22:31:24] gambl0re: has joined #RubyOnRails
[22:39:50] rakm: just making sure.. if i have a join table that has a polymorphic relationship defined (e.g. table: blog_authors, author relationship can be a user or an organization), I cannot create a has_many :through on the Blog model that returns records from both Users/Organizations tables right?
[22:44:07] jenrzzz: has joined #RubyOnRails
[22:44:07] jenrzzz: has joined #RubyOnRails
[22:44:08] krzysztoff: has joined #RubyOnRails
[22:45:12] rakm: https://gist.github.com/anonymous/1754d3b65a138b53ebee36fa1d6c262a
[22:45:45] Rodya_: has joined #RubyOnRails
[22:49:07] Haydos: has joined #RubyOnRails
[22:49:08] Haydos: has joined #RubyOnRails
[22:49:43] quazimodo: has joined #RubyOnRails
[22:49:45] s2013: has joined #RubyOnRails
[23:00:59] jusa: has joined #RubyOnRails
[23:01:47] benlieb: has joined #RubyOnRails
[23:03:37] daydream: has joined #RubyOnRails
[23:04:44] nOwz: has joined #RubyOnRails
[23:05:51] chouhoul_: has joined #RubyOnRails
[23:07:00] chouhoul_: has joined #RubyOnRails
[23:08:48] eyck: has joined #RubyOnRails
[23:09:01] chouhoulis: has joined #RubyOnRails
[23:10:58] Trynemjoel: has joined #RubyOnRails
[23:11:27] chouhoul_: has joined #RubyOnRails
[23:19:35] davedo321: has joined #RubyOnRails
[23:20:55] arBmind: has joined #RubyOnRails
[23:30:56] erlend: has joined #RubyOnRails
[23:34:00] erlend: has joined #RubyOnRails
[23:36:19] pwnd_nsfw`: has joined #RubyOnRails
[23:44:41] GodFather: has joined #RubyOnRails
[23:46:41] Rodya_: has joined #RubyOnRails
[23:51:15] Or1on: has joined #RubyOnRails
[23:51:32] kristofferR: has joined #RubyOnRails
[23:55:48] snickers: has joined #RubyOnRails
[23:56:23] snickers: has joined #RubyOnRails
[23:58:38] cnk: has joined #RubyOnRails