« Back to channel list

#RubyOnRails - 01 April 2016

« Back 1 day Forward 1 day »
[00:00:02] yfeldblum: has joined #RubyOnRails
[00:04:34] benlieb: has joined #RubyOnRails
[00:07:14] speaking1ode: has joined #RubyOnRails
[00:08:20] speaking1ode: has left #RubyOnRails: ()
[00:11:58] FooMunki: has joined #RubyOnRails
[00:12:22] QualityAddict: has joined #RubyOnRails
[00:13:55] Pathfinder: has joined #RubyOnRails
[00:14:38] uglybandersnatch: has joined #RubyOnRails
[00:15:59] diegoaguilar: has joined #RubyOnRails
[00:17:55] Ropeney: has joined #RubyOnRails
[00:18:31] ur5us: has joined #RubyOnRails
[00:18:42] egray: has joined #RubyOnRails
[00:18:42] dpg1: has joined #RubyOnRails
[00:18:48] pawnbox: has joined #RubyOnRails
[00:20:35] lalalaaa: has joined #RubyOnRails
[00:22:23] RaetiveName: has joined #RubyOnRails
[00:22:56] dopie: Hello all
[00:23:37] dopie: [[1,2,3,4,5]].include?(2) produces false... how can i make it true?
[00:23:45] dopie: should i flatten the array?
[00:24:06] Arcaire: [[1,2,3,4,5]].flatten.include?(2)
[00:26:07] SteenJobs: has joined #RubyOnRails
[00:26:13] B1n4r10: has joined #RubyOnRails
[00:27:44] Radar: [[1,2,3,4,5]].any? { |a| a.include?(2) }
[00:27:59] FooMunki: has joined #RubyOnRails
[00:28:43] djbkd: has joined #RubyOnRails
[00:34:32] Technodrome: has joined #RubyOnRails
[00:34:51] Technodrome: if you guys need a CMS for a project, what do you choose mostly? even if its non rails?
[00:35:02] Technodrome: for this edu project they want a standardized CMS
[00:35:20] sevenseacat: depends what they need out of a cms
[00:35:39] sevenseacat: there is no one-size-fits-all imo
[00:36:05] rodfersou: has joined #RubyOnRails
[00:37:41] dopie: Arcaire, Radar thank you
[00:42:09] superlou: has joined #RubyOnRails
[00:43:20] Technodrome: sevenseacat literally they all request drupal
[00:43:27] Technodrome: but the ruby side of me is like :( :( :(
[00:43:29] B1n4r10: has joined #RubyOnRails
[00:44:04] Technodrome: but i think drupal is so mature, and has much a large company behind it, that nothing will be able to catch up on the ruby side at this point
[00:44:25] pwnd_nsfw: Rails scaffold, best cms
[00:45:15] sevenseacat: doesnt really answer the question though
[00:48:30] pawnbox: has joined #RubyOnRails
[00:50:08] lalalaaa: people request drupal for the same reason kids request justin bieber and taylor swift
[00:50:21] lalalaaa: massively popular but has nothing to do with the quality of the music
[00:51:34] Scient: i like that analogy
[00:51:45] SteenJobs: if i have a form sending an update request, and the object being updated can be one of two classes, is there a way to find the class in my update action, of the object corresponding to the form, besides simply passing the class name thru params? since i need to know the class of the object being updated so i know which table to query using params[:id]
[00:53:07] sevenseacat: why are two classes using the same update process?
[00:53:21] SteenJobs: ah got it - it’ll be a key in params already, because of form_for, so i guess i just need to check if either of the two classes names are a key in params
[00:53:57] lalalaaa: thanks Scient
[00:54:44] SteenJobs: sevenseacat: this is part of the onboarding flow, where in the first stage the user creates either a brand or a creator object. the logic of the onboarding flow is handled by an onboarding controller. stages 2 and onwards will update that object in the onboarding controller’s update action, but it needs to know whether to query the brand or creator table for the corresponding object
[00:54:51] RegulationD: has joined #RubyOnRails
[00:54:53] sevenseacat: oh, this chestnut again
[00:55:07] SteenJobs: i decided to rewrite and abstract the logic into its own controller, but it’s all good
[00:56:08] moei: has joined #RubyOnRails
[00:56:23] akshat: has joined #RubyOnRails
[00:56:24] SteenJobs: sevenseacat: what i did was in stage 1, which goes thru the the create action, after the object is created i set @company = to that object, and pass @company to form_for in stage_2. when stage_2 is submitted, there will be a key with a name corresponding to the class of whatever @company is, within params.
[00:57:16] SteenJobs: that key contianing all of the params from the form
[00:57:30] pwnd_nsfw: did you now
[00:57:55] SteenJobs: haha uh oh...
[01:02:18] andrewkwon: has joined #RubyOnRails
[01:03:48] georgedrummond: has joined #RubyOnRails
[01:04:48] johnflux: has joined #RubyOnRails
[01:04:57] chipotle: has joined #RubyOnRails
[01:08:06] Pathfinder: has joined #RubyOnRails
[01:08:45] delgiudices: has joined #RubyOnRails
[01:15:46] flashpoint9: has joined #RubyOnRails
[01:17:43] guatajuk: has joined #RubyOnRails
[01:18:38] hxegon: has joined #RubyOnRails
[01:23:44] ekinmur: has joined #RubyOnRails
[01:25:09] monoprotic: has joined #RubyOnRails
[01:26:46] georgedrummond: has joined #RubyOnRails
[01:28:48] pawnbox: has joined #RubyOnRails
[01:30:53] catcher: has joined #RubyOnRails
[01:31:49] Technodrome: has joined #RubyOnRails
[01:33:17] B1n4r10: has joined #RubyOnRails
[01:41:14] chouhoulis: has joined #RubyOnRails
[01:41:23] kies: has joined #RubyOnRails
[01:49:45] Technodrome: has joined #RubyOnRails
[01:50:18] Technodrome: pwnd_nsfw although i love rails scaffolding, it honestly doesn't solve the CMS issue
[01:52:02] Technodrome: pwnd_nsfw and even in the CMS space, look how few vendors there realy is
[01:52:18] FooMunki: has joined #RubyOnRails
[01:52:20] Technodrome: that are mature, people either use wp , or drupal, and drupal usually in education and business
[01:52:20] joshkovach: has joined #RubyOnRails
[01:58:50] sypheren: has joined #RubyOnRails
[01:59:47] Technodrome: pwnd_nsfw / s
[02:00:03] zave: has joined #RubyOnRails
[02:03:54] rubyonrailed: has joined #RubyOnRails
[02:09:15] SteenJobs: Arcaire: i realize that i NEED the current_stage_num in the url, because if a user navigates backwards in the browser, the session[:current_stage_num] won’t -= 1, and then it won’t match the currnet stage’s actual number
[02:09:30] Cohedrin_: Technodrome: Shopify is a pretty good option, written in rails as well ;)
[02:09:50] Technodrome: Cohedrin_ how does shopify relate to a cms? :)
[02:10:54] Cohedrin_: https://www.shopify.com/tour/ecommerce-cms
[02:12:34] Technodrome: although i don't mind them using CMS as the back end for their products interface its a bit misleading
[02:12:43] Technodrome: its like the "magento cms" , they're both quite basic at best
[02:13:32] bronson: has joined #RubyOnRails
[02:13:34] Technodrome: Cohedrin_ say you have a Yale University project, lets give it a 175k budget, and lets say that it will hold 9 different content types, etc, needs to be accessible to around 5-7 publishers
[02:13:53] Technodrome: Cohedrin_ non self hosted solutions never usually even get considered, hence why paid self hosted solutions were used for so long
[02:13:58] Technodrome: really the only options are drupal and wordpress
[02:15:09] ekinmur: has joined #RubyOnRails
[02:18:31] pawnbox: has joined #RubyOnRails
[02:19:50] Technodrome: Cohedrin_ so you can see where my ruby loving anguish comes from
[02:22:27] georgedrummond: has joined #RubyOnRails
[02:26:40] Radar: Really though you should build it in Elixir.
[02:26:52] Technodrome: different project Radar
[02:26:57] Technodrome: that one is done
[02:27:07] Technodrome: and you're right, static content builder would have been just fine
[02:27:37] Technodrome: Radar but what about the high budget, publish daily, 5-7 editors / publishers ? There are hardly any mature solutions for that in the OSS world in general
[02:27:41] Technodrome: and really nothing in rails
[02:27:47] Radar: Technodrome: Wordpress.
[02:28:02] Technodrome: yes, but we are at the same problem, php
[02:28:10] Radar: Yup. Why is that a problem?
[02:28:24] Technodrome: i've been brainwashed for years to hate it? :)
[02:28:38] Radar: it is unfortunately the best solution out there for that kind of thing.
[02:28:50] Technodrome: i mean i don't hate it as much as some, but its always like, I can picture how a chunk of software would work in rails, but it would just be so much work to build it
[02:29:00] Technodrome: in fact, the man power behind it would need to be incredible
[02:29:07] moeabdol2: has joined #RubyOnRails
[02:29:07] benlieb: has joined #RubyOnRails
[02:29:16] Technodrome: Radar i think drupal 8 code wise is much better than wp
[02:29:23] Radar: Technodrome: There's also https://ghost.org/
[02:29:32] Technodrome: d8 is symfony, so its all kinda similar to rails in philosophy
[02:29:37] Radar: However, I think that's Node.JS which I dislike more than PHP.
[02:29:44] Radar: But at least Ghost is pretty.
[02:29:57] Technodrome: yes ghost is kinda cool, but again for large content organizations like yale with tons of mini sites and tons of large heavily published ones, you need a drupal or wp
[02:30:10] Technodrome: node is sorta annoying huh
[02:30:18] Radar: "sorta" doesn't cut it ;)
[02:30:27] Radar: Completely other topic though
[02:30:36] Radar: I think Drupal or Wordpress are your options.
[02:30:42] Technodrome: yeah, so you can understand my bad feelings
[02:31:17] Radar: We evaluated the options for a large blog that we maintain (just one site) and Wordpress was it.
[02:31:24] Technodrome: drupal has this thing called views , ever heard of it?
[02:31:46] Radar: no. I've fortunately stayed away from Drupal.
[02:31:47] Technodrome: its built into drupal 8 now, it was a contrib module
[02:32:36] Technodrome: well its a UI query builder, you basically build your content
[02:32:40] Technodrome: listings of content
[02:35:52] Radar: seems hard already
[02:47:52] georgedrummond: has joined #RubyOnRails
[02:48:35] pawnbox: has joined #RubyOnRails
[02:48:50] Devalo: has joined #RubyOnRails
[02:50:05] rickmasta: has joined #RubyOnRails
[02:55:26] Pathfinder: has joined #RubyOnRails
[02:56:16] ramfjord: has joined #RubyOnRails
[02:56:18] RegulationD: has joined #RubyOnRails
[02:59:35] jscheel: has joined #RubyOnRails
[03:02:27] G: has joined #RubyOnRails
[03:03:15] jscheel: has joined #RubyOnRails
[03:06:17] jscheel: has joined #RubyOnRails
[03:09:38] Technodrome: Radar making something like that would take 2 years of full time dev, literally that project is what made drupal what it is today
[03:09:55] Technodrome: so its so unrealistic to say, oh we are going to make a drupal for our clients
[03:10:01] Technodrome: its just a fantasy night dream
[03:14:10] uglybandersnatch: has joined #RubyOnRails
[03:17:20] braincrash: has joined #RubyOnRails
[03:21:37] IrishGringo: has joined #RubyOnRails
[03:22:30] marcdel: has joined #RubyOnRails
[03:24:27] WhatTheRails: has joined #RubyOnRails
[03:24:37] catcher: has joined #RubyOnRails
[03:24:47] catcher: has left #RubyOnRails: ()
[03:25:11] WhatTheRails: How can I have a virtual model attribute that references to one attribute association, if such association exists ?
[03:25:47] Dimik: has joined #RubyOnRails
[03:26:39] WhatTheRails: example: I want @user always return, besides the User attributes, the virtual “parent_name” attribute.. which happens to be a has_one association referenced by the the parent_id attribute on User”
[03:29:35] baweaver: has joined #RubyOnRails
[03:30:02] joshhbk: has joined #RubyOnRails
[03:34:02] Arcaire: Radar: >for professional bloggers
[03:34:19] Arcaire: blogging is srs bsns
[03:34:20] Radar: there are people who work here who blog professionally
[03:34:27] Arcaire: i removed all my blog posts
[03:34:30] Radar: they get paid to review things, go on tours, etc.
[03:34:32] triangles: has joined #RubyOnRails
[03:38:05] fedexo: has joined #RubyOnRails
[03:38:11] pawnbox: has joined #RubyOnRails
[03:39:42] georgedrummond: has joined #RubyOnRails
[03:40:06] Ropeney: Blogging technical content, professionally, would be good fun
[03:40:12] Radar: Tell me about it :P
[03:41:27] benlieb: has joined #RubyOnRails
[03:41:45] chipotle: has joined #RubyOnRails
[03:43:20] benlieb: has joined #RubyOnRails
[03:47:32] arBmind1: has joined #RubyOnRails
[03:48:40] Arcaire: Technodrome: tbh it'll always be in php
[03:48:47] Arcaire: php has critical mass for web languages
[03:48:55] Arcaire: maybe js in a year or three
[03:49:02] Arcaire: ruby/python are never gonna be up there really
[03:49:11] Arcaire: Ruby's hit peak and is now steady
[03:49:13] Technodrome: i am really just talking drupal in particular here or CMS
[03:49:21] Technodrome: for a SaaS , ruby / rails is great
[03:49:24] Arcaire: Python still can't find some of the people that it lost down the chasm when the 2.7/3.0 split happened
[03:49:34] hahuang61: has joined #RubyOnRails
[03:49:38] SteenJobs: if a user navigates backwards in a multi-form flow, like the onboarding flow ive been working on, and the user has_one profile, if he changes the info and then submits the form again, a new profile is created and the original one’s user_id changes to NULL - but the entry is still in the db - what’s the best way to prevent duplicates?
[03:49:42] Technodrome: i like rails better than django i think, its just a bit more rad in my opinion
[03:50:19] Arcaire: if you're looking for TOTALLY »RAD«
[03:50:22] Arcaire: I suggest Phoenix.
[03:50:33] SteenJobs: in theory during user registration, i can create a profile object and then in the onboarding flow just update the object, but seems a bit hacky
[03:50:40] Arcaire: Funny how my thought process for rad went "Fallout? Religious extremism? Oh, radical."
[03:50:51] Inside: has joined #RubyOnRails
[03:50:51] Inside: has joined #RubyOnRails
[03:50:51] zave: has joined #RubyOnRails
[03:51:02] Arcaire: SteenJobs: store it in session
[03:51:05] Arcaire: until the last step
[03:51:07] Arcaire: then commit it
[03:51:15] Meow-J: has joined #RubyOnRails
[03:51:16] Technodrome: fast for dev's or the computer Arcaire ?
[03:51:24] Arcaire: that means if someone presses back, fills in some more stuff, then goes forward again
[03:51:31] Arcaire: the stuff overwritten is just in session
[03:51:38] SteenJobs: Arcaire: oh word - i considered it but i thought i’d get yelled at for that haha
[03:51:43] Arcaire: nah that's the best way imo
[03:51:50] Arcaire: Technodrome: ?
[03:51:56] Arcaire: Both, really.
[03:52:11] Technodrome: is that a language?
[03:52:13] Arcaire: Which is very roughly "ruby on erlang"
[03:52:29] Arcaire: well, ruby on BEAM, actually, which is the erlang virtual machine
[03:52:41] SteenJobs: multiple model objects are created during this flow, so i guess i can add each of their attributes under a key for the model name, and then on the final step commit all to the db? sounds good. thanks man, cool to see how the session object is utilized.
[03:52:48] Arcaire: »#elixir-lang if you're interested
[03:53:01] Technodrome: Arcaire erlang? eeeek lol
[03:53:02] Arcaire: SteenJobs: session[:thing][:attribute]
[03:53:15] Arcaire: [:user][:name]
[03:53:24] SteenJobs: right - or session[:thing][{attributes}]
[03:53:28] SteenJobs: but yea, i gotcha
[03:53:36] Arcaire: Technodrome: Erlang yes.
[03:53:58] SteenJobs: although, it’s much harder to do piecewise validations that way - because if the object doesn’t pass validation, how do you know which stage to navigate back to to correct whatever info is invalid/missing?
[03:54:17] pawnbox: has joined #RubyOnRails
[03:55:05] Arcaire: multiple models, you said
[03:55:07] Arcaire: is it one at a time?
[03:55:23] Technodrome: Arcaire do you like it?
[03:55:28] Technodrome: how is it quicker than rails?
[03:55:40] Arcaire: It's quicker 'cause BEAM is faster.
[03:56:00] SPYGAME: has joined #RubyOnRails
[03:56:02] Arcaire: Approximately 10x faster with a fraction of the CPU load.
[03:56:36] Arcaire: http://www.littlelines.com/blog/2014/07/08/elixir-vs-ruby-showdown-phoenix-vs-rails/
[03:56:48] Arcaire: Outdated now but the only thing that's gotten faster is Phoenix, probably.
[04:00:40] duleja: has joined #RubyOnRails
[04:01:45] SteenJobs: the 4 stages go “company object (can be one of two classes) -> company object -> profile object -> profile object”
[04:01:52] SteenJobs: Arcaire: so yea i guess so
[04:04:10] Technodrome: Arcaire looks good, but rails is better to sell to clients
[04:04:40] duleja: hello, can some experienced ROR developer tell me whats a must for getting a job with ruby and rails? i have git hub 3-4 websites on heroku with responsive, back, front end all done by me and i cant even get into internship? any advice? or i am asking at the wrong place
[04:06:32] duleja: maybe some one that have experience in hiring people?
[04:07:03] tercenya: has joined #RubyOnRails
[04:07:24] Arcaire: duleja: You asked this same question yesterday under the alias rubyonrails344.
[04:07:58] baweaver: Arcaire remembers everything
[04:08:02] Arcaire: You were given advice by smathy.
[04:08:04] baweaver: _eeeeeverything_
[04:08:30] duleja: hmmm i dont hide it? but my nick was diffrent why i dont know...
[04:09:01] duleja: maybe some one else?
[04:09:08] baweaver: the point he's getting at is that smathy answered you yesterday as well as many of the rest of us.
[04:09:49] baweaver: http://logs.ryanbigg.com/RubyOnRails?date=2016-03-30#5435518
[04:09:56] duleja: i still dont know what i do wrong but ok...
[04:10:20] duleja: thx anyway
[04:10:33] baweaver: what I'm saying is that there were good answers in that
[04:10:38] baweaver: you might read back over it.
[04:11:25] duleja: i wont ask it again
[04:12:03] Arcaire: duleja: Playing that sort of tone isn't going to help, it's just irksome.
[04:12:10] Arcaire: Nobody here is going to offer you a job, for a myriad of reasons.
[04:12:22] fernando: has joined #RubyOnRails
[04:12:27] Arcaire: You were given very solid advice by someone who not only works in the field as a programmer, but also works with clientele.
[04:12:33] duleja: hmmmm i dont want to be rude? sorry?
[04:12:38] chagel: has joined #RubyOnRails
[04:12:54] duleja: i thought maybe someone else would talk it now
[04:12:57] duleja: if not thats fine
[04:13:11] Arcaire: smathy's advice is spot-on in the eyes of pretty much anyone in this channel who is experienced.
[04:13:30] duleja: he told me to go meet people... i wish i can... but like i said nvm
[04:13:42] bronson: has joined #RubyOnRails
[04:13:48] duleja: not trying to be rude here...
[04:14:02] Arcaire: If you have a couple projects that are well-implemented and are showing them off, the issue is probably elsewhere: You're not presenting yourself well, you have spelling or grammatical errors on your resume (huge one), you have nobody to vouch for you (big one).
[04:14:50] Arcaire: You can't go and meet people? Why not? Is there no Rails meetup near you? Have you looked?
[04:15:27] duleja: you are kind
[04:15:33] duleja: but i just cant
[04:15:45] Arcaire: That's not a particularly useful answer.
[04:16:10] Arcaire: Having nobody to vouch for you or introduce you to prospective employers is a severe hindrance.
[04:16:24] duleja: so how to over come it?
[04:16:32] baweaver: duleja: where are you located?
[04:16:56] uglybandersnatch: has joined #RubyOnRails
[04:17:02] duleja: thank you all for real
[04:17:13] duleja: thought someone else will have something else to say
[04:17:25] baweaver: http://www.meetup.com/Ruby-Serbia/
[04:17:37] duleja: sorry if i was RUDE? or something...
[04:17:45] baweaver: first, folding over like that and apologizing for everything does not do you any favors
[04:18:17] baweaver: second, we're giving you advice and other members and professionals would give much the same.
[04:18:28] SteenJobs: Arcaire: i guess somehow i have to mark each stage so if the validations fail, it’ll know which stage to navigate back to
[04:18:36] andrewkwon: has joined #RubyOnRails
[04:19:12] baweaver: Remote jobs are also incredibly hard to get unless you have 5+ years of experience
[04:19:24] baweaver: or enough chops to make that irrelevant, which is rare and hard
[04:19:57] baweaver: Find Serbian programming meetups and go to them
[04:20:09] baweaver: If you can't find any nearby, try and get to an area where there are some.
[04:20:28] duleja: ok baweaver
[04:22:01] SteenJobs: Arcaire: also check this out - https://github.com/schneems/wicked/wiki/Building-Partial-Objects-Step-by-Step#great-but. is it just me or is there a glaring mistake in this guide…the updated ‘status’ won’t be committed to the db before the rest of the params, so when those params go through validation, the model won’t know the updated status of the object until it’s already saved.
[04:23:32] Arcaire: SteenJobs: I've never used Wicked, unfortunately.
[04:23:35] Arcaire: You'll have to defer to someone else.
[04:24:00] SteenJobs: neither have I, but i was reading the guide for partial validations to see what i could learn, and this bit frustrated me because it seemed like either it was a glaring mistake or i’m missing something obvious
[04:25:40] syndikate: has joined #RubyOnRails
[04:25:59] SteenJobs: Arcaire: eh, it seems either i can do partial validations but end up with duplicates, or do one final validation and no duplicates, but then have the validation problem. i’ll figure it out, your help has been absolute gold.
[04:26:30] Arcaire: You hear that, Radar?
[04:26:39] Radar: I hear everything.
[04:26:47] Arcaire: I guess you'd be a pretty shit radar if you didn't.
[04:27:11] Radar: SteenJobs: You could also use Reform for each step of the process.
[04:27:51] SteenJobs: seriously, i’ve learned a shit ton today by trudging through this with your guys’ help
[04:27:51] Radar: Instead of Wicked.
[04:27:58] SteenJobs: i’m actually not using wicked
[04:28:07] SteenJobs: i had already swung my own implementation before i knew wicked existed
[04:28:16] SteenJobs: so i continued down that path for education’s sake
[04:32:14] zave: has joined #RubyOnRails
[04:32:56] rakm: has joined #RubyOnRails
[04:35:02] jenrzzz: has joined #RubyOnRails
[04:38:19] Palsson: has joined #RubyOnRails
[04:40:27] hxegon: has joined #RubyOnRails
[04:43:39] Pathfinder: has joined #RubyOnRails
[04:54:01] merida: has joined #RubyOnRails
[04:54:19] duncannz: has joined #RubyOnRails
[04:56:14] SteenJobs: weiiirdest thing - my user object has brand_id = nil, yet user.brand returns the associated brand object that was created using “brand = user.build_brand; brand.save” (user belongs_to brand)
[04:56:52] marcdel: has joined #RubyOnRails
[05:02:08] Ropeney: can you gist where you are seeing it has an associated brand, and the code SteenJobs ?
[05:02:39] yfeldblum: has joined #RubyOnRails
[05:02:46] SteenJobs: Ropeney: was playing around in console - but it seems that if i run user.save in addition to brand.save, the foreign key is then recorded on the user entry
[05:03:17] Ropeney: if you do user.build, then calling user.save should save its built objects
[05:05:07] triangles2: has joined #RubyOnRails
[05:18:37] sp1rs: has joined #RubyOnRails
[05:18:54] someish: has joined #RubyOnRails
[05:19:10] Devalo: has joined #RubyOnRails
[05:19:51] uglybandersnatch: has joined #RubyOnRails
[05:28:14] SteenJobs: Ropeney: why would i be doing user.build, i’m not sure i understand what you mean
[05:28:18] SteenJobs: i’m not building a user….
[05:28:32] Ropeney: brand = user.build_brand
[05:28:38] Ropeney: user.build_....
[05:28:39] SteenJobs: ya man, that’s not building a user
[05:28:50] SteenJobs: that’s building a brand
[05:28:53] SteenJobs: to which a user belongs
[05:29:04] Ropeney: as for, its built by user
[05:29:27] Ropeney: so calling user.save, saves its built objects
[05:29:40] SteenJobs: generally the classic syntax for a has_many/belongs_to is having the Parent and building its child
[05:29:53] SteenJobs: in this case it was a bit funky, because i had the child object, the user, but the parent object hadn’t been built yet
[05:30:01] SteenJobs: so needed to do it in the reverse direction
[05:30:14] SteenJobs: and i guess because of that, i had to save both the brand AND the user object
[05:30:21] Ropeney: if you do user.build_brand, user.save should save the brand
[05:30:26] Ropeney: if its valid
[05:30:49] SteenJobs: oh interresting - since the brand is a built object from the user, it’ll be incorporated in the user.save?
[05:31:17] SteenJobs: ah i guess that makes sense why i didn’t realize
[05:31:47] aganov: has joined #RubyOnRails
[05:31:59] Ropeney: i should have been more clear with my 'user.build' statement, would 'user.build_x' been more clear?
[05:32:14] SteenJobs: because usually when it’s Parent.child.build, you intuitively save the object doing the building, but since it’s the reverse here, you also have to swtich which object you’re saving based on which object is doing the building
[05:32:21] SteenJobs: Ropeney: i thought you thought i was creating a user
[05:32:43] Ropeney: okay cool, will try be clearer next time :D
[05:33:30] jglover: has joined #RubyOnRails
[05:34:05] techsethi: has joined #RubyOnRails
[05:34:21] SteenJobs: nah you’re good
[05:34:39] jglover: has joined #RubyOnRails
[05:34:44] SteenJobs: i’m just a bit irrate cause i’ve been working on this damn onboarding flow for like 13hrs straight today
[05:34:53] SteenJobs: and there’s so much hackiness that it feels a bit dirty
[05:34:56] SteenJobs: but time to sleep!
[05:35:11] jglover: im saving a model and it fails validations, with errors... but somehow #save returns true
[05:35:22] jglover: that's not normal, right?
[05:36:40] SPYGAME: are you doing client side validations alone ?
[05:36:58] jglover: no, this is a back end validation only
[05:37:15] Ropeney: its saving, but failing, but returns true? Whats failing? Can you gist?
[05:38:31] jglover: sure one second.
[05:41:14] hahuang61: has joined #RubyOnRails
[05:41:54] Pathfinder: has joined #RubyOnRails
[05:42:22] jglover: https://gist.github.com/jonahglover/fb52c2877337742893495d4695c29217
[05:42:57] jglover: seems reasonable, eh?
[05:44:26] SPYGAME: jglover: does email.rb inherits from activerecord ?
[05:44:41] jglover: in fact, other validations seem to work
[05:44:50] SteenJobs: has joined #RubyOnRails
[05:44:55] SPYGAME: then why don't you use unique: true for validation ?
[05:45:45] SPYGAME: http://guides.rubyonrails.org/active_record_validations.html#uniqueness
[05:46:00] Cohedrin_: jglover: It's giving you an error message?
[05:46:11] Cohedrin_: if you do @email.errors, what does it give you
[05:46:21] jglover: hash with the error
[05:46:26] jglover: but @email.save was true
[05:46:45] Cohedrin_: and if you put a puts right before that with a log message
[05:46:48] Cohedrin_: does it print out?
[05:46:59] jglover: i have a byebug
[05:47:06] SPYGAME: the question remains. why do you have to write your own validation ?
[05:47:22] Cohedrin_: is general a field in the model?
[05:47:28] jglover: spygame: there is some extra logic required.
[05:47:38] jglover: Cohedrin_: nope
[05:47:42] jglover: do i need that?
[05:47:44] Cohedrin_: jglover, thats the problem
[05:47:49] Cohedrin_: if you want to just return an error
[05:47:54] Cohedrin_: then you need to use :base
[05:49:34] jglover: alright, thanks. ill give it a s hot
[05:50:45] alex88: has joined #RubyOnRails
[05:51:49] solars: has joined #RubyOnRails
[05:52:33] moeabdol: has joined #RubyOnRails
[05:55:26] moeabdol1: has joined #RubyOnRails
[06:03:15] pawnbox: has joined #RubyOnRails
[06:08:44] techsethi: has joined #RubyOnRails
[06:10:43] solars: has joined #RubyOnRails
[06:13:31] jstransky: has joined #RubyOnRails
[06:15:54] bronson: has joined #RubyOnRails
[06:17:38] Technodrome: has joined #RubyOnRails
[06:19:13] gingray: has joined #RubyOnRails
[06:20:31] pawnbox: has joined #RubyOnRails
[06:21:16] uglybandersnatch: has joined #RubyOnRails
[06:21:18] SanguineAnomaly: has joined #RubyOnRails
[06:27:26] SanguineAnomaly: has joined #RubyOnRails
[06:28:19] comrad: has joined #RubyOnRails
[06:29:48] denaras: has joined #RubyOnRails
[06:30:54] techsethi: has joined #RubyOnRails
[06:32:32] tvw: has joined #RubyOnRails
[06:32:58] tvw: has joined #RubyOnRails
[06:35:39] AnoHito_: has joined #RubyOnRails
[06:39:15] chouhoulis: has joined #RubyOnRails
[06:41:47] ur5us: has joined #RubyOnRails
[06:43:07] jstransky: has joined #RubyOnRails
[06:45:44] pawnbox: has joined #RubyOnRails
[06:47:02] choke: has joined #RubyOnRails
[06:47:40] qhp: has joined #RubyOnRails
[06:51:27] Pazician: has joined #RubyOnRails
[06:51:27] Pazician: has joined #RubyOnRails
[06:52:09] sandstrom: has joined #RubyOnRails
[06:56:06] sergey_makagon: has joined #RubyOnRails
[06:59:30] DoubleMalt: has joined #RubyOnRails
[07:04:52] sadaf2606: has joined #RubyOnRails
[07:05:44] mark2: has joined #RubyOnRails
[07:06:36] sevenseacat: has joined #RubyOnRails
[07:08:44] AlexJakeGreen: has joined #RubyOnRails
[07:08:59] bruce_lee: has joined #RubyOnRails
[07:08:59] bruce_lee: has joined #RubyOnRails
[07:12:58] ur5us: has joined #RubyOnRails
[07:17:43] foucist: has joined #RubyOnRails
[07:20:37] nartes: has joined #RubyOnRails
[07:23:01] krz: has joined #RubyOnRails
[07:23:06] triangles2: has left #RubyOnRails: ()
[07:23:45] triangles: has joined #RubyOnRails
[07:26:09] sandstrom: has joined #RubyOnRails
[07:29:48] merida: has joined #RubyOnRails
[07:32:46] djbkd: has joined #RubyOnRails
[07:37:41] Pathfinder: has joined #RubyOnRails
[07:39:28] Palsson: has joined #RubyOnRails
[07:40:28] chouhoulis: has joined #RubyOnRails
[07:43:00] dionysus69: has joined #RubyOnRails
[07:47:53] artto: has joined #RubyOnRails
[07:48:00] Guest12: has joined #RubyOnRails
[07:48:20] srinidhi: has joined #RubyOnRails
[07:51:23] edwinvdgraaf: has joined #RubyOnRails
[07:55:25] Dreamer3: has joined #RubyOnRails
[07:56:39] Ergo: has joined #RubyOnRails
[07:57:06] uglybandersnatch: has joined #RubyOnRails
[07:57:26] artto: has joined #RubyOnRails
[08:01:00] AimlessRAven: has joined #RubyOnRails
[08:01:44] mikecmpbll: has joined #RubyOnRails
[08:02:29] AimlessRAven: hi all, here is my code https://gist.github.com/anonymous/d1dfd75c244022210653654958a20a5c this is for prices, if procut have 1 price, i want this price to be selected, but if have 2 or more prices i want second price to always be selected
[08:03:15] moeabdol1: has joined #RubyOnRails
[08:05:40] mrbubbles: has joined #RubyOnRails
[08:07:49] foucist: AimlessRaven: (brand.available_products == 1 || index == 1 ? "true" : "false")
[08:07:58] foucist: kind of hacky but could potentially do that i guess
[08:09:07] jenrzzz: has joined #RubyOnRails
[08:09:07] jenrzzz: has joined #RubyOnRails
[08:09:22] AimlessRAven: foucist: ran available product is always 1
[08:09:55] AimlessRAven: if product have 1 price, this price to be selected. if product have 2 or 3 or 4 prices, i want second price to be selected
[08:12:09] adre: has joined #RubyOnRails
[08:12:26] foucist: so you have product.prices as an array?
[08:12:50] foucist: i forget what spree does here
[08:15:52] darutoko: has joined #RubyOnRails
[08:16:17] baweaver: has joined #RubyOnRails
[08:16:28] quazimodo: has joined #RubyOnRails
[08:16:32] AimlessRAven: foucist: yea its a array
[08:16:38] AimlessRAven: product.prices
[08:18:12] bronson: has joined #RubyOnRails
[08:18:32] blackhuey: has joined #RubyOnRails
[08:19:00] foucist: AimlessRaven: well i mean that bit of code is just listing all the products, it's not listing their prices is it?
[08:19:00] AimlessRAven: foucist: (brand.available_products == 1 || index == 1 ? "true" : "false") ok this make my second sum always selected, but if product have 1 price
[08:19:38] foucist: well you could do (product.prices.size == 1 || index == 1 ? "true" : "false") maybe
[08:20:23] foucist: current code is only showing 1 price per product though right? just the price_min ?
[08:20:56] foucist: but you want to show all the prices? or return the second price instead of price_min ?
[08:21:48] pawnbox: has joined #RubyOnRails
[08:24:03] ferr: has joined #RubyOnRails
[08:24:55] Spami: has joined #RubyOnRails
[08:25:43] Ropeney: has joined #RubyOnRails
[08:25:48] AimlessRAven: helpa: are you here ?
[08:26:09] adaedra: It's a bot, it's always here.
[08:27:58] moep: has joined #RubyOnRails
[08:28:12] jsrn: has joined #RubyOnRails
[08:29:52] marr: has joined #RubyOnRails
[08:32:30] Spami_: has joined #RubyOnRails
[08:36:55] Spami: has joined #RubyOnRails
[08:39:28] jenrzzz: has joined #RubyOnRails
[08:39:28] jenrzzz: has joined #RubyOnRails
[08:41:14] chouhoulis: has joined #RubyOnRails
[08:44:48] Megamos: has joined #RubyOnRails
[08:46:29] sevenseacat: has joined #RubyOnRails
[08:47:16] ferr: has joined #RubyOnRails
[08:47:25] qhp: has joined #RubyOnRails
[08:48:55] marr: has joined #RubyOnRails
[08:49:07] vale_tudo: has joined #RubyOnRails
[08:50:04] GitGud: has joined #RubyOnRails
[08:50:25] ql6wlld: has joined #RubyOnRails
[08:50:37] fernandomm: has joined #RubyOnRails
[08:54:40] pawnbox: has joined #RubyOnRails
[08:55:24] skislak: has joined #RubyOnRails
[08:58:29] RegulationD: has joined #RubyOnRails
[08:58:34] bruce_lee: has joined #RubyOnRails
[09:00:46] rrawlins: has joined #RubyOnRails
[09:01:57] defsdoor: has joined #RubyOnRails
[09:03:41] dpg1: has joined #RubyOnRails
[09:05:34] ur5us: has joined #RubyOnRails
[09:10:43] snowy: has joined #RubyOnRails
[09:13:32] sp1rs: has joined #RubyOnRails
[09:16:03] polll: has joined #RubyOnRails
[09:16:31] quazimodo: has joined #RubyOnRails
[09:17:00] artto: has joined #RubyOnRails
[09:17:01] GriffinHeart: has joined #RubyOnRails
[09:18:35] Ergo^: has joined #RubyOnRails
[09:24:20] chagel: has joined #RubyOnRails
[09:29:17] patrick_star_3: has joined #RubyOnRails
[09:29:35] blackmes1: has joined #RubyOnRails
[09:37:35] arBmind: has joined #RubyOnRails
[09:38:09] qhp: has joined #RubyOnRails
[09:40:33] GitGud: has joined #RubyOnRails
[09:42:32] mikecmpbll: has joined #RubyOnRails
[09:43:19] chouhoulis: has joined #RubyOnRails
[09:44:30] mosez: has joined #RubyOnRails
[09:45:46] Spami: has joined #RubyOnRails
[09:45:58] merida: has joined #RubyOnRails
[09:49:06] artto: has joined #RubyOnRails
[09:49:34] TvL2386: has joined #RubyOnRails
[09:50:21] triangles2: has joined #RubyOnRails
[09:50:27] TvL2386: hi guys, I'm using rails-5.0.0.beta3 and have added 'haml' to the Gemfile... How can I get `rails g scaffold` to automatically create haml instead of erb templates?
[09:50:31] DuneMan: has joined #RubyOnRails
[09:51:16] sevenseacat: TvL2386: by using the haml-rails gem
[09:51:37] triangles2: has joined #RubyOnRails
[09:52:23] TvL2386: sevenseacat, ah cool thanks!!!!
[09:52:49] triangles2: has joined #RubyOnRails
[09:53:00] pawnbox: has joined #RubyOnRails
[09:53:36] triangles2: has joined #RubyOnRails
[09:54:26] triangles2: has joined #RubyOnRails
[10:00:51] FooMunki: has joined #RubyOnRails
[10:01:15] lxsameer: has joined #RubyOnRails
[10:01:20] braveheart2: has joined #RubyOnRails
[10:02:24] solars: if I have exclude = Item.where(date: date), how can I exclude all these records in another query on the same model, like Item.where(color: 'green')... ? do I have to use 'id not in' or is there a shorthand that let's me directly use the other relation?
[10:04:11] shibly: has joined #RubyOnRails
[10:05:53] QualityAddict: has joined #RubyOnRails
[10:08:56] scepticulous: has joined #RubyOnRails
[10:12:25] ur5us: has joined #RubyOnRails
[10:12:33] yfeldblum: has joined #RubyOnRails
[10:12:38] workmad3: solars: what version of rails are you using?
[10:15:39] pawnbox: has joined #RubyOnRails
[10:15:54] quazimodo: is it unusual for request.env['REMOTE_ADDR'] to return 127.0.0.1 on prod env, such as an ec2 instance via aws beanstalk ?
[10:16:16] quazimodo: i didn't expect that, i can only guess something like nginx is rewriting it in that env
[10:17:01] solars: workmad3, 4.2 - I noticed it works if I just use where.not(id: otherrelation)
[10:17:20] workmad3: solars: yeah, that was what I was about to suggest :)
[10:17:22] baweaver: has joined #RubyOnRails
[10:17:54] workmad3: solars: well, I was gonna say you may need to put `exclude.select(:id)` to be sure the subquery generates correctly, but I'm guessing you don't
[10:18:22] Coldblackice_: has joined #RubyOnRails
[10:19:08] workmad3: quazimodo: if you're behind a local proxy of some form, that's exactly what you should expect... but `request.remote_ip` should pick up a sensible value from the `X-Forwarded-For` headers added by proxies
[10:20:17] bronson: has joined #RubyOnRails
[10:24:25] nfk: has joined #RubyOnRails
[10:25:10] Ergo: has joined #RubyOnRails
[10:25:37] shibly: has left #RubyOnRails: ()
[10:36:56] solars: workmad3, thanks for the suggestion - it worked without though
[10:37:36] arup_r: has joined #RubyOnRails
[10:38:13] arBmind: has joined #RubyOnRails
[10:40:42] FooMunki: has joined #RubyOnRails
[10:44:01] chouhoulis: has joined #RubyOnRails
[10:47:26] c355E3B: has joined #RubyOnRails
[10:51:08] artto: has joined #RubyOnRails
[10:51:41] Veejay: has joined #RubyOnRails
[10:57:16] owaiswiz: has joined #RubyOnRails
[10:59:15] RegulationD: has joined #RubyOnRails
[10:59:16] sandstrom: has joined #RubyOnRails
[11:00:00] spiman: has joined #RubyOnRails
[11:00:03] Macaveli: has joined #RubyOnRails
[11:02:30] finnnnnnnnnnn: has joined #RubyOnRails
[11:02:51] kriskhaira: has joined #RubyOnRails
[11:03:10] nighttime: has joined #RubyOnRails
[11:04:53] finnnnnnnnnnn: migration question. I’m adding a belongs_to relationship to an existing model. my order model will belong_to an store model. When generating the corresponding relationship which table do I add the refernce to?
[11:08:45] Rahul_Roy: has joined #RubyOnRails
[11:09:06] apeiros: A.belong_to B means that A has a column b_id with an id of B
[11:10:08] rodfersou: has joined #RubyOnRails
[11:12:20] Rahul_Roy: Hi, Guys! I have an issue. I've used rails-api gem to generate new rails api only application. The problem is that rails-api is getting merged into rails 5 and is no longer getting maintained. Also, there’s no way to generate api only application with rails 4.
[11:12:51] Rahul_Roy: If we go with rails 4.2, then would it possible to upgrade rails 4.2 application to rails 5 api only application?
[11:13:08] Rahul_Roy: What would be the recommended path to build an api-only rails application?
[11:14:02] finnnnnnnnnnn: apeiros thanks, so my migration would be - rails generate migration AddStoreRefToOrders store:references ?
[11:14:39] apeiros: I usually don't generate the content of my migrations, but that looks correct
[11:14:42] michael_mbp: has joined #RubyOnRails
[11:15:16] spiman_: has joined #RubyOnRails
[11:16:09] Devalo: has joined #RubyOnRails
[11:18:13] trinaldi: has joined #RubyOnRails
[11:20:32] finnnnnnnnnnn: apeiros: thanks mucho
[11:27:24] tvw: has joined #RubyOnRails
[11:27:59] artto: has joined #RubyOnRails
[11:28:33] ldnunes: has joined #RubyOnRails
[11:29:48] ferr: Hey guys, new assets are not being precompiles in my production environment, any tips? https://gist.github.com/Fercell/6e236dd0de1e90bb201fa5aa20d1637a
[11:30:12] HisShadow: has joined #RubyOnRails
[11:30:58] HisShadow: Hello. I got a problem: I'm trying to destroy a record from console, but destroy method returns an array [false, number], number seems like some sort of counter
[11:37:19] srinidhi: has joined #RubyOnRails
[11:37:59] sevenseacat: has joined #RubyOnRails
[11:41:54] chagel: has joined #RubyOnRails
[11:43:40] krz: has joined #RubyOnRails
[11:44:57] chouhoulis: has joined #RubyOnRails
[11:45:53] akshat: has joined #RubyOnRails
[11:47:06] HisShadow: has left #RubyOnRails: ()
[11:47:17] flashpoint9: has joined #RubyOnRails
[11:49:17] rodferso1: has joined #RubyOnRails
[11:50:36] quazimodo: has joined #RubyOnRails
[11:53:56] pawnbox: has joined #RubyOnRails
[11:58:21] artto: has joined #RubyOnRails
[11:59:33] sudoubuntu: has joined #RubyOnRails
[12:01:49] King_Rex: has joined #RubyOnRails
[12:02:04] dionysus69: has joined #RubyOnRails
[12:02:06] pawnbox: has joined #RubyOnRails
[12:02:44] renegadeandy: has joined #RubyOnRails
[12:03:32] vale_tudo: has joined #RubyOnRails
[12:04:32] uglybandersnatch: has joined #RubyOnRails
[12:06:15] Ropeney: has joined #RubyOnRails
[12:09:42] volCat: has joined #RubyOnRails
[12:11:30] SPYGAME: has joined #RubyOnRails
[12:11:32] King_Rex: has joined #RubyOnRails
[12:11:46] sp1rs: has joined #RubyOnRails
[12:14:28] _Tariq: has joined #RubyOnRails
[12:14:55] AntiSpamMeta: has joined #RubyOnRails
[12:17:25] GodFather: has joined #RubyOnRails
[12:18:13] baweaver: has joined #RubyOnRails
[12:22:04] bronson: has joined #RubyOnRails
[12:24:41] Donkoko: has joined #RubyOnRails
[12:29:18] sudoubuntu: has joined #RubyOnRails
[12:31:16] flashpoint9: has joined #RubyOnRails
[12:31:58] aloneintheworld: has joined #RubyOnRails
[12:32:54] nfk|laptop: has joined #RubyOnRails
[12:33:21] merida: has joined #RubyOnRails
[12:34:50] arup_r: has joined #RubyOnRails
[12:37:23] Ropeney_: has joined #RubyOnRails
[12:39:29] georgedrummond: has joined #RubyOnRails
[12:39:55] arup_r: has joined #RubyOnRails
[12:40:33] Gkj8899: has joined #RubyOnRails
[12:43:45] arup_r: has joined #RubyOnRails
[12:45:31] chouhoulis: has joined #RubyOnRails
[12:45:32] IrishGringo: has joined #RubyOnRails
[12:46:56] pawnbox: has joined #RubyOnRails
[12:47:41] nfk|laptop: i'm using angular as frontend and rails as backend as per a certain tutorial that seems fairly new but rails is telling me to include 'responders' gem which makes me suspect that perhaps what i'm trying to do has a better alternative?
[12:47:57] sevenseacat: depends on what you're trying to do
[12:48:52] nfk|laptop: the default route serves the angular app, everything else should be just JSON API
[12:49:38] sevenseacat: and what problem are you having with that?
[12:50:16] rrawlins: has joined #RubyOnRails
[12:50:25] jas02: has joined #RubyOnRails
[12:50:30] nfk|laptop: per that tutorial i'm using respond_with in my controller and rails is telling me to add responders gem which makes me suspect that perhaps rails has something better now
[12:50:40] nfk|laptop: like jbuilder (not that i know what exactly it does)
[12:50:51] sevenseacat: i dont know what 'that tutorial' is, so this is all very vague
[12:51:07] sevenseacat: responders is good, but not for a json api
[12:52:15] tpendragon: has joined #RubyOnRails
[12:52:23] nfk|laptop: https://thinkster.io/angular-rails
[12:52:43] sevenseacat: ctrl+f responders -> not found
[12:53:07] _Tariq: has joined #RubyOnRails
[12:53:13] nfk|laptop: yeah, the tutorial doesn't seem to mention it
[12:53:34] nfk|laptop: which is what made me suspect that the tutorial might not be entirely up to speed with rails
[12:54:20] nfk|laptop: btw, do i correctly understand that using jbuilder is as simple as having a view that ends with json instead of erb?
[12:54:36] sevenseacat: its not that simple, no
[12:54:42] sevenseacat: and i dont know what *is* mentioning it if not the tutorial you're following
[12:55:34] nfk|laptop: sevenseacat, i am following it and rails is throwing a routing error telling me to install responders gem
[12:55:48] sevenseacat: can you gist that error?
[12:56:06] n008f4g_: has joined #RubyOnRails
[12:56:21] nfk|laptop: it's literally 'respond_to' feature has been extracted to the 'responders' gem. yadaya
[12:56:44] sevenseacat: i'll take that as a no
[12:56:57] pawnbox: has joined #RubyOnRails
[12:58:05] snowy: has joined #RubyOnRails
[12:58:11] pawnbox: has joined #RubyOnRails
[13:00:14] jas02: has joined #RubyOnRails
[13:00:24] jas02: has left #RubyOnRails: ()
[13:02:20] SeanLazer: has joined #RubyOnRails
[13:03:19] dvinciguerra__: has joined #RubyOnRails
[13:03:33] alfie_max15: has joined #RubyOnRails
[13:04:16] alfie_max15: i'm getting an missing template error in testing post requests to create/update methods using rspec
[13:04:50] sevenseacat: can you gist the error, and the code causing it?
[13:05:21] alfie_max15: sure, one sec please
[13:09:43] Ropeney: sevenseacat, howd first day of challenge go?
[13:10:36] sevenseacat: ropeney: i did it :)
[13:10:39] alfie_max15: sevenseacat, https://gist.github.com/alfie-max/87830d89cb90bb1bf6158264ee27f458
[13:10:56] alfie_max15: here's the gist
[13:11:04] alfie_max15: i've added the error message too
[13:11:14] Ropeney: so we expecting a close to finished book by end of month? :D
[13:11:51] sevenseacat: alfie_max15: can you remove the && return ?
[13:11:53] drbayer: has joined #RubyOnRails
[13:12:01] sevenseacat: ropeney: haha I wish
[13:13:20] alfie_max15: wow, that worked
[13:13:33] Ropeney: A good metric would be if you recorded how long it took and see how much you improve by the end
[13:13:37] aegis3121: has joined #RubyOnRails
[13:13:43] alfie_max15: but i've confused, should't i actually return the control if i'm redirecting?
[13:14:02] sevenseacat: i think you'll find you're not doing that
[13:14:10] blackmesa: has joined #RubyOnRails
[13:14:36] alfie_max15: sevenseacat, was that for me?
[13:14:37] arsnail: has joined #RubyOnRails
[13:14:37] nfk|laptop: i was talking to a colleague about php frameworks and accidentally wrote /foo.php as URL and Rails did not error out, wtf
[13:14:43] sevenseacat: i think lack of parentheses means you're doing redirect_to(article && return)
[13:15:12] sevenseacat: nfk|laptop: I'd expect a missing template error
[13:15:21] ekinmur: has joined #RubyOnRails
[13:15:30] nfk|laptop: but it returned [] which is the same output as .json is giving right now
[13:15:47] nfk|laptop: no, 4.latest
[13:16:06] sevenseacat: gist the logs?
[13:16:17] Ropeney: definitely blows up on 4 for me :)
[13:16:20] nfk|laptop: i don't have a github account
[13:17:02] nfk|laptop: Rendered students/index.json.jbuilder (0.9ms)
[13:17:09] chagel: has joined #RubyOnRails
[13:17:10] Devalo: has joined #RubyOnRails
[13:17:12] nfk|laptop: did i cock up?
[13:17:12] sevenseacat: gist the logs?
[13:17:44] nfk|laptop: i did GET /students.php and it rendered students/index.json.jbuilder
[13:18:09] sevenseacat: nfk|laptop: thats the third time you've been completely unhelpful and not followed a simple directive.
[13:18:13] sevenseacat: i'd call that cocking up.
[13:18:31] Ropeney: if you have a valid route /students, then /students.php won't blow up
[13:18:31] nfk|laptop: there's nothing else to report, no errors, no nothing
[13:18:47] alfie_max15: sevenseacat, thanks. that was the reason. how silly of me
[13:18:49] sevenseacat: nfk|laptop: you're on your last warning.
[13:19:23] nfk|laptop: naturally i have resources :students, only: [:index, :show, :create]
[13:19:45] Ropeney: .php would be in your format, since it uses REST routes
[13:20:13] Ropeney: so I feel, no error if you have that path is appropriate 'foo.php' if u don't have foo, isn't
[13:20:37] helpa: If you don't provide any code, it becomes really difficult for us to help you. Providing code to reproduce the problem increases your chances of getting great, accurate help immensely.
[13:20:57] Ropeney: I think you can do any extension, that doesn't have a registered mime type
[13:21:26] nfk|laptop: that sounds a bit weird
[13:21:48] nfk|laptop: why would it not be weird?
[13:21:52] yellow5: has joined #RubyOnRails
[13:22:27] Ropeney: your claiming it, designers chose to make it so; it seems. So I feel onus is on you.
[13:22:35] aganov: has joined #RubyOnRails
[13:22:50] sp1rs: has joined #RubyOnRails
[13:23:04] nfk|laptop: i'm not even going to waste my time on reading up what onus means
[13:23:24] Ropeney: I think if you do routes, itll do /:action/:id.:format
[13:23:27] sevenseacat: nfk|laptop: be civil.
[13:23:28] Ropeney: making it a valid url
[13:24:26] nfk|laptop: sevenseacat, i am being civil
[13:24:49] nfk|laptop: i just honestly said that i'm not spending like half a minute to wiki some fancy word
[13:25:17] adaedra: Even if onus is on you to look up this word.
[13:25:23] sevenseacat: ropeney is right though, the onus is on you
[13:25:40] sevenseacat: you're the one making the claim of weirdness, you prove it
[13:25:48] nfk|laptop: it better not mean "the burden is on you" as i inferred
[13:25:56] nfk|laptop: ah, so i was right, wasn't it?
[13:26:03] nfk|laptop: see, waste of time
[13:26:36] sevenseacat: starting to think trying to converse with you is a waste of time
[13:27:28] nfk|laptop: こちらこそ
[13:28:05] Ropeney: then what are you doing here?
[13:28:13] Donkoko: has joined #RubyOnRails
[13:28:25] apeiros: nfk|laptop: you'd have probably gotten a kick for that in #ruby
[13:28:36] alfie_max15: has left #RubyOnRails: ("Ex-Chat")
[13:28:44] artto: has joined #RubyOnRails
[13:29:02] nfk|laptop: apeiros, why?
[13:29:05] someish: has joined #RubyOnRails
[13:29:26] apeiros: I won't make the mistake and waste my time conversing with you :-p
[13:30:08] Donkoko: has joined #RubyOnRails
[13:32:10] krz: has joined #RubyOnRails
[13:39:36] adlerdias: has joined #RubyOnRails
[13:42:04] alfie_max15: has joined #RubyOnRails
[13:42:11] chouhoulis: has joined #RubyOnRails
[13:42:42] twilling: has joined #RubyOnRails
[13:44:24] arup_r: has joined #RubyOnRails
[13:47:06] AlexJakeGreen: has joined #RubyOnRails
[13:47:18] Rixius: has joined #RubyOnRails
[13:56:09] hardtail: has joined #RubyOnRails
[13:57:34] triangles: has joined #RubyOnRails
[13:57:45] siaW: hello everyone!
[13:58:37] GitGud: has joined #RubyOnRails
[13:58:56] Ropeney: hello siaw
[13:59:30] siaW: today i got curious. wrote a silly gem following a tutorial on rubygems.org
[13:59:30] siaW: https://rubygems.org/gems/sayhello
[13:59:43] siaW: minutes after publishing
[13:59:47] siaW: 28 downloads
[14:00:03] siaW: this doen’t make any sense to me
[14:00:21] Ropeney: like npm's padding gem :P
[14:00:39] siaW: does this mean the download figures are bumped and not actual stats? if that’s the case then it’s not really cool
[14:01:07] Ropeney: idk how it measures if gem mirrors sync with rubygems
[14:01:10] sevenseacat: mirroring, likely.
[14:01:50] bronson: has joined #RubyOnRails
[14:02:48] twilling: has joined #RubyOnRails
[14:03:09] CodaBrink: has joined #RubyOnRails
[14:04:54] alfie_max15: has joined #RubyOnRails
[14:07:47] Silox|: has joined #RubyOnRails
[14:10:49] stannard: has joined #RubyOnRails
[14:10:58] LeoDee: has joined #RubyOnRails
[14:11:51] pagios: has joined #RubyOnRails
[14:11:59] pagios: hello, i have a field that reads a date in utc format, i would like to create a query to select the dates that happen to be a friday, what is the best way to do it thanks. using activerecord wday ==5 diddnt work
[14:12:34] joshkovach: has joined #RubyOnRails
[14:12:42] alfie_max15: has left #RubyOnRails: ()
[14:12:43] alfie_max15: has joined #RubyOnRails
[14:13:27] arup_r: pagios: what is the RDBMS you are using in your app?
[14:13:30] hxegon: has joined #RubyOnRails
[14:15:29] arup_r: so.. try something like `.where("DAYNAME(date_column) = ?", 'Friday')`
[14:15:32] Ropeney: pagios, i wonder if https://github.com/mojombo/chronic will do for you
[14:15:38] snowy: has joined #RubyOnRails
[14:16:03] arup_r: pagios: https://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_day
[14:16:30] apeiros: oh, cross poster
[14:16:55] n1lo: has joined #RubyOnRails
[14:17:12] Martyn: has joined #RubyOnRails
[14:18:12] workmad3: has joined #RubyOnRails
[14:18:23] Rubie: has joined #RubyOnRails
[14:20:41] barajasfab: has joined #RubyOnRails
[14:20:45] cpruitt: has joined #RubyOnRails
[14:22:16] alfie_max15: has left #RubyOnRails: ()
[14:25:46] sypheren: has joined #RubyOnRails
[14:28:04] pagios: arup_r, date_column or date
[14:28:29] arup_r: pagios: what is your column name? :) Put that column name.
[14:28:56] akshat: has joined #RubyOnRails
[14:28:56] pagios: not working
[14:29:08] pagios: .where("DAYNAME(date_column) = ?", "Friday")`
[14:29:33] pagios: arup_r, ^
[14:30:00] arup_r: pagios: What is your column name?
[14:30:15] pagios: date i tried .where("DAYNAME(date = ?", "Friday")`
[14:30:51] RegulationD: has joined #RubyOnRails
[14:30:52] arup_r: pagios: your last query is broken syntactically..
[14:31:02] pagios: date i tried .where("DAYNAME(date) = ?", "Friday")`
[14:31:14] arup_r: so your column name is `date`?
[14:31:16] pagios: ^ arup_r yea
[14:31:38] arup_r: pagios: Was it throwing error? or simply no data from the query?
[14:32:14] arup_r: Are you sure, you have data for Friday?
[14:33:12] sp1rs: has joined #RubyOnRails
[14:34:26] arup_r: no idea. It should work.
[14:34:45] arup_r: pagios: What is your model name?
[14:36:03] arup_r: What days shows this query ? `ModelName.pluck("DAYNAME(date)")` # ( replace `ModelName` with your actual name)
[14:36:13] arup_r: pagios: ^
[14:38:08] Macaveli_: has joined #RubyOnRails
[14:38:26] Ergo^: has joined #RubyOnRails
[14:39:00] kies: has joined #RubyOnRails
[14:39:27] speakingcode: has joined #RubyOnRails
[14:40:15] arup_r: you are slow :)
[14:40:28] norc: has joined #RubyOnRails
[14:40:34] ZerGabriel: has joined #RubyOnRails
[14:41:09] Rubie: has joined #RubyOnRails
[14:41:50] ZerGabriel: has joined #RubyOnRails
[14:42:08] asker: has joined #RubyOnRails
[14:42:09] pagios: arup_r, the date is of type timezone
[14:42:19] AzaToth: has joined #RubyOnRails
[14:43:35] snowy: has joined #RubyOnRails
[14:44:11] Donkoko: Guys, anyone has a suggestion on how to implement sitemaps? We have something very simple right now, however our link count is pretty high now so we need to do the multiple sitemaps
[14:44:57] tubbo: Donkoko: the sitemap_generator gem is pretty effective.
[14:45:28] baweaver: has joined #RubyOnRails
[14:46:12] pagios: arup_r, here?
[14:46:20] dtzuzu: has joined #RubyOnRails
[14:47:38] Donkoko: Thanks tubbo
[14:47:42] Donkoko: I will take a look
[14:47:43] arup_r: pagios: no idea. I don't know about any timezone datatype.
[14:48:44] bronson: has joined #RubyOnRails
[14:50:00] tildes: has joined #RubyOnRails
[14:50:21] helpa: has joined #RubyOnRails
[14:52:21] arup_r: pagios: have you tried that .pluck() query I gave you?
[14:53:09] gabr13l: has joined #RubyOnRails
[14:53:11] pagios: error no timezone supported it said
[14:54:32] arup_r: pagios: show the query as a gist..
[14:54:45] ZerGabriel: has joined #RubyOnRails
[14:55:20] RegulationD: has joined #RubyOnRails
[14:57:15] hxegon: has joined #RubyOnRails
[14:58:04] loc22: has joined #RubyOnRails
[14:58:11] adavia: has joined #RubyOnRails
[14:58:24] loc22: has joined #RubyOnRails
[14:58:44] tjohnson: has joined #RubyOnRails
[14:58:57] Megamos: has joined #RubyOnRails
[14:59:09] jscheel: has joined #RubyOnRails
[14:59:33] B1n4r10: has joined #RubyOnRails
[14:59:43] reber: has joined #RubyOnRails
[15:01:06] dipnlik: has joined #RubyOnRails
[15:01:30] mDuff: has joined #RubyOnRails
[15:02:24] dipnlik: hi all. i have a few rails apps that are still running in ruby 2.0.0, any upgrade tips/tutorials are welcome. should I go straight to 2.3? anything special I should look for?
[15:03:06] sevenseacat: should be fine to go straight to 2.3. upgrade, run tests, push.
[15:03:26] helpa: has joined #RubyOnRails
[15:03:49] cpruitt: If you’re using a ruby version manager (rbenv, rvm, etc…) just change it & run your tests.
[15:05:10] drbayer: has joined #RubyOnRails
[15:06:07] Pazician: has joined #RubyOnRails
[15:06:36] hxegon: has joined #RubyOnRails
[15:07:16] dipnlik: rvm user here. running as we speak, already fixed a few warnings. hope this test suite is good enough :)
[15:07:24] syndikate: has joined #RubyOnRails
[15:07:48] sevenseacat: people run rails apps with warnings on??? :D
[15:08:00] sevenseacat: ACTION 's world implodes
[15:11:51] Rubie: has joined #RubyOnRails
[15:15:10] twilling_: has joined #RubyOnRails
[15:15:11] tubbo: sevenseacat: ruby throws warnings sometimes
[15:19:09] flashpoint9: has joined #RubyOnRails
[15:19:24] twilling: has joined #RubyOnRails
[15:20:11] fernando: has joined #RubyOnRails
[15:20:29] ZerGabriel: has joined #RubyOnRails
[15:20:40] baweaver: has joined #RubyOnRails
[15:21:21] ZerGabriel: has joined #RubyOnRails
[15:21:26] Donkoko: sevenseacat: mind explodes
[15:21:42] ajporterfield: has joined #RubyOnRails
[15:21:50] pagios: has joined #RubyOnRails
[15:22:02] pawnbox: has joined #RubyOnRails
[15:22:10] ZerGabriel: has joined #RubyOnRails
[15:22:44] rubyonrailed: has joined #RubyOnRails
[15:23:10] ZerGabriel: has joined #RubyOnRails
[15:23:42] d0nn1e: has joined #RubyOnRails
[15:23:43] Donkoko: Anyone has an idea why when we render our app within Facebook canvas the session gets destroyed and we get logged out, even tho we are still logged in, in another tab? Seems like the cookie is conflicting somehow with FB but cant figure out why and how.
[15:25:06] tubbo: so...`let` blocks are being re-run every time in my rspec tests
[15:25:11] tubbo: am i crazy or is that expected behavior?
[15:25:27] tubbo: well actually i'm not sure about that hang on
[15:25:50] FooMunki: has joined #RubyOnRails
[15:26:01] sevenseacat: rerun for every test, or multiple times in the same test?
[15:26:04] ajporterfield: has joined #RubyOnRails
[15:26:17] sevenseacat: rerun for every test is expected behaviour
[15:26:19] tubbo: rerun for every test i assume
[15:26:21] tubbo: oh ok cool
[15:26:42] Malgorath: has joined #RubyOnRails
[15:26:59] Malgorath: Anyone here develop plugins for Openproject.org's Openproject-CE ?
[15:27:38] pagios: has left #RubyOnRails: ("Leaving")
[15:28:38] rakm: has joined #RubyOnRails
[15:29:10] rubyonrailed: I have a edit form on a join table. ChannelsUsers. I added a attribute to the ChannelUsers class name :disabled. I want to be able to edit this in my edit view. How can I make my select that takes channel_users display channel.name as an option? https://gist.github.com/JasonMannon/6f3914418b7660719675c48f73f0373f
[15:29:34] hxegon: has joined #RubyOnRails
[15:30:00] petor: has joined #RubyOnRails
[15:30:14] element_zer0: has joined #RubyOnRails
[15:30:32] Malgorath: Anyone konw if there is an irc help channel for OpenProject.org? I can't find any information on their website
[15:30:41] tubbo: rubyonrailed: in options_from_collection_for_select(@channel_users, :id, :name, @channels_users), why are you passing @channel_users and @channels_users?
[15:30:42] finnnnnnnnnnn: has joined #RubyOnRails
[15:30:43] petor: has joined #RubyOnRails
[15:31:41] rubyonrailed: tubbo: Whoops don't need that
[15:31:42] disgrntld: has joined #RubyOnRails
[15:32:24] halfamind: has joined #RubyOnRails
[15:36:29] rubyonrailed: Here is a updated gist. https://gist.github.com/JasonMannon/6f3914418b7660719675c48f73f0373f I don't want to show the channel_id, I would like to show the channel name
[15:39:06] GnuYawk: has joined #RubyOnRails
[15:39:31] GnuYawk: has joined #RubyOnRails
[15:41:20] arup_r: has joined #RubyOnRails
[15:41:21] chagel: has joined #RubyOnRails
[15:41:42] dvinciguerra: has joined #RubyOnRails
[15:44:02] dtzuzu: has joined #RubyOnRails
[15:47:30] ZerGabriel: has joined #RubyOnRails
[15:50:57] diegoaguilar: has joined #RubyOnRails
[15:51:57] pawnbox: has joined #RubyOnRails
[15:53:53] bronson: has joined #RubyOnRails
[15:54:08] mostlybadfly: has joined #RubyOnRails
[15:54:33] ascarter_: has joined #RubyOnRails
[15:55:47] ascarter: has joined #RubyOnRails
[15:56:43] denaras: has joined #RubyOnRails
[15:57:06] ascarter: has joined #RubyOnRails
[15:57:37] fernando: has joined #RubyOnRails
[15:57:48] drbayer: has joined #RubyOnRails
[15:59:47] marr: has joined #RubyOnRails
[16:02:45] petor: has joined #RubyOnRails
[16:04:43] reckoner: has joined #RubyOnRails
[16:05:15] Donkoko: reckoner: hello
[16:06:23] uglybandersnatch: has joined #RubyOnRails
[16:07:32] zave: has joined #RubyOnRails
[16:09:54] manfrin: has joined #RubyOnRails
[16:10:13] benlieb: has joined #RubyOnRails
[16:10:32] duderonomy: has joined #RubyOnRails
[16:14:57] eljimbo: has joined #RubyOnRails
[16:15:10] reckoner: I could use some guidenance on this.
[16:15:13] reckoner: https://gist.github.com/anonymous/0cb475c412a45deaf6628bcdfa3c68d1
[16:15:55] Rubie: has joined #RubyOnRails
[16:16:14] reckoner: I keep running into a duplication problem, but i think this is easier done than i'm realizing right now.
[16:18:40] Frem: has joined #RubyOnRails
[16:20:25] hxegon: has joined #RubyOnRails
[16:21:51] gabr13l: has left #RubyOnRails: ()
[16:21:57] chouhoulis: has joined #RubyOnRails
[16:26:43] rodfersou: has joined #RubyOnRails
[16:27:29] twilling: has joined #RubyOnRails
[16:27:55] Balzrael: has joined #RubyOnRails
[16:29:26] sayhi: has joined #RubyOnRails
[16:29:54] KensoDev: has joined #RubyOnRails
[16:30:04] Donkoko: sayhi: hello
[16:30:14] sayhi: since #capistrano is sleeping.. does anyone know if its possible to :wait and :limit the regular deploy task in capistrano3 ?
[16:30:34] context: "wait" or "limit" ?
[16:30:42] sayhi: seems my host has some .. restrictions with the amount of ssh connections it allows
[16:30:45] context: so you want "cap _ deploy" to ... "wait" ?
[16:30:53] sayhi: i want to batch it
[16:31:07] sayhi: i have lik 100 jailed envs on 1 server
[16:31:10] context: i think cap only makes one connection at a time, it only does one thing at a time
[16:31:18] ZerGabriel: has joined #RubyOnRails
[16:31:28] Technodrome: has joined #RubyOnRails
[16:31:36] sayhi: hmm.. it seems if its doing it simultanously
[16:31:50] context: are you treating one host as multiple hosts or something ?
[16:32:04] sayhi: i have lik 100 jailed envs on 1 server
[16:32:13] context: ok i get that
[16:32:28] sayhi: i m using subdomains
[16:32:29] context: so you are trying to create 100 ssh connections?
[16:32:39] context: that sounds totally legit..
[16:33:24] sayhi: i dont c the difference between 100 different servers.. to deploy.. or 100 jailed envs on 1 server
[16:33:35] sayhi: basically the same
[16:33:38] context: so, you have 100 sshd's running or 1 to act on al 100 ?
[16:33:54] sayhi: im not sure how capistrano handles it
[16:34:03] context: sayhi: well, 100 servers == 100 sshd's == you most likely would not be having the really really awkward issue you are having right now....
[16:34:05] sayhi: it seems to be doing it simultanously
[16:34:28] context: so.. they are NOT "basically" the same
[16:34:40] baweaver: has joined #RubyOnRails
[16:34:51] sayhi: well. i dont have a choice.. its a managed server with jailed envs
[16:34:58] context: sayhi: do you have 1 "server" or 100 "server" lines in your deploy env file
[16:35:13] sayhi: context: 100 server lines
[16:35:24] context: which are all really going to the same exact host ?
[16:35:41] context: do they all relate to the same IP ?
[16:35:52] context: ... then its the same server.. not "sure"
[16:36:05] context: why can you not just use 1 "server" line ?
[16:36:06] ascarter: has joined #RubyOnRails
[16:36:06] Detch: has joined #RubyOnRails
[16:36:22] sayhi: context: you know what a jailed env is?
[16:36:31] sayhi: i have 100 users on that server
[16:36:32] B1n4r10: has joined #RubyOnRails
[16:36:38] epochwolf: sayhi: chroot?
[16:36:45] sayhi: epochwolf: no
[16:36:58] hightower3: has joined #RubyOnRails
[16:37:01] dopie: has joined #RubyOnRails
[16:37:03] context: it sounds like a really awkward unneeded setup really
[16:37:24] sayhi: managed server
[16:37:29] benlieb: has joined #RubyOnRails
[16:37:31] sayhi: i dont make the rules.. i just play by them
[16:37:32] pawnbox: has joined #RubyOnRails
[16:37:54] context: consdering from what I understand, cap/sshkit opens a single connection for each 'server' and keeps it open. its not creating many for each server only one.
[16:37:59] sayhi: i can understand the setup
[16:38:03] loc22: has joined #RubyOnRails
[16:38:04] context: and i doubt there is a way around that
[16:38:15] xblade: has joined #RubyOnRails
[16:38:19] sp1rs: has joined #RubyOnRails
[16:38:24] context: 100 'server' lines for a deploy env config just sounds.... rediculous
[16:38:32] context: especially when they all go to the same host...
[16:38:53] context: its still the same host.. just use 1 jail, its all the same damn app
[16:39:07] sayhi: well.. setting aside that the setup is ridiculous.. its something i can not change
[16:39:35] sayhi: anyone know if its possible to batch process them?
[16:39:57] context: sure you can... you dont need the same app installed 100 times on the same host.
[16:40:00] Technodrome: has joined #RubyOnRails
[16:40:12] sayhi: context: jailed!
[16:40:18] epochwolf: sayhi: do you mean virtualization like FreeBSD jail or KVM?
[16:40:20] context: its the same fucking host !
[16:40:32] sayhi: context: with 100 different customer
[16:40:41] sayhi: context: and all of them are fucking jailed :p
[16:40:47] sayhi: i can not change it
[16:41:33] sayhi: they do not have access to a "shared" directory
[16:41:52] sayhi: they are all limited to their individual "home" directories
[16:41:58] shinnya: has joined #RubyOnRails
[16:42:10] epochwolf: ... sayhi what's the mechanism for this "jail"?
[16:42:27] context: jail since all the ssh is hitting the same IP
[16:42:33] epochwolf: Because "jail" can refer to 3 different ways of isolating users and processes.
[16:42:42] context: http://stackoverflow.com/questions/429816/how-to-deploy-to-a-single-specific-server-using-capistrano
[16:42:55] context: sayhi: create a different env for each customer, or use the above...
[16:43:01] context: either way you get to script cap
[16:43:03] fedexo: has joined #RubyOnRails
[16:43:09] context: or.. fix sshd
[16:43:21] context: sayhi: OR, you could do something like we do
[16:43:40] context: sayhi: have a user that can sudo to all those users, and cap deploy from there
[16:43:43] sevenseacat: use real servers?
[16:43:45] context: err nm, we still ssh
[16:43:56] context: sevenseacat: yeah, totally
[16:44:27] context: or real VMs, or docker, or fix sshd, or... you know, get mad at the tool doing its job ;)
[16:44:50] sayhi: i just write the hoster and tell them they are shit :p
[16:44:58] sayhi: maybe they like me more then
[16:45:09] epochwolf: sayhi: what's the website for your host?
[16:45:26] sayhi: nethosting.com i think
[16:45:35] context: what DO You know ?
[16:45:45] sayhi: http://www.nethosting24.de/
[16:46:04] sayhi: i know today is friday..
[16:46:25] context: give all 100 access to the same dir the code is in, done
[16:46:35] context: touch tmp/restart.txt just rebooted app x 100
[16:46:46] sayhi: context: i cant.. there is no shared dir
[16:46:51] context: so make one.
[16:47:01] context: ACTION stops
[16:47:34] sayhi: damn.. no /slap alias in this irc client
[16:47:47] sayhi: ACTION slaps context with a large trout
[16:47:50] sandstrom: has joined #RubyOnRails
[16:47:55] context: get a new host.
[16:48:01] context: dont slap me for your ghetto setup.
[16:48:16] sayhi: i dont mind the setup
[16:48:36] sayhi: and ive read up on the topic.. its not uncommon
[16:48:37] sevenseacat: hows it working out for you?
[16:49:32] sayhi: well.. i get paid good money and the customer wants it like this
[16:49:38] sayhi: so im fine with it sevenseacat
[16:49:51] sevenseacat: then you dont need our help :)
[16:49:53] sayhi: i didnt make the rules.. like i said
[16:50:20] sayhi: obviously you cant help..
[16:50:32] sayhi: peace out
[16:50:34] sayhi: has left #RubyOnRails: ("http://quassel-irc.org - Chat comfortably. Anywhere.")
[16:50:59] ZerGabriel: has joined #RubyOnRails
[16:51:24] ZerGabriel: has joined #RubyOnRails
[16:51:31] context: how do people like that get jobs
[16:51:46] epochwolf: context: they get hired by people that don't understand programming.
[16:56:51] ZerGabriel: has joined #RubyOnRails
[16:57:32] ZerGabriel: has joined #RubyOnRails
[16:58:14] pawnbox: has joined #RubyOnRails
[16:58:29] ZerGabriel: has joined #RubyOnRails
[16:58:33] sbarg: has joined #RubyOnRails
[16:58:41] chagel: has joined #RubyOnRails
[17:00:35] ivanskie_work: has joined #RubyOnRails
[17:00:46] ramfjord: has joined #RubyOnRails
[17:01:10] baweaver: has joined #RubyOnRails
[17:03:37] sleungcy: has joined #RubyOnRails
[17:04:40] rubyonrailed: has joined #RubyOnRails
[17:07:41] Fire-Dragon-DoL: mhhh... How do I rebuild ActiveSupport::TimeWithZone from a JSON string? I have something like "2016-04-01T17:03:37.709Z"
[17:12:04] Donkoko: Guys, I want to get all the actions from a controller in an array/collection. I am trying PagesController.action.all
[17:12:05] context: .new() and Time.parse
[17:12:24] reckoner: has left #RubyOnRails: ("*poof!*")
[17:12:28] Donkoko: seems like all is not working for .action. Any idea what I need to use
[17:13:45] context: as a guy that identifies as a guy, and orients as a guy, i take offense to being called a guy
[17:14:28] context: what you should've said is: Yo Bros, ...
[17:15:07] tubbo: context: !guys
[17:15:07] helpa: context: We're not all guys here - while you probably don't meant to be exclusive, not everybody feels that way. Maybe consider using "folks", "y'all" or "everyone" instead?
[17:15:43] mikecmpbll: has joined #RubyOnRails
[17:15:48] pawnbox: has joined #RubyOnRails
[17:15:54] tubbo: > unitymediagroup.de
[17:16:52] Donkoko: helpa: will do. Made this mistake a few times already. The reason being that in a social situation you can use 'guys' to refer to a group of mixed genders.
[17:17:36] Donkoko: I can see why some people take it serious tho, so I apologize if I offended someone.
[17:17:42] context: tubbo: women can be bros too. its the bro-culture man !
[17:18:01] Donkoko: context: agreed :)
[17:18:06] tubbo: context: actually i was referring you to the command so you don't have to type shit out haha
[17:18:14] cnk: has joined #RubyOnRails
[17:18:33] context: tubbo: im offended that you feel my fingers aren't up to the task of typing out full sentences
[17:18:35] tubbo: not that a give a fuck about this bullshit in the very least
[17:18:51] Devalo: has joined #RubyOnRails
[17:18:53] context: see... you just triggered me again
[17:19:31] tubbo: context: yeah we wouldn't want you to get your oppressive patriarchy all over this channel
[17:19:39] bronson: has joined #RubyOnRails
[17:20:29] stannard: has joined #RubyOnRails
[17:20:45] choke: has joined #RubyOnRails
[17:22:42] bronson: has joined #RubyOnRails
[17:22:58] pawnbox: has joined #RubyOnRails
[17:23:48] epochwolf: Donkoko: SomethingController.action_methods
[17:24:56] Donkoko: epichwolf: tried that already but for some reason it returns also the helper_methods and some other stuff from a different controller so it will be a hassle to filter it
[17:24:56] smathy: has joined #RubyOnRails
[17:25:19] epochwolf: Donkoko: well, that's the best you can get.
[17:25:42] Donkoko: epochwolf: yeah, I figured.
[17:25:53] B1n4r10: has joined #RubyOnRails
[17:25:54] Donkoko: epochwolf: thanks a bunch tho
[17:25:59] epochwolf: Donkoko: also, you can render templates without a controller action.
[17:26:27] epochwolf: Donkoko: if I have pages/show.html I can access /pages/show without PagesController having a show action.
[17:26:31] sudoubuntu: has joined #RubyOnRails
[17:27:34] Cohedrin: has joined #RubyOnRails
[17:30:00] Cohedrin_: has joined #RubyOnRails
[17:30:04] mDuff: has joined #RubyOnRails
[17:31:47] scepticulous: has joined #RubyOnRails
[17:34:50] Donkoko: epochwolf: Yeah, that is clear. I needed it for a bit of a different purpose but I think I figured it out now. Thanks again.
[17:35:41] arup_r: has joined #RubyOnRails
[17:37:09] pawnbox: has joined #RubyOnRails
[17:37:21] twilling: has joined #RubyOnRails
[17:37:59] scepticulous: has joined #RubyOnRails
[17:38:52] flashpoint9: has joined #RubyOnRails
[17:42:57] darkxploit: has joined #RubyOnRails
[17:44:22] ZerGabriel: has joined #RubyOnRails
[17:46:34] MrPunkin: has joined #RubyOnRails
[17:52:21] dpg1: has joined #RubyOnRails
[17:54:40] adre: has joined #RubyOnRails
[17:55:29] ascarter: has joined #RubyOnRails
[17:57:17] ascarter: has joined #RubyOnRails
[17:57:43] fernando: has joined #RubyOnRails
[17:58:21] Technodrome: has joined #RubyOnRails
[17:58:55] flashpoint9: has joined #RubyOnRails
[18:00:13] DoctorMonocular: has joined #RubyOnRails
[18:00:52] halfamind: has joined #RubyOnRails
[18:01:01] djbkd: has joined #RubyOnRails
[18:01:29] halfamind1: has joined #RubyOnRails
[18:01:51] halfamind: has joined #RubyOnRails
[18:02:54] baweaver: has joined #RubyOnRails
[18:06:34] twilling: has joined #RubyOnRails
[18:08:05] fernando: has joined #RubyOnRails
[18:09:35] baweaver: has joined #RubyOnRails
[18:10:24] scepticulous: has joined #RubyOnRails
[18:10:26] jsrn: has joined #RubyOnRails
[18:10:50] manfrin: I got a really high level question for any aces in the room
[18:11:04] hxegon: has joined #RubyOnRails
[18:11:06] manfrin: I made a small module to 'soft delete' things because I didnt want to add another gem
[18:11:22] manfrin: just overrides delete and destroy to add deleted_at, sets default scope to where deleated at is nil
[18:11:36] manfrin: problem is that associations with dependent: :destroy aren't being destroyed
[18:12:02] chouhoulis: has joined #RubyOnRails
[18:12:03] manfrin: so, I'm thinking I'm going to add a line in my soft deletion to delete where associations have dependend: :destroy
[18:12:10] manfrin: but I'm not sure how to access those
[18:12:11] Cohedrin: has joined #RubyOnRails
[18:12:32] manfrin: I could do like, object.reflect_on_associations and try to traverse through to select where the association has the dependent?
[18:12:34] manfrin: is there a better way?
[18:13:06] arup_r: manfrin: Although you are not to ready to pick the gem to do this job, you can check their source code to see how they did. You will get the idea..I think
[18:13:16] manfrin: looking it up right now
[18:13:30] arup_r: but why trying to reinvent the wheel :p?
[18:13:38] twilling: has joined #RubyOnRails
[18:14:47] manfrin: truthfully I'd probably just use the gem if I started over
[18:14:57] yellow5: has joined #RubyOnRails
[18:15:03] manfrin: but I'm done with everything, just fixing this bug with associations being orphaned
[18:15:37] epochwolf: manfrin: look at the rails source for delete and destroy, copy the missing bits into your methods.
[18:15:58] ramfjord: has joined #RubyOnRails
[18:16:07] epochwolf: manfrin: or use acts_as_paranoid.
[18:17:22] epochwolf: manfrin: I highly recommend using acts_as_paranoid. It's tested and already does everything you need.
[18:17:49] manfrin: I've already written and deployed my stuff
[18:17:57] manfrin: I'm just dealing with this association stuff
[18:18:25] epochwolf: manfrin: yes but acts_as_paranoid does exactly what you need the same way.
[18:18:54] epochwolf: Unless you have a very large application, you shouldn't need to modify much code.
[18:19:11] ereslibre: hi, i was checking the tasks to be done for migrating from rails 4 to rails 5 a fairly big application and I stumbled across one question. association(true) was removed for both collections and has_one associations. Thing is, it makes sense for collections since I can only reload what I want (post.collections.reload), but I think for has_one associations is a bit more tricky instead of comment.author(true) it is now recommended to comment.reload.
[18:19:11] ereslibre: author, but that's not equivalent. You are actually invalidating the whole comment object, not the object in the relationship. any ideas or is this way? or is there any place this was discussed that I can read?
[18:19:34] ChanServ: +o baweaver
[18:19:50] Malgorath: has joined #RubyOnRails
[18:19:55] ChanServ: -o baweaver
[18:20:21] Malgorath: anyone know a good guide on how to build a custom gem that has DB transactions and such?
[18:20:25] epochwolf: ACTION hits baweaver with a stick.
[18:20:33] manfrin: epochwolf the app is enormous
[18:20:39] ChanServ: +o baweaver
[18:20:48] epochwolf: manfrin: in that case, copy and paste.
[18:21:17] tubbo: malgorath: !vague
[18:21:17] helpa: malgorath: Your question has just been deemed vague; please consider rewording it. It may also help to give us any relevant code or errors so that we may better assist you.
[18:21:20] ChanServ: -o baweaver
[18:21:21] tubbo: what are you trying to do?
[18:21:29] epochwolf: malgorath: look at the source for similar gems
[18:22:03] Malgorath: tubbo: I'm trying to figure out how to build gems or plugins for rails apps that I commonly end up making for each project
[18:22:40] smathy: malgorath, did you google: how to create a gem ?
[18:22:47] Malgorath: epochwolf: i am currently doig that, was just wondering if you all know of a guide or tut about it also
[18:23:01] tubbo: malgorath: check out the `rails plugin new` generator. you can use --full or --mountable to generate an app/ dir and an Engine object to hook into the rails app. rails plugins are called "engines", so that might help when googling.
[18:23:11] tubbo: malgorath: rails plugin new --help to see all the options
[18:23:12] Malgorath: smathy: yes I did. its very limited on what I found, nothing about DB transactions inside the gem
[18:23:57] arup_r: baweaver: You new Rails 5 announcement link taking me to Youtube video. Is it correct link?
[18:24:02] smathy: malgorath, those two things, "a gem, and how to create one" and "DB transactions in ruby/rails" are on two entirely different levels.
[18:24:19] smathy: malgorath, it's like saying: "yes, I found stuff on creating a gem, but nothing on using regular expressions inside a gem"
[18:24:28] tubbo: malgorath: there isn't going to be a guide for every little thing that you can possibly do with rails. sometimes you might actually have to get creative and think for yourself.
[18:24:46] tubbo: arup_r: yeah definitely. if you're seeing a youtube video you might have A VIRUS
[18:25:02] arup_r: what??? :(
[18:25:10] tubbo: arup_r: it's pretty common, but thankfully there is a way out. paypal $50.00 USD to tubbo@psychedeli.ca
[18:25:19] tubbo: once you do you'll be free and clear of THE VIRUS
[18:25:26] adaedra: Godamn viruses. They're never gonna let you down.
[18:25:28] tubbo: arup_r: <3 april fools!
[18:25:31] B1n4r10: has joined #RubyOnRails
[18:25:36] Malgorath: I just asked if there was anyone that knew a guide or tutorial, no reason to drive more people away from Rails.
[18:27:47] reckoner: has joined #RubyOnRails
[18:27:53] sadaf2606: has joined #RubyOnRails
[18:28:12] reckoner: is there a way to define has_many :foos
[18:28:31] reckoner: where :foos is a specific type on a polymorphic model?
[18:28:52] smathy: reckoner, yes, just use a scope in your association.
[18:29:22] reckoner: i'm trying :source and :source_type currently
[18:29:28] reckoner: with little success.
[18:30:29] The_Phoenix: has joined #RubyOnRails
[18:31:57] apotry: has joined #RubyOnRails
[18:32:21] smathy: reckoner, not sure why you mentioned that. Did you misread my answer as suggesting you use source?
[18:32:31] The_Phoenix: has joined #RubyOnRails
[18:32:49] hightower3: has joined #RubyOnRails
[18:33:44] PedramT: has joined #RubyOnRails
[18:33:45] reckoner: just what i'm trying.
[18:33:53] reckoner: your way is better.
[18:34:24] The_Phoenix: has joined #RubyOnRails
[18:35:09] smathy: ...and by "better" you mean "the only way that works" - yes it is.
[18:35:20] The_Phoenix: has joined #RubyOnRails
[18:35:46] lemur: has joined #RubyOnRails
[18:36:38] dopamean_: has joined #RubyOnRails
[18:36:39] qejk: has joined #RubyOnRails
[18:37:25] reckoner: ACTION nods
[18:37:27] The_Phoenix: has joined #RubyOnRails
[18:37:43] Technodrome: has joined #RubyOnRails
[18:38:29] alex88: has joined #RubyOnRails
[18:38:58] mdw: has joined #RubyOnRails
[18:40:04] baweaver: 🎉Rails 5.0! (See channel topic)
[18:40:08] someish: has joined #RubyOnRails
[18:40:25] epochwolf: ACTION handcuffs baweaver to a train.
[18:41:07] adaedra: The hype train?
[18:41:29] tubbo: come on ride the train
[18:41:32] tubbo: choo choo ride it
[18:42:23] flashpoint9: has joined #RubyOnRails
[18:43:48] iamvery: has joined #RubyOnRails
[18:43:50] epochwolf: https://github.com/vinhnglx/active_bootstrap_skin
[18:44:49] pawnbox: has joined #RubyOnRails
[18:46:44] netzfisch: has joined #RubyOnRails
[18:48:41] darkxploit: has joined #RubyOnRails
[18:51:33] MrPunkin: has joined #RubyOnRails
[18:51:51] blackmesa: has joined #RubyOnRails
[18:52:00] Mattx: has joined #RubyOnRails
[18:54:42] arup_r: has left #RubyOnRails: ()
[18:54:45] arup_r: has joined #RubyOnRails
[18:57:09] B1n4r10: has joined #RubyOnRails
[18:59:40] reckoner: has left #RubyOnRails: ()
[18:59:51] Regulati_: has joined #RubyOnRails
[19:00:54] ascarter: has joined #RubyOnRails
[19:04:40] capin: nice headline on the rails 5 release :P
[19:07:34] chrissonar: has joined #RubyOnRails
[19:08:18] dionysus69: has joined #RubyOnRails
[19:08:48] darkxploit: has joined #RubyOnRails
[19:11:44] choke: has joined #RubyOnRails
[19:12:21] drbayer: has joined #RubyOnRails
[19:14:38] B1n4r10: has joined #RubyOnRails
[19:15:42] momomomomo: has joined #RubyOnRails
[19:15:50] RaetiveName: has joined #RubyOnRails
[19:16:13] audy: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[19:17:30] nibbo: has joined #RubyOnRails
[19:18:02] B1n4r10_: has joined #RubyOnRails
[19:19:59] yfeldblum: has joined #RubyOnRails
[19:21:23] Dimik: has joined #RubyOnRails
[19:21:24] n008f4g_: has joined #RubyOnRails
[19:21:25] ascarter: has joined #RubyOnRails
[19:27:26] fernando: has joined #RubyOnRails
[19:28:13] _Tariq: has joined #RubyOnRails
[19:29:01] mwlang: how quickly does Rails recover from a dropped connection?
[19:29:13] ekinmur: has joined #RubyOnRails
[19:29:57] dopie: has joined #RubyOnRails
[19:30:01] matthewd: mwlang: Database connection? On the next request.
[19:30:01] scepticulous: has joined #RubyOnRails
[19:30:03] RaetiveName: has joined #RubyOnRails
[19:30:32] DonOtreply: has joined #RubyOnRails
[19:30:40] mwlang: matthewd: so if it dies in current request, no forcing a recovery immediately?
[19:31:40] RaetiveName: has joined #RubyOnRails
[19:31:59] tubbo: mwlang: no it will probably throw an exception
[19:32:02] mwlang: basically, here’s what I learned about yesterday’s problem. when storing a 8mb+ file to longblob field in mysql, the actual data’s being sent as HEX, which is twice as large as a pure binary representation. So we were in fact crossing the 16MB max packet size long before we were expecting it.
[19:32:21] tubbo: mwlang: why are you storing an 8mb file in MySQL?
[19:32:38] mwlang: poor design choice by prior developers. :-)
[19:33:03] mwlang: I’m moving them to filesystem, but that’ll take a few more weeks since it affects several systems that interact with this one.
[19:33:05] n1lo: has joined #RubyOnRails
[19:33:44] tubbo: ah ok, yeah
[19:34:56] ramfjord_: has joined #RubyOnRails
[19:36:16] arup_r: mwlang: always do nice interesting rails things... :)
[19:36:49] mwlang: arup_r: I didn’t coin the term, but I’m whatcha call a technical debt sin eater. :-D
[19:38:09] sneakerhax: has joined #RubyOnRails
[19:38:09] mdw: has joined #RubyOnRails
[19:39:51] matthewd: mwlang: I imagine you could force it
[19:40:59] mwlang: just talked to the client…we’re gonna let it slide…focus on going to filesystem and just deal with these one-offs manually since 8mb+ is fairly rare.
[19:41:57] jenrzzz: has joined #RubyOnRails
[19:41:57] jenrzzz: has joined #RubyOnRails
[19:42:18] rrawlins: has joined #RubyOnRails
[19:42:43] CodaBrink: has joined #RubyOnRails
[19:42:48] PedramT: has joined #RubyOnRails
[19:45:15] Devalo: has joined #RubyOnRails
[19:47:51] hxegon: has joined #RubyOnRails
[19:49:48] baweaver: has joined #RubyOnRails
[19:50:20] jfelchner: has joined #RubyOnRails
[19:51:01] arBmind: has joined #RubyOnRails
[19:53:43] mrgreenfur: has joined #RubyOnRails
[19:54:06] fox_mulder_cp: wow. me use carrirwave
[19:55:23] arup_r: same here,
[19:56:26] srinidhi: has joined #RubyOnRails
[19:57:03] mrgreenfur: anyone know any secrets to putting erb statements into js? it’s acts all funky. I have a simple if statement in a js and i’m trying to precompile it
[19:58:26] arup_r: mrgreenfur: .js.erb will allow you to put ruby inside the JS.
[20:00:08] mrgreenfur: arup_r: yeah, i’ve been trying that. It just seems kind bizarro. I have just an if statement to switch strings based on the current env, but it’s not really behaving consistently when using precompile
[20:00:14] mrgreenfur: curious if there are any gotchas i’m missing
[20:00:28] ascarter: has joined #RubyOnRails
[20:00:51] ur5us: has joined #RubyOnRails
[20:01:15] arup_r: mrgreenfur: once the js is served from server to browser, no more ruby.. only JS there.. but I think you know this. So I am confused what is confusing you..
[20:01:24] mrgreenfur: yes, le tme show you
[20:01:31] chagel: has joined #RubyOnRails
[20:01:37] mDuff: has joined #RubyOnRails
[20:01:57] _Tariq: has joined #RubyOnRails
[20:02:20] alaing: has joined #RubyOnRails
[20:02:55] alaing: has joined #RubyOnRails
[20:05:04] djbkd: has joined #RubyOnRails
[20:06:17] ur5us: has joined #RubyOnRails
[20:06:27] mrgreenfur: https://gist.github.com/anonymous/cb0c8961909790e6e2640bc99869ef60
[20:06:49] mrgreenfur: it seems to always return whichever string is first, not actually executing the full ruby block
[20:06:51] pawnbox: has joined #RubyOnRails
[20:07:13] phaza: has joined #RubyOnRails
[20:08:13] uglybandersnatch: has joined #RubyOnRails
[20:08:22] jscheel: has joined #RubyOnRails
[20:10:49] arup_r: it should work, I think..
[20:10:55] mrgreenfur: yeah, me too :)
[20:11:00] blackmesa: has joined #RubyOnRails
[20:11:29] mrgreenfur: now it worked!
[20:11:48] mrgreenfur: all i changed was the linebreak after the end
[20:11:54] choke: has joined #RubyOnRails
[20:13:40] mrgreenfur: now it produced the opposite
[20:13:42] mrgreenfur: i think it’s random
[20:14:40] alaing: i have messages = object.errors.full_messages_for attribute is there a way to map the full messages for to l18n translation?
[20:15:07] jinette: has joined #RubyOnRails
[20:15:57] alaing: i have an error message that appears next to the field that that has been translated but the error summary produced at the top of the page is different because it hasn't be translated
[20:19:40] htmldrum: has joined #RubyOnRails
[20:22:04] gheegh: has joined #RubyOnRails
[20:23:13] B1n4r10: has joined #RubyOnRails
[20:27:27] djbkd: has joined #RubyOnRails
[20:28:22] adlerdias: has joined #RubyOnRails
[20:28:43] chouhoulis: has joined #RubyOnRails
[20:29:30] USvER: has joined #RubyOnRails
[20:30:33] Maletor: has joined #RubyOnRails
[20:32:11] USvER: Quick question about ActionCable. Is there a way to know home many connections is listening for any particular stream?
[20:32:15] chouhoulis: has joined #RubyOnRails
[20:32:17] mwlang: ugh, this is messy: expect(checkout_step2_page.errors.messages[:sub_url].first).to match /already in use/
[20:32:30] mwlang: surely there’s a better way to check for specific validation failures.
[20:32:59] uglybandersnatch: has joined #RubyOnRails
[20:34:32] USvER: I want to do something when no one is listening for stream...
[20:34:50] USvER: Can someone give me a hint how to do that?
[20:37:13] USvER: Something like connections_for "my_stream"
[20:38:19] baweaver: has joined #RubyOnRails
[20:38:29] mwlang: mrgreenfur: I think I would move that chunk of ruby into a helper so your ERB reduces to <%= host_for_environment %>
[20:38:52] mrgreenfur: mwlang: willing to try it. I just tried putting it into an initializer that set an app constant, but the results were still random
[20:38:56] mrgreenfur: mwlang: going crazy over here
[20:38:57] GodFather: has joined #RubyOnRails
[20:39:11] uglybandersnatch: has joined #RubyOnRails
[20:39:12] mrgreenfur: i suspect the devil is inside precomiple somehwere
[20:39:21] kpwarr: has joined #RubyOnRails
[20:39:26] kpwarr: I have defined a before_action cors_preflight_check method on a controller which sets my headers to allow CORS, but before the method runs, I get a routing error for the OPTIONS method. Does that mean I need to explicity allow requests using the OPTIONS method in my routing?
[20:39:29] mwlang: mrgreenfur: any chance browser cache is messing with you?
[20:39:54] mrgreenfur: mwlang: nope, only using these two cli commands: bundle exec assets:clobber and RAILS_ENV=production bundle exec assets:precompile
[20:40:02] mrgreenfur: and checking hte /public/assets folder for outputs
[20:40:12] mwlang: mrgreenfur: what about “spring stop”
[20:40:20] mrgreenfur: whats spring?
[20:40:26] mrgreenfur: Spring is not running
[20:40:51] mrgreenfur: hrm, maybe another instance of another rails app that srunning is conflicting
[20:40:54] mrgreenfur: i’ll try turning everything off
[20:40:59] arup_r: mwlang: http://api.rubyonrails.org/classes/ActiveModel/Errors.html#method-i-added-3F
[20:40:59] mwlang: if you have it, it speeds up rails by avoiding reloading everything all the time.
[20:42:13] mrgreenfur: i think somewhere int he precompilation it’s switching contexts or environments
[20:44:11] mwlang: arup_r: looking for a better matcher, I think.
[20:44:37] mwlang: but full_messages gets us to an array of error messages a bit cleaner.
[20:45:21] mwlang: actually a simple change worked: expect(checkout_step2_page.errors.full_messages).to include /already in use/
[20:45:36] mwlang: and that’s good enough for me.
[20:45:48] arup_r: ok, then full_messages can hold other key errors also.
[20:45:57] arup_r: ok, fine :)
[20:47:14] jenrzzz: has joined #RubyOnRails
[20:47:33] Jon30: has joined #RubyOnRails
[20:47:33] Jon30: has joined #RubyOnRails
[20:47:37] dtzuzu: has joined #RubyOnRails
[20:49:42] chouhoul_: has joined #RubyOnRails
[20:51:03] twilling: has joined #RubyOnRails
[20:54:10] tvw: has joined #RubyOnRails
[20:55:41] baweaver: has joined #RubyOnRails
[20:55:50] Spami: has joined #RubyOnRails
[20:56:35] brentw: has joined #RubyOnRails
[20:57:28] mrgreenfur: @mwlang @arup_r : Got it working, thanks fo ryour help! turns out sprockets is passed some small data and you need to explicitly have it include stuff or it does what it wants. I had to manually include my application helpers into the sprockets context.
[20:58:15] mwlang: ah, good ole sprockets
[20:58:32] mwlang: that beast is a love/hate affair
[20:59:01] Technodrome: has joined #RubyOnRails
[20:59:14] mrgreenfur: at least i have a few hairs left that haven’ tbeen pulled out yet ;)
[21:00:21] zave: has joined #RubyOnRails
[21:01:55] baweaver: 🎉 Rails 5.0! (See channel topic)
[21:02:40] diegoaguilar: has joined #RubyOnRails
[21:03:29] USvER: Hey, can someone help me with action cable? My unsubscribed method on Chanel is not invoked, only subscribe is working =\
[21:05:21] Babelfish: has left #RubyOnRails: ()
[21:05:31] Denarii: has joined #RubyOnRails
[21:05:52] dopie: has joined #RubyOnRails
[21:06:35] blackmesa: has joined #RubyOnRails
[21:07:35] SeanLazer: has joined #RubyOnRails
[21:09:06] arup_r: I wouldn't click there anymore :p
[21:10:14] arup_r: mrgreenfur: show how you solved it if you want? That may save my future hours. :D
[21:11:49] halfamind: has joined #RubyOnRails
[21:12:05] ruurd: baweaver hahahahahaha
[21:12:15] fox_mulder_cp: has joined #RubyOnRails
[21:12:50] jottr: has joined #RubyOnRails
[21:13:09] netzfisch: has joined #RubyOnRails
[21:14:27] nibbo: has joined #RubyOnRails
[21:14:38] baweaver: none shall escape shenanigans on this day
[21:14:49] georgedrummond: has joined #RubyOnRails
[21:15:17] zave: has joined #RubyOnRails
[21:16:31] stannard: has joined #RubyOnRails
[21:17:22] _Tariq: has joined #RubyOnRails
[21:17:55] Spami: has joined #RubyOnRails
[21:19:30] mrgreenfur: arup_r: something like this inside your .js.erb file <% environment.context_class.class_eval{ include ApplicationHelper } %>
[21:20:16] n008f4g_: has joined #RubyOnRails
[21:20:50] drbayer: has joined #RubyOnRails
[21:27:13] choke: baweaver for the api here at work ( api for a social network on mobile devices ), i made it so that any picture or video my boss ( ceo ) and marketing team sees one, the thumbnail is right but when they open it up in full screen, they see that same video lol
[21:30:41] georgedrummond: has joined #RubyOnRails
[21:31:52] MrPunkin: has joined #RubyOnRails
[21:34:59] MrPunkin: has left #RubyOnRails: ()
[21:35:23] georgedrummond: has joined #RubyOnRails
[21:39:31] twilling: has joined #RubyOnRails
[21:40:59] yfeldblum: has joined #RubyOnRails
[21:42:44] Technodrome: has joined #RubyOnRails
[21:43:05] rrawlins: has joined #RubyOnRails
[21:43:18] _Tariq: has joined #RubyOnRails
[21:43:18] polll: has joined #RubyOnRails
[21:45:22] mostlybadfly: has joined #RubyOnRails
[21:48:36] GodFather: has joined #RubyOnRails
[21:49:29] SeanLazer: has joined #RubyOnRails
[21:50:34] sudoubuntu: has joined #RubyOnRails
[21:51:01] ur5us: has joined #RubyOnRails
[21:52:29] baweaver: has joined #RubyOnRails
[21:54:34] audy: has joined #RubyOnRails
[21:55:23] FooMunki: has joined #RubyOnRails
[21:57:47] bronson: has joined #RubyOnRails
[21:59:52] ZerGabriel: has joined #RubyOnRails
[22:00:08] eljimbo: has joined #RubyOnRails
[22:00:35] smathy: No shell escape shenanigans either.
[22:10:44] quazimodo: has joined #RubyOnRails
[22:14:14] mdw: has joined #RubyOnRails
[22:14:48] ecksit: has joined #RubyOnRails
[22:15:36] Matum: has joined #RubyOnRails
[22:15:55] drbayer: has joined #RubyOnRails
[22:15:55] ecksit: morning! i'm trying to track down which piece of middleware is mutating an env value. is there an easy way to watch for changes to a particular variable in middleware?
[22:16:22] ecksit: or would it just be better to set break points after piece of middleware and step through it?
[22:16:38] baweaver: 🎉 Rails 5.0! (See channel topic)
[22:16:47] baweaver: ecksit: freeze it, watch for exception
[22:17:18] ecksit: that might do it, thanks!
[22:17:20] halfamind: has joined #RubyOnRails
[22:17:42] havenwood: ACTION bump production to Rails 5
[22:19:02] drbayer: has joined #RubyOnRails
[22:19:07] smathy: havenwood, Friday afternoon major version bump eh - April Fools prank on your ops team?
[22:21:41] smathy: I pranked my ops guys a few years ago (during daylight hours) by pointing all our uptime checkers at broken URLs.
[22:21:42] baweaver: DHH really covered a lot of ActiveCable in that video, he's sold me on it
[22:22:05] smathy: "I don't know WTF is going on, we're getting alerts across the board, but the site seems up to me here in the office,"
[22:22:39] smathy: I got one of our other offices to call the ops guys, pretending the site was down for them too.
[22:23:06] smathy: It was a good half hour or more before they worked it out.
[22:23:37] SteenJobs: has joined #RubyOnRails
[22:25:36] SteenJobs: if my Users can belong_to either Model1 or Model2, i presume the obvious move is to use a polymorphic association so i can just query the objects user belongs_to easily. in this case, what’s the best way to find out the class of the received object thru the association should i need to know it?
[22:28:11] workmad3: has joined #RubyOnRails
[22:29:08] MrPunkin: has joined #RubyOnRails
[22:32:38] superlou: has joined #RubyOnRails
[22:34:35] Radar: omg rails 5 got released overnight?! Yayyyy! :D
[22:34:46] Radar: That video in the topic is a great summary of all the new features.
[22:35:52] pawnbox: has joined #RubyOnRails
[22:36:04] Donkoko: has joined #RubyOnRails
[22:36:43] rubyonrailed: has joined #RubyOnRails
[22:39:37] baweaver: has joined #RubyOnRails
[22:44:41] baweaver: has joined #RubyOnRails
[22:45:58] triangles2: has joined #RubyOnRails
[22:47:48] pawnbox: has joined #RubyOnRails
[22:49:01] Coldblackice: has joined #RubyOnRails
[22:49:28] Inside: has joined #RubyOnRails
[22:49:28] Inside: has joined #RubyOnRails
[22:51:08] owenjones: has joined #RubyOnRails
[22:52:53] owenjones: has joined #RubyOnRails
[22:58:03] anna`: has joined #RubyOnRails
[22:58:40] anna`: has joined #RubyOnRails
[23:01:05] ur5us: has joined #RubyOnRails
[23:02:13] halfamind: has joined #RubyOnRails
[23:02:26] dalbuschat: has joined #RubyOnRails
[23:06:05] htmldrum: has joined #RubyOnRails
[23:10:11] bronson: has joined #RubyOnRails
[23:13:43] Rubie: has joined #RubyOnRails
[23:15:42] jottr: has joined #RubyOnRails
[23:16:15] polyidus: has joined #RubyOnRails
[23:17:17] one_zero: has joined #RubyOnRails
[23:18:20] a1fa: has left #RubyOnRails: ()
[23:20:43] htmldrum: has joined #RubyOnRails
[23:23:03] SteenJobs: has joined #RubyOnRails
[23:23:51] pwnd_nsfw: has joined #RubyOnRails
[23:25:11] nachoman: has joined #RubyOnRails
[23:25:39] djbkd: has joined #RubyOnRails
[23:28:34] htmldrum: has joined #RubyOnRails
[23:30:16] SteenJobs: hey guys - for a reservation system where booked jobs can have different status’, i presume using AR::Enum is the way to go?
[23:30:52] adskfhasdf: has joined #RubyOnRails
[23:31:18] Mia: has joined #RubyOnRails
[23:31:18] Mia: has joined #RubyOnRails
[23:32:35] bronson: has joined #RubyOnRails
[23:33:27] smathy: SteenJobs, I always prefer a gem that allows strings in the DB, I use enumerize.
[23:34:54] joshhbk: has joined #RubyOnRails
[23:34:56] SteenJobs: smathy: checking it now - i’ve built a reservation system in swift, and since all type checking is done at compile time, the compiler yells at me for any type errors - so using swift enums is perfect for this because then you can declare your own “status” type, and if anything isn’t declared properly it’ll throw an error
[23:35:06] SteenJobs: smathy: whereas with strings, if you mistype something, it’ll break but no error gets thrown
[23:35:11] sandstrom: has joined #RubyOnRails
[23:35:52] SteenJobs: smathy: ah so enumerize does what AR::enum does, but allows you to use a string raw value instead of integer
[23:35:57] jenrzzz: has joined #RubyOnRails
[23:37:39] smathy: There we go :)
[23:37:44] smathy: I was just waiting patiently ;)
[23:38:23] SteenJobs: cool! i like it, just what i needed
[23:39:39] SteenJobs: smathy: also i’m totally gonna quickly take advantage of your being here despite it being friday - i have a User model, and a user can belong_to either a Brand or a Creator - problem is, when querying the user’s parent in a given relationship, i have no way of knowing whether the user belongs_to a Brand or a Creator (it’s never both).
[23:39:47] SteenJobs: i presume the solution is polymorphic
[23:40:27] SteenJobs: but i haven’t found a terrible amount of resources on 1) the various create and build methods available and 2) how to find the class of the queried object (@company = either a Brand or Creator) in a clean way
[23:41:35] smathy: Just because something is either-or doesn't mean it has to be a polymorphic association. Brand and Creator sound like very different concepts.
[23:42:20] smathy: Create and build etc., are the same as for any belongs_to, the only additional piece you might want is `becomes` - look it up.
[23:42:45] smathy: You finding the class the normal way.
[23:43:07] SteenJobs: they are - they’re the two sides of the business arrangement - the problem is, whenever there’s a current_user, i need the parent object - most of the code deals with the brand/creator object and not the user object, but i have no way of knowing whether to query Creator.where() or Brand.where()
[23:43:15] SteenJobs: so i figured using a polymoprhic ass would solve that
[23:43:37] ekinmur: has joined #RubyOnRails
[23:44:06] rrawlins: has joined #RubyOnRails
[23:44:35] smathy: So, what one word encompasses both Brand and Creator here? "Owner" ?
[23:44:45] jetpack_joe: has joined #RubyOnRails
[23:45:02] SteenJobs: “company"
[23:45:05] polyidus: has joined #RubyOnRails
[23:45:30] SteenJobs: which is helpful because both Brands and Creators has_many Projects
[23:45:40] SteenJobs: (and users)
[23:45:50] smathy: Ok, so `belongs_to :company, polymorphic: true` - simple. Just need to change your brand_id and creator_id fields to company_id, company_type
[23:46:03] SteenJobs: already done sir
[23:46:16] SteenJobs: so here’s the case - let’s say i have a
[23:46:19] SteenJobs: bum bum bum
[23:46:25] SteenJobs: peace brother, have a great weekend!
[23:46:52] smathy: Oh, actually, no - I meant "good to go". I guess you young people have a new meaning.
[23:47:23] SteenJobs: cmon smathy
[23:47:25] smathy: Oh right :)
[23:47:45] SteenJobs: ha that was really funny actually
[23:48:38] croberts: has joined #RubyOnRails
[23:48:57] SteenJobs: so if i have a user, and he’s going through the flow to create a company (because he’s the first user account from a particular company), originally i would do user.build_brand or user.build_creator…how would i use the polymorphic assoc in this case to create my brand or company object?
[23:51:22] smathy: SteenJobs, guess.
[23:51:44] smathy: If the association is now called: belongs_to :company....
[23:51:49] SteenJobs: well i wouldn’t be asking if user.build_company worked! haha
[23:51:59] SteenJobs: and in that case, how would it know whether to create a brand or creator object?
[23:52:02] Radar: !didntwork
[23:52:02] helpa: What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
[23:52:08] Radar: ps good morning
[23:52:11] SteenJobs: always sneaking
[23:52:21] SteenJobs: i love the helpas though, keeps me on my game
[23:52:47] SteenJobs: undefined method “build_company” for my User class
[23:52:53] georgedrummond: has joined #RubyOnRails
[23:54:04] one_zero: has joined #RubyOnRails
[23:54:06] smathy: SteenJobs, right, for exactly the reason you mentioned, you can't build it that way. There's no way for it to know what class to use.
[23:54:39] SteenJobs: right, i thought maybe there was a method build_company(your_model_as_company)
[23:54:56] smathy: SteenJobs, close.
[23:55:11] diegoaguilar: has joined #RubyOnRails
[23:55:52] smathy: How else can you attach a new instance to a model through its belongs_to association? Hint: http://devdocs.io/rails/activerecord/associations/classmethods#method-i-belongs_to
[23:55:56] SteenJobs: oh?? that would be mighty convenient…i mean i can simply update the attributes on the user by doing b = Brand.new; user.update(:company, b) or something…but i’d rather use a generated AR method than hack the ID itself
[23:56:10] FooMunki: has joined #RubyOnRails
[23:56:11] Radar: maybe the setter method?
[23:56:12] B4daBing73: has joined #RubyOnRails
[23:56:25] smathy: Damnit Radar, I already knew you knew!
[23:56:34] Radar: smathy: I didn't give the exact answer :P
[23:56:50] SteenJobs: c’mon man
[23:56:56] SteenJobs: now no one will believe i had it
[23:57:01] Radar: SteenJobs: of course
[23:57:03] smathy: ACTION doesn't
[23:57:09] nachoman: has joined #RubyOnRails
[23:57:12] SteenJobs: yea cool, so simply use dot notation
[23:57:21] SteenJobs: user.company = brand
[23:58:10] flashpoint9: has joined #RubyOnRails
[23:58:31] kies: has joined #RubyOnRails
[23:58:47] smathy: has joined #RubyOnRails
[23:58:51] SteenJobs: and whenever i query user.company, i can just do user.company.class and check if it’s Brand or Creator
[23:59:13] SteenJobs: smathy: although with iOS and swift, i avoid having to constantly check class type by using protocols/delegates…does anyone ever use that with rails?
[23:59:26] smathy: Second time in the past couple of days that my Mac has hard-crashed :(