« Back to channel list

#RubyOnRails - 01 December 2014

« Back 1 day Forward 1 day »
[00:46:34] JoshuaPaling: If my controllers only 'respond to' html, then having the respond_to blocks is useless and I might as well get rid of them. Correct?
[00:52:13] SteenJobs: Ryan1013: how was your thanksgiving??
[00:53:05] Ryan1013: hmm I'm in New Zealand and we don't celebrate that here
[00:53:07] Ryan1013: how was yours?
[00:54:54] SteenJobs: mine was great, thanks. had a cousin???s wedding so a ton of family was in town which was nice.
[00:56:14] Ryan1013: that's always good, ive been a little isolated from family recently
[01:14:18] KLVTZ: family wedding and thanksgiving, damn that's a lot of food.
[01:14:36] smathy: Huzzah, pushed 1.1 of wherex, got Rails4+ support into that sucker! (for the tiny percentage of you who might care :)
[01:20:03] midhir: Feels good eh mate? Shipped a big update to Redcrumbs this weekend too
[01:20:10] midhir: It's the season of giving etc..
[01:23:01] sevenseacat: ACTION pushed many updates to R4IA this weekend
[01:23:05] sevenseacat: success for all!
[01:23:44] sevenseacat: also, rails 4.2.0.rc1. exciting.
[01:25:36] smathy: midhir, yes it does, I also shipped 1.0 of acl9 (also with Rails4 support all tidied up)
[01:26:26] smathy: midhir, most fun was actually adding appraisals to both projects, that shit is cool.
[01:26:46] midhir: Good job :)
[01:26:51] x-light: SteenJobs: Happy belated thanksgiving :)
[01:27:00] SteenJobs: thanks bro!
[01:27:25] SteenJobs: KLVTZ: yea, my mother cooked for 25+ ppl on thanksgiving. was really something.
[01:28:29] Ryan1013: thats intense
[01:28:32] Ryan1013: thats like a camp lol
[01:28:38] x-light: Hey Ryan1013: What part of NZ are you...?
[01:28:42] SteenJobs: my mom doesn???t play games when it comes to food.
[01:29:53] SteenJobs: i feel outnumbered as a resident of the US right now. quite a funny dynamic. refreshing in fact.
[01:31:06] Ryan1013: x-light: Auckland
[01:32:43] x-light: Hey sevenseacat. Good work on R4IA :) Maybe I should buy it.
[01:33:02] sevenseacat: you should. there will be another MEAP version out relatively soon hopefully.
[01:33:08] helpa: Rails 4 in Action - http://manning.com/bigg2 - An excellent book combining Rails and TDD/BDD development. Written by Steve Klabnik, Ryan Bigg, Yehuda Katz
[01:33:24] sevenseacat: note: I am none of those three people
[01:33:39] x-light: sevenseacat: big sell there ;)
[01:34:54] sevenseacat: <h1><blink><marquee><b>BUYBUYBUY</b></marquee></blink></h1>
[01:35:51] x-light: Ryan1013: Cool. :) I'm in Hamil(tr)on. Used to be in Auckland but needed to get out. Not a big city boy.
[01:36:17] KLVTZ: SteenJobs: Holy Crap! How did her fridge survive. Our shelves in the fridge where bending...xD
[01:36:19] sevenseacat: do all people in Auckland soundlike the cast of Outrageous Fortune?
[01:36:41] x-light: Yes, and we all own v8 muscle cars.
[01:36:54] x-light: Mines in the garage.
[01:36:57] SteenJobs: sevenseacat: if i???m using a mail_to helper, is there anyway to get any analytics information, such as a timestamp, from users clicking said link and sending an email to said recipient?
[01:37:17] SteenJobs: KLVTZ: haha subzero fridges are one of the great wonders of the world.
[01:37:32] SteenJobs: sevenseacat: well a timestamp if they actually send an email...
[01:37:43] sevenseacat: SteenJobs: there's no way of knowing if they send an email or not.
[01:37:49] sevenseacat: its all done from their mail client.
[01:38:24] SteenJobs: right that???s what i figured - is there a better way to set up allowing a client to send emails that would allow for keeping track of the email sending?
[01:38:35] sevenseacat: send emails to who?
[01:38:40] x-light: nice code sevenseacat. Hope rest of R4IA is as good a quality.
[01:38:46] SteenJobs: sevenseacat: valid question obvs.
[01:38:51] SteenJobs: sevenseacat: to a list of subscribers.
[01:39:07] sevenseacat: make a form that allows them to do it?
[01:39:10] SteenJobs: sevenseacat: they can select a specific subsriber by clicking their name, which opens an email with the subscriber???s email address as the recipient.
[01:39:13] sevenseacat: then do the processing and serving server-side?
[01:39:22] sevenseacat: that way you can track whatever you want
[01:39:30] SteenJobs: sevenseacat: that???s what i was thinking but the guy i work for doesn???t think a form would provide an ???email like feeling??? for the client haha.
[01:39:42] sevenseacat: well it doesnt, because its not a direct email
[01:40:08] SteenJobs: sevenseacat: right. it seems the only alternative would be some type of email plugin, but also still not a great option.
[01:40:37] SteenJobs: sevenseacat: can i at least get a timestamp for someone clicking the mail_to link? it obviously would appear in the logs of my remote server???just not sure how to grab it.
[01:40:53] sevenseacat: probably, depending on how you're doing your analytics tracking.
[01:42:03] SteenJobs: sevenseacat: k great. thanks.
[01:46:20] SteenJobs: sevenseacat: now i need to figure out how to configure the app for production on hostmysite.com. shoot me now. why can???t we just use heroku???.
[01:46:34] sevenseacat: ask your devops dude
[01:47:05] SteenJobs: sevenseacat: if only there was one haha
[01:47:19] sevenseacat: well someone's deciding which host to use, ask them
[01:47:57] SteenJobs: sevenseacat: yea it???s the guy who owns the startup - it???s a pricing thing - once we accept our funding offers it won???t be a problem, but for now hostmysite is dirt cheap and he???s trying to save capital wherever he can.
[01:48:01] Ryan1013: x-light: cool I lived there for 7 years
[01:48:32] SteenJobs: sevenseacat: but this means learning how to configure from scratch, and not getting to use figaro, sendgrid, etc. with a single command :???(
[01:48:46] x-light: SteenJobs: hostmysite.com doesn't mention... rails. (lots of php tho)
[01:48:48] sevenseacat: ahh, VC funding, the root of all evil
[01:49:22] SteenJobs: x-light: meaning it might not even be compatible?
[01:49:38] SteenJobs: sevenseacat: it???s dirt cheap though. hostmysite is under 200/year
[01:49:57] x-light: SteenJobs: meaning it might be heaps of cost in other ways.
[01:50:12] x-light: SteenJobs: ie. not supported.
[01:50:30] SteenJobs: x-light: that would be ideal tbh, because then that means we???d be forced to use heroku!
[01:51:45] sevenseacat: or one of the other 40 million hosts out there that are cheaper than heropku
[01:51:55] sevenseacat: heroku is not cheap
[01:52:05] x-light: SteenJobs: yeah I think it might be useful to have a look at others as well (eg DigitalOcean)
[01:52:14] SteenJobs: sevenseacat: true???but as a one man team, it???s quite convenient.
[01:52:35] sevenseacat: digital ocean is much cheaper, but if you're going to that level, please please get someone who knows what theyre doing, looking after your servers
[01:53:13] SteenJobs: sevenseacat: what level?
[01:53:35] SteenJobs: sevenseacat: ???if you???re going to that level???
[01:53:44] sevenseacat: the level of managing your own servers
[01:53:54] SteenJobs: o yea, obviously. i???ve tried conveying that to him...
[01:54:59] SteenJobs: which is why i insisted on heroku until he decided to get a systems engineer or someone to manage the servers. but he doesn???t want to host on his own servers, his preference is to host it remotely on a cloud server.
[01:55:54] x-light: good advice sevenseacat
[01:56:08] sevenseacat: i try to always offer good advice :)
[01:56:44] SteenJobs: although i wish it was something i didn???t already know???and have tried to be pretty adamant about. but he definitely doesn???t want to have his own servers at this point.
[01:57:40] sevenseacat: good luck with that then... you're gonna need it
[01:58:10] SteenJobs: sevenseacat: but then again, i don???t think he fully realizes that using something like hostmysite entails managing your own servers?
[01:58:28] sevenseacat: sounds like its your job to educate him on that
[01:58:38] sevenseacat: if thats the case - i dont know anything about hostmysite
[02:00:04] SteenJobs: isn???t it supposed to be someone elses job to do that stuff if i???ve literally built the MVP single-handedly from scratch with no support (not including you guys of course)?
[02:00:28] helpa: Sorry, sevenseacat is not able to help you any further as they do not know.
[02:00:35] sevenseacat: hah wasnt expecting that
[02:01:09] sevenseacat: i work at a company that has dedicated designers and developers and sysadmins, so
[02:01:19] SteenJobs: sevenseacat: i just mean amongst conventional team structures - like that responsibility would presumably fall under the purview of someone else.
[02:01:49] sevenseacat: ive worked at places where it didnt
[02:01:57] SteenJobs: interesting
[02:02:15] SteenJobs: i figured it was analogous to asking a surgeon to provide anesthesia.
[02:02:25] sevenseacat: ACTION once took down a server that hosted every site made by the company, by misediting a DNS record
[02:03:28] SteenJobs: what ended up happening?
[02:03:34] SteenJobs: on a scale of one to pissed???
[02:03:40] sevenseacat: eh it wasnt down for long
[02:04:55] SteenJobs: ah well that???s good.
[02:17:22] smathy: SteenJobs, btw, depends on the team and often the size and stage of company. A "full stack developer" will often handle, y'know, the full stack - including setting up the server somewhere like DO, deploying, monitoring, alerting, etc.
[02:17:44] SteenJobs: smathy: good to know. you have any good resources to start reading up on that stuff?
[02:19:34] smathy: SteenJobs, I honestly can't even remember how I learnt about servers, feels like it just permeated into my brain over many years of being involved with teams that had great sysops.
[02:19:50] smathy: ...plus running Linux on the desktop for 10 years.
[02:19:53] smathy: That helped a lot.
[02:19:55] SteenJobs: yea, no kidding. def sounds like the best way to learn.
[02:20:18] SteenJobs: just by being around people that know what they???re doing and being attentive enough to pick it up as you go along.
[02:21:10] smathy: But even then, your desktop isn't going to get hacked, you usually don't have to setup your own firewall (because your internet router does it for you), lots of differences and things that you only learn by being in the trenches, or watching someone else while they're in them :)
[02:21:27] smathy: Oh right, yeah, that side of it was good education.
[02:22:00] SteenJobs: i mean i???m not familiar enough with hostmysite to know how much configuration i would need to do. it???s possible i won???t need to build from scratch.
[02:22:11] SteenJobs: just need to speak to them i guess and find out what exactly i do need to do on my end.
[02:22:22] x-light: SteenJobs: just had a quick look and it looks like a fair bit
[02:22:32] SteenJobs: shoot me now
[02:22:44] x-light: SteenJobs: boom!
[02:23:08] SteenJobs: i think this is the only thing possible that would make me rather work on the css for the app
[02:36:12] sevenseacat: css is mad fun.
[02:36:21] sevenseacat: making stuff look so purty
[02:36:30] notyawning: why does rails use snake case for model, controller, and other file names? Why not name them just like the classes are named eg: OrdersController.rb Order.rb
[02:37:17] sevenseacat: first reasons that pops into my head is that not all systems are case-sensitive
[02:37:46] sevenseacat: OrdersController could define either Orderscontroller or OrdersController
[02:42:11] notyawning: code that had both of those would be pretty smelly. But I see your point.
[02:43:04] notyawning: most file systems seem to be case aware for display purposes if not case-sensitive. but i guess that might not be good enough
[02:47:52] x-light: Ryan1013: Sorry - missed your msg. A lots changed in 7 years. As an example, we now have power ;). Gotta run for now, but maybe catch up later in the week.
[03:06:49] apeiros_: sevenseacat: wouldn't matter in case insensitive file systems
[03:07:25] apeiros_: if it's insensitive, why should require 'Foo' fail to load Foo.rb?
[03:07:56] sevenseacat: i was thinking more in terms of autoloading
[03:08:13] apeiros_: mind elaborating?
[03:08:32] apeiros_: I mean I don't see the problem there either, but it's 0400 here :)
[03:08:45] sevenseacat: yeah ive thought about it a bit more and maybe it wouldnt be a problem
[03:08:52] sevenseacat: like i said, it was the first thing that popped into my head :P
[03:09:26] apeiros_: ruby's require system is IMO one of the weaker parts in its design :-/
[03:30:00] Blizzy: anyone recommend a text editor for Rails for blog posts.
[03:30:21] sevenseacat: what functionality does it need?
[03:30:57] Blizzy: um, basically the functions of markdown. a markdown editor would be cool.
[03:31:35] sevenseacat: first google hit http://stackoverflow.com/questions/10440037/rails-markdown-editor-with-live-preview
[03:31:41] Ryan1013: the whole point of markdown is that you write it in plain text
[03:31:55] sevenseacat: it doesnt use a wysiwyg
[03:33:49] Blizzy: hmm, so what would #RoR recommend for a text editor for a blog?
[03:34:27] Blizzy: I am like 99% done with my project. I just need an editor.
[03:35:07] Radar: Blizzy: Sublime Text 3.
[03:35:25] Blizzy: nevermind. thxs, Radar. I'll just rewrite this in Django.
[03:35:50] Radar: Blizzy: Ace Editor is also good if you're looking for something that you can embed.
[03:35:58] Radar: It's what GH uses for Gist.
[03:37:22] Ryan1013: radar the json forem is coming along
[03:37:38] Radar: Ryan1013: Is it still an engine?
[03:37:48] Radar: How are you testing it?
[03:38:01] Ryan1013: i need you to write test cases.. urm.. lol
[03:38:13] Radar: yeah nah not going to happen :)
[03:38:30] Ryan1013: for now im just using postman in chrome
[03:39:52] Radar: I'd recommend looking at how the real Forem sets up a dummy app and then going from there
[03:43:03] Ryan1013: ok how about you help me with some functional requirements for the api? ill send you my list so far
[03:43:43] Ryan1013: https://gist.github.com/rocifier/76f93dc0abcaccade5e1
[03:44:02] Ryan1013: yeah ive got a dummy app working
[03:44:11] Ryan1013: im just not sure exactly what all the features of the api need to be
[03:44:28] Ryan1013: especially around users
[03:44:28] helpa: http://i.imgur.com/tyViD.gif
[03:45:16] Radar: Ryan1013: I'm at my day job now and can't do this?
[03:45:32] Ryan1013: Radar: okay I'll send you a bogey to scan when you're at home
[03:45:33] Radar: You've got a good list of requirements htere already.
[03:45:56] Ryan1013: beep. roger that
[03:46:10] Spami: ow I can improve that?
[03:47:34] Radar: ACTION uses his crystal ball to inspect Spami's code
[03:47:41] helpa: Sorry, we are unable to read your mind at this time. Please gist (http://gist.github.com) your code and any relevant stacktrace so we can assist you.
[03:47:50] Spami: Radar, yeah bug fail writing my sentence
[03:53:25] Radar: Spami: So.
[03:53:29] Radar: How's that sentence coming along?
[03:54:20] Spami: Got distracted but so: I have a open(url, :proxy=> stuff).read and it seems to use a fair amount of memory. any way to improve this
[03:56:15] Spami: To be more precise, I read stuff like this: https://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA and then parse the json
[03:56:29] sevenseacat: define 'fair amount of memory'
[03:58:12] Spami: the server runs out of memory after few minutes when 10 scripts are running un parallel
[03:58:18] Spami: *in parallel
[03:58:43] sevenseacat: and how have you determined that its related to parsing json?
[04:00:36] Radar: It's not even parsing it
[04:00:37] Spami: sevenseacat, I used a gem to track the use of memory: https://gist.github.com/anonymous/8b1a1a9d519157d56b9c
[04:00:39] Radar: It's just readin git
[04:01:29] sevenseacat: ok, so what does that mean
[04:02:17] Radar: Spami: Which gem?
[04:02:21] Spami: well, I'm guessing that each page is being saved in the memory and not released
[04:02:44] Spami: Radar, https://github.com/SamSaffron/memory_profiler
[04:02:50] Radar: And how much memory is free on the machine?
[04:03:14] Spami: Radar, 5GB
[04:03:26] Radar: Spami: It has 5GB *free* and it's still using it all?
[04:03:30] Radar: Seems unlikely imo
[04:03:31] sevenseacat: i like guessing games, they're my favorite.
[04:03:37] Radar: Spami: Free or total?
[04:03:44] Radar: Spami: how much RAM does the machine have total?
[04:03:46] Spami: 7.5GB total, 5GB free
[04:04:05] Radar: There's no explanation that I can come up with that explains why 10 concurrent processes would be taking up 5GB of RAM.
[04:04:10] Radar: We're going to need to see more code.
[04:04:19] Radar: Give us an app which reproduces this problem and we can probably fix it.
[04:04:31] Spami: Radar, http://codereview.stackexchange.com/questions/71055/reduce-memory-use-for-a-property-geolocator
[04:04:48] Radar: That's not an app.
[04:05:10] Spami: Ok let me get the app in github
[04:06:39] sevenseacat: how many times is your Property.includes.each line going to run?
[04:07:07] sevenseacat: and how many objects is that going to instantiate?
[04:08:05] sevenseacat: and i bet that doesnt get cleaned up
[04:08:33] sevenseacat: anything that wants to process 40 million records very quickly is going to be very memory intensice
[04:08:51] sevenseacat: especially if you do it as naively as that
[04:09:33] Spami: sevenseacat, for every record it's going to run
[04:12:22] Ryan1013: lol harvester nightmare
[04:13:31] s2013: for cache-control private, no-cache, proxy-revalidate, max-age=0' means its not being cached right
[04:13:51] s2013: or am i crazy
[04:50:11] Radar: s2013: You're the one telling the story.
[04:52:52] Ryan1013: any idea why this function successfully updates my database, but return 204 No Content? https://gist.github.com/rocifier/c051a72eb0f37dbe06c6
[04:52:54] s2013: huh? anyways, its cool
[04:55:00] sevenseacat: err, what HTTP status does 'updated' refer to?
[04:55:44] sevenseacat: so what are you expecting to get back?
[04:55:48] Ryan1013: I didn't realise it was reserved
[04:56:00] sevenseacat: (its not... thats my point)
[04:56:01] Ryan1013: { "status": "updated" }
[04:57:24] Radar: Ryan1013: It's returning a 204 because update does that by defualt.
[04:57:35] Radar: An update action doesn't need to return any data because you've just told it what that data should be
[04:57:40] Radar: So why should it return that same data?
[04:57:54] Ryan1013: to confirm that it worked
[04:59:13] Ryan1013: so it tends to be that 204 = success, anything else = error in this case?
[04:59:21] Radar: http://httpstatus.es/204
[05:00:05] Ryan1013: same with delete?
[05:00:26] sevenseacat: this is going to be an interesting engine
[05:09:42] Radar: Sounds like it's going smoothly so far.
[05:10:30] Ryan1013: yeah now that I understand how to return a status code it's going pretty smoothly
[05:18:00] Ryan1013: that's odd. hmm. how do I respond to json from a before_filter?
[05:18:57] Ryan1013: I'll post my code
[05:19:56] Ryan1013: https://gist.github.com/rocifier/1bd6c667907dcd8885ba
[05:20:12] Ryan1013: the issue is deleting the resource, ie. calling destroy
[05:20:40] Ryan1013: the record can't be found and it's just swallowing my respond_with in the exception handler and returning 204
[05:20:54] Ryan1013: instead of 404 with data
[05:23:01] fp-: i'm trying to build a small app similar to 37signals' Highrise in functionality, but more industry specific. Anyhow, poking around their API, it looks like they are using single table inheritance from a "parties" table with Company and Person < Party
[05:23:06] fp-: but I'm not entirely sure
[05:23:59] fp-: where I'm confused is how they're returning "name" on a company record, but "first_name" and "last_name" on a person record, via the /parties.xml api
[05:24:02] fp-: http://pastie.org/9753311
[05:35:10] Radar: https://gist.github.com/rocifier/1bd6c667907dcd8885ba#file-posts_controller-rb-L48
[05:35:11] Radar: Ryan1013: ^
[05:35:15] Radar: Put a return after this line
[06:19:47] blackhuey: hi, I'm trying to get my rails server to bind to instead of localhost by default. I can force it by using -b but I'd like to not have to do that every time. halp pls?
[06:21:57] sevenseacat: thats the new default, for security reasons.
[06:22:23] blackhuey: understood, but I need to access it from my host machine
[06:22:37] sevenseacat: so bind it to for the special case that you need it for
[06:24:49] blackhuey: the "special case" is every time. hence wanting to make it the default. Are you saying it's not possible, or that you wouldn't advise it?
[06:27:57] sevenseacat: i wouldnt advise it, theres a reason its no longer the default
[06:28:20] blackhuey: noted thanks. If I wanted to be retarded and do it anyway, how would I do it?
[06:28:42] sevenseacat: i wouldnt know.
[06:50:03] rhizome: blackhuey: up-arrow; enter
[06:56:26] Ryan1013: Radar you there?
[07:01:39] sevenseacat: its like sonar.... ping... ping.... ping
[07:04:16] Ryan1013: I think I found my answer
[07:04:35] Ryan1013: using recue_from to handle exceptions
[07:04:51] sevenseacat: thats what its for
[07:05:50] Ryan1013: nope still didnt work
[07:06:32] Ryan1013: it did catch the exception, but gave me a 204 status
[07:07:11] Ryan1013: totally not cool https://gist.github.com/rocifier/5923a32fc8b161c15f05
[07:07:20] sevenseacat: finally, some code
[07:07:28] sevenseacat: but no description of the problem
[07:07:45] Ryan1013: when I DELETE a resource
[07:07:55] Ryan1013: that doesnt exist.. I get 204 no content back
[07:08:01] Ryan1013: but I want to get 404 and a custom error back
[07:08:39] sevenseacat: (13:35:10) Radar: https://gist.github.com/rocifier/1bd6c667907dcd8885ba#file-posts_controller-rb-L48 Put a return after this line
[07:08:57] Ryan1013: I tried that, but it didn't change anything
[07:09:23] sevenseacat: got a log of whats happening?
[07:10:25] Ryan1013: refresh the gist page
[07:11:43] Ryan1013: that time I sent it random parameters, but same thing happens with no parameters
[07:12:08] sevenseacat: with no parameters? not possible
[07:12:20] sevenseacat: your route wouldnt match
[07:12:42] Ryan1013: no additional json parameters I meant, sorry
[07:13:27] sevenseacat: sure there's no post with ID 12?
[07:13:56] Ryan1013: yup if I comment line 8 out I get a big HTML page saying no record found exceptino
[07:15:33] sevenseacat: have to admit im not familiar with this usage of respond_with
[07:15:45] sevenseacat: but it doesnt seem to be doing what you think its doing
[07:16:02] hd1: how do I read values into rails from jquery's datepicker?
[07:16:21] Ryan1013: ok thanks for looking, I'll keep researching
[07:16:30] sevenseacat: hd1: you submit the form and then read it out of the params
[07:16:57] hd1: sevenseacat: you mean the input's name field?
[07:18:10] hd1: there's no submit button
[07:18:21] sevenseacat: how are you submitting your form then?
[07:18:57] hd1: <label for="from ">From Date:</label> <input type="text" id="from" name="from">&nbsp;&nbsp; <label for="to">To Date:</label> <input type="text" id="to" name="to">
[07:19:06] sevenseacat: that doesnt answer the question
[07:19:09] Ryan1013: sevenseacat: this worked -- render :json => '{ "error": "Post with id=' + params[:id] + ' not found." }', status: 404
[07:19:12] hd1: seems to be javascript
[07:19:29] sevenseacat: then read it out from the params after you get the ajax request
[07:20:36] sevenseacat: hd1: what are you actually trying to do
[07:21:23] hd1: I have a select box with facilities, I'd like to live filter on select from a drop down
[07:21:35] hd1: live filter the results
[07:21:44] sevenseacat: you dont need rails for that
[07:22:54] hd1: sevenseacat: maybe -- just hide the irrelevant rows?
[07:23:11] sevenseacat: that would be one idea.
[07:23:51] hd1: how about others?
[07:24:05] sevenseacat: if you did it in rails, you'd have to perform another search with the new filter, then return the new HTML, then update your page with the newHTML.
[07:40:56] Ryan1013: ok so far with the new forum api I can: query all posts, submit a post, delete my own post, edit my own post, get all comments for a post, submit a comment, edit my comment, delete my comment. getting there! categories -> forums -> topics -> posts is next
[07:43:35] sevenseacat: you can delete more than just your own post
[07:45:09] glaksmono: anyone had done rspec?
[07:45:16] helpa: Nope. No one. Ever. In the history of the world.
[07:45:33] glaksmono: any ideas about this error on my rspec? https://gist.github.com/glaksmono/00e0c4ca72ee55fa3170
[07:45:35] glaksmono: i don't get it
[07:46:08] sevenseacat: i'm guessing a discount belongs to a user
[07:47:34] rvanlieshout: and your discount factory doesn't obey disctount validation rules
[07:53:02] glaksmono: how do you create discount belongs to a user?
[07:53:17] sevenseacat: https://github.com/thoughtbot/factory_girl/blob/master/GETTING_STARTED.md
[07:53:21] glaksmono: and no, my discount doesn't belong to a user
[07:53:30] sevenseacat: we're guessing at the problem because you havent shown any code whatsoever.
[08:09:18] uber_hulk: Any anybody knows how to use resque locally?
[08:09:54] uber_hulk: I am running it as TERM_CHILD=1 QUEUES=* rake resque:work
[08:10:10] uber_hulk: but apparently it all the jobs are failing
[08:20:13] rvanlieshout: uber_hulk: failing with what error?
[08:23:16] uber_hulk: rvanlieshout: there are no errors, it just won't run the job it seems
[08:23:21] glaksmono: ah i think i found the reason why sevenseacat
[08:23:22] glaksmono: anyone is around?
[08:23:30] uber_hulk: rvanlieshout: th functionality is working fine on server
[08:23:32] glaksmono: discount belong_to business, and business belong_to user
[08:23:40] glaksmono: how do you do the factory girl to something liekt hat?
[08:23:47] sevenseacat: https://github.com/thoughtbot/factory_girl/blob/master/GETTING_STARTED.md
[08:34:38] tobago: say i want to do several things in ActiveRecord callback before_create and break it into several methods. how to ensure the order, in which the before_create callbacks run?
[08:35:07] tobago: is it the order they are defined?
[08:35:10] sevenseacat: they run in the order they are defined.
[08:35:18] tobago: sevenseacat, alright :) thank u!
[08:35:20] sevenseacat: and doing too much in callbacks is going to majorly bite you in the ass eventually.
[08:35:47] tobago: sevenseacat, i suspect it. put it into a concerning class instead?
[08:36:05] sevenseacat: a concerning class?
[08:37:02] tobago: sevenseacat, mmh. what do you mean by "is going to majorly bite you in the ass eventually" and how to prevent beeing bitten?
[08:37:22] sevenseacat: because 90% of the time you're interacting with the class, you're not going to want the callbacks to run, especially in tests
[08:38:05] sevenseacat: inevitably when people start doing lots of heavy lifting in callbacks, their next question is 'ok how do i skip callbacks'
[08:38:10] sevenseacat: answer: you don't
[08:38:17] tobago: sevenseacat, where to put the logic instead?
[08:38:22] sevenseacat: depends on what it is
[08:38:27] tobago: for 10% of the times.
[08:39:04] tobago: sevenseacat, I want to set default values if they are blank before creating the record.
[08:39:24] sevenseacat: why does the order of that matter
[08:41:25] tobago: sevenseacat, there are 2 attributes like: self.name = 'Default' if name.blank?; self.premedication_id = self.class.first if premedication_id.blank?
[08:41:49] tobago: sevenseacat, and i'd like to put it into 2 callback methods because of the conditions.
[08:41:57] sevenseacat: right, the order of them doesnt matter
[08:43:27] sevenseacat: also, there's no reason to split them out into separate methods.
[08:43:57] tobago: sevenseacat, o.k. would you stick having just one callback method per callback in general?
[08:44:50] sevenseacat: no, but i would group related things together like 'setting default values'
[08:45:42] tobago: sevenseacat, o.k. how would you handle 2 grouped callback methods in terms of their order, if it matters?
[08:46:04] sevenseacat: if it matters, i would look very hard at the logic and whether or not it should be there.
[08:47:26] tobago: sevenseacat, o.k. fair enough. i need to implement a cloning logic (deep copy), if a reference of another object of the same class is set: deep_copy if premedication_id
[08:50:08] tobago: sevenseacat, I'll pastie some code.
[08:57:54] tobago: sevenseacat, would you put the "deep_copy" stuff into the same defaults method: https://gist.github.com/trinibago/e0e089045d98cc0eb145
[09:02:27] DaniG2k: I hope you didn't miss me too much
[09:03:07] uber_hulk: Hi all. In CSV.parse(filename, headers: true, skip_blanks: true)
[09:03:17] uber_hulk: should skip the blanks lines in csv like ,,,,,,,,,
[09:03:23] uber_hulk: Am I right?
[09:03:36] uber_hulk: It should skip such lines and keep parsing?
[09:04:00] rvanlieshout: uber_hulk: what does CSV.parse return?
[09:04:18] uber_hulk: yes a hash I suppose
[09:04:42] rvanlieshout: hash != array
[09:07:19] uber_hulk: rvanlieshout: array of arrays
[09:07:41] uber_hulk: so there is one array sth like [,,,,,,]
[09:08:34] uber_hulk: so after this it will stop parsing, rvanlieshout
[09:13:50] rvanlieshout: uber_hulk: result.reject(&:blank?)
[09:15:55] rvanlieshout: if .blank? is true for that one
[09:18:03] uber_hulk: I am skipping validations
[09:38:02] uber_hulk: Thant's the necessity
[09:38:22] zly: Does anyone know how to generate Doorkeepers refresh_token from rails_console?
[09:41:31] apoorvparijat: I'm reading this - http://12factor.net/config
[09:42:01] apoorvparijat: and it says the way Rails groups configuration as development, test and production is not scalable.
[09:42:43] apoorvparijat: According to this, the best way to store deployment configuration is using environment variables.
[09:43:22] apoorvparijat: How can one go about doing that?
[09:43:44] apoorvparijat: Run a bash script on every instance of the app which sets the environment variable?
[09:44:13] apoorvparijat: Also, the codebase itself will be cluttered with references to environment variables, and to me it seems, dirty.
[09:50:27] alex88: apoorvparijat: I use https://github.com/settingslogic/settingslogic so you define a global configuration object and pick values from ENV with fallbacks
[09:51:03] alex88: about how to set the env variables, you use either nginx config (passenger) or use something like https://github.com/bkeepers/dotenv-deployment in your deploy script to create the env file
[09:51:17] alex88: that's how I do, YMMV
[09:54:15] mrbubbles: apoorvparijat: following the advice of workmad I ended up using upstart to set the env variables when the server reboots
[09:55:44] krz: is friendly_id worth it? or easy enough to manually implement?
[09:57:02] apoorvparijat: mrbubbles: upstart is an interesting approach to do this.
[09:57:18] apoorvparijat: alex88: Looking into settingslogic and dotenv.
[09:58:06] mrbubbles: apoorvparijat: http://upstart.ubuntu.com/cookbook/#environment-variables
[09:58:22] uber_hulk: mrbubbles: that's nice
[09:58:47] krz: apoorvparijat: .env will do the trick
[09:58:54] krz: dotenv the gem
[09:59:06] krz: we use it in aws opsworks. works great!
[10:00:49] alex88: krz: I use that too in opsworks
[10:01:18] krz: alex88: whats your layer setup? bg, fg and cron?
[10:01:43] apoorvparijat: krz: Yep. Seems like it.
[10:01:54] alex88: no cron, just frontend (rails with passenger-nginx) and workers (sidekiq), all with custom recipes
[10:03:17] apoorvparijat: Btw, why would you choose opsworks above EC2 with your custom image?
[10:03:56] apoorvparijat: Is there any significant advantage in the beginning?
[10:04:11] alex88: apoorvparijat: depends how often you deploy, if you build it automatically or not
[10:04:14] apoorvparijat: i.e when scaling is not a bottleneck.
[10:04:34] alex88: I'm the only developer/sysadmin here and so writing chef recipes is easy enough to fire up 1 or n servers
[10:05:45] alex88: also if you have a simple app the default rails layer in opsworks works just fine
[10:06:10] alex88: I'm just waiting for aws ecs to be ga and integrated with elb/cloudwatch.. sounds they have great plans for that
[10:06:14] apoorvparijat: Got confused. You don't use chef with opsworks. Do you?
[10:06:23] DaniG2k: woohoo there will be garbage collection of symbos in Ruby 2.2 :D
[10:06:24] alex88: yeah you do
[10:06:33] DaniG2k: not even sure if that's good or bad but I'm excited ! :D
[10:06:39] alex88: unless you want to use their default layers
[10:07:00] apoorvparijat: Ah okay. Will give it a spin and come back.
[10:07:16] alex88: apoorvparijat: enjoy
[10:11:59] DaniG2k: tagrudev: :(
[10:12:30] apoorvparijat: alex88: What do you use for log streaming? Sentry, fluentd, or something else?
[10:13:20] alex88: apoorvparijat: sentry isn't about exception tracking? btw we use sentry hosted free on heroku for exceptions and logentries gem with syslog-ng for logs
[10:17:54] DaniG2k: tagrudev: are you a core Rails dev?
[10:17:58] DaniG2k: or just a troll like me?
[10:18:03] hd1: ActiveRecord::Base.connection.execute("#{sqlstatement}").values should return a standard ruby array, right?
[10:18:34] apoorvparijat: Ah yes, Sentry only for exceptions.
[10:18:35] tagrudev: core Rails nope, troll nope
[10:19:56] DaniG2k: tagrudev: THEN WHAT ARE YOU?????
[10:19:56] tagrudev: hd1, it's easy to check that
[10:20:26] tagrudev: DaniG2k, I am awesome
[10:20:33] shortCircuit__: what is a good metric gem
[10:20:41] workmad3: tagrudev: stop trolling :P
[10:20:58] hd1: tagrudev: the question i'd like to ask, is how do i iterate over the results of ActiveRecord::Base.connection.execute?
[10:21:44] tagrudev: hd1, each_hash :?
[10:21:59] tagrudev: let me check
[10:22:11] workmad3: tagrudev: why not let him check? :P
[10:22:58] hd1: workmad3: cause the bloke's got his ego invested in the answer now :p
[10:22:58] workmad3: hd1: did you try just calling .each on the result and looking at what you got? (you know, like you can do with pretty much any collection in ruby)
[10:23:22] tagrudev: workmad3, well that's an option too but now he got my curiousity
[10:23:38] hd1: workmad3: #<PG::Result:0x00000005b779d8 @connection=#<PG::Connection:0x00000005770970 @socket_io=nil, @notice_receiver=nil, @notice_processor=nil>> get this after hitting return on the line
[10:23:49] hd1: that doesn't look like an array to me
[10:23:56] workmad3: hd1: I said *collection* not array
[10:24:11] workmad3: hd1: .each is the standard interface for enumerable collections in ruby
[10:24:14] hd1: nor does it look like a *collection*
[10:24:29] workmad3: hd1: it says 'Result' is the class name from a database
[10:24:34] workmad3: hd1: seems collection-ey to me :P
[10:24:48] workmad3: hd1: and you'd expect it to be a collection of results simply from what you're looking for
[10:25:00] workmad3: hd1: so I repeat... did you actually try calling .each on it? or looking at the pg gem docs?
[10:25:11] workmad3: hd1: or did you just come on here and want us to google it up for you? :P
[10:25:20] hd1: workmad3: yes, I did.
[10:25:42] workmad3: hd1: ok... and what happened? :)
[10:25:42] hd1: no, I actually am basing my code off the pg gem tests
[10:25:50] hd1: nothing came up
[10:26:05] workmad3: hd1: but you didn't get a NoMethod error?
[10:26:58] hd1: i get the following
[10:27:07] tagrudev: so it's empty
[10:27:10] hd1: => #<PG::Result:0x00000005d6cd88 @connection=#<PG::Connection:0x00000005770970 @socket_io=nil, @notice_receiver=nil, @notice_processor=nil>>
[10:27:53] workmad3: hd1: as tagrudev said, you got no results back
[10:27:54] tagrudev: each should iterate over the values of the result
[10:28:30] tagrudev: but that's written in the docs
[10:29:52] wopi: Hi, what is the difference betwenn the roles :web and :app in Capistrano3 ?
[10:30:24] workmad3: wopi: :web is the web server (e.g. apache/nginx), :app is the app server
[10:30:46] workmad3: wopi: in a lot of setups, they're the same... but if you've split off your web server to load balance across multiple app servers, they won't be
[10:30:56] wopi: workmad3: so you mean web is more like a static file server ?
[10:31:06] wopi: workmad3: and app is where my unicorns are running ?
[10:31:52] workmad3: wopi: :web would be the web server that serves your static files and probably load-balances across multiple app servers (if you have that setup)
[10:32:03] workmad3: wopi: but it's all rather dependent on your setup
[10:32:22] wopi: ok, thanks
[10:32:53] workmad3: wopi: at it's simplest, without involving semantics, ':web' are the servers that you've set up with the :web role, and :app are the servers you've set up with the :app role, and the meaning behind it is whatever you've chosen for your deployment (but typical meaning is as previously suggested :) )
[10:33:31] hd1: ahh... ok so i made a spelling mistake in my SQL... got some results... how do i access the individual columns in this collection, code snippet follows
[10:34:41] hd1: @mycol = ActiveRecord::Base.connection.execute('SELECT id, foo from model').each { |m| puts('#{m.id}')
[10:35:02] rvanlieshout: why would you need that to fix a spelling mistake?
[10:35:03] hd1: undefined method `id' for #<Hash:0x000000092f2f20>
[10:35:14] workmad3: hd1: they're hashes
[10:35:15] rvanlieshout: and did you even look at what's presented in that block?
[10:35:25] sevenseacat: apparently not
[10:35:33] hd1: rvanlieshout: if you scroll up, you'll see, I did
[10:35:50] hd1: and sevenseacat is apparently blind :p
[10:35:57] rvanlieshout: hd1: look at m
[10:37:35] sevenseacat: feel free to apologize when you see your own silly mistake.
[10:41:27] piezol_: Hi. Stupid question from newbie: is it possible to change the keyname of id inside params without changing routes ?
[10:42:03] piezol_: i will paste my routes here and write down what i mean exactly
[10:42:04] workmad3: piezol_: no, you'd need to rewrite the routes... if you were using resource routes, you'd need to write them out by hand
[10:42:10] hd1: ACTION laughs at himself and apologises to whomever wants one
[10:42:11] sevenseacat: nope, you can change the param
[10:42:32] rvanlieshout: hd1: but the problem isn't fixed yet?
[10:42:33] sevenseacat: eg. if you want like params[:slug] instead of params[:id]
[10:42:40] piezol_: workmad yes resource routes is exactly what i do... Such a shame :<
[10:42:48] hd1: rvanlieshout: i think it is
[10:43:08] rvanlieshout: piezol_: it's also not common to change the param name
[10:43:47] piezol_: but it would be helpful in my case
[10:43:58] hd1: i will add, that if you go around demanding an apology in the part of the world where i grew up, you're liable to get something other than an apology probably involving a blunt object connecting with your head
[10:44:15] sevenseacat: http://edgeguides.rubyonrails.org/routing.html#overriding-named-route-parameters
[10:45:03] workmad3: sevenseacat: that's on edgeguides
[10:45:11] workmad3: sevenseacat: can't see it on guides... is it new in 4.2?
[10:45:15] sevenseacat: its been part of rails for a long time, though
[10:45:19] sevenseacat: just only recently added to the docsa
[10:46:57] uber_hulk: Hi all. I am trying to import the csv contacts in my app but I am not sure why it would stop after importing just first contact when other contacts also have email and mobile present
[10:47:06] uber_hulk: here is my code https://gist.github.com/anonymous/96dbe14f5da33d7f3db4
[10:47:24] uber_hulk: I reviewed code quite a few times, nothing looks buggy
[10:47:26] workmad3: piezol_: see sevenseacat's response... she knew about a feature that's only just been documented ;)
[10:48:07] brazenbraden: so I'm playing with Public Activity. I have a tonne of different engines so the recorded trackable_type looks like EngineName::Controller. The Public Activity install generator does not provide the model for Public Activity but I would like to add a custom method into the model to get all records LIKE enginename. Is there anyway of makingg a custom model that inherits from Public Activity?
[10:48:20] piezol_: Workmad yep i am looking at it right now. I've came from rewriting routes to rewriting app :) Still useful for me, though, thanks
[10:48:35] maloik: Does anyone know of any good ways to check if all keys in secrets.yml have been set before a test run or before a deploy?
[10:49:06] maloik: Just now I got a pretty vague error that took a while to figure out, turns out a new feature required an extra key in secrets.yml that wasn't set on my machine
[10:49:10] workmad3: maloik: as in has a value, or been specified at all?
[10:49:21] maloik: well both I suppose
[10:49:39] maloik: (specifying it without a value seems a bit pointless?)
[10:49:59] workmad3: maloik: 'foobar: <%= ENV["foobar_value"] %>'
[10:50:03] uber_hulk: workmad3: can you please have a quick look at my gist as well?
[10:50:15] workmad3: maloik: ^^ forget to specify the env var, it's value-less ;)
[10:50:58] workmad3: maloik: checking if it exists... you'd need to specify what keys you expect and have some code to verify they have been... nothing is built in for that, I believe
[10:51:17] maloik: we don't use env vars for that, but I see what you mean
[10:51:43] workmad3: maloik: checking for values... you could use Rails.application.secrets.values.any?(&:blank)
[10:52:06] maloik: it's mostly them being undefined in the first place that I'm worried about... if they're plain wrong it should be more obvious
[10:52:40] workmad3: maloik: yeah... the problem is that rails itself allows you to specify any arbitrary values in there... so it can't check that you've specified them all
[10:53:01] maloik: I might give grepping the source code a shot
[10:53:05] workmad3: maloik: and most people would find it very annoying to have to specify a new key in two places (secrets.yml and some other config file to say "this key is expected")
[10:53:06] maloik: not sure how performant that would be
[10:53:23] piezol_: with resources :categories, param: :category_id do ... end i end up with {"action"=>"index", "controller"=>"products", "category_category_id"=>"3"} XD
[10:53:52] piezol_: when inside products controller action
[10:54:11] workmad3: piezol_: sounds about right ;)
[10:54:52] piezol_: Well what i wanted was "always "category_id" and always "product_id" "
[10:55:26] uber_hulk: workmad3: =P
[10:55:58] workmad3: uber_hulk: I'd already taken a look... if I had any advice I'd have given it
[10:56:15] uber_hulk: workmad3: aha, okay also one more question
[10:56:23] workmad3: uber_hulk: hi-lighting people and asking for help is rather rude btw
[10:57:05] workmad3: uber_hulk: so ask your question to the channel and if anyone has a response they will answer it
[10:57:36] workmad3: uber_hulk: but don't ask specific people unless they've already responded (and no, this does not count as a response on my part)
[10:58:44] workmad3: uber_hulk: a.k.a. I'm busy with other people's questions and my own work, so I'm not inclined to respond to someone who hi-lighted me unsolicited now :P
[10:59:03] uber_hulk: Okay, got it
[11:01:00] piezol_: Maybe this way http://pastebin.com/Yt10TYVd
[11:01:26] piezol_: Sorry, bot, didn't know :(
[11:02:58] piezol_: As you wish, bot http://pastie.org/9753803
[11:12:27] piezol_: I can't believe i was this stupid. I tried to check, whether product/category is defined by looking at params instead of locals exposed by controllers :o
[11:15:55] maloik: workmad3: https://gist.github.com/hannesfostie/56e310aadee74e698fd5
[11:16:16] maloik: simple rake task i just came up with... will probably turn it into a gem for easy capistrano and rspec/minitest implementation
[11:16:27] maloik: ... at some point :P
[11:17:32] workmad3: maloik: fun :)
[11:17:56] maloik: I do wonder if others sometimes have this "problem" as well
[11:21:32] workmad3: maloik: it's still early days with secrets.yml, but I think most people tend to pull in environment variables for use in production
[11:21:57] workmad3: maloik: so they can check in their secrets.yml, rather than needing to communicate new values to each dev
[11:22:33] maloik: I think we may need to do that... dotenv takes care of that right?
[11:23:19] DaniG2k: anyone know the difference between input type search and input type submit?
[11:23:34] DaniG2k: I'm making a search box so I suppose I should use the first
[11:24:11] maloik: I guess I don't know if dotenv should be used in production tho
[11:25:13] workmad3: maloik: things that I need as environment variables, I set up in the init script or runit script in production
[11:25:40] workmad3: maloik: with runit, I specifically use an env directory, filled with files where the filename is the variable and the contents are the value, which you can pass to chpst with a -e option
[11:25:45] sevenseacat: arrr bootstrap
[11:26:31] maloik: sounds like a bit more work than what I had in mind
[11:27:04] sevenseacat: ACTION googles 'bootstrap navbar-right negative margin' and gets a billion results
[11:30:37] quazimodo: hi kitty :D
[11:30:49] shortCircuit__: If I have a custom error message, and I run u = User.new and u.valid? it says true
[11:31:05] sevenseacat: quazimodo: i asked you to stop.
[11:31:18] sevenseacat: shortCircuit__: why wouldnt it?
[11:31:38] quazimodo: i became naughty
[11:31:48] workmad3: maloik: well, I generate the entire runit service with chef using the opscode runit resource ;)
[11:32:23] workmad3: maloik: so generating the directory == passing a hash to the resource
[11:32:25] shortCircuit__: let me check again, maybe (i learnt) because it runs a errors.clear or something like that first
[11:32:36] workmad3: shortCircuit__: .valid? does indeed clear errors
[11:33:31] workmad3: shortCircuit__: if you want to return false from .valid?, you need to add a custom validator that will get run during validation, not just add a random error message before running .valid?
[11:37:01] Ryan1013: I want to put this line at the top of all my controller classes: rescue_from ActiveRecord::RecordNotFound, :with => :record_not_found
[11:37:28] Ryan1013: where's a good place to define record_not_found so I don't repeat code but so it doesn't get lost somewhere in the depths of my engine?
[11:37:30] workmad3: Ryan1013: no
[11:38:02] Ryan1013: workmad3: it's a json api
[11:38:06] workmad3: Ryan1013: record not found is already handled by the rails stack, and will route into a 404 in the exceptions_app if you have one defined
[11:38:36] workmad3: Ryan1013: so the 'correct' way to handle it is to set up an exceptions app that handles 404s
[11:38:54] Ryan1013: ah ok and that will work with json?
[11:39:11] workmad3: Ryan1013: yup, that will work regardless of request/response type
[11:39:24] workmad3: Ryan1013: you just need to render the appropriate errors in the exceptions app
[11:40:00] Ryan1013: it's funny because I found this example in rails guides
[11:43:46] shortCircuit__: >:( why I can't reproduce errors.
[11:45:54] hekep: help : similar problem, http://stackoverflow.com/questions/1254366/problem-installing-rmagick-rubygem-on-centos-5 , error is /usr/bin/ruby -r ./siteconf20141201-8878-1r24op3-0.rb extconf.rb
[11:45:54] hekep: extconf.rb:153: undefined (?...) sequence: /^Version: ImageMagick\s+(?<Version>\d+\.\d+\.\d+\-\d+)\s+(?<Unknown>\S+)\s+(?<Arch>\S+)\s+(?<Date>\S+)/
[11:46:33] hekep: unable to install rmagick gem :(
[11:46:43] rvanlieshout: hekep: gist full error output
[11:46:48] rvanlieshout: and maybe switch to mini_magick
[11:47:05] helpa: hekep: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[11:48:19] Ryan1013: workmad3: should I use config.exceptions_app = self.routes?
[11:48:27] workmad3: Ryan1013: that's what I tend to do
[11:48:28] hekep: https://gist.github.com/hekep/cd5453b319fc5ed5bc92
[11:49:27] hekep: rvanlieshout , do not know how to switch , newbie to Ror, tring simply to install this https://www.chiliproject.org/projects/chiliproject/wiki/Installation#Which-version-to-choose
[11:49:29] Ryan1013: workmad3: do I match them with GET?
[11:49:34] rvanlieshout: hekep: and you've got ImageMagick installed?
[11:49:56] hekep: suppose so ... have tried everything within centos 6.5
[11:49:59] rvanlieshout: hekep: and have you checked if rmagick 2.13 is ruby 1.8 compatible?
[11:49:59] workmad3: Ryan1013: you need to use 'match "/<code>" => "whatever", via: :all'
[11:50:44] shortCircuit__: rvanlieshout : do you use any metric gem?
[11:51:02] hekep: actually I am stuck with ... chillyproject 'bundle install --without test development' , do not know comaptibility issues ...
[11:51:03] workmad3: Ryan1013: needs to match with the original request method... so if you want to be able to catch the error on any action, you need to match with :all (otherwise you wouldn't have a /404 route for DELETE, for example)
[11:51:54] hekep: actually I am stuck with ... chillyproject 'bundle install --without test development' , and It tries to install gem install rmagick -v '2.13.4'
[11:52:08] shortCircuit__: I actually saw that sandi metz was using a metric to demonstrate how she reduced the code complexity
[11:53:41] workmad3: hekep: are you using the master branch?
[11:53:56] hekep: rvanlieshout, Idk what to do, what libs / versions suppse to be installed prior ' gem install rmagick' ...
[11:54:22] workmad3: hekep: because the master branch of their repository has removed 1.8 compatibility, without updating the install guide
[11:54:51] hekep: workmad3 , git clone -b stable git://github.com/chiliproject/chiliproject.git , was this the answer you wanted ?
[11:55:32] hekep: ACTION argghgg , depressed & frustarated !!!
[11:56:42] workmad3: hekep: any particular reason you've decided to install what appears to be a dead project, btw?
[11:57:59] hekep: workmad3, might be useful, what's the next best thing ...
[11:58:19] hekep: what can I do to get it work in centos
[11:58:43] sevenseacat: chiliproject was a fork of redmine because redmine got stupidly out of date
[11:58:48] sevenseacat: then redmine got updated
[12:01:32] Ryan1013: is config/application.rb recognised in an engine?
[12:03:58] fxn: hi, is there a way to detect cherry-picks of a given commit? some good-enough programmable heuristic or something? (cherry-picks withou -x)
[12:05:08] fxn: I have a little utility that tells which release contains a certain commit, would like to add "and it is also present in this other one", where the other one is presumably in a different branch
[12:05:53] fxn: errrr, wrong channel!
[12:08:00] Ryan1013: can someone help with custom 404? I'm still seeing the default rails 404 page: https://gist.github.com/rocifier/9a2686c92d01e5062441
[12:12:40] sevenseacat: its a really really bad idea to render 500s from the app itself
[12:12:54] sevenseacat: what happens if something in your 500 error handling throws a 500?
[12:15:00] comrad: what if your rending a 500 produces a usual 500? ;)
[12:15:07] comrad: will you then throw a 500? ;)
[12:15:30] Scott2619: What are engines used for?
[12:16:38] Scott2619: Nevermind just found http://guides.rubyonrails.org/engines.html lol.
[12:18:21] Scott2619: Okay so why would you use another engine?
[12:20:20] pacMakaveli: Split the app
[12:20:27] pacMakaveli: In case it gets big..
[12:20:55] pacMakaveli: Gems are engines, from a certain point of view
[12:24:08] shortCircuit__: what is a better way to write this? if @com..update_attributes() && @company.address.update_attributes) && .... ?
[12:24:24] shortCircuit__: http://pastie.org/private/knktiftqsuqdjxmjpevaa
[12:26:26] pacMakaveli: I would start with moving that .all_companies find into the user model
[12:27:19] alex88: I've a new rails app, trying to integrate guard + rspec + simplecov + spring https://gist.github.com/alex88/1352efd5ebfd06f64b65
[12:28:13] alex88: problem is `bundle exec rspec` works fine, `bundle exec spring rspec` doesn't, coverage of first is correct, coverage of second command shows 0 coverage
[12:28:18] shortCircuit__: ow now, they are nested attribuwtes
[12:36:21] greengriminal: Hey guys can borrow me a set of eyes on this one please: https://gist.github.com/anonymous/fc47876b5cb735c63891
[12:37:08] greengriminal: query1 = #mysql_string and x = 1 so why if i do ActiveRecord::Base.connection.execute("query#{x}") it doesn't fetch the query?
[12:37:46] greengriminal: I know i can do ActiveRecord::Base.connection.execute(query1) and this will work.
[12:38:32] greengriminal: Like what is the difference between: https://gist.github.com/anonymous/e9aa4ef5a136377a617b
[12:40:14] jammanbo: Um ??? you're trying to execute the variable name?
[12:40:42] greengriminal: yes that is right.
[12:41:01] Ryan1013: you mean wrong
[12:41:07] jammanbo: It's right to execute "query1" rather than "#{query1}"
[12:41:58] greengriminal: Yes i see my issue.
[12:42:03] greengriminal: I am passing in a string
[12:42:14] greengriminal: but i actually want to be calling the variable.
[12:42:29] jammanbo: instance_variable_get or eval or whatever?
[12:42:43] greengriminal: instance_variable_get ?
[12:43:25] greengriminal: I will try that out
[12:44:04] sinelaw: hi! my environment/development.rb is not being loaded, even if I export RAILS_ENV=development
[12:44:06] Ryan1013: Radar you still awake?
[12:44:09] sinelaw: how can I debug this?
[12:44:54] sinelaw: when running rake, development.rb is not run - and even if there's a syntax error in development.rb, there's no error.
[12:47:46] jammanbo: you in the right directoy sinelaw?
[12:48:11] sinelaw: yes, when I change config/application.rb it shows up
[12:50:25] Varun_krishna: Hi all where do I put this code http://stackoverflow.com/a/4581116
[12:50:34] Varun_krishna: in application.rb ?
[12:51:51] rvanlieshout: Varun_Krishna: where you want that to be executed
[12:52:12] Varun_krishna: rvanlieshout: Seriously I don't get that .
[12:52:23] greengriminal: i take it using #define_method or #send is much better than using #eval correct?
[12:52:39] rvanlieshout: Varun_Krishna: that ruby code performs a get request
[12:52:47] sinelaw: how can I debug which environment is selected by rake?
[12:52:47] Varun_krishna: So I would like to send a n http request when a user creates a new post, so where should I add ?
[12:53:03] Varun_krishna: in PostsControllers#new action ?
[12:53:09] rvanlieshout: create action
[12:53:12] rvanlieshout: but could be a place yes
[12:53:27] Varun_krishna: Ok thanks I got that.
[12:58:50] shortCircuit__: does controller generate the http location headers?
[13:02:02] rvanlieshout: shortCircuit__: when?
[13:03:40] shortCircuit__: when? I am not quite sure, I just asked who generates them, Generally those things are in the controller so I guess from the view to the controller, why would a model ned location headers
[13:04:09] rvanlieshout: a controller doesn't generate anything unless something is called
[13:04:18] rvanlieshout: if you use a redirec_to, a location-header is added
[13:07:33] hekep: I have still the same error, now with ruby 2 and rails 4 , https://gist.github.com/hekep/cd5453b319fc5ed5bc92
[13:08:42] rvanlieshout: hekep: it's still using 1.8
[13:08:48] rvanlieshout: see the last line of your error
[13:11:00] AxonetBE: Hi, I???m currently developing something like a carconfigurator and I was wondering how to store the selection I made in a multistep form
[13:11:42] AxonetBE: the answers in a next step depends also on the answers giving in the previous steps
[13:12:23] hekep: rvanlieshout ,argghh got it ... changed to 2.0
[13:12:47] hekep: is there quick way to uninstall 1.8.7
[13:14:58] brazenbraden: so I'm playing with Public Activity. I have a tonne of different engines so the recorded trackable_type looks like EngineName::Controller. The Public Activity install generator does not provide the model for Public Activity but I would like to add a custom method into the model to get all records LIKE enginename. Is there anyway of makingg a custom model that inherits from Public Activity?
[13:24:25] rvanlieshout: hekep: use a ruby version manager?
[13:31:05] rails_noob: If I want to have a form that changes according to the collection_select from an association, so for example the first question in the form is to chose the user, then the second question is to select the group, but I don???t want it to show me all the groups, just the groups that are associated to that user, how would I go about doing something like that?
[13:32:34] universa1: Rails_noob: !g dependent collection select rails
[13:35:31] rails_noob: universa1: I think its possible you misunderstood my question. I have the dependent collection created already, so it is already showing me that collection, but I would like the form to be dynamic by only showing me the groups from the user chosen in the first collection.
[13:36:13] universa1: Rails_noob: random link from the first page: http://stackoverflow.com/questions/5311284/rails-dependent-collection-select-fields-in-form
[13:37:05] universa1: Rails_noob: there are probably more railsy ways...
[13:39:20] universa1: but then there are many more links in that google search that look promising
[13:39:23] Ryan1013: universa1: do you know about using config.exceptions_app for engines?
[13:39:46] universa1: Ryan1013: no. but somebody else probably does. so just ask your question.
[13:40:03] brazenbraden: Im trying to call an action Logs#hrmod which does a query, then render the tables action and view with the result from the hrmod action. How do I do this? https://gist.github.com/brazenbraden/cf9c7111a97cf4fddd6b
[13:40:41] universa1: BrazenBraden: render action: :table
[13:40:43] greengriminal: Can no one judge me on this, as there may be quite a few things that will be refactored. Currently i have: https://gist.github.com/anonymous/d4be54716f3e7b818858. It seems to throw a undefined method `query2` however in the log it is actually defined.
[13:41:04] universa1: BrazenBraden: or render :table might also work... i don't understand your question.
[13:41:05] greengriminal: I believe the way i call: ActiveRecord::Base.connection.execute(eval("query#{x}")) maybe an issue.
[13:41:55] DaniG2k: has anyone here used solr & elasticsearch?
[13:42:12] helpa: DaniG2k: Nope. No one. Ever. In the history of the world.
[13:42:13] universa1: DaniG2k: !anyone
[13:42:17] Ryan1013: any idea why this happens? visiting /jsonforem/404 in my engine "jsonforem" shows me my error controller is working, but if I navigate elseware to something that doesnt exist, I'm not getting the custom error page. Here's my jsonforem/lib/jsonforem.rb: https://gist.github.com/rocifier/b6ecf6842d5c2fd1997b
[13:42:17] universa1: greengriminal: https://gist.github.com/anonymous/d4be54716f3e7b818858#file-gistfile1-rb-L89
[13:42:18] hekep: hmm now? https://gist.github.com/hekep/7a0577accc35d21dc919
[13:42:25] brazenbraden: universa1, render :table does nothing. When you click a tab in the view, I do an ajax load on logs/hrmod which performs that query but I then want it to render the table.html.haml view using the result from tyhe hrmod action.
[13:42:29] universa1: greengriminal: you're just assigning a string...
[13:42:45] universa1: BrazenBraden: look in the browser log.
[13:42:51] universa1: BrazenBraden: network tab.
[13:42:52] DaniG2k: universa1: have you?
[13:43:04] universa1: DaniG2k: no.
[13:43:16] universa1: DaniG2k: just ask your question...
[13:43:19] helpa: Don't ask "does anyone use <thing>?". It's better to just state your problem and if anyone has used <thing> they will most likely answer.
[13:43:40] greengriminal: universa1: Check my log: https://gist.github.com/anonymous/d4be54716f3e7b818858#file-logs-L3
[13:44:01] DaniG2k: I'm using Solr on a DigitalOcean VPS and am wondering if it's best to use Elasticsearch for my other website or to use another Solr instance
[13:44:12] DaniG2k: will it be more resource intensive to use Elasticsearch or just about the same?
[13:44:20] universa1: greengriminal: https://gist.github.com/anonymous/d4be54716f3e7b818858#file-gistfile1-rb-L63
[13:44:30] hekep: provided more info for my problem , https://gist.github.com/hekep/7a0577accc35d21dc919 , can anyone help ? ...
[13:44:46] universa1: greengriminal: you'e just printing out strings...
[13:45:02] universa1: "foo = bar" is just a string that looks like an assignment but is in fact just a string
[13:45:22] universa1: greengriminal: and you don't need eval...
[13:45:23] jammanbo: I've used Elastic a good bit, and looked into Solr, and my conclusion was that Elastic was vastly cooler. Not saying anything about resources, just interface.
[13:45:41] greengriminal: universa1: You can see what I am attempting to do though.
[13:45:43] universa1: greengriminal: queries = {}; queries[index] = ...
[13:45:49] universa1: greengriminal: not really..
[13:46:00] brazenbraden: universa1, dont you just hate it when you realise the JS file you working in has not been included into the project? :S
[13:46:09] universa1: BrazenBraden: nope.
[13:46:28] universa1: hekep: what is your problem?
[13:46:51] universa1: hekep: https://gist.github.com/hekep/7a0577accc35d21dc919#file-redmine-installation-L7
[13:46:52] greengriminal: universa1: So instead of having: https://gist.github.com/anonymous/bd428c84afa1b8113b04 i wanted to dynamically build the query string up
[13:47:02] hekep: I don't know , seems like soleved it ... like this: " bundle exec rake --trace generate_secret_token "
[13:47:05] greengriminal: ^^ Is horrendous
[13:47:47] universa1: greengriminal: why don't you just use proper associations?
[13:47:52] universa1: and ar queries?
[13:47:56] hekep: newbie to Ror , no idea why rake aborted ... :(
[13:47:56] greengriminal: universa1: Long story
[13:48:10] greengriminal: universa1: This is a particular use case why i have to do it this way
[13:48:20] universa1: hekep: yes. bundle exec rake generate_secret_token should work.
[13:48:28] greengriminal: i initially did use AR queries. But that was not what was needed.
[13:48:51] universa1: greengriminal: yeah error prone manual sql queries sound much better :p
[13:49:18] universa1: greengriminal: where properly set up associations would just boil down to: company.destroy .
[13:49:29] greengriminal: just nuke it one go
[13:49:39] universa1: so set up your associations properly.
[13:49:57] universa1: hekep: bundle exec makes sure you use the gems in the version your app needs :-)
[13:50:59] mrbubbles: I need my rails app to be able to access files uploaded to a /home/uploads directory??? would the easiest way to do this be to make the group the user which nginx runs as ?
[13:55:27] brazenbraden: universa1, ok, im getting 500 errors. Updated the gist with another action (just tried both options)
[13:56:05] universa1: BrazenBraden: error?
[13:56:53] brazenbraden: universa1, one sec...
[13:57:46] universa1: time's up ;)
[13:58:00] jammanbo: everyone lets you down evenutually :/
[13:58:01] brazenbraden: let me rephrase... "1 sec of vagrant time"
[13:58:09] jammanbo: evenUtually
[13:58:19] rvanlieshout: my vagrant about similar to my machine
[13:58:37] brazenbraden: problem is I am on windows so dont have NFS :(
[13:58:52] Ryan1013: hey guys I posted my custom 404 error page question on stack overflow if anyone has any ideas: http://stackoverflow.com/questions/27229973/custom-error-pages-in-rails-4-engine
[13:58:54] brazenbraden: universa1, I fixed it. I had a sql syntax error
[13:59:20] brazenbraden: apparently "LOWER(trackable_type) LIKE 'hrmod%'" and 'LOWER(trackable_type) LIKE "hrmod%"' are not the same things
[14:04:48] epochwolf: BrazenBraden: http://stackoverflow.com/questions/2876789/case-insensitive-for-sql-like-wildcard-statement don't use LOWER() to do case insensitive queries.
[14:05:23] epochwolf: or use Postgres which has ILIKE for that.
[14:06:24] brazenbraden: epochwolf, oh ok. im using postgres
[14:16:37] dANO: Hi , in my production server , I installed postfix that allows sending and receiving email on my address user@test_app.com and in my mailer I defined another mail contact server(like gmail). But what I 'd like to do is to directly read the messages received on the account user@test_app.com in my rails application. I saw that there was a receive(email) function, but I do not understand how to tell him to "read" the mail from the address user@te
[14:16:37] dANO: st_app.com . If someone can give me an explanation of how. thank you
[14:17:08] mrbubbles: hmm so it looks like rails can???t access any of the filesystem outside of it???s own app root, does that sound about right?
[14:18:11] epochwolf: dANO: http://library.edgecase.com/configuring-postfix-to-deliver-email-to-ruby here's something to get you started.
[14:19:17] epochwolf: ah, here we go: http://www.tunnelsup.com/getting-postfix-to-send-incoming-mail-to-rails
[14:20:01] dANO: epochwolf: thank's for the doc
[14:20:53] epochwolf: dANO: the basic idea is to have postfix send the email to a ruby script via STDIN and then have the ruby script stick it in a queue somewhere.
[14:21:05] epochwolf: Do not use rails as the ruby script.
[14:23:30] epochwolf: dANO: there's other options if you wanted to use a gmail account instead. You can have a cron job periodically download new emails from the account via IMAP or POP.
[14:23:31] rshetty: I have upgraded to 4.2.0.rc1 recently and I am getting these warnings
[14:23:36] rshetty: `#quietly` is deprecated and will be removed in the next release
[14:24:40] epochwolf: rshetty: have fun spelunking, there's probably a gem or rails internal that hasn't gotten the memo.
[14:26:00] epochwolf: rshetty: if you really want to find the source of that, search for the error message instead the rails gem and replace "warn" with "raise" and then figure out where the crashes are happening.
[14:27:42] rshetty: epochwolf: hmm, I see an open issue already filed here https://github.com/rails/activerecord-session_store/issues/36
[14:31:01] adac: I now saw bot variants for postgres and the encoding settings in database.yml. Some set "encoding: utf8" other set "encoding: unicode" what is the correct/better one?
[14:34:58] epochwolf: adac: use utf8
[14:35:28] epochwolf: unicode could mean any number of unicode encodings, utf8 is specific.
[14:35:31] adac: epochwolf, I thought so too, kk thanks dor confirm that!
[14:40:30] alex88: imagine that I've to select a backend service based on env (dev, prod) or by setting, how would you do that? assign to a global variable like ImageStorage an adapter or another, or create an ImageStorage class with a method to configure the backend service used?
[14:45:28] epochwolf: alex88: um... I've done this a couple of ways.
[14:46:49] epochwolf: If the classes have identical interfaces, you can just make a method that returns the proper class./
[14:47:13] epochwolf: Otherwise, you'll need to isolate the api and add if statements like this does: https://github.com/epochwolf/litsocial/blob/master/app/lib/controllers/manage_bookmarks.rb
[14:48:24] alex88: epochwolf: I'll go with the first one, classes has the same interfaces, thanks for the tips
[14:48:40] epochwolf: alex88: no problem
[15:28:51] ninaaa: Hi, I need some help with a simple Active Record query, everything is here... : https://gist.github.com/anonymous/2acb28c07e36927292c7 - thank you :)
[15:30:01] ninaaa: I was thinking using : level.attempts.includes(:user_level).group('user_level_id').having('MAX("score")').order(score: :desc).limit(5) but I don't know if it's the best way to do it
[15:30:21] comrad: that would be the solution i would think of as well
[15:30:23] universa1: ninaaa: distinct(:user_level_id)
[15:30:38] dANO: Anyone now solution for extract URL from text , I try URI.extract but if my test is : URI.extract("Links: the links is https://www.google.com"), the result is ["Links:", "https://www.google.com"] maybe an other method exist for return just the url ?
[15:31:00] hydrajump: hi I just deployed my first rails 4 app on heroku (2 dynos) and after running 1 day I started seeing warnings in heroku about memory leaks. I've been googling but I have no idea how to troubleshoot this. Any suggestions?
[15:31:32] workmad3: dANO: try URI.extract(string, %w(http https) )
[15:31:53] workmad3: dANO: a.k.a. reading the docs and seeing the 'schemes' parameter that URI.extract takes ;)
[15:32:00] dANO: with string is my text ?
[15:32:25] universa1: workmad3: pahh!
[15:32:36] workmad3: universa1: what? reading docs? I know, crazy!
[15:32:46] ninaaa: universa1: how sould I use distinct in my query?
[15:32:58] ninaaa: comrad: oh ok
[15:33:07] workmad3: ACTION goes back to crafting his event bus
[15:33:34] workmad3: a wild tenderlove appeared...
[15:33:44] universa1: ninaaa: level.attempts.includes(:user_level).distinct("user_level_attempts.user_level_id").order(score: :desc).limit(5)
[15:33:50] universa1: ninaaa: iirc
[15:34:01] batasrki: workmad3: event bus?
[15:34:29] universa1: batasrki: another name for party bus
[15:35:26] brazenbraden: My business partner bought a 3 piece desk at an auction for USD 100. We contacted the manufacturers about it and requesting info on it.. its valued at USD 9282.... uck me.
[15:36:14] workmad3: batasrki: fancy name for 'thing that registers event listeners and handles firing events out to them, maybe with some other stuff happening around the scenes'
[15:36:15] batasrki: BrazenBraden: isn't that good?
[15:36:22] ninaaa: universa1: with distrinct I still have the lower score of user_id #1
[15:36:46] brazenbraden: batasrki, its mind blowing... thats why I had to share. lol
[15:37:16] universa1: ninaaa: your example shows no user_id ...
[15:38:12] ninaaa: universa1: sorry, yep I meant that I still have the lower score of user_level_id #1
[15:38:29] ninaaa: and I only want to keep the max score of each user in the output
[15:38:49] batasrki: workmad3: gotcha. Doing the same here. What tech are you using?
[15:39:09] workmad3: batasrki: ruby :P
[15:39:34] workmad3: batasrki: I'm writing the minimal interface I need with a simple 'direct' implementation that simply calls everything synchronously at the moment
[15:40:03] workmad3: batasrki: once I've flushed out my needs and interactions with that, I'll probably consider a second implementation for production on top of EM or RabbitMQ to connect the pieces together
[15:40:08] workmad3: batasrki: or maybe celluoid
[15:40:44] universa1: ninaaa: sorry, no clue then ;) gtg unfortunately.
[15:40:57] ninaaa: oki np, thank you
[15:41:49] workmad3: batasrki: I've got the additional annoyances of needing to track every event and that the app I'm writing is pretty heavily multi-tenanted
[15:42:15] workmad3: batasrki: so I'm already splitting out events into global and tenanted events, which will get recorded separately
[15:42:41] batasrki: workmad3: cool. Try to stay away from EM, though. We have an event bus written on top of Faye which is on top of EM
[15:43:13] workmad3: batasrki: I wrote a pretty fun testing tool on top of EM a while back :)
[15:43:31] batasrki: We've had write begin/rescue blocks around certain pieces of application code that publishes events through Faye, which handle errors happening in EM on ruby 2.1
[15:44:10] ninaaa: Guys, need some help with an Active Record query : https://gist.github.com/anonymous/c3fa74daab5daa4aecc2 (everything is here, with one of my solution) :)
[15:45:58] workmad3: ninaaa: you're using mysql, right? :P
[15:47:14] Malgorath: if I am setting up a new linux system, you guys still say use rbenv versus just system wide changes?
[15:48:00] workmad3: malgorath: well, I personally say use chruby and ruby-install rather than rbenv and ruby-build
[15:48:29] ninaaa: workmad3: sqlite3, why?
[15:48:47] workmad3: malgorath: but your more general question of 'do you guys suggest using a ruby version manager rather than packaged, system-wide installs of ruby?', I'd say 'yes'
[15:49:07] workmad3: ninaaa: because your group by attempt there would break on an SQL-compliant group by implementation
[15:49:37] workmad3: ninaaa: tbh, you don't want/need group by on that query
[15:50:53] ninaaa: workmad3: what should I do then?
[15:50:58] workmad3: ninaaa: if you were on postgres, I'd do 'SELECT DISTINCT ON (user_level_attempts.user_level_id) user_level_attempts.* FROM user_level_attempts HAVING MAX(user_level_attempts.score)'
[15:51:08] workmad3: ninaaa: not sure if sqlite supports DISTINCT ON though
[15:51:49] Malgorath: workmad3: thanks for the tips and advice
[15:52:16] workmad3: ninaaa: or, more simply, SELECT DISTINCT ON (user_level_attempts.user_level_id) user_level_attempts.* FROM user_level_attempts ORDER user_level_attempts.score LIMIT 5 <-- top 5 scores (1 per user)
[15:53:06] ninaaa: workmad3: earlier universa1 told me to try : level.attempts.includes(:user_level).distinct("user_level_attempts.user_level_id").order(score: :desc).limit(5) -- but with that request I still have the lower score of user_level_id and not its highscore
[15:57:30] SteenJobs: nice to see workmad3 is going at it
[15:57:39] workmad3: ninaaa: I'm not sure what you could do on sqlite tbh... your group by looks like it would be flawed (that 'HAVING MAX(score)' field will, I believe, only give you back users that have the maximum score, not order by the score)
[15:57:49] Malgorath: I have never used git for RoR before, is there a sample .gitignore to be used with RoR so I don't backup things I don't need or shouldn't?
[15:57:57] SteenJobs: workmad3: what???s your record for number of questions you???ve taken on at a given time?
[15:58:05] workmad3: malgorath: one gets generated with a new project nowadays
[15:58:30] workmad3: SteenJobs: a few... never bothered trying to count :P
[15:58:54] comrad: workmad3: http://bit.ly/1yaIR9C
[15:58:57] Malgorath: workmad3: i know, but is it smart enough to know what to upload and what not to?
[16:00:00] workmad3: malgorath: I don't know what you want with 'smart'... it's good enough to ignore the default db/*.sqlite files, the tmp/ and log/ directories, some IDE/editor specific files and stuff like thumbnails.dll
[16:00:19] workmad3: oh, scratch that last bit, it doesn't have editor-specific ignores
[16:00:29] workmad3: but still... it's a super-simple format to add to anyway ;)
[16:00:45] workmad3: and the default is good enough for a new project... add to it as necessary
[16:01:24] workmad3: comrad: pretty sure that was meant to be directed at malgorath :P
[16:01:44] workmad3: comrad: !gg IRC high-lighting
[16:02:23] comrad: it was. i got confused. please accept my apologies.
[16:03:31] workmad3: comrad: I'm trying to think if there's any more lmgtfy things I can send your way as mocking retribution first :P
[16:03:57] ninaaa: workmad3: I'm lost, sqlite seems to have distinct : https://www.sqlite.org/lang_select.html#distinct - but can't get the wanted result (https://gist.github.com/anonymous/c3fa74daab5daa4aecc2)
[16:04:11] workmad3: ninaaa: DISTINCT != DISTINCT ON
[16:04:44] workmad3: ninaaa: DISTINCT removes exact duplicates, DISTINCT ON (expr) removes duplicate evaluations of (expr)
[16:05:10] workmad3: ninaaa: e.g. DISTINCT ON (user_level_id) will remove duplicated user_level_id values, keeping just the first
[16:05:26] comrad: http://bit.ly/1yaJEaI workmad3 ;)
[16:05:27] ninaaa: ok I understand better
[16:05:30] comrad: gotta go. cu
[16:09:09] ninaaa: workmad3: so I should avoid using "group('user_level_id').having('MAX("score")')" ? :( I found that it finally give me the desired output, but if you tell me that its not the best way to do it, I trust you :p
[16:13:17] workmad3: ninaaa: the question is - what database are you planning on deploying this app with?
[16:13:33] workmad3: ninaaa: because with this particular query, that question is going to have an impact on the query you write
[16:13:52] workmad3: ninaaa: and you should probably start developing your app with that database too, rather than sqlite ;)
[16:14:22] ninaaa: workmad3: actually none, its a training project, I'll only use SQLite and I don't plan to migrate that app to something else
[16:15:23] workmad3: ninaaa: ok... in that case, stick with your working .group version, but put a note on it... something like # TODO: This would need changing if deploying on PostgreSQL
[16:16:06] workmad3: ninaaa: i.e. remind yourself that you wouldn't be able to get away with that SQL-invalid GROUP BY on a different database... but that it's working for you atm, and the other options aren't supported on SQLite ;)
[16:16:35] ninaaa: ok, workmad3, do you have more informations why it can't work on pgsql? (same for mysql?)
[16:17:18] workmad3: ninaaa: it would work by default on mysql... it wouldn't work on pg or a mysql instance configured to follow the SQL standard for GROUP BY because your GROUP BY leaves ambiguous columns
[16:17:22] brendan6: Does anyone know how to fix the "invalid byte sequence" bug that sometimes happens with strings? I have already tried #force_encoding and #encode with the replaces and nothing
[16:17:56] workmad3: ninaaa: and then you're using SELECT with those ambiguous columns... so the database doesn't know what value to use for them
[16:19:16] ninaaa: workmad3: ok thank you so much !
[16:19:17] workmad3: ninaaa: in more technical terms, when you use a GROUP BY, you can only then SELECT columns that are specified in the GROUP BY, are dependent on the GROUP BY (e.g. if you GROUP BY a primary key, you can SELECT anything from the table that key is for) or are in an aggregate function (e.g. SELECT id, COUNT(other_table.id) where COUNT is an aggregate function)
[16:19:59] workmad3: ninaaa: otherwise what you do is SELECT a column that could have multiple values, so the database either makes up a criteria to sort by (potentially non-deterministic) or (correctly) throws an error
[16:21:23] workmad3: ninaaa: as for the HAVING... I'm not convinced that is doing what you want either... HAVING is like a WHERE query executed after the GROUP BY
[16:21:49] workmad3: ninaaa: so on further consideration, I think your HAVING clause there is essentially just noise, and you could remove it to absolutely no ill-effect on your query
[16:22:06] smathy: brendan6, depends a lot on your particular situation, so without code the best I can do is point you here: http://robots.thoughtbot.com/fight-back-utf-8-invalid-byte-sequences - it's a great article about a common cause of this problem.
[16:22:38] workmad3: ninaaa: I'm basing that on the fact your HAVING clause isn't actually doing a comparison with anything... so it's effectively just 'HAVING 2000' (or whatever the maximum score is at the time of the query)
[16:23:51] workmad3: brendan6: something you could try is to force_encoding to ASCII-8BIT and then use something like CharlockHolmes to try and detect the encoding
[16:24:15] workmad3: brendan6: which will use heuristics on the string to try and decide which encoding is a 'best fit' for making the string sensible
[16:24:53] brendan6: smathy: I've read that article and unfortunately it didn't help. I finally did find something that did though which is similar to workmad3's approach which encodes it first to UTF-16 then back to UTF-8
[16:24:55] workmad3: brendan6: however, it's not really a 'bug'... at least, not in your code...
[16:25:12] ninaaa: workmad3: looks like it does something for me : https://gist.github.com/anonymous/f9f94f72d8d6428634e7
[16:25:16] smathy: brendan6, without code we're all just guessing.
[16:25:18] brendan6: The odd thing is that it has already been converted to UTF-8
[16:26:03] workmad3: brendan6: converted? or assumed to be UTF-8?
[16:26:33] workmad3: ninaaa: hmm... any chance you could look at the .to_sql output of both of your queries too? :)
[16:27:32] greengriminal: Out of interest could I get away with doing something like: https://gist.github.com/anonymous/6b9602862f9d725fea7d
[16:27:33] brendan6: https://gist.github.com/HuffMoody/b0488eb669e35c9d207d
[16:27:46] ninaaa: workmad3: yep , https://gist.github.com/anonymous/2e971292366eb5e2a78d
[16:27:50] workmad3: brendan6: ah... force_encoding doesn't convert
[16:27:54] brendan6: workmad3: It's from an S3 stream. It was converted to UTF-8 before it was uploaded
[16:28:02] workmad3: brendan6: it merely says 'Set the encoding on this block to UTF-8'
[16:28:12] Malgorath: Would anyone have a suggestion on building a contact us form that works when your done for testing purposes and later production
[16:28:27] brendan6: workmad3: I also tried encode('UTF-8', 'UTF-8', :invalid => :replace, :undef => :replace, :replace => "?")
[16:28:53] brendan6: workmad3: Good to know though
[16:29:09] workmad3: brendan6: how about just simply '.encode("UTF-8")'?
[16:30:09] workmad3: brendan6: also, .encode("UTF-8", "UTF-8") is equivalent to doing '.force_encoding("UTF-8"); .encode("UTF-8")' which would be a no-op
[16:30:23] workmad3: brendan6: i.e. .encode when the current encoding and the target encoding are the same does nothing
[16:30:51] workmad3: brendan6: maybe you want .encode("UTF-8", "UTF-16", <same-opts>) ? ;)
[16:31:34] brendan6: workmad3: That's my current approach which basically converts it to UTF-16 then UTF-8
[16:31:45] brendan6: ...which works, just seems expensive
[16:32:09] workmad3: brendan6: no, what that does is sets the encoding to UTF-16 *without* re-coding the string, then transcodes it to UTF-8
[16:33:12] ninaaa: workmad3: for .tosql outputs : https://gist.github.com/anonymous/2e971292366eb5e2a78d
[16:33:15] workmad3: brendan6: if that works, it implies that you have received the data as UTF-16, not UTF-8 as you expected, and if you want to deal with UTF-8 at that point you have to transcode it
[16:34:05] workmad3: brendan6: out of curiosity... what is the .encoding of the string when you receive it? :)
[16:34:11] brendan6: workmad3: Yea that must be the situation. Very strange since it was definitely encoded to UTF-8 first and running it through rchardet guesses UTF-8
[16:34:14] workmad3: brendan6: before you call .encode or .force_encoding on it? :)
[16:35:36] brendan6: Just checked
[16:37:34] workmad3: brendan6: ok... and how about if you call '.valid_encoding?' on it (again before encoding/transcoding)?
[16:38:20] brendan6: false ...hmmmm
[16:38:59] workmad3: brendan6: there you go... something you can use to determine whether to transcode or not ;)
[16:39:39] workmad3: brendan6: but it seems to me like the S3 stream itself has decided to transcode the data you provided...
[16:39:40] brendan6: workmad3: That's a good point. Thanks!
[16:39:51] brendan6: workmad3: I think that might be the situation, I'm going to have to dig into that
[16:40:22] workmad3: ninaaa: thanks... I'm gonna just have to say I'm not sure how that's working tbh
[16:40:37] ninaaa: workmad3: haha :')
[16:56:31] greengriminal: Have you guys seen: http://ronin-ruby.github.io
[16:56:35] greengriminal: let me know what you think
[17:01:59] smathy: Ezra, wow.
[17:02:05] smathy: https://news.ycombinator.com/item?id=8676140
[17:02:37] walidvb: trying to figure out how to let heroku serve static assets, but gzip them
[17:02:52] walidvb: any clue? any thing I find requires serve_static_assets = true, which i don't want in prod
[17:03:42] kaspergrubbe: walidvb: Have you tried contacting Heroku about it?
[17:04:06] walidvb: kaspergrubbe: not yet, just spent some 30 minutes searching, and tried a couple of things
[17:04:15] walidvb: but i figured maybe someone would know.
[17:04:19] walidvb: i'll ask in #heroku, though
[17:10:22] TheAtomicGoose: are there any resources that people would recommend for getting started with rspec?
[17:16:03] Malgorath: if you guys where to build a server for local hosting websites what would you us OS wise?
[17:17:19] workmad3: malgorath: some server version of linux (preferably not red-hat or centos)
[17:18:38] Malgorath: like ubuntu 14.04 or debian? why not centos?
[17:19:29] workmad3: malgorath: because I don't particularly like working on libraries and tools that are 5+ years old
[17:20:11] Malgorath: lol good reason
[17:25:08] smathy: malgorath, I always use the LTS Ubuntu distros.
[17:25:34] smathy: Been very happy for the past 5 years on them.
[17:31:57] Malgorath: yeah i don't do the .10s
[17:34:16] batasrki: I'm actually interested if freebsd will work
[17:36:38] smathy: malgorath, it's not only the .10s that are not LTS: https://wiki.ubuntu.com/LTS
[17:37:15] smathy: Basically it's <even major version>.04
[17:42:18] Malgorath: yeah I just avoid the .10s like the plague
[17:49:44] smathy: malgorath, I avoid all non-LTSs.
[18:02:29] Jake232: Can someone confirm whether this is a bug or not? Doing SomeModel.last(5) generates a query ending in ' ORDER BY "orders"."id" DESC LIMIT 5' as you would expect, but some_model.some_assosiation.last(5) does not.
[18:02:37] Jake232: Seems broken
[18:03:42] workmad3: Jake232: does SomeModel by any chance have a default_scope in it, SomeAssociation doesn't?
[18:04:43] Jake232: workmad3: None contain default scopes
[18:05:19] Jake232: https://gist.github.com/JakeAustwick/e0915f772dfa325f85d1
[18:05:26] workmad3: Jake232: probably rails adding in an order by default on an otherwise empty query then... while some_model.some_association isn't generating an empty query
[18:05:42] Jake232: I feel like it's a bug though
[18:05:47] Jake232: It's not the expected behaviour
[18:05:51] Jake232: Well, not imo
[18:06:04] workmad3: Jake232: personally, I see adding the ORDER BY in on the first query as the bug
[18:06:27] walidvb: hey guys, i have a local app that is forcing ssl on me, i don't know why
[18:06:32] walidvb: (in dev mode)
[18:06:37] jacksparrow007: Why do i get '554 Message rejected: Email address is not verified' for my amazon mailer account ?
[18:06:40] walidvb: force_ssl is set to false
[18:06:46] Jake232: workmad3: How so? It uses DESC because I did last(), it uses ASC if I use first()
[18:06:55] Jake232: workmad3: That seems to logical thing to do
[18:07:28] workmad3: Jake232: it assumes that ids have an ordering, which is not the case with semantically-meaningless ids (the rails default)
[18:08:07] walidvb: weirdly, only on localhost, not
[18:08:21] Jake232: workmad3: Ahh, that's a valid point. But I feel like the assosiation thing I ran into is also a bug, seems like it should be consistent on what it does
[18:08:31] Jake232: whether it's an assoc or not
[18:11:02] workmad3: Jake232: it may be classifiable as a bug :)
[18:11:58] tbuehlmann: walidvb, how exactly is it forcing you to use SSL?
[18:12:12] walidvb: not sure, by prepending https
[18:12:36] tbuehlmann: using chrome?
[18:15:49] tbuehlmann: happened to me before using chrome, it offers you to type in the url from the history and you can't remove the s from https manually
[18:16:09] Jake232: workmad3: Creating an issue, we'll see what happens
[18:16:10] SteenJobs: workmad3: just realized with my current app i have a pain in the ass bug - i reset and then reseed my database every night from mailchimp, but when it resets, it deletes the current users as well. is there a way to reset only a speciific table in the database?
[18:16:51] SteenJobs: i wouldn???t need to reset the db every night if it weren???t for needing to remove unsubscribers
[18:17:06] workmad3: SteenJobs: maybe rather than running 'rake db:reset', you should simply clear out the table you're updating?
[18:17:36] SteenJobs: workmad3: right i can do that for the subscribers table each night - how would i clear out that one individual table?
[18:17:36] rhizome: or a proper import rake task
[18:17:39] workmad3: SteenJobs: or maybe you should do an update of all the information in there, and then do a 'Subscriber.where.not(mailchimp_id: <found_ids>).destroy'
[18:18:01] soahccc: Is there any "easy" way of fixing bugs in the documentation or does it require pull request and all that jazz?
[18:18:04] workmad3: (may be .destroy_all)
[18:18:09] soahccc: rails docs I mean
[18:18:10] SteenJobs: workmad3: right so i was thinking about using their webhook, but i???m not quite sure where the post request would be sent to for the webhook.
[18:18:31] SteenJobs: workmad3: o cool. that makes sense, easy enough.
[18:18:39] walidvb: tbuehlmann: oh. maybe that's right, but i never work in https locally..
[18:18:50] workmad3: soahccc: https://github.com/rails/docrails
[18:19:08] SteenJobs: rhizome: what do you mean?
[18:19:17] workmad3: soahccc: public repository, you're free to edit it, the maintainers of that project then create the PRs into the main rails repo
[18:19:32] tbuehlmann: walidvb, you could either remove the history entry or setup a custom host for your app in /etc/hosts (like, myproject.dev)
[18:20:05] fxn: workmad3: that changeg a while back http://weblog.rubyonrails.org/2013/6/14/docrails-back-to-the-roots/
[18:20:06] workmad3: soahccc: oh, wait a sec... you need to ask for commit-bit there again now
[18:20:12] workmad3: fxn: yeah, was just reading that :)
[18:20:18] fxn: awesome :)
[18:20:33] soahccc: hmm so commit bit or pull request in main repo?
[18:20:45] workmad3: soahccc: yeah
[18:22:22] fxn: soahccc: if you'd like to contribute regularly you could get commit bit, if it's just one edit a PR is good also
[18:22:52] hnanon: How can I show multiple attributes in a collection_select?
[18:22:56] hnanon: I have: <%= collection_select( :order, :shipping_address_id, @shipping_addresses, :id, :name, {:prompt => "Select a Shipping Address"} ) %>
[18:23:19] hnanon: I want to show: Name - Address City, State, Zip Code
[18:23:45] workmad3: hnanon: create a method that returns the label you want (ideally on a decorator rather than the model itself) and use that instead of :name
[18:24:05] soahccc: fxn: well I spot some typos from time to time, this time it's a syntax error in an example code... No idea if I am able to find things like that regularly :)
[18:24:45] hnanon: "On a decorator" - I've never used decorators. Link to a guide, if you don't mind?
[18:26:45] rhizome: that's going to be a wide select
[18:26:55] walidvb: tbuehlmann: thanks
[18:27:46] fxn: soahccc: that kind of fixes are very welcome... which is your GitHub nickname?
[18:28:05] soahccc: fxn: https://github.com/rails/rails/pull/17869 I just made the PR :<
[18:28:31] walidvb: i'm having issues with i18 and the path helpers, getting a missing required keys: [] in formatter.rb
[18:29:06] walidvb: those are my routes:
[18:29:10] walidvb: https://gist.github.com/anonymous/54ee4ef80592ce177c66
[18:34:45] soahccc: fxn: Thanks :)
[18:35:12] fxn: soahccc: np :)
[18:36:26] fxn: soahccc: invitation for docrails sent!
[18:38:13] soahccc: fxn: Again, thanks :) Much appreciated!
[18:40:12] weaksauce: fxn have you actually put this into use? https://github.com/fxn/i-told-you-it-was-private
[18:40:12] weaksauce: very funny stuff
[18:40:34] fxn: weaksauce: hahaha, no, no, it is just a joke :)
[18:41:05] fxn: I was into Perl for some years, there's an Acme:: namespace there full of funny modules I miss in the Ruby culture
[18:46:13] soahccc: well at least Bleach is possible
[18:46:52] smathy: fxn, I created it.
[18:47:03] smathy: http://rubygems.org/gems/acme
[18:47:14] smathy: ...and I ported Acme::Bleach to Ruby.
[18:47:18] smathy: soahccc, ^
[18:47:26] smathy: ...and others have added stuff too now.
[18:47:31] fxn: smathy: awesome, didn't know it
[18:47:31] smathy: Tell your friends.
[18:47:54] smathy: Always accepted pull requests: https://github.com/smathy/acme
[18:48:07] soahccc: smathy: did tenderlove use this for the talk on rubyconf? :)
[18:48:18] smathy: soahccc, nfi
[18:48:19] centrx: asshat is one of the badges
[18:48:47] smathy: soahccc, what was his talk?
[18:48:58] soahccc: Don't why I always have the links at hand https://www.youtube.com/watch?v=4_RJu_TrqO0&t=8h6m40s
[18:53:17] smathy: Oh right, so no, no pull request from tenderlove.
[18:53:41] smathy: ...and no, he couldn't have used Bleach because it just bleaches the whole file.
[18:53:46] smathy: There's no partial bleach :)
[18:54:14] smathy: I really want someone to port EyeDrops.
[18:54:27] smathy: I'll get to it soon if no one does, the pressure is building.
[18:54:51] startab: G'day everyone. Hoping there's someone more versed with strong parameters that can help me with ForbiddenAttribute errors with nested attributes http://pastie.org/9754570
[18:56:45] smathy: startab, show the attributes and error from your logs please too.
[18:58:25] walidvb: hea guys, still trying to solve that error in route generation. I'm getting a missing required attribute keys: []
[18:58:30] walidvb: my code is here: https://gist.github.com/walidvb/9862fc3c74957be70a5e
[18:59:27] smathy: startab, btw, step 1 is to change your create so that it uses `permit_params` instead of `params[:conversation]`
[19:00:09] startab: smathy: Re-pasted with test and error output http://pastie.org/9754584
[19:00:12] smathy: startab, ...which prompts me to ask why you're not using the Rails generators, I think you'd benefit from them.
[19:00:59] smathy: startab, also, when I said "logs" I meant from your log files, eg. `log/test.log`
[19:02:32] soahccc: walidvb: I think your routes.rb:2 is a bit dangerous since just /admin would also match this
[19:03:06] soahccc: walidvb: also which link is raising the error?
[19:03:18] SteenJobs: if i have a webhook that sends key/value pairs, and i want to access that data in my controller, how do i reference the collection that???s being sent?
[19:03:36] walidvb: soahccc: i tried without that
[19:03:44] walidvb: soahccc: root_path is raising the error
[19:03:52] startab: smathy: `permit_params`?
[19:04:30] soahccc: walidvb: there is no call to root_path in your gist
[19:04:37] startab: smathy: Is that a built-in? Or do you mean writing a private method that calls params.permit?
[19:04:38] walidvb: soahccc: which is actually in a parent templagte
[19:05:19] SteenJobs: meaning if mailchimp is sending me a post request of key/value pairs, how do i access that data in my controller? how do i reference it?
[19:06:00] rhizome: SteenJobs: how do you handle any other POST data?
[19:06:24] smathy: startab, it's your own method, please just use the generators and you'll see. Or read this for a full explanation: http://guides.rubyonrails.org/action_controller_overview.html
[19:06:57] SteenJobs: rhizome: by using the form_for helper and then passing the params into my newly created object?
[19:07:01] SteenJobs: rhizome: so rails magic i guess?
[19:07:32] SteenJobs: rhizome: i guess i???ve never dealt with post data outside of the realm of a form being submitted.
[19:07:50] startab: smathy: Oh! Brain fart.
[19:09:13] walidvb: soahccc: any other clue?
[19:09:51] soahccc: walidvb: well I need the code which is causing the fail
[19:10:52] smathy: SteenJobs, http://guides.rubyonrails.org/testing.html#functional-tests-for-your-controllers
[19:11:02] walidvb: https://gist.github.com/anonymous/65f15a810104f0467db7
[19:11:15] rhizome: SteenJobs: what are params?
[19:11:18] walidvb: soahccc: it's really just a call to root_path. but any path helper fails
[19:12:10] SteenJobs: smathy: yea, to test the routing that???s what i???m doing - but im not even at that point - i don???t know how to grab the data.
[19:12:29] SteenJobs: rhizome: data within the url???but now i???m guessing it also contains data within a post request
[19:12:46] walidvb: soahccc: https://gist.github.com/walidvb/9862fc3c74957be70a5e
[19:13:07] EminenceHC: startab: I was disconnected, did you figure it out?
[19:13:16] smathy: SteenJobs, no idea what you're talking about, a functional test is how to test that you can post data to a URL in your app.
[19:13:41] soahccc: walidvb: I'm not sure but I think that line 2 may be the cause
[19:13:54] walidvb: i removed it
[19:13:56] startab: EminenceHC: Yes, smathy reminded me I wasn't calling my private method `permit_params` which returns the permitted hash of params
[19:13:56] SteenJobs: so if i just do params[:key] it will give me the value i need
[19:14:03] startab: EminenceHC: Thanks for asking
[19:14:07] EminenceHC: startab: Yup :)
[19:14:33] SteenJobs: smathy: i???m assuming my url is valid - but i want to reference the data within my controller so i can save the data being posted to my db, or in the case of an unsubscribe, check for an unsubscribe in the post data and delete said user.
[19:14:34] walidvb: soahccc: updated one: https://gist.github.com/walidvb/9862fc3c74957be70a5e
[19:15:02] walidvb: soahccc: i've tried this: https://github.com/rails/rails/issues/12178
[19:15:06] smathy: SteenJobs, right, the way to test a controller is with a functional test.
[19:15:16] smathy: (I'll say it as many times as I need to ;)
[19:15:26] SteenJobs: i think we???re talking past each other....
[19:15:34] SteenJobs: i???m assuming it???s posting to the url properly
[19:15:45] walidvb: this way: https://gist.github.com/walidvb/9862fc3c74957be70a5e
[19:16:09] SteenJobs: now i want to do if some_data_in_post_exists; Subscriber.find_by(email: ???the person???s email from the post req???).delete
[19:17:13] smathy: SteenJobs, right, so write that controller action, then write a functional test that checks that precisely that happens when you call the action.
[19:17:41] SteenJobs: i don???t even know what to include in the action to reference the data sigh...
[19:18:19] rhizome: you're close. scroll up
[19:19:14] walidvb: soahccc: actually, i've just downgraded to 4.0.4, and i still get the error, so it's unlikely that the issue i mentionned is my issue.
[19:20:10] walidvb: my code is here, btw: https://github.com/walidvb/festor
[19:20:56] vedu: Hello. I am a no route error when I click on my link_to button "dasboard". code: https://gist.github.com/vedant1811/7404c709d6c54fce21a9
[19:22:01] soahccc: walidvb: maybe? https://github.com/rails/rails/issues/12178
[19:22:08] bricker`work: vedu: try just passing the route helper as the second argument, without url:
[19:22:23] walidvb: soahccc: i've tried this, no luck.
[19:22:33] walidvb: i'm not getting the same error message, though
[19:22:45] walidvb: also, i've just tried with 4.0.4, same error
[19:23:24] walidvb: and according to this thread, passing {} should work, and it doesnt
[19:24:06] vedu: walidvb: same error. The other 2 links work just fine though
[19:24:13] vedu: bricker`work: ^
[19:25:03] SteenJobs: rhizome: i???m guessing if i just put params[:key] it???ll work...
[19:25:42] bricker`work: vedu: when does the error occur? When you click the link, or when it tries to build the URL?
[19:25:58] vedu: bricker`work: when I click on it
[19:26:53] bricker`work: vedu: what does the sellers_path helper output?
[19:27:22] vedu: bricker`work: sorry I didn't get you
[19:27:42] vedu: bricker`work: did you mean: sellers_path GET /sellers(.:format) sellers#index ?
[19:29:32] smathy: SteenJobs, params[:the_data...]
[19:30:11] bricker`work: vedu: in the generated HTML, what does that link point to? a href="???"
[19:30:18] SteenJobs: smathy: isi that different than what i said?
[19:34:55] vedu: bricker`work: `index.html` :(
[19:35:20] reckoner: what is the connection pool size based on? i want increase it, but not sure by what yet.
[19:35:28] reckoner: the default is 5
[19:40:00] pwz2000: Can someone help spot where I went wrong with setting up collection check boxes? = select_tag :ethnicity, collection_check_boxes(collection: ['Asian', 'Black', 'Biracial', 'Indian', 'Hispanic/Latin', 'Middle Eastern', 'Native American', 'Pacific Islander', 'White', 'Other']), prompt: 'Ethnicity???. I am getting Arguement Error `wrong number of arguments (1 for 5..7)`.
[19:40:25] walidvb: pwz2000: have you tried with brackets?
[19:40:39] vedu: bricker`work: no idea :(
[19:40:49] bricker`work: vedu: is there another route overriding it?
[19:40:57] bricker`work: vedu: did you remove the url: bit like I said?
[19:41:03] vedu: bricker`work: yes I ddi
[19:41:20] bricker`work: gist the updated file and your full routes files
[19:43:20] vedu: bricker`work: https://gist.github.com/vedant1811/7404c709d6c54fce21a9
[19:43:26] smathy: SteenJobs, oh, no, same - sorry, I hadn't seen your comment.
[19:44:08] walidvb: argh i'm going crazy over these route helpers..
[19:44:35] walidvb: it simply won't let me generate a route or give me an error that makes sense!
[19:45:04] cnk: rubygems.org is down???
[19:46:27] walidvb: anyone with knowledge in that? I keep getting a missing attribute keys: [] error that i can't debug
[19:46:44] pwz2000: walidvb: I placed collection inside the brackets and it does not work.
[19:46:49] smathy: cnk, the website? Works for me.
[19:46:59] cnk: interesting
[19:47:09] walidvb: pwz2000: place brackets after the select_tag, also
[19:47:14] weaksauce: it's down http://uptime.rubygems.org/
[19:47:23] vedu: bricker`work: ok I made a very very silly mistake. too embarassed to say what it was
[19:47:43] bricker`work: vedu: come on tell me
[19:47:54] cnk: hmmm I can't even get to the uptime url
[19:48:09] bricker`work: vedu: it might help me help someone else next time
[19:48:11] walidvb: i've now spent 2 hours on it, can't seeem to find what's wrong: https://gist.github.com/walidvb/9862fc3c74957be70a5e
[19:48:26] vedu: bricker`work: I had a index.html (along with the index.html.erb) and I was editing that
[19:48:46] vedu: I am sure this wont help anyone -_-
[19:49:20] bricker`work: vedu: "make sure you're editing the right file" is good advice though, I have definitely made that mistake before.
[19:49:21] weaksauce: vedu I think we have all done that in some form or another
[19:50:00] weaksauce: editing index.html.erb for one controller but thinking it's for a different one is common
[19:50:10] walidvb: pwz2000: check the doc, you're not using the right syntax(or function): http://apidock.com/rails/v4.0.2/ActionView/Helpers/FormOptionsHelper/collection_check_boxes
[19:50:11] vedu: yeah true. most errors are due such "human" mistakes I guess ;-)
[19:50:29] vedu: weaksauce: yeah I that occoured to me and then I checked this
[19:51:03] walidvb: pwz2000: you might want to use smth else: http://apidock.com/rails/ActionView/Helpers/FormTagHelper/select_tag
[19:51:36] weaksauce: one thing I like to do to make sure I'm in the right file is to add some large text or an alert just to make sure it's actually getting to the right place
[19:51:49] vedu: I created a partial and was using it other places so I stumbled upon my mistake
[19:53:17] pwz2000: walidvb: think I found the issue. thanks for docs
[19:55:29] walidvb: i think this is where my route helpers die, in actionpack/formatter.rb:22
[19:55:34] walidvb: https://gist.github.com/anonymous/5a62694b134aafe23209
[19:55:37] walidvb: next unless name || route.dispatcher?
[19:59:54] walidvb: pwz2000: nice
[20:01:13] s2013: is there some problem with rubygems?
[20:01:28] s2013: the website isnt working for me and half the gems arent installing for me
[20:01:31] walidvb: s2013: apparently it's down
[20:02:06] smathy: walidvb, you're providing an :id that your route doesn't have.
[20:02:06] tubbo: trying to get puma & nginx to play nice, what am i doing wrong here? https://gist.github.com/tubbo/64bd9f5d68558db162b7
[20:02:15] s2013: woah tubbo asking for help
[20:02:18] tubbo: that `?umask=777` seems to be required
[20:02:27] s2013: Gem::RemoteFetcher::UnknownHostError: no such name (https://rubygems.org/gems/rake-10.3.2.gem)
[20:02:28] walidvb: smathy: it does have it, and it fails the same on events_path
[20:03:56] smathy: walidvb, I don't see any id in your routes.rb - where are you seeing that?
[20:04:15] walidvb: it's in the resources
[20:05:07] walidvb: smathy: you're talking about events, right?
[20:05:48] walidvb: smathy: my routes: https://gist.github.com/anonymous/64f737b8d6d7e8239222
[20:06:14] tubbo: s2013: no wonder i'm having trouble, the stupid cookbook that installed this decided to install an ancient version of nginx :P
[20:06:34] walidvb: hm ok, it seems it is a rails admin issue
[20:06:40] smathy: walidvb, yes, I'm talking about the error you're getting which is for the index action.
[20:06:57] smathy: walidvb, index actions generally don't have `:id`s, and yours is no different in your routes.rb.
[20:07:15] walidvb: i tried to remove the rails admin routes from my routes.rb, and that helper then works
[20:07:17] smathy: walidvb, the `resources :events` does add :id to index.
[20:07:27] walidvb: smathy: so, i don't see where the problem is?
[20:07:29] smathy: walidvb, the *show* action has an :id.
[20:07:29] s2013: stupid cookbook
[20:07:32] s2013: but wtf i cant seem to install any gems
[20:08:17] jameswork: Hi i was wondering how you would name the serializer for a model (Advertiser::Asset) is located within a folder for activemodel serializers?
[20:08:17] walidvb: smathy: https://gist.github.com/anonymous/9e8fa33a160b8f8eacbb
[20:08:32] tubbo: s2013: i've had that issue before too, typically when i have a second gem source that is slow
[20:09:43] s2013: http://status.rubygems.org
[20:09:45] s2013: does this work for anyone else
[20:10:07] s2013: my source is rubygems.org
[20:10:19] walidvb: s2013: they're down
[20:10:39] s2013: is it for everyone?
[20:11:01] rhizome: s2013: down for me. weird, i had just seen this morning they had some new design. may be related
[20:11:11] s2013: no one seems to be complaining besides me.. and http://www.isitdownrightnow.com/status.rubygems.org.html says its up
[20:12:12] s2013: youd think atleast the status page would be up
[20:12:28] walidvb: s2013: prob a dns error
[20:12:36] s2013: apparently its ddos
[20:12:55] s2013: http://dnsimplestatus.com/
[20:13:04] walidvb: so, i think my problem is that RailsAdmin::Engine doesn't recognize my scoped path helpers
[20:15:37] smathy: walidvb, seems unlikely. You're testing these all in some console? Have you restarted that console?
[20:15:49] walidvb: i'm testing those in better_error
[20:15:59] walidvb: and restarted the server several times
[20:18:00] walidvb: smathy: but i don't know how engines work, so..
[20:18:25] walidvb: still, if I remove the RailsAdmin routes, those helpers work
[20:19:37] walidvb: smathy: oooh! both RailsAdmin and I declare those routes
[20:19:57] walidvb: check: show is twice there: https://gist.github.com/anonymous/2f2aa55b0a556ab0eb98
[20:22:48] walidvb: ..still, the helper method isn't the same (events_path vs show(:event, :id))
[20:24:14] walidvb: smathy: so, i'm pretty sure RailsAdmin is killing my path helpers
[20:24:36] banisterfiend: yo, anyone here familiar with carrierwave? how do i stop files being deleted when the model itself is deleted?
[20:25:35] smathy: walidvb, sounds like it.
[20:25:45] cnk: banisterfiend: override the callback that is running after the model delete? or use delete instead of destroy (so callbacks don't run)
[20:25:47] walidvb: weird that i can't find anything on the internet
[20:26:08] walidvb: i'd like to avoid coupling my app too much to rails_admin, this isn't really helping...
[20:26:30] banisterfiend: cnk i was hoping there was a cleaner way, cos this is a cross-cutitng concern and it appears to define the callback by the name of the field
[20:27:05] uptownhr: so i setup an api controller with a few actions, how do i send parameters to my action?
[20:27:34] uptownhr: is there an automated way to send parameters through the url like , /:controller/:action/:parameter without having to redefine my route?
[20:34:41] banisterfiend: cnk was hoping there'd be a config optino for this
[20:34:52] banisterfiend: same as there's a config option for remove_previous_files_after_update
[20:37:06] Malgorath: how do i undo a rails g scaffold? or do I have to manually remove everything?
[20:37:13] cnk: banisterfiend: There might be - that is, indeed, something one would need to know CarrierWave more intimately
[20:37:21] cnk: rails d scaffold
[20:37:27] cnk: d for destroy
[20:55:35] walidvb: anyone with exp in locales? i'm going a bit crazy i think
[20:55:57] walidvb: i'm getting a fr is not a valid locale, but I can't find where to configure that
[20:56:17] liquid-silence: whats the error, and show the code
[20:56:39] walidvb: liquid-silence: well i'm in the console, tryin to I18n.locale = :fr
[20:57:00] Malgorath: is from zero to deploy the best book for learning RoR from?
[20:57:26] walidvb: liquid-silence: but i get the same error when I18n.locale = 'fr' in my application_controller
[20:58:52] walidvb: liquid-silence: do you want/need the full code?
[20:59:45] Malgorath: Just asking cause I bought multi tenancy rails and rails 4 in action already, was wondering if "From Zero to Deploy" is better for new people then those other two?
[21:03:27] Malgorath: I'll wait to buy to see any opinoins first
[21:03:42] liquid-silence: walidvb well you are not descriptive enough in what is happening
[21:04:17] walidvb: liquid-silence: well, i couldn't find where to add locales to I18n.available_locales, but it seems i've found it
[21:04:20] liquid-silence: malgorath best book I have read was about capistrano
[21:04:40] walidvb: i'm having massive issues with rails_admin and scoped resource routes, though
[21:05:02] Malgorath: liquid-silence: I'm looking for a quick way to get into learning RoR instead of so many wordy long or silly attempts at making the reading easier
[21:06:13] liquid-silence: malgorath the first book I used was The Rspec book
[21:07:14] cnk: malgorath: Rails Tutorial?
[21:07:42] tubbo: is there a way to get nginx to log to syslog, but on the local machine?
[21:08:06] tubbo: i don't have an rsyslog server just yet but i'd still like to point all my logs to /var/log/syslog
[21:08:09] Malgorath: cnk: I don't understand what your talking about?
[21:08:25] banisterfiend: how do i list all the callbacks that a model has defined?
[21:08:35] cnk: Book to learn ROR
[21:09:01] tuelz: tubbo: can you not just point it to localhost?
[21:09:32] tuelz: server=
[21:10:01] Malgorath: cnk: yes I'm looking for a good one that isn't to long and fully of theory.
[21:10:46] cnk: Are you already a web dev picking up a new framework? or are you new to dev?
[21:10:51] Radar: malgorath: I think MTWR and R4IA are excellent books.
[21:10:56] Radar: But that's just like my opinion.
[21:11:38] Malgorath: okay I'll just retry to read them again, last year it wasn't something I could get through but thats probably my own personal issues at the time
[21:11:52] Radar: malgorath: (hint: I wrote both of them)
[21:12:08] cnk: and both are excellent
[21:12:12] Malgorath: Ah, well, hope you spent the money wisely :D
[21:12:44] Radar: And I'm currently in the process of updating R4IA for Rails 4.2.
[21:12:50] liquid-silence: Radar now Im not buying those :P
[21:12:50] banisterfiend: how do i list all the callbacks that a model has defined?
[21:13:16] liquid-silence: Radar when are you going do Rails 5? :P
[21:13:23] Radar: liquid-silence: When it's released.
[21:13:30] rhizome: banisterfiend: less app/models/foo.rb
[21:13:35] liquid-silence: Don't you start working on the book before release?
[21:13:41] liquid-silence: and release in conjunction
[21:13:59] banisterfiend: rhizome hehe, there's nothing like a `list_callbacks` method or so on?
[21:14:16] Radar: liquid-silence: Typically, yes. But Rails 5 is a ways off yet.
[21:14:22] Malgorath: Radar: Do you have app examples in your R4IA? I'm looking for a good step through on how to right 1 application completely so I see the pieces come together, so many partial tutorials out there and I'm left going... umm how do I add this to that if they do this and that... ugh
[21:14:23] Radar: And I am concerned that they might change things quite drastically.
[21:14:33] Radar: malgorath: That is what Rails 4 in Action does.
[21:14:36] Radar: That is why I wrote the book.
[21:14:46] Malgorath: Radar: ah thank you in advance then
[21:15:08] Radar: We build a project management application that starts with projects + tickets then moves onto user authentication, authorization, file uploads, emails, comments, building an API...
[21:15:13] helpa: http://guides.rubyonrails.org/engines.html - Engines Guide - Written by Ryan Bigg
[21:15:19] cnk: banisterfiend: I think there is an attribute that is the list of callbacks - fire up the console and go hunting
[21:15:25] Radar: ^ Is actually an old chapter from R4IA.
[21:16:09] cnk: Radar: That chapter is actually why I bought R4IA even though I had been using Rails since < 1.0
[21:16:10] Malgorath: Radar: has it been updated? I just noticed my R4IA has versons of rails 3.2.6
[21:16:13] banisterfiend: This callback is being defined: `after_commit :remove_image!, :on => :destroy` how do i disable it? i tried: skip_callback :commit, :after, :remove_image! but the callback is still running
[21:16:39] Radar: malgorath: We're in the process of updating it. I've got code here for Rails 4.2.0.beta4 and it'll be released as a MEAP soon.
[21:16:55] Radar: malgorath: If you PM me your GH username I can get you even earlier access than the early access program
[21:17:19] Radar: I've got a note to update it for Rails 4.2.0.rc1 after I'm done with this current chunk of work.
[21:19:02] Malgorath: Will the book go okay with what I have no? I'm 4.1.8
[21:19:12] Malgorath: er now even
[21:21:28] tweeeaks: dnsimple is getting destroyed by a ddos right now :/
[21:21:46] tuelz: yup, had to change to google dns servers to touch rubygems
[21:22:15] Radar: malgorath: Yes, it should be OK. The Gemfile examples won't match up, but other than that things should run smoothly.
[21:25:32] LazyCoder8: stupid question: cars = Cars.first, so i have cars.manufactor, but i want to add car.name for example how to do that?
[21:26:03] LazyCoder8: How to create that cars.name if it not exists
[21:26:03] Malgorath: Radar: what if I don't use the version # in the gem files, will that make it work okay?
[21:26:19] Radar: malgorath: YMMV ;)
[21:26:28] Radar: malgorath: Best to follow along directly with the book content.
[21:26:43] Radar: LazyCoder8: generate a migration to add that field to the database?
[21:26:45] xibalba: anyone here have issues with FactoryGirl sequeneces not working when using a before(:all) block?
[21:27:00] xibalba: when I switch mine to before(:each) my issue w/the email sequencing goes away
[21:27:20] Malgorath: Radar: sorry whats does YMMV mean?
[21:27:30] Radar: malgorath: Your Mileage May Very.
[21:27:56] liquid-silence: Radar only Australians use that
[21:27:57] LazyCoder8: Radar, i dont need column in table. Can't just create that cars.name, cars.name = "Audi"
[21:28:20] Radar: LazyCoder8: Why not call it manufacture_name?
[21:28:28] Radar: LazyCoder8: Or even, car.manufacturer_name
[21:28:36] Radar: Whoops, car.manufacturer.name*
[21:34:19] LazyCoder8: Radar, im taking data from database and i need to change some data. I have column: period_in_days and i want to pass variable without period_in_days, but with some other name. Maybe in code will be more clear:https://gist.github.com/TomasAchmedovas/67682e590b0a163a34a5
[21:35:22] LazyCoder8: lets say that cars.period for visibility, also im just learning so im testing everything now
[21:35:25] dopie: how can i make this work
[21:35:31] dopie: match 'contact' => 'contact#new', :as => 'contact', :via => :get
[21:35:31] dopie: match 'contact' => 'contact#create', :as => 'contact', :via => :post
[21:39:34] jameswork: anyone think they could help me with this factory girl question? http://stackoverflow.com/questions/27237509/using-factory-girl-associations-for-non-standard-rails-associations-primary-key
[21:40:18] bricker`work: dopie: What's the problem? You have a path helper defined twice which is unnecessary but shouldn't actually break anything.
[21:40:36] bricker`work: dopie: otherwise it looks okay
[21:42:22] tubbo: tuelz: i suppose i could, seems hacky though
[21:42:28] tubbo: (pointing nginx logs to localhost)
[21:42:33] tubbo: also: i have trouble seeing them when i do that :P
[21:42:41] tubbo: probably because i'm not actually running an rsyslog server
[21:45:16] tuelz: it does seem hacky but if it works I'd personally use it, especially if I had intentions of setting up a remote rsyslog
[21:50:06] dopie: bricker`work, it breaks saying that Invalid route name, already in use: 'contact'
[21:50:06] dopie: You may have defined two routes with the same name using the `:as` option, or you may be overriding a route already defined by a resource with the same naming. For the latter, you can restrict the routes created with `resources` as explained here:
[21:50:25] tubbo: tuelz: yeah that seems like the best bet
[21:51:12] dopie: scope(path_names: { new: 'neu', edit: 'bearbeiten' }) do
[21:51:12] dopie: resources :categories, path: 'kategorien'
[21:51:18] dopie: example wise
[21:53:41] dopie: scope(path_names: {new: '', create: ''}) do
[21:53:41] dopie: resources :contact, path: 'contact'
[21:53:51] Blizzy: unless anyone has any other recommendations, I think I'm going to use Mercury for my WYSIWYG editor.
[21:54:05] dopie: Blizzy, hold on
[21:55:41] skyjumper: Blizzy: redactor
[21:55:48] skyjumper: much better than mercury in my experience
[21:58:46] Blizzy: atm I'm using ckeditor, yet it's 'chunky', so I'll try redactor.
[22:02:11] dopie: redactor is the way to go
[22:02:15] dopie: its so light
[22:05:14] Radar: Blizzy: Did Ace not work out?
[22:05:31] Radar: Redactor does look nice too :)
[22:06:12] skyjumper: Blizzy: beware of IE support under Redactor
[22:10:48] helpa: dopie: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[22:10:48] Radar: dopie: !gist
[22:15:37] dopie: Radar, thank you I have figured it out since it was in the docs
[22:15:54] dopie: i still have a question of why tho... i think its because of rails 4 syntax?
[22:15:59] Radar: why what?
[22:16:03] dopie: rails 4 - match 'contact', to: 'contact#new', via: :get
[22:16:09] dopie: rails 3.2 - match 'contact' => 'contact#new', :as => 'contact', :via => :get
[22:16:12] Radar: why are you using match with via?
[22:16:22] Radar: That's the new hash syntax for Ruby 1.9.
[22:16:33] Radar: get 'contact' => 'contact#new', ...
[22:16:54] dopie: and the top one?
[22:16:58] bricker`work: dopie: oh yeah, in rails 4 you get that error
[22:17:06] Radar: dopie: I am sure you can figure that one out
[22:17:08] bricker`work: dopie: in rails 3 it would just override
[22:17:42] dopie: bricker`work, I figured it out, so it was just new syntax?
[22:17:48] SteenJobs: if a webhook posts data in key/value pairs, and one of the keys is data[email], how do i reference the value, params[:data[email]]?
[22:18:00] bricker`work: dopie: the error explained what the problem was
[22:18:18] bricker`work: SteenJobs: the key is "data[email]" ?
[22:18:30] SteenJobs: bricker`work: so it seems from the sample output in the api docs
[22:18:33] bricker`work: SteenJobs: or is it "data": { "email": ... } ?
[22:18:51] SteenJobs: bricker`work: right so that???s what i would???ve thought, because that???s how the regular api returns info
[22:19:08] SteenJobs: bricker`work: but https://apidocs.mailchimp.com/webhooks/ - doesn???t show the entire hash, if it even exists
[22:19:11] bricker`work: SteenJobs: if it's really "data[email]", you can do params["data[email]"]
[22:19:19] dopie: because I am using as => 'contact' twice
[22:20:20] SteenJobs: bricker`work: it also says that they use a get request to check for a valid url - i have a url for a post request in my routes folder - should i just copy that and replace post with get?
[22:20:57] bricker`work: SteenJobs: I think you'll get a normal JSON document from them: "This is sample data to show you the fields returned - the POST request actually sends key/value pairs, just like a normal HTML Form Submission"
[22:21:00] Radar: SteenJobs: Show us the log output for the controller plzkthx
[22:21:12] Axsuul: is rubygems down?
[22:21:12] Radar: SteenJobs: it's probably params[:data][:email]
[22:21:14] Radar: axsuul: yes
[22:21:23] Radar: DNSimple is down, which means RubyGems is down.
[22:21:25] bricker`work: SteenJobs: yeah or use :via
[22:21:25] startupality: anybody had problems with https://semaphoreapp.com/ ?
[22:21:28] Axsuul: oh thank god, it's not me :)
[22:21:36] SteenJobs: Radar: i would - i haven???t written anything yet really, trying to figure out how to create this webhook, so no output yet.
[22:21:47] Radar: startupality: problems like...? It's currently unreachable.
[22:21:57] SteenJobs: Radar: and i have to write tests in order to check it because there???s no other way to check in production (can???t use localhost as the callback url)
[22:22:03] SteenJobs: bricker`work: cool, thanks!
[22:22:12] Radar: SteenJobs: install ngrok
[22:22:13] startupality: @Radar yeah some of my deployments didnt pass and its unavailable
[22:22:22] Radar: SteenJobs: Point the webhooks at the address that ngrok provides
[22:22:35] Radar: startupality: Probably down due to the dnsimple problems
[22:22:43] SteenJobs: Radar: you just always have an answer, don???t you.
[22:22:51] Radar: SteenJobs: yes
[22:22:56] SteenJobs: hahah love it!
[22:23:07] SteenJobs: k, gonna install ngrok.
[22:23:20] SteenJobs: it???ll save me a lot of time
[22:24:20] Radar: SteenJobs: yes it will :) ngrok punches a hole out to the internet and allows incoming requesdts
[22:24:27] Radar: Extremely useful for testing external callbacks
[22:24:43] SteenJobs: Radar: yea, and especially since i???ll be doing a lot of trial and error since it???s my first time ever using webhooks
[22:24:52] Radar: There is also http://requestb.in/ but it's also down to due to dnsimple
[22:27:31] Axsuul: wow alot of sites use dnsimple
[22:28:36] soahccc: so fragile, maybe I should start selling printed "DNS books" for the paranoids :D
[22:34:59] SteenJobs: Radar: how do i change the address that my local rails server is running at?
[22:35:08] Radar: SteenJobs: Why?
[22:35:22] SteenJobs: Radar: thought i needed to for ngrok but based on your answer i guess not.
[22:35:38] Radar: SteenJobs: Na, ngrok will proxy the request through to localhost
[22:35:48] SteenJobs: Radar: oooo. so i should just run ngrok on 3000
[22:35:51] SteenJobs: instead of 80
[22:35:57] Radar: SteenJobs: mhm
[22:36:01] SteenJobs: cool beans :)
[22:37:25] x-light: SteenJobs: o/
[22:38:59] soahccc: haha awesome. someone implemented a helper method on AR::Base in our project. It's called bangable... Best naming!
[22:39:13] SteenJobs: Radar: never thought i???d be so happy to see a 500 error haha
[22:40:30] SteenJobs: if the webhooks is sending a get request to the callback url, how do i make the url accessible without having a view for the get request?
[22:41:11] bricker`work: SteenJobs: respond with an empty body and 200 request
[22:41:21] bricker`work: SteenJobs: assuming it's just doing a healthcheck on the endpoint
[22:41:41] SteenJobs: bricker`work: yea that???s what it is - and that???s the exact answer i was looking for - how do i do that though?
[22:43:26] LazyCoder8: How to convert string "1 month" or "+1 month" to 2015-01-02 (cause now is 2014-12-02)? I want to add "x month" to today's date
[22:44:16] bricker`work: SteenJobs: render text: "", status: 200
[22:44:32] SteenJobs: bricker`work: awesome - in routes.rb?
[22:45:12] bricker`work: SteenJobs: in the controller
[22:46:35] SteenJobs: bricker`work: ah ok. that might be a problem???because i???m routing the get and post requests to /subscribers_callback, and creating a method in the controller ???subscribers_callback??? which parses the returned values. so i can???t have the method just render ???"
[22:46:48] Blizzy: well, Redactor is a paid program, so nvm Redactor.
[22:47:06] SteenJobs: bricker`work: unless i make an if statement where one of the branches is executed if it???s a get request rather than post...
[22:50:14] joshua___: Hey guys, how can I vendor my gems for my Rails3 application? Not requiring a network. i.e. from my local machine into /vendor
[22:51:52] SteenJobs: bricker`work: not sure how to do that either though...
[22:51:54] tubbo: joshua___: type `bundle help package`.
[22:52:01] startab: Good afternoon all, I was hoping someone could help me figure out an ActionController::UrlGenerationError being raised from a test despite calling the appropriate HTTP method for (put) for an update method
[22:52:29] Blizzy: so, any recommendations for a good editor for a rails application?
[22:52:30] tubbo: joshua___: take that vendor/cache directory, tar it up, and SCP it to your box
[22:53:24] joshua___: tubbo: that tries to get them from the network.
[22:53:53] tubbo: joshua___: what exactly is your use case here?
[22:55:36] joshua___: rubygems is down
[22:55:41] joshua___: and I need to deploy desperately.
[22:57:31] tubbo: joshua___: i actually already have a `vendor/bundle/ruby/2.0.0/cache/` directory with each *.gem file in it
[22:58:02] joshua___: tubbo: I have a few but no means all in there, not sure why??!
[22:58:27] tubbo: joshua___: if you have it too, you could tarball that directory and extract it on the machine, then just loop over it: for file in `ls cache`; do gem install $file; end
[22:58:50] tubbo: that's pretty eierd
[22:59:43] Blizzy: this is free to use, right? https://github.com/SammyLin/redactor-rails
[23:01:31] tubbo: Blizzy: "You may use Redactor for non-commercial websites for free, however, we do not guarantee any technical support."
[23:02:31] tubbo: Blizzy: wouldn't trust that though, because the license at http://imperavi.com/redactor/license/ mentions nothing about free use.
[23:02:49] Blizzy: ok then, thxs, tubbo.
[23:03:52] tubbo: the WYSIWYG landscape is a bit of a ghetto imho unless you're willing to pay, so i tend to just do the "markdown + live preview tab" thing
[23:04:41] Blizzy: hmm, so how would I add a markdown editor to a rails app?
[23:04:44] tubbo: a small popup explaining the syntax and the live preview, IMHO, is good enough for a lot of applications. seeeing as markdown is a common commenting language on many sites, and not too hard to grasp for new users, i don't think a WYSIWYG editor is necessary anymore.
[23:05:35] tubbo: Blizzy: the way i'd do it is to render the markdown as it's coming out. so store the markdown content in a text column, and when you're ready to render the text, that's when you use something like Redcarpet to parse the markdown into HTML
[23:06:02] tubbo: the live preview thing is the hardest part, because it involves JS :)
[23:06:21] Blizzy: couldn't you just use angular for the live part?
[23:06:32] rhizome: you don't even need that
[23:06:46] tubbo: yeah, it's just a nice-to-have
[23:06:53] tubbo: angular's a framework, you can build whatever you want with it
[23:07:10] rhizome: .on('keyup', renderMarkdown('#preview'))
[23:07:18] Blizzy: well, ok. I'm installing redcarpet now. :P
[23:07:29] Blizzy: oh fak rubygems is ded.
[23:07:37] tubbo: i'm surprised rubygems isn't on Amazon's Route 53
[23:07:42] tubbo: what's so great about DNSimple? :)
[23:08:02] rhizome: several things about rubygems surprise me
[23:08:07] Blizzy: and like that, thousands of Rails developers cried while complaining on Tumblr with their 2013 Macbook Pro.
[23:08:28] tubbo: rhizome: go on
[23:09:15] rhizome: uptime and design cover many of them
[23:10:00] tubbo: well like
[23:10:03] tubbo: who gets paid to work on rubygems?
[23:10:17] tubbo: rails has almost 2,500 contributors. rubygems has 165.
[23:10:22] tubbo: the chef repo only has 4
[23:10:37] tubbo: so from that data i can gather that this shit is being looked into by 1/4 people
[23:11:00] tubbo: imo rubygems needs more devs
[23:11:02] rhizome: 165 seems like a lot for something like rubygems
[23:11:26] tubbo: the site actually has 174
[23:12:55] Blizzy: at least it's not 173.
[23:13:07] tubbo: i just wish there were companies who sponsored rubygems the way they sponsor rails
[23:13:23] tubbo: a good amount of the rails core team are paid primarily to work on rails.
[23:13:50] Blizzy: do people sponsor pip?
[23:16:04] tubbo: i don't even know who made pip
[23:16:20] tubbo: it just popped into existence one day with no warning. and the python programmers rejoiced, for easy-install was no more.
[23:19:55] bricker`work: Blizzy: I think pip is sponsored by PSF
[23:20:08] Blizzy: oh ok. thxs, bricker`work.
[23:21:07] bricker`work: Apparently bundler will be built-in to Ruby sometime in the near future
[23:21:21] bricker`work: Or included in stdlib anyways
[23:26:24] hydrajump: can anyone suggest how to debug a rails 4 memory leak(s) that heroku is complaining about?
[23:26:24] xibalba: in one of my tests, i need to test against a time. I want to stub out a time in RSpec3, to say it's today's date but 8am. how would I accomplish this? I'm trying the following based off a stack overflow example, but it's reporting no stub! method for Time:Class ; https://gist.github.com/anonymous/adac1b34622c37cf2670
[23:29:31] Radar: xibalba: Use the Timecop or Delorean gems.
[23:29:42] xibalba: funny i just stumbled onto TimeCop
[23:29:45] xibalba: k, i'll continue reading
[23:32:26] xibalba: Radar, mind helping me w/an example? I want Today's date in Timecop but at a specific hour.
[23:32:41] xibalba: I think I'll use Timecop.freeze(Date.today - 8.hours)
[23:32:44] xibalba: something liken to that
[23:34:06] xibalba: or something like this is probably better, Time.local(Time.now.year, Time.now.month, Time.now.day, 8, 0, 0)
[23:34:30] Malgorath: Radar: sorry was eating lunch with the wife. If the book is R4IA, why does it use Rails 3.2.6?
[23:37:50] hd1: is rspec still the recommended unit testing framework for rails?
[23:38:05] xibalba: i think it's going MiniTest, I dont know though.
[23:40:08] Radar: malgorath: Are you sure you have the latest copy?
[23:40:21] bricker`work: hd1: recommended by whom?
[23:40:30] Malgorath: not really, I bought it back in april 2013
[23:40:38] Malgorath: am i able to get a new copy?
[23:40:43] Radar: malgorath: You should download an updated version at account.manning.com
[23:40:55] helpa: hd1: What you just asked could be classed as subjective. Subjective questions often start flamewars, which are tedious and boring. Try all the available options and see which one suits you the best.
[23:40:55] Radar: hd1: !subjective
[23:44:09] Malgorath: Radar, thanks got it downloaded now.
[23:44:14] Radar: malgorath: cool :)
[23:44:25] Radar: malgorath: If you want even earlier access than Manning's MEAP I can add you to the GH project.
[23:44:26] Malgorath: Did not know I could get updates to the book after it was written
[23:44:48] Radar: Yeah, it'll be updated as long as I'm working on it :)
[23:44:48] Malgorath: Radar: I messsaged you my GH name(its same as my irc one ) :)
[23:45:38] Radar: Done. You should've received an email about it.
[23:46:26] towski_: anyone use request-log-analyzer
[23:46:32] towski_: what does it mean when part of the bar is red
[23:47:47] Malgorath: Radar: would you prefer me to start with the github book? I mean since I'm pretty much coming from a blank noob perspective
[23:48:20] Radar: malgorath: Yeah that would be a great help :)
[23:48:21] Malgorath: So it might be a decent test of how it will work for new to RoR people
[23:48:40] Radar: Please file any issues on that GH project if you come across anything that seems... weird or just plain wrong
[23:49:18] Malgorath: Radar: Is there a generated PDF of this? or do I just git clone it and start reading html pages?
[23:49:50] Radar: malgorath: Instructions for generating a PDF can be found the README
[23:50:59] startupality: Do you guys know how to manage properly a redirect after user accepts an invitation from devise (but that it also keep all parts of the url)? So I want it to redirect to url like in line 1 but I get the other url created with accept_user_invitation_url in line 3 http://pastie.org/private/u0noaxtvd2xt6ewfnd22g
[23:56:30] bricker`work: Radar I feel guilty... I have spent the last week removing Forem from the apps I'm working on :( It's tearing me apart inside
[23:56:40] Radar: bricker`work: np :)
[23:56:44] Radar: bricker`work: Why have you been removing it?
[23:57:13] bricker`work: Radar: It got to a point where were were overriding 95% of what Forem was providing, so we decided the engine was no longer necessary
[23:57:29] Radar: bricker`work: hey if it doesn't work for you then that's ok
[23:57:38] Radar: bricker`work: Forem is relatively simple anyway.