« Back to channel list

#RubyOnRails - 28 November 2012

« Back 1 day Forward 1 day »
[00:00:25] kolbe: bricker: http://dev.mysql.com/doc/refman/5.5/en/mysql-options.html
[00:01:20] kolbe: bricker: those options control how long the client waits to be able to write to or read from mysql, nothing to do with aborting a query if it takes a certain amount of time
[00:01:59] kolbe: bricker: setQueryTimeout is a feature of JDBC and it is implemented in MySQL Connector/J by the driver creating a second connection to MySQL and executing KILL QUERY to (attempt to) force the running query to abort
[00:02:15] slash_nick: thanks parndt, looks like that (deface) is the solution
[00:02:24] parndt: thought it might be
[00:04:55] bricker: kolbe: are you sure? I'm looking at code right now that says read_timeout and write_timeout set MYSQL_OPT_READ_TIMEOUT and MYSQL_OPT_WRITE_TIMEOUT directly
[00:05:15] bricker: And the page you linked me says, for READ_TIMEOUT: "The timeout in seconds for attempts to read from the server.
[00:11:14] kolbe: bricker: MYSQL_OPT_READ_TIMEOUT will cause the connection to time out, but will not actually cause the query to be killed explicitly
[00:11:37] bricker: kolbe: I see.
[00:11:49] kolbe: setQueryTimeout has very different behavior
[00:12:24] Radar: How do I set HTTP_REFERER in a controller spec? Hint: I have googled for it and the answers aren't working.
[00:12:41] slash_nick: parndt: Not sure deface would be enough, actually... The engine is using "form_for do |f|"... I don't see how i'd be able to add an 'f.text_field' from the application...
[00:13:01] parndt: slash_nick: really? what about inserting it after something else
[00:13:11] parndt: you're just injecting strings etc right?
[00:13:14] parndt: Radar: is that correct ^
[00:13:29] slash_nick: parndt: Nah, we'd be inserting input tags
[00:13:41] Radar: You're able to insert ERB too.
[00:13:48] parndt: nothing stopping you :)
[00:14:11] bricker: kolbe: I am not sure that there is anything built-in that has the same behavior
[00:14:11] Radar: https://github.com/spree/spree_auth_devise/blob/master/app/overrides/admin_tab.rb
[00:14:13] slash_nick: but without the application knowing about the form object (f), I can't very well insert "f.text_field"...
[00:14:14] Radar: For example.
[00:14:23] kolbe: bricker: built in to what?
[00:14:49] bricker: kolbe: active record
[00:14:53] kolbe: bricker: Connector/J has support for this, the problem is that ActiveRecord seems to hide the Statement object such that it's not possible to call the setQueryTimeout() method on it :-/
[00:16:18] parndt: slash_nick: sure you can; as long as you specify to insert it *inside* the form_for it works
[00:16:28] parndt: deface intercepts erb/haml rendering and does MAGIC
[00:16:40] slash_nick: MAGIC... that'll do!
[00:16:44] bricker: kolbe: you would have to hack into rails to accomplish it. AR doesn't have a Connector/J adaptor it seems. I also don't know what Connector/J is because I am not a Java developer.
[00:16:53] parndt: well honestly I don't understand it myself
[00:17:01] parndt: lots of work has gone into deface
[00:17:03] parndt: it's pretty awesome
[00:17:18] kolbe: bricker: Connector/J is the MySQL JDBC driver
[00:18:56] bricker: kolbe: I got that, sorry I don't have an answer for you, someone else might
[00:19:06] kolbe: bricker: ok, thanks :)
[00:20:32] kolbe: i suppose this question may belong more generically to someone who knows more about the internals of activerecord-jdbc-adapter
[00:24:30] kjs: ACTION is doing rails for zombies... 
[00:26:29] jarib: is there some way to configure page caching globally to only cache if: lambda { flash.empty? && !user_signed_in? }
[00:27:32] jarib: only option i can see is to override ApplicationController#caching_allowed?
[00:28:04] jarib: not sure if that's a good idea
[00:31:22] epochwolf: jarr0dsz: you really don't understand page caching
[00:33:11] jarib: epochwolf: feel free to enlighten me
[00:33:39] epochwolf: jarib: page caching writes files into the public folder and then apache or nginx will serve them without handing the request off to rails.
[00:34:01] jarib: that i know
[00:34:10] jarib: i don't care particularly about the flashes getting lost
[00:34:28] jarib: this is just temporary until i can get varnish set up.
[00:34:44] epochwolf: jarib: then why do you think you can write a lambda to tell rails to use page caching or not per user?
[00:35:22] Brainix: jarib: I think that if a page is cached, then it'll just get served, and the request won't even hit your Rails app to do any extra logic. epochwolf, is that what you're saying?
[00:35:53] epochwolf: Brainix: pretty much…
[00:35:58] jarib: epochwolf: if the request that writes to the cache has a flash, i don't want it cached.
[00:36:34] jarib: actually, ignore !user_signed_in? in the lambda
[00:36:59] jarib: epochwolf: makes sense?
[00:37:05] epochwolf: Brainix: you can try to explain page caching to nooblet here, I'm done.
[00:37:48] bricker: jarib: once rails caches a page, it gets served by nginx or whatever, that's it. It'll get cached once, by whoever visits the page first.
[00:38:25] bricker: jarib: so having a lambda about user signed in or whatever doesn't work
[00:38:34] joshlegs: oooh lots of nicks in here
[00:39:10] foucist: hey folks, how much time do you spend a week learning/updating your programming knowledge etc?
[00:39:13] jarib: bricker: i understand. and if the first request has a flash, i don't want that to be the request that writes to the cache.
[00:39:50] epochwolf: foucist: I learn new things all the time.
[00:39:57] clouder`g: I think jarib is talking about an edge case where the cache gets cleared and the very next request is like a direcrect to the home page with a flash
[00:40:00] Radar: foucist: NEVER STOP LEARNING
[00:40:15] epochwolf: foucist: you'll have to clarify what type of learning you mean.
[00:40:15] jarib: clouder`g: correct
[00:40:15] foucist: Radar: the problem is i don't spend much time learning at all... and that hurts me in the long run
[00:40:32] foucist: Radar: i need to dedicate much more time to it.. just curious if anyone has a good rule of thumb about the amount of time to spend on it
[00:40:40] epochwolf: foucist: as much as you want
[00:40:45] foucist: epochwolf: heh
[00:40:53] Tarential: foucist: Wow, I spend like half my time learning new things
[00:41:03] epochwolf: but not so much that you lose touch with how to actually write code and use the things you have learned
[00:41:06] Brainix: foucist: I rarely spend any "dedicated" time to just reading books, if that's what you mean. But I often try to use new technologies or approaches, and I work on a lot of side projects.
[00:41:23] epochwolf: I probbaly spend 5% of my time reading books
[00:41:29] epochwolf: or articles on stuff
[00:41:45] epochwolf: I do a fair amount of algorithm stuff at work
[00:41:57] foucist: epochwolf: well my problem is that i'll get focused on just working on current projects and hacking away at shit to make it work, instead of taking the time to learn the fundamentals of whatever tech
[00:42:24] epochwolf: foucist: I never just hack away to get stuff working unless it's an emergency.
[00:42:29] foucist: i have trouble justifying to myself to take a break from the work and learn the shit
[00:42:59] epochwolf: I haven't had a problem with that.
[00:43:05] epochwolf: well, not since college.
[00:43:15] epochwolf: I'd learned to go slow and code smart.
[00:43:26] epochwolf: saves a lot of time.
[00:43:55] epochwolf: For example, I spent 4 of the last 6 working days to design algorithms and only spent 2 days on code.
[00:44:03] bricker: jarib: oh I see. Well back to your question, no there's no global way to configure that.
[00:44:09] epochwolf: now I'll be spending 3 or 4 days on testing
[00:44:25] Ogredude: I spent all of today getting my test suite to let me actually run tests with a javascript driver.
[00:44:27] epochwolf: of course, I'm an enterprise developer, not some hack
[00:44:50] jarib: bricker: ok, thanks. perhaps no one's actually using the cookie session store, and then always lose sessions on redeploy? that'd keep this problem from happening
[00:44:54] epochwolf: Ogredude: I do that before I even write the first controller.
[00:45:19] jarib: or use the database?
[00:45:20] Ogredude: epochwolf: I thought I had already done it. Authlogic had different ideas.
[00:45:23] jarib: what do people use for their sessions?
[00:45:31] epochwolf: Ogredude: haha, I'm using devise, for worse.
[00:45:41] epochwolf: jarib: php typicakky
[00:46:11] foucist: epochwolf: you do lots of SQL then?
[00:46:54] epochwolf: foucist: almost none, why?
[00:46:57] lethjakmans_lap: the CSV parser in ruby seems really slow and buggy, is there anything better?
[00:47:24] epochwolf: foucist: I know some of the theory and I can do reports with manual queries. I just don't need to often.
[00:47:40] epochwolf: lethjakmans_lap: what blazes816 said
[00:47:41] blazes816: lethjakmans_lap: https://www.ruby-toolbox.com/categories/CSV_Parsers
[00:47:53] lethjakmans_lap: is it buggy like the built in one? it wasn't always completing it's quotes
[00:47:58] clouder`g: jarib, maybe this will work? http://stackoverflow.com/questions/1377666/disabling-flashnotice-to-make-page-caching-make-sense
[00:48:02] blazes816: thanks for stamp epochwolf
[00:48:41] epochwolf: blazes816: sure, next time I'll use a branding iron.
[00:48:58] Shubuntu: blazes816: where can i find info on node.security, some people say node.js isn't safe
[00:49:29] epochwolf: Shubuntu: not a rails question!
[00:49:35] blazes816: Shubuntu: uh, google probably, but there's no problems using node as your js engine
[00:49:43] jarib: clouder`g: yeah, loading the flash with an xhr is an option, just seems like a lot of work for this
[00:49:51] blazes816: it's only used for asset management
[00:50:29] epochwolf: blazes816: compiling assets*
[00:51:13] bricker: jarib: If you're serving a page cache with no flash notice, then why do you have flash notices at all?
[00:52:03] lethjakmans_lap: `const_missing': Please switch to Ruby 1.9's standard CSV library. It's FasterCSV plus support for Ruby 1.9's m17n encoding engine.
[00:52:20] lethjakmans_lap: I tried running it and got that error, any clue why it'd throw that?
[00:53:13] jarib: bricker: good call
[00:53:34] jarib: bricker: i use flashes quite a bit in my /admin namespace
[00:53:40] jarib: but that's a different layout
[00:53:59] jarib: so i guess i can just move them out of the main layout
[00:54:13] jarib: bricker: good call, thanks!
[01:09:00] rhizmoe: good times
[01:12:13] oogabubchub: Where in my Rails app should I be putting various actions that I'd like to run occasionally? For example, if I create a function to pull, parse, and update from an API to various models?
[01:16:00] Eiam: rake task?
[01:18:01] Radar: +1 rake task
[01:20:15] oogabubchub: Can rake tasks be called from within my app? I want to be able to run the update from the controller every time a new account is authenticated via API
[01:20:35] oogabubchub: It would be nice to be able to run it like a method
[01:20:58] Radar: oogabubchub: Why not put the code inside another class and call that class from your controller?
[01:21:17] Radar: That way, you can test a) that your controller CALLS that method and b) that the method works in complete isolation from a request
[01:21:58] oogabubchub: Custom class? I was looking at this SO answer from Yehuda Katz that sounds like what you are describing: http://stackoverflow.com/a/1071510/337903
[01:22:48] Radar: oogabubchub: Yes, something that's completely separate and testable within isolation.
[01:23:02] oogabubchub: Radar: Thanks
[01:34:58] makerbreaker: this is more of a theory question, refactoring etc rather than a specific example
[01:35:50] makerbreaker: I have 3 models, job, bid, and tshirt, people submit jobs, other people bid, tshirt printing is what they are bidding/putting in jobs for
[01:36:00] makerbreaker: (sorry, thinking how to phrase)
[01:36:20] makerbreaker: tshirts, have a lot of attributes, brand, 8 sizes, colors etc
[01:36:49] makerbreaker: im assuming that putting all those attributes on that tshirt is the wrong way to do things
[01:37:03] makerbreaker: but, I cant see the "right" way
[01:37:40] makerbreaker: wondering if anyone could point me to some reading, or help me think about this correctly
[01:38:24] Radar: What are the attributes?
[01:38:39] Radar: makerbreaker:
[01:38:54] makerbreaker: sizes are the big one
[01:39:00] Radar: makerbreaker: colour
[01:39:03] makerbreaker: 10 values for size
[01:39:15] Radar: makerbreaker: We deal with that in Spree by having option types
[01:39:29] makerbreaker: ie, the attribute is "large", and someone might order 10 largers
[01:39:30] Radar: makerbreaker: A product can have many variants and variants are unique based on option values for the option types
[01:39:53] Radar: so you could have a Chairman Mao shirt which comes in two option types: Size and Color.
[01:40:00] Radar: Size has the option values of Small, Medium and Large
[01:40:09] Radar: Color has the option values of Red, Red or Red. Because it's Chairman Mao.
[01:40:45] makerbreaker: so just abstract away the variations away from tshirt?
[01:40:51] Radar: Yes, I think so.
[01:41:01] epochwolf: ACTION nibbles on a shirt
[01:41:08] makerbreaker: ie, a brand can have many sizes
[01:41:12] Radar: The T-Shirt itself is a collection, underneath that you have the different variants which themselves are unique based on option types and option values
[01:41:34] Radar: That's how we've architected it in Spree, anyway. I'm not suggesting it's the best way of doing it.
[01:46:46] Eiam: hmm can anyone think of a way from rails to generate a chart that could be emailed…? i currently use flotr2 which requires js & canvas/dom to render
[01:46:54] Eiam: which unfortunatey means I cannot email it.
[01:47:16] makerbreaker: radar, cool thanks
[01:47:25] makerbreaker: ill look at spree, see how that works
[01:47:46] makerbreaker: I figured that writing my own stuff, would be faster than learning what it takes to modify spree, but now im not sure
[01:47:58] oogabubchub: Radar: Even though I'm making API requests which would normally go in a controller within the MVC framework, there's no need to worry about the controller when I'm using the custom classes that you suggested earlier, right?
[01:48:26] Emily: Eiam: check out http://scruffy.rubyforge.org/ there's probably something newer/more supported though
[01:48:28] Radar: oogabubchub: What kind of API requests? Do you have some example code?
[01:49:18] oogabubchub: I'm working with the YouTube API. Basically I'll be making a get request to update video and channel statistics in a youtube video and channel models that I have.
[01:49:51] oogabubchub: So, it'll be a get request, then parsing the response and writing to the database
[01:50:04] foucist: oogabubchub: most of us do the API interfacing with other APIs at the model level, not controller
[01:50:04] TheLolrus: I don't want to be too rude and critical, but is there any logical reason why ruby on rails's ecosystem changes so often?
[01:50:20] foucist: oogabubchub: using ActiveResource or better alternatives
[01:50:54] oogabubchub: foucist: Ah, being new to MVC, I thought that most requests, whether incoming or outgoing were handled by the controller
[01:51:16] Eiam: Emily: none of the charts on that page actually render i see empty blocks
[01:51:17] foucist: oogabubchub: API is treated like a database in a way, just a remote one
[01:52:06] Emily: Eiam: they probably screwed up their server config at some point then, it works in an old stat reporting app I've got at work
[01:55:01] foucist: oogabubchub: controller is really only to massage data into a palatable format for the view.. and massage form input data into a palatable format for the model.. but code in controller is ideally kept to a minimum
[01:55:07] foucist: model is the work horse
[01:55:20] foucist: tho don't want too fat of models.. if the models get fat, refactor them out to /lib etc
[01:55:42] oogabubchub: My models are a bit too thin right now.....I need to feed it some methods
[01:58:28] oogabubchub: foucist: If I have two models - YoutubeAccount and YoutubeVideo - if I wanted to make one request that would populate data within YoutubeAccount and many YoutubeVideo's, would it be OK to write a method in YoutubeAccount that writes to both models? Or should I keep YoutubeVideo writing to just that model?
[01:59:42] idzuna: new to rails, just getting into it over the weekend -- could anyone perhaps explain why basic link_to calls are always and only linking to "#" when the links are in a partial? in a normal view they work as expected, but no matter how I word them they don't link correctly from within my header/footer partials
[02:00:11] foucist: oogabubchub: i think it's fine for the account model to populate the db for whatever the video model would access later
[02:01:11] Emily: idzuna: using 3.2.9? also could you copy/paste one of the link_to's from one of the partials?
[02:02:34] idzuna: emily: 3.2.9, yes -- for example: <%= link_to "About", about_path %>
[02:02:57] idzuna: that works perfectly fine in a regular old view (not a partial) and the named route seems fine
[02:03:05] Emily: idzuna: I'm assuming you have a named route for that, right?
[02:03:17] idzuna: in my (very simple) partial header/footer the outputted links are always "
[02:04:01] idzuna: I'm feeling kind of dumb as I expect this is something that is obvious, but I'm just not familiar with the framework quite yet
[02:04:06] Emily: idzuna: what does your named route look like?
[02:04:27] idzuna: match '/about', to: 'static_pages#about'
[02:04:45] Emily: that'd do it
[02:05:01] Emily: try adding , as: "about" to the end of that
[02:07:44] idzuna: Emily: it still seems to be outputting <li><a href="#">About</a></li> for that call
[02:09:16] idzuna: the same link_to within the main view (not the partial header/footer) still correctly points to <a href="/about">
[02:09:42] idzuna: it seems to be treating the exact same linking differently within the partials
[02:09:55] Emily: idzuna: hm, that's odd, you're not passing in any weird locals or anything, right?
[02:10:28] idzuna: Emily: I don't think so, I'm doing the most basic of stuff essentially just following along with some tutorials
[02:11:27] Emily: how are you rendering the partial?
[02:13:43] idzuna: Emily: as it turns out, I am in idiot; I just realized I was editing old copies of the files prior to moving them to a new folder earlier, problem solved
[02:14:00] idzuna: Emily: many thanks for prompting me to go actually notice that, haha, sorry
[02:14:11] idzuna: user error strikes again
[02:14:14] foucist: anyone know about using ajax to do something like hipmunk's tabbing approach, and load images in the background ? want to let the user click on a bunch of thumbnailed images, and load the images in a tab in the background
[02:14:34] foucist: would backbone.js be the best way to handle that or what?
[02:14:52] foucist: just looking for recommendations
[02:16:30] idzuna: Emily: I wasn't aware of the 'as: " "' attribute in routes, I'm assuming that's to specify a particular path name for the match?
[02:16:52] Emily: idzuna: yup
[03:04:38] djbpython: why is it if i dont have the else with the span it outputs an escaped html input tag? https://gist.github.com/4158773
[03:06:27] djbpython: in this particular template im just trying to show new records, but the parent record has existing records
[03:06:38] r0bglees0n: can attr_accessible be called multiple times without resetting the whitelist?
[03:19:31] Radar: r0bglees0n: calling attr_accessible multiple times does not reset the whitelist
[03:43:40] Radar: ssssssshhhhh
[03:50:35] r0bglees0n: Radar: thanks!
[04:27:40] GreenPlastik: i'm guessing this is the lull due to transition between time zones?
[04:28:18] sevenseacat: does there have to be a reason?
[04:29:32] parndt: because of the hobbit premiere duh
[04:29:55] parndt: I guess "noobs be noobin" == false
[04:29:57] parndt: so it's quiet
[04:30:33] sevenseacat: doesnt come out here till boxing day
[04:30:39] sevenseacat: so foo to you >_>
[04:32:04] parndt: tricksy hobbitses
[04:32:23] skyjumper: GIS'd "boxing day", wasn't disappointed - http://1.bp.blogspot.com/-wEYkWxc1c0w/TvjpdWk3eLI/AAAAAAAAAK8/_G6NYGKNrek/s1600/boxing-day1.jpg
[04:33:05] parndt: skyjumper: hahah!
[05:18:40] mcoffee: How can I load modules in a rails controller. So let's say I had a model called 'user' and I wanted to load it in the 'home' controller, and get all records of it from the 'index' function, how would I do that?
[05:20:18] wmoxam: mcoffee: models are available globally
[05:20:23] sevenseacat: mcoffee: all models are available in all controllers
[05:22:12] mcoffee: wmoxam: thanks. You are right. I added an 's' when I tried to access the model.
[05:22:28] mcoffee: wmoxam: thanks. You are right. I added an 's' when I tried to access the model, but that, of course failed. I removed it, and it now works.
[05:22:37] cableray: aren't models available in most of your rails app?
[05:22:48] Billiam: I have a model (model_1) with a has_many model_2, :through join_model association. How can I find the join model associated for model_1 by the model_2 instance?
[05:23:01] wmoxam: mcoffee: :D
[05:23:45] Billiam: It seems like I can do something like model_1.join_model.find_by_model_2_id(model_2.id) ... but it feels like I'm doing something wrong... :(
[05:23:46] wmoxam: Billiam: model_2.join_model.model_1
[05:23:48] cableray: do the association backwards on model 2
[05:24:39] cableray: wait, is join_model automatically available on model_2?
[05:24:42] Billiam: wmoxam, cableray: lets say that it's a many-to-many from model_1 to model_2, with some metadata in the join model
[05:26:45] Billiam: Does that make sense?
[05:27:30] cableray: yep. and you have a has_many relationship with join_model on both model_1 and model_2?
[05:28:04] Billiam: cableray, yep.
[05:30:31] cableray: so given model_1 and model_2 you need the join_model with both model_1 and model_2, right?
[05:30:40] Billiam: I do, exactly.
[05:35:17] cableray: Yeah, I think the statement you had above should work, but why do you need to do it that way?
[05:35:27] mcoffee: I'm trying to display a custom JSON format, rather than the one supplied by rails. I created a new view, with the extension 'index.json.erb', for the test of it, I inputed the string '{ "message": "Hello, World!" }', but that doesn't work. It still displays whatever there is in the database. How would I output custom JSON?
[05:35:46] sevenseacat: custom json format?
[05:35:53] helpa: What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
[05:35:55] cableray: Use RABL or Json Builder
[05:36:35] Billiam: cableray. I guess I really don't know how else to do it.
[05:37:59] cableray: Billiam: well, it seems to me in nearly all cases where you have model_1 and model_2 you should have the join model as well.
[05:38:38] mcoffee: sevenseacat: I created a model, called 'user'. Of course, I also created a controller and view for the model. Whenever I navigate to /users.json, I get a list of all users. Good. But now, I want to format that outputted JSON string to be something else, other than what ruby provides.
[05:38:55] Billiam: cableray, hmm. Model_1 is the current_user. model_2 is the resource they're viewing. I need to read and write to the join model between them.
[05:39:05] Billiam: Where should I have gotten the join model?
[05:39:08] foucist: mcoffee: rabl or json builder let you control the json output
[05:39:21] mcoffee: foucist: thanks, I'll look into that.
[05:39:27] foucist: mcoffee: or 'jbuilder' it's already in teh gemfile, commented out
[05:39:57] cableray: Billiam: and model_2.join_model, doesn't work in this case?
[05:40:20] Billiam: cableray, well, model_2 has a bunch of join_models.
[05:41:17] Billiam: I mean, the find_by works, it just felt clunky, and I assumed there was something cleaner available.
[05:41:53] cableray: well, one thing you should do is give model_2 a join_model_for_model_1 method, if that's not what you're doing.
[05:42:18] cableray: and then that method will be something kind of clunky inside there.
[05:42:34] Billiam: Ok, that's what I have so far. Thanks!
[05:44:05] cableray: I think it might be best to do something like JoinModel.where(model_1_id: model_1.id, model_2_id: model_2.id)
[05:44:24] cableray: that may give you a better sql call.
[05:44:41] cableray: and I think it looks cleaner.
[05:46:55] cableray: or rather JoinModel.find_by_model_1_id_and_model_2_id(model_1.id,model_2.id)
[05:49:41] lemonsparrow: !object.is_safe? && !object.departments_enabled? any better way to write this comdition
[05:51:28] cableray: lemonsparrow: !(object.is_safe? or object.departments_enabled?) is equivalent.
[05:51:29] mcoffee: This is more of a ruby question: I'm on Ubuntu, and it seems that rails manages to "force" ruby 1.9.x, but when I run the 'ruby' command, it simply runs v1.8.x. I'm guessing there is a command for running 1.9, I wonder if any of are familiar with this.
[05:51:44] lemonsparrow: cableray: thanks :)
[05:52:57] cableray: lemonsparrow: you may want to right another method for object (if you wrote it) that encapsulates that condition.
[05:53:07] skyjumper: mcoffee: if you're using passenger+apache, your passenger module was probably compiled against 1.9.x
[05:53:56] lemonsparrow: cableray: ryt
[05:54:15] Spaceghostc2c: lemonsparrow: Use English. :)
[05:54:20] mcoffee: skyjumper: I don't think my rails setup is even involved with apache.
[05:54:24] cableray: mcoffee: try rubyenv or rvm to manage ruby versions
[05:54:45] skyjumper: mcoffee: do you run it via "rails server" or something similar?
[05:54:46] lemonsparrow: cableray: I can write this as unless (object.is_safe? || object.departments_enabled?)
[05:54:58] mcoffee: skyjumper: yes.
[05:54:59] joshlegs: Spaceghostc2c: use Korean
[05:55:10] Spaceghostc2c: joshlegs: Use your mouf.
[05:55:10] joshlegs: (Oppan Gangnam style)
[05:55:13] cableray: lemonsparrow: yep.
[05:55:17] joshlegs: i already did that
[05:55:18] mcoffee: cableray: yeah, that's what I should've done. But I used apt-get. =/
[05:55:19] skyjumper: mcoffee: then cableray is probably right, it's likely managed by rvm
[05:55:34] skyjumper: then you should redo it via rvm
[05:55:36] joshlegs: i was gonna suggest you consider something rvm-ish
[05:57:50] cableray: rvm is nice, but it's kind of a beast.
[05:58:16] halcyonicstorm: ACTION is horsedancing
[05:58:41] Spaceghostc2c: It's pretty nice, imo.
[05:58:43] cableray: sevenseacat: never heard of rbfu
[05:58:50] Spaceghostc2c: HAs lots of features the others don't have.
[05:59:15] Spaceghostc2c: You just kind of have to not have the brain of aLinux to use it.
[06:00:17] halcyonicstorm: Spaceghostc2c: you're setting the bar wayyyyy toooo high
[06:00:31] Spaceghostc2c: halcyonicstorm: ikr. :(
[06:02:17] cableray: what does rbenv have that rbfu removes?
[06:02:27] cableray: as far as I can tell they work the same.
[06:02:47] Spaceghostc2c: They both lack features when compared to rvm.
[06:03:36] cableray: which is the idea, they're smaller.
[06:03:36] sevenseacat: rbfu is the simplest and easiest to use
[06:03:57] chendo_: and don't involve stupid shell functions ;/
[06:04:07] Spaceghostc2c: rvm is also pretty simple.
[06:04:08] joshlegs: i heart shell
[06:04:13] Spaceghostc2c: chendo_: Shell functions are good things. :)
[06:04:35] chendo_: i'm not saying they're bad
[06:04:42] Spaceghostc2c: I disagree with how rvm is written, but when I don't touch code, it works like a dream.
[06:04:43] joshlegs: plus, using the shell makes you feel smarter than other people who can't
[06:04:50] endzyme: I am having a problem saving a bash script to a text: column in my sqlite3 cell
[06:04:56] chendo_: but when you can solve a problem an easier way
[06:04:59] chendo_: no need to resort to shell functions
[06:05:06] Spaceghostc2c: chendo_: Not sure I agree.
[06:05:17] Spaceghostc2c: When you can solve the problem with less work, do that.
[06:05:25] Spaceghostc2c: Right now, pretty equal in terms of work.
[06:05:41] endzyme: ActiveRecord::StatementInvalid: SQLite3::SQLException: unrecognized token: "'#!/bin/bash...
[06:05:55] sevenseacat: endzyme: code?
[06:05:57] helpa: endzyme: Instead of simply saying 'something is broken' please elaborate on this by showing us the code and the error that you are getting by making a Gist (http://gist.github.com) about it
[06:06:14] shinnc_: anyone use heroku here?
[06:06:25] helpa: Don't you mean lolroku?
[06:06:32] endzyme: sevenseacat: trying not to paste everything as there will be some obfuscation i'll have to do :-/
[06:06:40] helpa: endzyme: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[06:06:40] Spaceghostc2c: endzyme: !gist
[06:06:56] Spaceghostc2c: endzyme: Also, except for your IP and passwords, your code isn't special.
[06:07:03] Spaceghostc2c: It's just more (likely) shit code.
[06:07:06] endzyme: Spaceghostc2c: thanks will start cleaning up the paste
[06:07:13] shinnc_: getaddrinfo: Name or service not known (SocketError) <-- is this a client side dns problem?
[06:07:21] endzyme: Spaceghostc2c: yeah, thanks, super useful info
[06:07:29] helpa: shinnc_: Instead of simply saying 'something is broken' please elaborate on this by showing us the code and the error that you are getting by making a Gist (http://gist.github.com) about it
[06:07:53] Spaceghostc2c: mlang: I forgot who you were, but I have an inkling of a notion that I liked you.
[06:08:17] mlang: Spaceghostc2c: Thats quite nice to hear :>
[06:10:40] shinnc_: https://gist.github.com/4159336
[06:12:24] sevenseacat: shinnc_: sounds like heroku had a bit of a brainfart during the process. try it again?
[06:12:54] shinnc_: I'm having the same problem last night
[06:12:57] mlang: Spaceghostc2c: tat leaves you speechless? :)
[06:13:02] shinnc_: it sounds weird
[06:13:19] Spaceghostc2c: mlang: It's how I respectfully show my distaste for lolroku. :)
[06:13:55] mlang: Oh, c'mon. Terriroku is not that evil :>
[06:14:41] joshlegs: our SA doesn't like heroku either
[06:14:45] Spaceghostc2c: Horroku is bad.
[06:17:02] shinnc_: what do you use other than heroku?
[06:17:02] mlang: Spaceghostc2c: Why is your dislike of it so big?
[06:17:15] joshlegs: Spaceghostc2c: system admin
[06:17:21] iliketurtles: When I use Rails.application.routes.url_helpers.posts_path(self) in a model i get "stack level too deep" What's the correct way to get path helpers in models?
[06:17:42] endzyme: error line 251
[06:17:43] endzyme: https://gist.github.com/0056ff32bca59267a214
[06:17:50] Spaceghostc2c: mlang: It is proportionate to my ability to run my own systems reasonably and cleanly.
[06:17:52] endzyme: anyone ever seen this type of thing before?
[06:18:54] endzyme: it *does* save if i escape more charachters with .inspect
[06:18:55] mlang: Spaceghostc2c: Yeah, I completely agree to that. Sadly, I have been working with Cthulhu so long, that I even prefer Heroku then this thing we are on right now.
[06:18:57] endzyme: characters
[06:19:04] alexshenoy: can someone recommend a good book on design patterns and refactoring?
[06:19:13] shinnc_: sevenseacat: now i got this "Connection reset by peer (Errno::ECONNRESET)"
[06:19:35] Spaceghostc2c: mlang: At work, we afford ourselves some proper services. These being engineyard.
[06:19:49] joshlegs: ok i had fun talking with you chaps. but it's off to bed for me
[06:19:53] joshlegs: y'all have a good one ya hear
[06:20:11] joshlegs: later Spaceghostc2c
[06:20:23] mlang: Spaceghostc2c: Okay, yeah, EY is quite amazing. Our current Production System is hosted by Rackspace and was set up by someone who had NO idea how to do it.
[06:20:23] Antiarc: alexshenoy: Code Complete is very good, though not ruby-specific.
[06:20:53] mlang: So yeah.. whenever i SSH into it, i'm being greated by half a screen of warnings and error messages.
[06:21:37] alexshenoy: antiarc: it doesn't need to be ruby-specific. ill check that out. :-) any others i might want to look at?
[06:22:29] Antiarc: I'm not much of a book guy, so I don't really have any other recommendations. But the fact that I like code complete and don't usually like programming books should give you an idea of my appreciation of it :)
[06:23:57] alexshenoy: thank you! ill certainly check it out
[06:26:09] Jamezor: can someone explain what david black is doing with this: puts "%.2f." % ticket.price
[06:26:16] Jamezor: I've never seen modulus used like that before
[06:26:28] chendo_: it's sprintf
[06:26:29] Antiarc: It's basically sprintf
[06:26:34] Antiarc: Python does the same thing.
[06:27:38] Spaceghostc2c: Jamezor: It's called parameterization.
[06:28:42] Antiarc: You can even use named parameters with it, which is nice.
[06:29:04] Jamezor: where's some examples? can't find any :/
[06:29:04] Antiarc: "%<item>s cost $%<price>2.1f" % {:price => 12.345678, :item => "Bananas"} => "Bananas cost $12.3"
[06:29:10] Antiarc: http://www.ruby-doc.org/core-1.9.3/Kernel.html#method-i-sprintf
[06:30:28] Spaceghostc2c: The % marks the place for the parameterization.
[06:30:57] Jamezor: hmm that's kinda cool
[06:31:19] Jamezor: if he did price>1.1 would it be 2.3?
[06:31:46] helpa: Why don't you try it and find out for yourself?
[06:32:06] Jamezor: well it doesn't
[06:33:09] Antiarc: The sprintf portion of the doc I linked explains most flags
[06:33:19] Antiarc: And you can look at the printf doc for C if you want a more complete picture
[06:33:21] Jamezor: why did you put 2.1 instead of .1?
[06:33:25] Antiarc: Since I'm pretty sure that's what it's using under the good.
[06:34:49] Antiarc: habit, really.
[06:35:56] Antiarc: %2.1f is "a decimal representation of this number at least 2 characters large with 1 decimal precision"
[06:36:39] Antiarc: If you use like... "%05.1f" % 1.23, you get "001.2", which is "at least 5 characters long, left-padded with 0, 1 decimal point of precision"
[06:37:27] Jamezor: that's kinda wonky
[06:37:37] Antiarc: Well, it's for string formatting.
[06:37:45] Antiarc: Very useful when you need strings formatted.
[06:38:08] Antiarc: Like, if you want to print out a table of info to the console with it all lined up.
[06:39:23] Antiarc: https://gist.github.com/e66ec4779467e590fc76 <-- like that for example!
[06:39:49] Antiarc: Even though I don't know how long any individual number might be, I get two columns, each 40 characters wide, so my second column always lines up with itself.
[06:40:09] HashNuke: I found this awesome presentation - https://speakerdeck.com/jeg2/10-things-you-didnt-know-ruby-could-do
[06:41:26] Jamezor: Antiarc: does rand give you a default length of decimal points?
[06:41:37] helpa: Why don't you try it and find out for yourself?
[06:41:48] helpa: YOLO driven development
[06:41:48] Spaceghostc2c: !ydd is a good thing!
[06:42:46] Jamezor: I was just wondering why some of the random numbers were of different lengths is all
[06:43:09] Antiarc: because they're random, of course.
[06:46:09] Jamezor: well yeah, but why would that change the precision? it looks like each col is half number space half white space
[06:46:46] Spaceghostc2c: You're still fucking with string formatting?
[06:46:53] Antiarc: I printed %-40s, which is "a left-aligned string 40 characters wide"
[06:47:04] Antiarc: It just takes the number and calls to_s on it and uses it without touching the precision of it
[06:47:13] Antiarc: Some random numbers have different precisions than others.
[07:16:23] levifig: how can I create a Rails 4 app?! :o
[07:16:31] levifig: rails new XXX --edge is still doing 3.2
[07:18:47] sevenseacat: install the gem from git
[07:18:56] Dreamer3: is hendrik louw here?
[07:18:57] sevenseacat: rails new will just use whatever version you have installed
[07:21:36] Antiarc: bleeeeeeeeeeeeeeehj
[07:21:43] Antiarc: I have things I must do and zero motivation to do them :|
[07:22:09] levifig: sevenseacat, halp? :)
[07:22:59] levifig: "install gem from git" <- how do I do that?
[07:23:07] sevenseacat: Antiarc: dont make me get the whip out
[07:24:10] certainty: sevenseacat: do you have that link to the rspec docs stating that that tests that act as acceptence-tests now go into the /features directory instead of /requests ... i can't seem to find it
[07:24:48] sevenseacat: certainty: https://www.relishapp.com/rspec/rspec-rails/v/2-12/docs/request-specs/request-spec
[07:24:57] Ruxton: ACTION cries
[07:25:04] Ruxton: i was BANNED :O
[07:25:26] certainty: sevenseacat: thanks
[07:26:20] certainty: hm unfortunatelly the link to feature_specs is dead :/
[07:26:42] sevenseacat: certainty: true, its in the sidebar though
[07:26:52] sevenseacat: levifig: hmm, clone the repo i guess
[07:27:06] certainty: heh, oh man. thanks again sevenseacat
[07:27:37] sevenseacat: Ruxton: who did you piss off to get banned? >_>
[07:28:20] Ruxton: sevenseacat: nfi, i'm guessing irc connection was bouncing a bit and that caused it
[07:30:01] certainty: can anybody acknowledge that activemq still has severe problems running stable without errors?
[07:30:39] rvanlieshout: how can something have severe problems and run without errors?
[07:30:53] sevenseacat: rvanlieshout: no 'and'
[07:32:03] sevenseacat: what was i trying to do again.... oh yeah, manually generate formtastic error messages
[07:32:41] levifig: sevenseacat, thanks
[07:33:36] certainty: rvanlieshout: that was badly worded. it was known to not be able to run without errors in a production environment because it had severe errors
[07:33:48] certainty: i wonder if that is still the case
[07:34:41] certainty: hmm i guess that's still badly phrased
[07:34:43] rvanlieshout: dunno. have you tried?
[07:34:47] certainty: ACTION gets some coffee
[07:36:11] certainty: rvanlieshout: we have it run in a small scale. but we need to emphasize messaging in the future, which makes me reevaluate the available options. and hearing opinions is, as a first step, easier than trying things out
[07:36:51] Antiarc: certainty: Most of the folks using that sort of thing seem to be using zeromq or rabbitmq, from what I've seen
[07:36:58] Antiarc: Pure anecdote, obviously.
[07:37:17] Antiarc: (I actually use redis pub/sub for it, but I'm not doing high volume with it yet)
[07:37:37] certainty: Antiarc: zeromq is not an option. i'm looking at rabbitmq though
[07:38:22] certainty: Antiarc: does redis support durable queues?
[07:38:45] certainty: i thought it features only pubsub without queues
[07:39:27] certainty: we don't expect much throughput. but we demand reliability
[07:39:39] certainty: that's the major concern
[07:39:41] Antiarc: It doesn't support durable queues for the pubsub stuff, but its lists are basically usable as durable queues if you need worker distribution
[07:40:24] Antiarc: blpop is atomic and first-come-first-serve, so your clients can just blpop a list and they'll get items shoveled to them in the order they registered for them, and once they are ready for another they just blpop again
[07:40:32] certainty: Antiarc: i'll look at this
[07:40:49] Antiarc: I use that for farming out web crawling work to a bunch of crawler nodes controlled by a single master node
[07:41:28] Antiarc: the master node has a list of jobs that need to be done on a recurring basis (URL crawls, basically), and it just adds them into a list. workers blpop the list, so if there's an item available, they get it immediately. Otherwise they block until redis has an item for them.
[07:41:40] Antiarc: http://redis.io/commands/blpop
[07:42:22] certainty: Antiarc: but the message is removed once a worker has picked it up, correct?
[07:42:37] sevenseacat: if anyone knows how i can generate formtastic error messages (eg. for a field that ive constructed manually without using f.input), i would be most grateful
[07:42:44] Antiarc: (which is what you'd want, I presume)
[07:43:48] rvanlieshout: sevenseacat: manually? or do you still want to use a builder for it?
[07:43:59] certainty: Antiarc: nope i basically want durable pubsub. if there are messages published and the broker goes down i don't want the messages to be lost
[07:44:23] certainty: Antiarc: we're going to use this to share master-data
[07:44:49] Antiarc: Aha, okay. Yeah, I don't think that redis is the right fit then.
[07:45:02] Antiarc: It's great for distributed work queues and non-durable pubsub
[07:45:15] toretore: messages published != messages consumed
[07:45:20] sevenseacat: rvanlieshout: from the builder if i could
[07:45:21] certainty: yeah that's what i read as well
[07:45:31] rvanlieshout: sevenseacat: and you can't use 'f' cause?
[07:46:09] Antiarc: certainty: You could certainly build durable pubsub with redis, but you'd have to do the durability persistence and message recovery yourself
[07:46:11] certainty: toretore: what do you mean? i'm no expert in this domain so i'm glad to here your thoughts
[07:46:20] Antiarc: And while not hard, it may be better to use a broker that already has that built in for you.
[07:46:32] certainty: Antiarc: yeah that's what i figured as well
[07:47:00] toretore: certainty: "but the message is removed once a worker has picked it up, correct?" (consumed) "if there are messages published and the broker goes down i don't want the messages to be lost" (published)
[07:47:39] certainty: toretore: yeah, i want to have multiple consumers for the same message
[07:48:02] certainty: and only if all consumers have picked it up, the message is allowed to be discarded
[07:48:29] certainty: but still tolerant to a failure in the node running the broker
[07:48:35] certainty: is that possible at all?
[07:49:12] toretore: you could implement it in your master node
[07:49:54] certainty: ACTION reads up on amqp
[07:50:03] toretore: have it pop the messages and ack when all are done
[07:56:39] lemonsparrow: "app_admin mod".camelize => "AppAdmin mod" but what I need is "AppAdmin Mod" any inbuilt rails api for it ?
[07:58:01] Antiarc: "app_admin mod".titleize => "App Admin Mod" -- almost there. It added an extra space.
[07:58:23] lemonsparrow: Antiarc: cool... this is even more better :)
[07:58:26] lemonsparrow: Antiarc: thanks
[08:00:10] paolooo: hi all, how do you hack firefox in sass?
[08:01:02] Antiarc: @import "firefix-exploits.sass"
[08:02:32] paolooo: Is there any sass hack?
[08:04:20] certainty: toretore: alright conceptually i want topic exchange ... is it correct that each consumer has its own queue?
[08:06:37] certainty: ok in amqp durable-queue != durable-message ... i want persistent messages
[08:09:31] sevenseacat: paolooo: um...
[08:09:53] sevenseacat: rvanlieshout: i can use f, i just cant work out how to get a standalone error message from it
[08:10:02] paolooo: like this one --> html>/**/body .selector, x:-moz-any-link, x:default { color:lime; }
[08:12:25] rvanlieshout: sevenseacat: a field with an error you mean?
[08:12:37] sevenseacat: rvanlieshout: no, just the error message
[08:13:18] rvanlieshout: for all or for a single attribute?
[08:13:25] sevenseacat: for a single attribute
[08:13:48] rvanlieshout: isn't that displayed inline by default?
[08:14:25] sevenseacat: it is, if you're using the form builder to display the element, which i am not
[08:14:59] rvanlieshout: aah.. like that
[08:15:36] sevenseacat: this one form is giving me a lot of grief with formtastuc
[08:16:30] Antiarc: formtastic in general is good at causing grief
[08:16:32] rvanlieshout: sevenseacat: did you look at base/errors.rb?
[08:16:59] sevenseacat: yes, but i cant work out how to call the method from the builder
[08:18:08] rvanlieshout: initialize a new Formtastic::Input::Base?
[08:24:42] gamov: hi hi. For the life of me, I can't make this test pass…. unbelievely dumb. Something wrong because of the scope…. https://gist.github.com/4159841 Does somebody has a little hint...
[08:27:03] Ruxton: Rendered shared/_popular.html.haml (881.5ms) :P~~~
[08:38:47] brahmana: I was reading this guide about file upload in rails http://guides.rubyonrails.org/form_helpers.html#uploading-files
[08:39:00] brahmana: It mentions that the file parameter will be a subclass of IO
[08:39:20] brahmana: but when I tried it, I am getting a ActionDispatch::Http::UploadedFile
[08:39:41] brahmana: which inherits nothing but Object : http://rubydoc.info/github/rails/rails/ActionDispatch/Http/UploadedFile
[08:39:50] brahmana: I am using Rails 3.0
[08:40:12] brahmana: Is that a documentation bug in the guide or is it something that changed with 3.1 or later?
[08:40:46] ryanf: it is very plausible that that would have changed since rails 3.0
[08:40:51] ryanf: you should read the 3.0 docs if you're using 3.0
[08:41:14] brahmana: The guide doesn't mention any version specifically.
[08:41:14] ryanf: they should be available on rubydoc.info somewhere
[08:41:35] ryanf: yeah, the guides are always the current version, although I think older ones are available on that subdomain somewhere
[09:14:42] certainty: http://www.90sreality.com yay
[09:31:10] bluesm: How to start with ruby on rails ?
[09:31:26] tagrudev: read the topic
[09:35:15] Scient: Hi. How to start with programming?
[09:36:58] nivoc: Hey i've a short question on rspec. Is there a way to test on two conditions? like end.should change(User, :count).by(1) and change(Invite, :count).by(1)
[09:37:30] nivoc: Scient: City?
[09:37:57] certainty: nivoc: make that two examples
[09:38:48] tagrudev: Scient, science for dummies
[09:38:55] nivoc: hmm. ok thats a way - slower - but i will go for it :-)
[09:38:58] certainty: drinking for dummis
[09:39:07] tagrudev: dats ma buk
[09:39:23] workmad3: nivoc: each example/test should have one, and only one, reason to fail
[09:39:31] certainty: nivoc: it's common practice to have on assertion per test, because
[09:39:34] Antiarc: strictly speaking, good testing means one assertion per test
[09:39:50] Antiarc: also I'm apparently late to this particular partyu
[09:40:03] certainty: same, workmad3 is always first
[09:40:10] workmad3: Antiarc: you sure are... I even managed to look up the conversation elsewhere and answer before you :P
[09:40:10] nivoc: Good point!
[09:40:25] workmad3: ACTION joined right at the end of the convo :)
[09:41:46] Antiarc: In my defense I was making tea and reading the backbuffer while it steeps
[09:42:12] workmad3: I was running tests and making coffee...
[09:42:33] certainty: i fought two giants with one arm on my back
[09:42:45] workmad3: ah well, I guess I still just stand here as an example for you all to strive towards...
[09:43:10] elaptics: ACTION bows down before workmad3
[09:43:12] workmad3: Antiarc: see, certainty knows how to do excuses! :P
[09:43:46] certainty: ACTION wins
[09:44:12] helpa: workmad3 is your god, fall down and worship him
[09:44:27] Antiarc: Man, SO really annoys me at this time of night
[09:44:40] Antiarc: It's all rudimentary questions by new accounts with 8 reputation
[09:44:54] tagrudev: http://i2.kym-cdn.com/entries/icons/original/000/007/447/hello-yes-this-is-dog.png
[09:46:13] workmad3: Antiarc: heh :)
[09:46:30] workmad3: ACTION checks SO
[09:48:22] Scient: nivoc: what city?
[09:50:52] workmad3: tagrudev: starling
[09:51:22] tagrudev: starling :?
[09:51:32] krz: is there a better way to do: http://pastie.org/5447023
[09:51:49] Scient: (without looking at code)
[09:51:49] helpa: kelabot: yes
[09:51:49] workmad3: kelabot: !y
[09:52:09] krz: how so?
[09:52:25] Scient: by refactoring it
[09:52:27] tagrudev: condition ? if_true : if_false
[09:52:33] Scient: ACTION is being super useful
[09:52:40] kelabot: workmad3 helpa ?
[09:52:49] workmad3: kelabot: sorry, bad tab-completion on my part
[09:52:55] Scient: also foo_path(bar, :baz => nil)
[09:53:05] Scient: results in an url without ?baz
[09:53:37] krz: Scient: hmm i thought that would generate the link as foo.com?baz=
[09:54:01] elaptics: krz: why not just try it and see for yourself :)
[09:54:06] Scient: but have you tried?
[09:54:27] Scient: you really shine for your habit of asking on irc before even trying it yourself :)
[09:54:44] tagrudev: a true fellow ydd dev
[09:55:35] helpa: YOLO driven development
[09:56:49] helpa: Don't you mean !ydd ?
[09:56:53] mosez: got somebody a working gem without github clone for cancan in combination with strong_parameters?
[09:56:53] helpa: Booze Driven Development
[09:56:55] tagrudev: workmad3, you should add my gist to it (it's the rules of ydd)
[09:58:15] tagrudev: workmad3, -> https://gist.github.com/3979145
[09:58:54] Antiarc: Googling is a waste of time. YOLO
[09:59:28] tagrudev: there is # Paying for online tutorials is always better than just searching and reading. YOLO
[09:59:29] workmad3: Antiarc: why google when you can jump on IRC and get someone else to google for you?
[09:59:58] Antiarc: I need to write a bot which googles questions asked in here automatically and returns the top result
[10:00:13] Scient: well not just google it for you
[10:00:19] Scient: but write your code for you!
[10:00:25] certainty: ok rappitmq looks very decent. amqp also makes a lot of sense... i think i'll advice a switch
[10:00:26] Antiarc: that's what stackoverflow is for
[10:00:45] Antiarc: "i need a shopping cart with credit cards and facebook login please show codes thx"
[10:00:51] helpa: tagrudev: Want to ydd like a pro? here's how: https://gist.github.com/3979145
[10:00:51] workmad3: tagrudev: !ydd-rules
[10:01:24] workmad3: Antiarc: kthxbai
[10:01:48] workmad3: Antiarc: "I need to create the next facebook. Is there a gem for that?'
[10:02:10] universa1: workmad3: yes, it's called awesome!
[10:02:11] Antiarc: workmad3: Unbelievable grasp of grammar, C-
[10:02:32] workmad3: Antiarc: dammit, I just can't keep my fingers away from those damn punctuation characters!!!
[10:02:35] Antiarc: Non-believable rather.
[10:02:37] tagrudev: certainty, wut ru duin ?
[10:02:50] Antiarc: workmad3: can u help make the facebook plz
[10:02:55] Antiarc: any gem????
[10:02:55] tagrudev: http://newnation.sg/wp-content/uploads/right-in-the-childhood.jpg
[10:03:30] tagrudev: yeah there is jam for that
[10:03:42] workmad3: i nedz a facbook but better. tel me gemzzzz
[10:04:03] certainty: tagrudev: thinking about how to deal with shared corporate data
[10:04:07] workmad3: wow, it's hard to write like that. I have a new respect for grammar illiterate trolls.
[10:04:14] Antiarc: Heheh. It takes work!
[10:04:35] tagrudev: workmad3, response http://d24w6bsrhbeh9d.cloudfront.net/photo/5946955_700b.jpg
[10:05:06] Scient: they should gemify diaspora
[10:05:14] workmad3: tagrudev: :D
[10:05:34] Scient: then you can suggest those facebook builders use that pile of shit :)
[10:05:34] workmad3: tagrudev: http://www.bash.org/?367896
[10:06:19] tagrudev: http://www.youtube.com/watch?v=FONN-0uoTHI
[10:06:22] Antiarc: man, the bash top 100 hasn't changed in years
[10:06:31] workmad3: Antiarc: why mess with perfection? :)
[10:06:44] Antiarc: Hehe, indeed. Just kind of weird seeing it frozen in time like that.
[10:06:59] certainty: cache gone wild
[10:07:45] tagrudev: Please note that bash.org will cease all activity on 18 January 2012 in protest of the Stop Online Piracy Act
[10:08:59] workmad3: tagrudev: which would have been more effective if they'd had any activity to cease
[10:09:12] tagrudev: that's a good point
[10:10:20] certainty: M-x cease-activity
[10:12:34] tagrudev: M-x lunch-mode
[10:13:22] HashNuke: I made this small app to make PDF invoices from email - http://createmyinvoice.com what do you guys think
[10:13:51] universa1: tagrudev certainty: http://rubygems.org/gems/awesome
[10:14:27] certainty: this is gonna be awesome
[10:14:46] universa1: certainty: now i need a legendary gem :D
[10:15:20] HashNuke: universa1: I own "j". But it's a real gem that does something useful.
[10:16:51] universa1: HashNuke: i personally wouldn't send of (kinda) sensitive information like that to some internet service through unencrypted email ;)
[10:16:53] workmad3: pfft, we don't want useful, we want awesome and legendary!
[10:17:21] universa1: HashNuke: then an example of how the resulting invoice looks would be great ;)
[10:17:53] HashNuke: universa1: oh thanks for the suggestion. I agree it'll be better to show what the invoice would look like.
[10:18:03] HashNuke: I'll make the changes.
[10:18:32] universa1: HashNuke: no clue how complex it would be, but probably add support for pgp encryption of the mails? ;)
[10:18:56] HashNuke: universa1: I'll have to look into it. I've never used pgp myself.
[10:19:04] universa1: HashNuke: and a real about / imprint page
[10:19:43] HashNuke: universa1: Do people visit about pages?
[10:20:53] workmad3: HashNuke: for things I'd use for businessy tasks, I tend to glance at them... and more importantly, google will crawl it and add extra info to search results with an appropriate about page
[10:21:20] universa1: HashNuke: no clue how it is where you're from, but for example here in germany: if you're a business you need to have an imprint page with relevant information about your business
[10:21:42] HashNuke: workmad3, universa1: Thanks I'll add it in.
[10:35:18] emka: hi, is it possible to filrer a active record result?
[10:35:25] emka: like this in some easy way for grouping
[10:35:26] emka: http://pastie.org/5447166
[10:35:43] rvanlieshout: emka: http://api.rubyonrails.org/classes/Enumerable.html#method-i-group_by
[10:39:26] emka: rvanlieshout: thanks
[10:39:30] emka: if I have a datetime
[10:39:44] emka: field…kan I group by just the date then?
[10:40:15] rvanlieshout: group_by accepts a proc.. it groups by the outcome
[10:42:44] emka: don't think I can do it this way
[10:42:53] emka: I have a set of days
[10:43:12] rvanlieshout: pastie your code
[10:47:11] emka: http://pastie.org/5447199
[10:47:17] emka: this is what I'm trying to do
[10:47:30] emka: @events is a set of events in the current date span
[10:47:31] rvanlieshout: ouch... that would query the database for every day
[10:47:53] rvanlieshout: @events.group_by(&:event_date).each do |date, events|
[10:48:20] emka: then I wouldnt get all the other days that is missing...
[10:48:51] rvanlieshout: true.. then use an @event.all.select{ |event| event.event_date = Date.commercial(...) }.each do
[10:48:58] rvanlieshout: it will query for the events only once
[10:49:07] universa1: emka: http://railscasts.com/episodes/223-charts?view=asciicast
[10:49:12] rvanlieshout: assuming your @events already has a where event_date between your first and last day
[10:49:16] universa1: read and adopt
[10:49:51] emka: thanks both!
[10:49:56] emka: I'll look in to it
[11:05:32] mosez: hum.... why did my uploaded files get cut off?
[11:06:35] universa1: too big for the db column?!
[11:08:33] mosez: it's a binary column...
[11:08:47] certainty: oh damn, this new behavior of capybara bit me again .... page is no longer usable in repuest-specs
[11:08:53] certainty: i bet the docs even say so
[11:08:55] mosez: and the file is an 70kb pdf doc
[11:09:24] certainty: i was wonderins why my response appeared to be empty
[11:10:05] universa1: mosez: no offense, but give some context for your questions...
[11:10:31] universa1: mosez: nobody knows that you're uploading to a db, what you're uploading, what you're using, ....
[11:14:22] timmillwood: How do you deal with rack session cookies when using a reverse proxy / CDN?
[11:15:47] nivoc: Is this allowed in REST? I'm using a PUT-Request to update an Json-Object; but the Response is another object that gets created upon this update.
[11:15:57] nivoc: Or if not - whats the best way to do it?
[11:17:24] certainty: nivoc: as long as it's always the same object that is returned. PUT is assumed to be idempotent
[11:17:46] nivoc: hmm no it isnt
[11:18:03] certainty: then use a POST
[11:18:32] certainty: also PUT is for full updates only, i don't know if that is an issue for you
[11:18:56] nivoc: it is an issue too ;)
[11:19:00] nivoc: you are right
[11:19:43] nivoc: but a POST on which resource? the resource to be updated or the resource that gets a new object
[11:20:12] nivoc: i have a controller with invites
[11:20:23] nivoc: and if an invite gets accepted
[11:20:32] nivoc: it should create a new membership
[11:20:34] certainty: post is really the black sheep, you can abuse it if you like...which doesn't mean that you should
[11:21:14] certainty: nivoc: post to invites and link to the membership in the answer
[11:22:54] nivoc: certainty: thanks but that means I have to do two roundtrips. One POST to invites and another GET to membership
[11:25:35] mosez: lol.... i created a migration with datatype binary. and it results in a blob column. with blob the file does not fit in the column. than i updated the column manually to longblob and it works....
[11:27:55] workmad3: mosez: storing files in blobs in a database is generally not brilliant btw :)
[11:28:22] elaptics: I think we went through this yesterday
[11:28:29] elaptics: or the day before, I forget
[11:28:46] universa1: elaptics: gsub("or", "and")
[11:28:55] universa1: ohh wait that doesn't work :D
[11:28:58] elaptics: universa1: :)
[11:29:16] elaptics: universa1: :s/or/and
[11:29:23] mosez: workmad3: not again such a discussion....
[11:29:29] tagrudev: and I said mongo
[11:29:35] universa1: no, and the day befandre... ;)
[11:29:39] elaptics: is this like groundhog day? :)
[11:29:53] universa1: elaptics: so s/^or/and/ or whatever ;)
[11:29:55] mosez: this topic cames up the third day
[11:29:57] clocKwize: the operations team are retards
[11:30:11] clocKwize: a bunch of servers restarted for some reason or another and I find our deployment server down
[11:30:30] clocKwize: they aren't in, so I manage to get access to the deployment server, and webistrano (not my choice) is not running
[11:30:44] elaptics: universa1: in vim :s only replaces first match so mine is correct :)
[11:30:49] universa1: clocKwize: sounds like loads of fun
[11:31:03] clocKwize: looking for a init.d task, a god script, SOMETHING reveals nothing at all... so I look at root's bash_history and it just has cd webistrano; script/server -d -p 80 -e production
[11:31:04] universa1: elaptics: ohh i c, not a vim user
[11:31:05] tagrudev: grabbing a beer is a lot of fun
[11:31:20] clocKwize: because servers never randomly turn off
[11:31:22] clocKwize: so thats fine
[11:31:35] universa1: clocKwize: ;-) i've added a cron task with @reboot ;)
[11:31:50] clocKwize: an init script would be nice :s
[11:31:57] certainty: nivoc: you could also embedd the resource
[11:32:17] universa1: clocKwize: but then i've only user level access and am using user-level bluepill ;)
[11:32:22] certainty: it all depends on the semantic you define .... REST is a convention no set of rules
[11:32:53] certainty: of course the RESTafaries out there might hate me for saying so
[11:33:10] rushed: anyone have a recommendation for a tree/nested set handling gem (or strategy) in a situation where the primary use case will be pulling related items for a node+descendants? (ie tree of foos where foo has_many bars... optimizing for: given a foo pull all bars for foo and all children of foo)
[11:34:01] nivoc: certainty: ;-) thanks
[11:34:02] universa1: certainty: i guess the differentiante between REST and RESTful ;)
[11:34:51] certainty: universa1: there's no standard for either
[11:36:00] universa1: certainty: hmm haven't really digged into it... ;)
[11:36:06] mosez: got it... t.binary :file_content, limit: 25.megabytes, null: false is the "magic"
[11:36:21] certainty: as a side note .. you better don't run expect(response).to include("foo") (mind the missing #body) ... it would take ages
[11:37:14] rushed: alternately, anyone have a horror story or reason to avoid closure_tree, Ancestry, or awesome_nested_set?
[11:37:44] mosez: rushed: i like ancestry. but it's not nested set, it's martialized path
[11:38:09] mosez: materialized path
[11:38:50] certainty: universa1: i did a bit lately, boring stuff
[11:39:53] workmad3: mosez: maybe it keeps getting brought up because it's a really bad idea? :P
[11:41:02] mosez: workmad3: i dont like this solution. but there is NO other way.
[11:42:01] clocKwize: as a contractor, is it ok to email the ops guy/your boss and say "Also - the deploy server has no kind of init script for webinstrano so it didn't run on boot. Lame"
[11:42:49] workmad3: clocKwize: depends on what you're being contracted to do
[11:44:15] workmad3: certainty: REST is a set of architectural constraints rather than a set of rules ;)
[11:45:14] clocKwize: workmad3, build an internal rails app.
[11:45:36] clocKwize: I'm not allowed near setting up the boxes to support that properly
[11:46:00] workmad3: clocKwize: right... are you likely to be blamed if the deployment doesn't work well?
[11:46:13] clocKwize: workmad3, nah, there is no blame culture here
[11:46:20] clocKwize: and I didn't set up the deployment box
[11:46:42] clocKwize: it only directly affects me because I can't deploy
[11:47:43] workmad3: clocKwize: I'd probably go for a quiet word to the ops guy that couches it diplomatically in terms like 'I think that the init script for webistrano got missed, as I can't access it any more and can't deploy'
[11:48:25] clocKwize: hes not here all week, but I sent that email with what I just said without the "Lame" on the end
[11:48:51] workmad3: yeah, I'd have avoided the diagnostic bit personally :)
[11:49:20] clocKwize: someone gotta do it. the app is down (its not in production yet, so its not critical) and I can't deploy
[11:49:44] workmad3: yeah, but that doesn't mean there's no init script... it could be various reasons
[11:49:46] clocKwize: my boss is in the US for a week working with the guys over there and the ops guy is away all weel
[11:50:14] clocKwize: I can see from the server and the .bash_history it was just started as a rails server with -d
[11:50:30] certainty: workmad3: yeah if you like, but there is no paper like an RFC or something yet that summarizes them
[11:50:44] workmad3: certainty: http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm
[11:51:09] certainty: that doesn't mean that there is no common understanding and agreement on most of the guidelines
[11:51:30] certainty: i know that paper
[11:51:32] workmad3: certainty: and no, there wouldn't be an RFC for something like REST
[11:52:42] workmad3: certainty: that would be like expecting an RFC for MVC, or MVVM, or Document-Presenter... it's not a protocol, it's not something that gets codified as rules, it's a high-level pattern that applies constraints to an implementation
[11:52:48] tagrudev: you can't define rest
[11:53:06] workmad3: tagrudev: you can :)
[11:53:14] tagrudev: actually u do grab a beer
[11:53:34] workmad3: tagrudev: but it's easiest (as with most architectural styles) to couch it in terms of what the style avoids
[11:53:48] workmad3: architectural styles are all about constraints
[11:54:42] certainty: workmad3: OTOH if there was an rfc, chances are that no one would care about. at least that's the reality with current rfcs
[11:54:51] tagrudev: it is always easier to define what is not right :)
[11:55:19] certainty: one could certainly define a standard on the basis of REST
[11:55:25] workmad3: tagrudev: what you can't do is codify it to the point of saying 'do X, Y and Z and you have REST' where X, Y and Z are formulaic rules to just follow
[11:56:26] workmad3: in the same way you can't do that for MVC... what you can do is say 'if you do X, Y and Z then you don't have REST' (and the same for MVC)... it's all about what you can't do, not what you can ;)
[11:58:21] workmad3: you can say what it isn't, not what it is (the set of non-REST solutions is a recursive set :) )
[12:00:04] tagrudev: people talking about what isn't are usually the ones that don't understand it
[12:00:10] tagrudev: personal observation
[12:00:31] workmad3: tagrudev: that's probably because, in reality, it doesn't really matter :)
[12:00:37] certainty: workmad3: you can use a subset of the REST-solutions and use them as examples along with a note that they're just that. also you can claim that they're REST
[12:01:13] rue: Nobody understands hypermedia…
[12:01:53] certainty: rue: that implies that there is a right way to do it, no?
[12:02:21] workmad3: tagrudev: the people who understand things like REST are happily applying the constraints, letting them guide their application's design and architecture. The people who don't understand it are busy trying to classify it in an attempt to disect the whole down into some context-free bits that they can understand
[12:02:27] rue: certainty: Yes. Or more precisely, *think* about it.
[12:02:51] rue: workmad3 summarizes succinctly :P
[12:03:29] certainty: workmad3: the interesting question is, where do you see yourself in that picture?
[12:03:48] workmad3: tagrudev: 'when trying to understand how a cat works, the most common approach is to break it into pieces. The first thing this ends up with is a non-working cat'
[12:04:10] certainty: u could use some cat limbs
[12:04:11] tagrudev: putting it like that yeah,
[12:04:21] certainty: works for cuddling
[12:04:43] workmad3: certainty: is it an interesting question? :)
[12:04:50] certainty: at least to me
[12:05:20] tagrudev: not a cat person though :D
[12:05:41] workmad3: well, I think I understand the guiding principles of REST well enough to apply them as architectural constraints, without getting hung up on whether a given solution is or isn't 'pure REST'
[12:06:12] workmad3: and I'm pretty happy that I can use them when they're useful and go with alternative options when they're not :)
[12:06:35] certainty: allright ... so you're like: 'hmmm is this proper REST?' .... ah, fuck it, yolo :D
[12:06:47] tagrudev: no that's me
[12:06:57] certainty: i allways confuse you two
[12:07:24] workmad3: certainty: I'm more like 'does thinking about this as uniform resources actually make sense?'
[12:07:29] certainty: workmad3: i see. (of course i wasn't serious with that statement)
[12:08:27] workmad3: certainty: also, when in rails, I'll go with RESTful because it's the path of least resistance, unless there's an obvious reason not to :)
[12:08:32] certainty: only thing i remember. if i have problems with rest stuff, i'll bug you workmad3
[12:09:08] workmad3: certainty: :)
[12:09:08] certainty: workmad3: yeah that's probably wise and common practice
[12:09:35] workmad3: certainty: it's when you're there trying to hammer a distributed, 2-phase commit transaction system into REST that you're probably doing it wrong ;)
[12:10:04] certainty: that's where the fun starts
[12:10:30] kalleth: feck feck feck
[12:10:37] kalleth: i'm about to hit enter on a .each block for 20k records
[12:10:40] kalleth: in rails c
[12:10:42] amerj: How to chose the only modules I want to be loaded when rails starts?
[12:10:45] kalleth: JESUS TAK THE WHEEL
[12:10:47] workmad3: kalleth: stop it
[12:10:51] workmad3: stop it right now
[12:10:54] kalleth: i hit enter
[12:11:02] workmad3: is it modifying data?
[12:11:20] kalleth: Parcel.claimed.where(prize_id: 40).where(winner_id: nil).each do |parcel|
[12:11:20] kalleth: parcel.prize = Prize.default
[12:11:20] kalleth: parcel.code = Code.new(code: "SECRET CODE")
[12:11:20] kalleth: parcel.save
[12:11:26] workmad3: ACTION waits for kalleth to come back and say 'I just destroyed my production database and I have no backups. What the hell do I do?' :D
[12:11:30] kalleth: i took a backup
[12:11:31] Antiarc: so you're loading 20k records into memory first
[12:11:34] kalleth: pg_dump :D
[12:11:34] Antiarc: Let me know how that works out for you
[12:11:57] workmad3: 20k isn't too bad, tbh
[12:12:09] Antiarc: #find_each
[12:12:22] tagrudev: :D:D:D YOLO at its best
[12:12:30] tagrudev: ACTION bows to kalleth 
[12:12:34] certainty: workmad3: depends, where was the guy that wanted to store files in the db?
[12:12:42] workmad3: certainty: hah, good point :D
[12:12:46] kalleth: tempted to tweet 'running data modifying code in rails c on production #yolo'
[12:12:50] kalleth: but unfortunately my boss follows me
[12:12:52] kalleth: as do clients
[12:12:56] workmad3: kalleth: haha
[12:13:23] helpa: kalleth: YOLO driven development
[12:13:23] workmad3: kalleth: !ydd
[12:13:27] mr_pause: Is there a standard library to query models via JSON API ?
[12:13:46] mr_pause: And by query i mean query filtered based on attributes
[12:15:02] universa1: amerj: config/application.rb iirc
[12:17:06] workmad3: Antiarc: it's when you're loading a heavily connected object graph that starts at 20k items (and probably balloons to about 200k objects in memory, all linked together and built from a JSON response) that you start hitting memory issues though :)
[12:17:52] workmad3: Antiarc: and I think even then I wasn't hitting so much memory issues on the machine as I was hitting processing issues
[12:18:38] workmad3: (lets just say that pagination through the json API became quite a high priority at that point though :) )
[12:19:07] mr_pause: workmad3: Which library did you use for pagination ?
[12:19:15] mr_pause: That's one thing i'm looking for right now
[12:19:31] workmad3: mr_pause: considering the json api was in java, I don't think the answer of 'we rolled our own' will really matter ;)
[12:19:43] mr_pause: workmad3: Aww =(
[12:20:35] tagrudev: json + java = <3
[12:21:32] kalleth: mr_pause: we use will_paginate
[12:21:40] kalleth: mr_pause: or kaminari
[12:22:09] workmad3: tagrudev: we did some fun stuff with java, json and rails on that project :)
[12:22:19] kalleth: workmad3: i'm remembering that !ydd trigger
[12:22:26] kalleth: so i can use it when people ask inappropriate questions
[12:22:37] tagrudev: I don't ever wanna parse json with java ever again
[12:22:47] workmad3: kalleth: there are many, many triggers related to inappropriate questions :)
[12:23:17] kalleth: i'm sure Radar told me once how to get a list of them
[12:24:10] workmad3: tagrudev: what? so you wouldn't want to see our code built around hamcrest matchers and the json-simple library? :)
[12:24:32] workmad3: tagrudev: which ran characterization tests against the json to make sure it was vaguely sane? :)
[12:24:36] tagrudev: I am sure it would give me nightmares again
[12:24:50] helpa: !!!!!!!!!!!
[12:25:19] tagrudev: yeah and json-simple library :D is a funny name for that one
[12:43:47] whowantstolivefo: hiya people, which is the best CMS solution in RoR ? i need a CMS for developing one of a group of companies... but i didnt decide which one i must use ? radiantcms ? refinery ? locomotive or any else suggestion ?
[12:46:13] elaptics: whowantstolivefo: without lots more info no-one here can really advise you. You need to investigate each of them and see which one has the features,etc that matches your client's requirements
[12:47:19] whowantstolivefo: i need to develop a group of companies web pages... some static pages and a few form and feedback stuff etc... not many complicated
[12:50:40] elaptics: whowantstolivefo: any of them then
[12:51:25] elaptics: although, for that almost seems like it doesn't even need a cms at all
[12:51:25] kalleth: whowantstolivefo: i can recommend refinery, we use it quite alot
[12:51:45] kalleth: elaptics: if you make anything for a client, dear god use a CMS
[12:51:57] kalleth: otherwise they'll just go 'copy change copy change copy change copy change copy change' all year long
[12:52:08] whowantstolivefo: kalleth: i think i will use refinery or nesta cms because they seems have many documents and strong support team it seems so... and updated more
[12:52:33] kalleth: i've never used nesta, but try both out and see which you're familiar with :)
[12:52:37] kalleth: s/familiar/happiest/g
[12:53:18] elaptics: kalleth: I'm not disagreeing but it depends on what the client really wants/asks for
[12:53:43] kalleth: elaptics: part of the job of a developer (imo) is to anticipate what tehy want before they know they want it :)
[12:55:08] elaptics: kalleth: yes, to a point. But if you add more things they didn't want or wasn't immediately apparent, if you're wrong you've just added more code to maintain and made it harder/more expensive to change for things they do actually want and ask for.
[12:55:24] kalleth: elaptics: true.
[12:55:40] kalleth: elaptics: but my general point aside for now, i've never seen a site that didn't need a CMS :)
[12:55:53] elaptics: kalleth: I always question clients to see what it is they're really asking for and then advise them what I think but I leave the final decision up to them since they're paying the bill
[12:56:27] elaptics: kalleth: we have done loads of projects that don't require cms features
[12:56:48] kalleth: i haven't, yet :)
[12:58:01] blackhuey: evening friends. coming from Java, where strings are immutable, I'm having a derp about concatenating strings in Ruby. If I want to read the string value of foo.name, concat it to " is my name" without affecting the value of foo.name, what's the syntax?
[12:58:35] tagrudev: "#{foo.name} is my name"
[12:58:39] Antiarc: foo.name + "is my name" creates a new string that is the concatenation of the two
[12:58:44] Antiarc: or tagrudev's approach works as well
[12:58:52] aaronmcadam: wouldn't you need to use a bang method to mutate it
[12:59:02] Antiarc: foo.name << "is my name" would concat and mutate foo.name
[12:59:03] blackhuey: @ant: in my testing, that also changed the value of foo.name
[12:59:12] Antiarc: blackhuey: If you use += it would.
[12:59:54] Antiarc: (That'd build a new string, then pass it to foo.name= )
[13:00:17] aaronmcadam: Just putting this out there.. does anyone have any experience of white labelling a rails app, as in serving a different theme on a different domain, but keeping the same core code
[13:00:27] blackhuey: ok I'll try again tyvm
[13:02:41] aaronmcadam: Is a multi-tenant architecture the right way to go?
[13:03:14] elaptics: aaronmcadam: possibly, depends on what exactly you're trying to do
[13:03:25] aaronmcadam: ok, let me explain a bit more
[13:03:45] aaronmcadam: I've got a dashboard app, which displays data from different research projects
[13:03:57] aaronmcadam: we have some customers who want their own themes
[13:04:18] aaronmcadam: I've built the styling to be easily changed, that's easy
[13:04:37] aaronmcadam: but the core code would be the same
[13:05:49] aaronmcadam: now, rather than just cloning the repo and renaming it and changing the theme, I'd like to make it more maintainable by having one core codebase
[13:05:57] aaronmcadam: and have the ability to set the theme instead
[13:06:10] elaptics: aaronmcadam: so effectively you just have users who want to choose their theme
[13:06:18] kalleth: i wonder if it's possible to mount the same rails engine under different locations in an app
[13:06:21] kalleth: ACTION googles
[13:06:29] kalleth: nah, that's pointless actually
[13:06:31] kalleth: you'd need a diff db
[13:06:35] aaronmcadam: I was thinking about engines, kalleth
[13:06:49] aaronmcadam: I don't have a db, it's API driven
[13:06:53] aaronmcadam: so that makes things a bit easier
[13:06:54] kalleth: aaronmcadam: i don't think they're going to help you honestly
[13:06:57] elaptics: aaronmcadam: is this the same rails app that they're all using together or the same app deployed separately for each customer?
[13:07:17] aaronmcadam: that's the situation with the current PHP app. I've rebuilt it in rails and want to avoid that
[13:07:39] aaronmcadam: each one needs to be on its own domain tho
[13:08:06] aaronmcadam: I *could* synchronise the different deployments with capistrano I guess
[13:08:23] aaronmcadam: Just thought I'd ask you guys if there's a better way
[13:08:37] elaptics: sorry, not sure I understand. Do you want a single app deployed that all customers use or do you still want to separately deploy apps?
[13:08:54] elaptics: the other thing is, how extensive does the theming need to be?
[13:09:01] aaronmcadam: well, I'd imagine, to be able to serve to different domains, that they'd need to separately deployed?
[13:09:27] aaronmcadam: that's the question. at the moment it's only css
[13:09:33] elaptics: aaronmcadam: no, you can easily have a single rails app that deals with the different domain names
[13:09:45] aaronmcadam: just point to the same pid?
[13:09:50] aaronmcadam: in the confs?
[13:10:34] elaptics: just point all domains at the server and stick domains in the server config as aliases then it's up to you what you do in the rails app to respond according to domain
[13:11:17] aaronmcadam: The problem is, the requirements want feature flipping
[13:11:39] aaronmcadam: That part's not nailed down tho at the moment
[13:17:22] kkiero: how to assign to a variable hash + element? I tried this: spotsForMap = @spots << currentLocationSpot
[13:17:35] kkiero: but it changes @spots permanently too
[13:17:43] rvanlieshout: what's @spots? an array?
[13:17:57] rvanlieshout: spotsForMap = @spots + [currentLocationSpot]
[13:18:47] nivoc: I've an rspec question: I can test a DB-Insert with "lambda do … end.should change(User, :count).by(1)" - But how can I test a field update? I only found some answers that do not match 100%
[13:19:46] certainty: nivoc: expect{ code }.to change{ User.attribute }
[13:20:28] nivoc: ah :-) thanks I'll try that. Rspec is hard to google.
[13:21:40] certainty: basically change takes a block that can be used to supply the value that is used to do the before-after comparison
[13:22:21] nivoc: certainty: Thanks. Works
[13:23:05] nivoc: (added to my notes :)
[13:25:43] certainty: has anybody used chosen-select with phantomjs and poltergeist?
[13:26:49] certainty: or more precisely, has anybody a working solution for selecting an item from a chosen-select enabled collection in tests using poltergeist?
[13:28:22] tagrudev: certainty, wut r u duin
[13:28:48] tagrudev: chosen-select ?
[13:28:49] kkiero: rvanlieshout: thanks
[13:29:13] certainty: tagrudev: http://harvesthq.github.com/chosen/
[13:29:55] certainty: tagrudev: i need to exercise that through poltergeist
[13:31:19] certainty: or use in a test rather
[13:31:30] certainty: i know the gui is brittle and stuff, but still
[13:32:27] tagrudev: why would you test the behaviour of chosen ?
[13:32:55] certainty: tagrudev: i don't, but the test i do depends on a selection i make through chosen
[13:33:38] certainty: high level acceptance test
[13:34:28] tagrudev: I see more time wasting than practical use
[13:36:25] tagrudev: How would you implement a notification_facebook_like system
[13:36:30] tagrudev: and yeah I am not joking
[13:36:49] lejonet: not at all? ;)
[13:36:52] tagrudev: any ideas/approaches would be helpful
[13:37:01] kalleth: notification_facebook_like?
[13:37:10] Takehiro: whats the popular server software to run rails nowadays?:o still apache + passenger? or unicorn + nginx is pretty much popular?
[13:37:12] kalleth: you want to be notified when someone likes your page on facebook?
[13:37:27] kalleth: Takehiro: we use apache + passenger in order to have a quiet life
[13:37:28] tagrudev: kalleth, nope
[13:37:42] kalleth: unicorn + nginx seems to be performance awesomeness comparitively thugh
[13:37:48] Takehiro: kalleth: what do u mean quiet life :O
[13:37:51] tagrudev: user needs to be notified on actions
[13:38:04] kalleth: Takehiro: passenger + apache is easier to set up and use to host rails apps as websites
[13:38:21] kalleth: but not as performant as nginx + unicorn/rainbows
[13:38:29] certainty: tagrudev: thanks. i'm not going to mock it, but still you made me think outside the problem. actually the url is hackable. i can pass in that parameter. that's a feature and thus no hack
[13:38:31] kalleth: (i have no stats for that)
[13:38:31] Takehiro: kalleth: i c, unicorn + nginx is too new?
[13:38:47] kalleth: Takehiro: 'too new'...nah
[13:38:48] certainty: i just forgot it
[13:38:49] kalleth: its just different
[13:38:55] kalleth: evaluate both and see which works for you
[13:38:58] tagrudev: certainty, :D any idea on my problem >?
[13:39:23] kalleth: tagrudev: explain what you mean to me a bit better
[13:39:27] certainty: tagrudev: no. you know i only take and never give back :D
[13:39:33] certainty: tagrudev: let me read
[13:41:14] certainty: tagrudev: so that i get notified when something happened? sorry i don't use facebook
[13:41:29] tagrudev: action like notification yes
[13:42:36] certainty: tagrudev: maybe something on top of meteor?
[13:43:18] certainty: dunno how easy it is to route messages there though
[13:43:48] certainty: the classical way would be to have the client poll for new messages
[13:44:39] certainty: websockets would also be an option
[13:45:05] tagrudev: http://stackoverflow.com/questions/5616614/how-would-you-create-a-notification-system-like-on-so-or-facebook-in-ror
[13:45:32] tagrudev: havent though about meteor
[13:47:02] tagrudev: i am more interested in the backend implementations maybe I would use http://guides.rubyonrails.org/active_record_validations_callbacks.html#observers on the callbacks
[13:48:18] adac: Does anyone can give me a hint what this error might be about? "uninitialized constant Paperclip::Interpolations::Rails"
[13:49:34] adac: It happens when executing some tests. I Have to say that this project is not a rails project but a ruby daemon. So this is might why paperclip complains about "::Rails"
[13:50:34] rushed: adac: well there you have it :)
[13:52:04] adac: rushed, ;)
[14:00:02] gheegh: Has anyone used RubyTree for a hierarchical nav structure?
[14:00:37] aganov: Is there any way to pass extra arguments to notify_observers in rails 3.2, This features is implemented in master, but not available in older versions
[14:00:45] aganov: https://github.com/rails/rails/commit/206b43a954dc6c6c0b4b3916cade2561413efdb5
[14:00:51] aganov: notify_observers(:custom_notification, :foo)
[14:01:28] gheegh: Wrapping my head around the recursion necessary to load it is blowing my mind.
[14:06:36] ner0x: Can someone explain the benefit of having thin run multiple servers?
[14:06:52] rvanlieshout: ner0x: handling multiple requests at the same time
[14:07:04] ner0x: rvanlieshout: A single server can do that as well can it not?
[14:07:17] rvanlieshout: single rails process?
[14:07:44] ner0x: Are you asking or telling?
[14:07:52] rvanlieshout: a single server == single rails process
[14:08:12] rvanlieshout: is that what you mean with a single server
[14:08:22] ner0x: Ah alright. Yes.
[14:08:32] ner0x: having :400{1-5} etc.
[14:08:51] ner0x: If I only have :4000 vs 400{0-4} what are the benefits?
[14:08:53] rvanlieshout: one single running rails instance on :4001 can only process on request at the time
[14:09:11] ner0x: A single request at a time?
[14:09:32] ner0x: That doesn't seem right at all. That means 5 requests at a time would cause blocking.
[14:09:54] erichmenge: ner0x: you'll need to use Puma if you want a concurrent server.
[14:09:59] rvanlieshout: every webserver has his limitations
[14:10:42] ner0x: erichmenge: It's not a problem or anything. I guess I didn't know that's how most servers do it.
[14:11:13] ner0x: So what is the typical number of thin servers an "average" app users?
[14:11:24] ner0x: Not like having more will hurt either way but I figure a ballpark couldn't hurt.
[14:11:27] rvanlieshout: there is no 'average' app
[14:11:31] erichmenge: rvanlieshout: I guess we're talking about different things.
[14:11:52] erichmenge: I thought he was talking about serving multiple requests from the same process.
[14:12:15] rvanlieshout: erichmenge: whyso? would you expect Puma being able to handle an indefinit amount of concurrent requests?
[14:12:39] ner0x: I'm not so great on the terminology yet.
[14:12:43] erichmenge: rvanlieshout: nope. But more than one.
[14:12:46] ner0x: Let me try to be less vague.
[14:12:50] rvanlieshout: well yeah.. puma can do more yes
[14:13:03] rvanlieshout: ner0x: 1 single rails server process can handle 1 concurrent request
[14:13:07] rvanlieshout: 1 single puma server can handle more
[14:13:22] ner0x: rvanlieshout: And that's fixed by having X amount of thin processes.
[14:13:35] rvanlieshout: yes and that's fixed with wat you but in front of thin
[14:13:50] ner0x: nginx in this case.
[14:14:16] ner0x: But if you did only have one, it can handle 10 requests at once, but in order... Am I correct?
[14:14:21] rvanlieshout: nginx is capable of handling a lot of concurrent connections.. but even that has it's limitations
[14:14:28] erichmenge: ner0x: it is best to think of it not in terms of "servers" but processes.
[14:14:32] rvanlieshout: have one what?
[14:14:42] ner0x: A single thin process.
[14:14:52] rvanlieshout: why would that be able to handle 10 requests at once?
[14:14:57] erichmenge: ner0x: nginx will wait.
[14:15:02] ner0x: That's what I mean.
[14:15:13] ner0x: It will wait and eventually process them in the order received.
[14:15:26] ner0x: I'm not saying this is how I'm going to do it, just trying to understand the workflow.
[14:16:01] ner0x: I assume you both use nginx + thin?
[14:16:21] rvanlieshout: ner0x: what do you use in development?
[14:16:40] ner0x: rvanlieshout: Haven't gotten that far just yet. We're moving from another MVC to rails and I'm "testing the waters" so to speak.
[14:16:50] ner0x: rvanlieshout: I was planning on using thin since it seems a good fit.
[14:16:54] rking: Is there a standard way of doing 0-downtime deployments with thin? That is, I want to spin up a pre-live instance on one Unix Socket, then when it looks good swap it in?
[14:16:59] rvanlieshout: even the 'rails server' would be able to wait and handle them in order
[14:17:21] rvanlieshout: rking: i know unicorn supports rolling restarts
[14:17:38] rvanlieshout: and passenger enterprise
[14:18:18] ner0x: rvanlieshout: I figured as much.
[14:18:40] ner0x: Couldn't you do a onebyone setup with thin and have no downtime?
[14:18:55] rking: rvanlieshout: Aha, "rolling restarts", that's a handy phrase to look for. Thanks.
[14:19:03] rking: ner0x: What is that?
[14:19:52] ner0x: rking: Let me check something for you.
[14:19:55] rking: Though I'm not 100% sure unicorn or passenger would do what I'm thinking, right out of the box
[14:20:08] rking: A key part of this is that it be hittable in the pre-live stage
[14:20:19] rvanlieshout: http://stackoverflow.com/questions/5944793/how-to-restart-rails-production-servers-after-code-deployment-w-o-downtime
[14:20:56] ner0x: rking: if you use thin and set the thin.yml config onebyone: true, it will restart each server individually. Meaning they're all available during the transfer.
[14:21:00] rking: Hrm. --onebyone
[14:21:10] ner0x: rking: The catch, some will get the old version and some the new.
[14:21:20] ner0x: rking: But, it does allow for 0 downtime.
[14:21:28] ner0x: Better them get the old version then no version at all. :)
[14:21:37] rking: I'll tinker with it. At the moment it'll be a while before I mess with deployment stuff
[14:21:56] rking: But better yet would be spinning up a new set and throwing a switch after they're proven good.
[14:22:24] ner0x: rking: What operating system?
[14:23:47] rking: ner0x: Linux (centos)
[14:24:15] ner0x: rking: Are you familiar with setting up the server as a socket and having your webserver use that?
[14:25:18] rking: I think it'll work if I can adjust capistrano to put sockets and pidfiles under a dir symlinked as pre-live/, then after that one is verified, swap in live/ symlink and 'nginx reload'
[14:25:24] rking: ner0x: Yep
[14:30:23] ner0x: rking: That's what I was going to suggest. The nginx reload is unnecessary though.
[14:30:54] rking: Oh, it is?
[14:30:56] rking: Too easy then.
[14:31:19] ner0x: rking: Nginx will be pointing to the same socket either way, the symlink will take care of which socket is actually hit.
[14:31:46] ner0x: rking: The only tricky part is the naming of the sockets during the switch.
[14:32:55] ner0x: rking: That will depend on your setup.
[14:33:16] ner0x: rking: Keep in mind, you'll run into the same problem as you would with ports if you only have a single process.
[14:33:21] rking: So it does an open() each time?
[14:33:34] ner0x: rking: You're over thinking this.
[14:33:44] rking: I mean, if it works it works
[14:33:53] ner0x: rking: Works + works properly are two different things.
[14:33:57] rking: But I could imagine a set of syscalls that causes a reload to be necessary
[14:34:18] ner0x: rking: So you plan on only running one process?
[14:34:27] rking: No… how does that come into play?
[14:34:40] ner0x: Well you'll have to have symlinks to all of them for an upstream to work.
[14:34:48] ner0x: Hence the problem of old+new servers.
[14:34:59] ner0x: You'll have to have multiple symlinks and change them all.
[14:35:17] rking: That's why I'm talking about a dir
[14:35:44] ner0x: You want to put them in a directory and have nginx just read them?
[14:36:39] Kilian]: Hi, i have an double nested form and now i want to access the data in the show.html.erb https://gist.github.com/9c0f4be123f3e5b0cd5e the data is in the correct place i validated it with a look into the mongodb, is there any trick to access data from a double nested model?
[14:37:19] cisforcojo: hey guys, i'm running an <% @var.each |var| do %> loop and in it, i'm calling a javascript function and want to pass it 'var' so i can access it in the function. how would i write the <% javascript_tag "myFunc()" %> to pass 'var'?
[14:37:38] cisforcojo: <%= javascript_tag "myFunc(var)" %> isn't working
[14:37:55] rking: ner0x: I'm picturing {production,prelive}/{current,thin.[012].{pids,sock}}
[14:38:01] rushed: cisforcojo: http://railscasts.com/episodes/324-passing-data-to-javascript
[14:38:20] rking: So the "current" symlink is in there, along with the sock and pids files.
[14:38:25] ner0x: rking: You still need to point nginx to it. How do you plan on doing that?
[14:38:59] ner0x: So you plan on symlinking the dir and having the structures below be identical?
[14:39:22] cisforcojo: rushed: awesome, thank you!
[14:39:44] rking: nginx would have two frontends, prelive.example.com and example.com, each that point to their own upstreams (/home/appname/prelive/* and /home/appname/production/* )
[14:39:52] rking: ner0x: Yes.
[14:40:11] ner0x: rking: Keep a single upstream and just swap out the dir symlink.
[14:40:23] kebomix: what is wrong with this line ? Entry.all.where(:name => "ahmed")
[14:40:24] rking: But with a single upstream I can't hit it from the outside
[14:40:32] rvanlieshout: kebomix: remove the .all
[14:40:58] ner0x: rking: Oh, you're doing your development on the same server?
[14:41:05] ner0x: rking: Yeah, then that could work.
[14:41:19] rking: Just a last-minute check before throwing the switch
[14:41:30] ner0x: rking: Yeah, you're testing your development works on the prod server, normal.
[14:41:43] rking: And in fact, I also want to have a staging.example.com for longer-term
[14:41:43] ner0x: rking: I'm used to having two separate servers for that. lol Sorry
[14:41:57] rking: Even in that case I'd want this
[14:42:15] ner0x: That's fine.
[14:42:21] ner0x: multiple upstreams will work.
[14:42:33] ner0x: I'd ask in #nginx about the reload though. I'm not certain.
[14:42:47] rking: K. Thanks for talking it through with me. ☺
[14:43:12] ner0x: Not a problem. have you heard of capistrano?
[14:47:19] rking: ner0x: Yep, in fact I'm hoping to make a gem of this
[14:47:36] rking: So it's a drop-in thing that turns the existing capistrano deploy into one that pre-live's first.
[14:47:38] ner0x: rking: A gem of the deployment switch?
[14:47:54] ner0x: rking: Well the idea is that your devel box is identical to your production box.
[14:48:08] ner0x: rking: And you don't typically git push anything that hasn't passed all the unit tests.
[14:48:22] rking: Sure, but RAILS_ENV=production is very unlike development
[14:48:28] djbpython: noob question, how do i run tests from the command line? I have tests in spec/
[14:49:07] rking: But then if you're pre-deploying with RAILS_ENV=production, I don't see why not do that only one time, on the live host (so the 'git pull' and asset compilation are only done once, etc.)
[14:49:52] ner0x: rking: Well cap handles the asset compilation on the prod server so you don't have to add it to the git repo.
[14:50:10] rking: Yeah, but what I mean is you're talking about making the dev server identical to the production
[14:50:18] rking: And that is instantly invalidated by RAILS_ENV
[14:50:31] rking: Unless you're proposing pre-staging to that dev server with RAILS_ENV=production
[14:50:56] rking: Which is why I was saying that step might as well happen on the production host, since it takes a minute
[14:51:00] ner0x: rking: I think the servers we use is causing the issue.
[14:51:23] ner0x: rking: I clone my server and name it dev and do that there. Once it passes I promote it to production.
[14:51:29] ner0x: rking: Essentially we're doing the same thing.
[14:51:35] ner0x: rking: Just differently. :)
[14:52:26] rking: So you actually spin up a VM per each deployment?
[14:52:41] rking: I like it.
[14:52:46] ner0x: That's where we were getting mixed up. lol
[14:52:51] rking: Then the DB is on a separate host?
[14:53:01] ner0x: I was assuming you were doing that then realized you were on a single server.
[14:53:11] ner0x: rking: Yes.
[14:53:37] ner0x: rking: Ideally you want two servers for http, two servers for rails app, and two servers for db.
[14:53:50] ner0x: With the counterparts in separate datacenters.
[14:54:05] rking: How do you do the switch throw? Is there a frontend server that directs traffic to the 'production' and then 'new-production' http?
[14:54:17] ner0x: rking: I move the ip address. lol
[14:54:36] rking: Hrm, how do you do that atomically?
[14:54:59] rking: Like, machineA can't grab 10.0.0.2 until existing 10.0.0.2 relinquishes it, no?
[14:55:29] ner0x: rking: Right. You can assign, relinquish commandline with aws.
[14:56:04] ner0x: But I messed up my explanation to you a little bit but I think you get the idea.
[14:56:17] arabi: hey .. i am lerning rails... i have some problem while pushing app to heroku can some help?
[14:56:28] ner0x: I change the ip the two nginx servers point to, not the IP address of the nginx servers.
[14:57:06] ner0x: rking: There are a ton of ways to do it.
[14:57:12] rking: Yeah, cool.
[14:57:30] ner0x: rking: But realize I don't actually use that dev clone in production.
[14:57:39] ner0x: rking: I said that earlier, I lied.
[14:57:54] ner0x: rking: I just use it to make sure tests pass then I deploy to the current prods.
[14:58:37] foucist: arabi: try telling us the problem.. pastie.com the error if necessary
[14:59:10] ner0x: rking: I'm making less and less sense the more I try to explain it. Check out the deployment strategy pdfs on amazons website. They're pretty informative.
[14:59:52] ner0x: rking: If you're going single vm with all the servers on that, ec2 can clone nightly and spin up the previous clone if it detects it's down.
[14:59:59] cisforcojo: Ok, i've passed a rails var to javascript… is it possible to call .strftime() on it from a JavaScript function?
[15:00:01] ner0x: rking: ^ the less expensive way of doing it with minimal downtime.
[15:01:49] rking: foucist: There's this: http://www.dren.ch/strftime/
[15:02:07] rking: ner0x: I think I could make better use of VM power, in general.
[15:02:12] rking: Again, thanks.
[15:02:14] foucist: rking: don't you mean someone else?
[15:02:23] foucist: cisforcojo: ^
[15:02:26] rking: foucist: Yeah, hehe
[15:02:31] rking: cisforcojo: That link was for you.
[15:02:41] ner0x: rking: No problem.
[15:04:39] ner0x: rking: Do take a look at those docs. Even if you don't use aws they're still a very good place to start.
[15:05:10] rking: Coolness.
[15:05:48] cisforcojo: rking: thanks, but is there some way to do it without using someone else's .js file? I'm using .strftime to format the date in the view, then in the JScript function I'm querying for that text in order to find the absolute position.
[15:06:37] ner0x: AWS has some sort of ElasticBeanstalk thing that fires up rails apps. I don't trust it though. lol
[15:06:47] tubbo: cisforcojo: javascript has a really powerful Date class, have you checked out the MDN docs on it?
[15:07:07] cisforcojo: tubbo, good idea
[15:07:13] cisforcojo: i'll check it out, it's very simple what i need to do
[15:09:30] tubbo: ner0x: looks cool to me. people have been successful with it in Java
[15:11:53] ner0x: tubbo: I feel like it sets up too much without being very explicit about it.
[15:12:16] ner0x: tubbo: I'm sure if I took the time to really read what it does it could be helpful.
[15:12:28] ner0x: tubbo: I just typically like to handle my own deployment.
[15:18:34] rushed: ner0x: there is no spoon, try Heroku~
[15:20:19] ner0x: rushed: I've look at it, I'm not sure if I like it yet.
[15:21:21] rushed: ner0x: Mikey? is that you?
[15:22:22] ner0x: rushed: Only because I use it for more than just my prod server. I tend to rsync files, etc. And then there's the backup.
[15:22:36] ner0x: rushed: I'll be honest and say I haven't really delved into it with the respect it deserves.
[15:25:01] clocKwize: just sped up ldap integration by making it only get certain attributes - was pulling everything, which included binary fields that were like a few KB of data each..
[15:25:24] workmad3: clocKwize: so you switched your ldap integration from dumb to smart? :)
[15:25:28] GeekOnCoffee: clocKwize: yup
[15:25:42] clocKwize: wondered why it took so long
[15:25:54] ner0x: rushed: I'll look into it. I'm using aws anyway. I just need the SES and S3 as well.
[15:27:10] soahccc: What is the easiest way of enabling users to enter decimals with a different locale? (flipped decimal separator)
[15:30:03] certainty: have fun tagrudev
[15:30:09] certainty: i'm back in the green
[15:30:18] tagrudev: tests pass ?
[15:30:20] certainty: that's a good point to go home
[15:30:24] certainty: tagrudev: ye
[15:35:46] jarib: certainty: i'd argue it's better to leave a failing test so you know where to start the next day.
[15:38:06] lxsameer: i'm looking for a place to put my gem source that rails can load it by default
[15:38:54] ner0x: What the heck does rake notes do?
[15:39:43] helpa: ner0x: Why don't you try it and find out for yourself?
[15:39:43] workmad3: ner0x: !try
[15:39:58] joonas: ner0x: rake -T | grep notes
[15:40:29] ner0x: I just did that.
[15:40:38] joonas: ok, then google it
[15:40:40] ner0x: ACTION googles.
[15:40:40] joonas: or run it
[15:40:44] solars: can anyone recommend a gem/method/anything for defining filter parameters? (like start/enddate, etc) that are automatically validated and applied to a query or available in an object?
[15:40:45] joonas: if you don't understand what it says :)
[15:41:20] ner0x: Oh man. I missed the guide on the command line stuff.
[15:41:24] ner0x: ACTION reads it.
[15:41:43] joonas: it's a feature many IDEs provide
[15:41:50] joonas: and some editors (like TextMate, probably Sublime)
[15:42:02] ner0x: I don't even remember the last time I used an IDE. :)
[15:42:03] joonas: of course vim and emacs too
[15:43:14] joonas: I wonder if anyone has created a vim plugin that would let you run rake notes and open it up in a new buffer
[15:43:26] joonas: from which you could then jump to the files/lines
[15:46:15] rushed: solars: you might find these useful => http://railscasts.com/episodes/370-ransack or http://railscasts.com/?search=search&tag_id=30&utf8=✓
[15:49:56] solars: rushed, thanks, I'll have a look!
[15:52:29] coj: can someone recommend a good infinite scrolling gem/plugin for use with rails + kaminari + masonry?
[15:53:31] rushed: coj: you might find this useful http://railscasts.com/episodes/114-endless-page-revised
[15:54:04] coj: rushed: i'll watch it, is there anything to take note of re: the updated cast?
[15:55:08] rushed: coj: no idea sorry, if you already have kaminari & masonry working to taste you're probably just looking for the scrolling watcher client js portion
[15:55:18] coj: pretty much, yeah
[15:56:08] coj: thanks, rushed
[16:02:41] Kilian]: can anyone take a look at this? i have triple nested form and now i want to access the data while editing the object https://gist.github.com/9c0f4be123f3e5b0cd5e the address fields for the speciality_department.addresses are empty but the data is within the mongodb
[16:04:08] clocKwize: Kilian], nested forms make me cry
[16:04:31] latortuga: Kilian], me too
[16:04:48] Kilian]: clocKwize: any hint to avoid such forms?
[16:06:02] latortuga: if the data is in mongodb, then maybe your edit form is setup differently from your new form?
[16:06:35] Kilian]: i only have a _form, index and show
[16:08:04] Kilian]: do you think the form is correct?
[16:12:27] crankharder: Kilian]: what does "access the data while editing the object" mean?
[16:12:44] crankharder: inside create or update?
[16:13:39] Kilian]: the object is created and i want to update it to change soem values
[16:14:08] crankharder: so you're saying that speciality_department.addresses is empty but the data still gets into your DB?
[16:14:31] Kilian]: that works for the the object, and all childs, but not for childs.child
[16:14:58] Kilian]: hospital.speciality_department.addresses is the complete way
[16:14:59] crankharder: i suggest you debug out and see what's showing up inside params
[16:15:13] Kilian]: in which params?
[16:15:23] crankharder: inside update
[16:16:59] crankharder: and this looks wrong
[16:16:59] crankharder: department.simple_fields_for :"speciality_department.addresses"
[16:17:31] crankharder: isn't speciality_department an association on your base object?
[16:17:45] Kilian]: i will add the models to the gist onew moment
[16:17:47] crankharder: shouldn't it be department.simple_fields_for :addresses
[16:19:25] Kilian]: https://gist.github.com/9c0f4be123f3e5b0cd5e added them
[16:19:54] Kilian]: crankharder: i will test that, one moment again
[16:20:06] makerbreakr: new_user_with_role /users/sign_up/:initial_role(.:format) devise/registrations#new
[16:20:16] makerbreakr: if that is in my routes, how do I use that in a view?
[16:20:16] crankharder: also, unrelated, why are you using mongoid
[16:20:38] makerbreakr: new_user_with_role(customer)?
[16:20:38] crankharder: new_user_with_role_path('role_name')
[16:20:58] Kilian]: crankharder: i didnt started the project, no idea why it was choosen
[16:21:43] crankharder: you should get a different project.
[16:21:57] foucist: crankharder: are you against mongoid?
[16:23:01] Kilian]: crankharder: if i remove it, the address is saved at the document hospital and not in the part of the department
[16:23:07] crankharder: heh: https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ__cgTAxI4qW8JMnI2OaJ4sLQ1kZDDW9BHhidKrW2xOndcZUH0
[16:24:26] makerbreakr: in my view, whats the best way to check which role is passed?
[16:24:45] makerbreakr: ie, im using devise, and I want to display form A if customer, form B if printer
[16:24:52] rushed: can you wipe attr_accessor after it is set by an including module or the like?
[16:24:54] crankharder: Kilian]: "speciality_department.addresses" isnt' an association on anything - that can't possibly be right
[16:25:31] Kilian]: crankharder: okay ... maybe something with the helper is wrong, i added the complete _form file to the gist and the helper file too
[16:25:36] arabi: arabi> hey
[16:25:39] arabi: <arabi> focuist : http://pastie.org/5448448 here is the herroku log
[16:25:39] arabi: <arabi> i can't get my app deployed properly
[16:26:02] crankharder: makerbreakr: not by a role that is "passed" if you do that anyone can change what information is displayed
[16:26:25] makerbreakr: crankharder, its the sign up page though, so i dont necassarily cfare
[16:26:47] crankharder: ok, then check some param
[16:26:49] makerbreakr: ie, I have scoped routes, with devise, customer/printer, it will assign different roles depending on which link they click
[16:26:51] arabi: i can't access my app... something went wrong on heroku http://pastie.org/5448448
[16:27:47] crankharder: arabi: why dont you ask #heroku
[16:28:23] arabi: Wanna I install 'thin' gem for production... when i install 'thin' gem will it replace WebTrick ???
[16:29:23] rushed: arabi: does your application work locally?
[16:30:00] crankharder: Kilian]: where's your update method
[16:30:17] alx-: i have strange bug - the first form_tag never works, but the second one does. here is my gist: https://gist.github.com/4162368
[16:30:36] alx-: note how the first one is not wrapped in <form> tags
[16:31:11] Kilian]: crankharder: thats the complete controller, maybe one of the 1million gems handles such a request?
[16:31:26] crankharder: alx-: for fun what if you change the first path to be something like: batch_update_lis_path(:foo => 'bar')
[16:31:26] alx-: even stranger is that when i view-source rather than use the chrome inspector, both forms are created properly
[16:31:57] crankharder: Kilian]: too much magic, write your own code
[16:32:09] arabi: rushed it works fine locally
[16:32:31] alx-: crankharder: no difference
[16:33:00] rushed: arabi: you sure, have you saved and committed all the changes you think you have? because this doesn't seem fine: 'ActionController::RoutingError (No route matches [GET] "/new"):'
[16:33:25] crankharder: alx-: add the markup from view source
[16:33:37] Kilian]: crankharder: the controller inherts in a chain from ActionController::Base but there isnt an update methode
[16:34:17] arabi: yes .. it works fine locally...... here is the github repository of the app... https://github.com/abdulraoof/sample_app
[16:34:23] crankharder: Kilian]: you need to see what params are showing up inside update, because they're passed to update_Attributes. or at least that's how active record works.. nfc what mongoid is doing
[16:34:45] alx-: crankharder: added
[16:35:13] rushed: arabi: that app doesn't look like it has a /new route defined either :P
[16:35:37] djbpython: is there a way i can enumerate all of the available variables in a template?
[16:36:10] djbpython: like show the template context or something
[16:36:36] arabi: lemme check
[16:37:31] henn1nk: i would like to find a model by a nested attribute... how do i achieve this?
[16:38:19] rushed: how do you unwind a call to attr_accessible you didn't want on your model to prevent it from complaining that all other attributes are protected?
[16:38:23] henn1nk: model car has_many :vins ... vin vin:string ... now i would like to do something like: Car.find_by_vins_vin(params[:vin])
[16:40:20] arabi: rushed sorry... that was a log of another application.. here is the actual log .. http://pastie.org/5448524 pls check
[16:42:38] arabi: rushed have you seen that
[16:43:27] crankharder: alx-: add :id => 'foo_id', but make it different for each form
[16:43:36] rushed: arabi: again, are you sure it's working locally? "ActionView::Template::Error (Invalid CSS after "*/":"
[16:44:18] arabi: it is working locally rushed ... i have tested it a moment ago
[16:44:21] crankharder: arabi: oh, also, a put should probably have an ID in the path? e.g. batch_update_listings_path is not a path to an update action
[16:44:25] rushed: arabi: possible you have CSS that is only dying during pre-compilation then
[16:44:43] rushed: arabi: https://devcenter.heroku.com/articles/rails3x-asset-pipeline-cedar
[16:45:07] crankharder: alx-: see last comment. add the output of 'rake routes | grep update_list'
[16:45:29] arabi: how can I correct it ?
[16:46:35] rushed: arabi: look at the css and fix it? look at the logs from your deployment attempt to see where it is dying? etc, etc
[16:47:14] alx-: crankharder: still doesn't work. even if i remove the second form, the first one still doesn't work. gist updated with routes
[16:47:34] rushed: arabi: there is also a troubleshooting section on the page I linked, but since you're just getting started it seems more likely you just have some invalid sass, might be faster to gist your stylesheets and hope someone is bored :P
[16:48:08] crankharder: that makes zero sense
[16:49:00] crankharder: alx-: so, even though it shows up in the source, the forms dont work?
[16:49:16] crankharder: assuming you add a submit button or something
[16:49:42] crankharder: what if you open up the js console and do $('form') - do you get both forms back?
[16:49:47] alx-: crankharder: the first form never works. if i add a second one, that one works
[16:49:57] crankharder: are you inside another form?
[16:50:02] crankharder: nested forms are bad
[16:51:21] workmad3: alx-: you say the view-source is correct?
[16:51:59] workmad3: alx-: if so, that probably means that you're attempting to put a form in a place that isn't valid in the HTML spec and chrome is moving or removing the form tag (which it's allowed to do)
[16:52:17] crankharder: the second one working is weird
[16:52:32] crankharder: if they're inline, and chrome is removing one, the 2nd one should be invalid too
[16:53:03] crankharder: that'd make it seem like there's a bug in chrome's "remove bogus form element" logic
[16:53:13] fgro: i have a complex method in a controller which is used to determine how the response message looks like. where should i put the method? in the model? or a "controller helper"?
[16:54:16] crankharder: fgro: what's the format? json?
[16:54:28] alx-: workmad3, the second one always works, and they are not nested. I can't see what's invalid about the location, it's just in a div...
[16:54:49] crankharder: alx-: can you gist the entire page's source?
[16:54:54] helpa: fgro: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[16:54:54] toretore: fgro: !code
[16:54:58] fgro: crankharder: it's json, but does it really matter? the method determins the success message string (depending on the referrer)
[16:55:19] crankharder: private method in the controller
[16:55:37] latortuga: fgro: make an object
[16:55:56] crankharder: or that if you're going to reuse it a bunch
[16:56:18] rushed: trying to avoid an undesired attr_accessible call, there has to be something less ugly then this: http://pastie.org/private/bfqjccckleccvfud2juata
[16:56:30] latortuga: fgro: ComplexResponse.new(your, options, here).generate, there i made you an API
[16:57:16] epochwolf: latortuga: that's only a good approach if it's highly complicated. Extract to method first, if that's too many lines, then think about objects
[16:57:22] toretore: rushed: why are you trying to avoid it? show real code
[16:57:44] latortuga: epochwolf: I agree, his description was that the method was already complex
[16:57:59] epochwolf: latortuga: yes but it's a controller action
[16:58:04] rushed: toretore: because I'm using strong params and if it is called for one field all other fields will error on assignment
[16:58:22] epochwolf: latortuga: if you can extract some of that logic into a helper method in the controller, that might be enough
[16:58:23] latortuga: epochwolf, fgro: custom responder?
[16:58:28] helpa: rushed: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[16:58:28] toretore: rushed: !code
[16:58:40] PsciCOdeliXHAt: hello, someone can help me...I'm using fedora, and i install ruby rvm and another things from yum. and know I want to install rails doing: gem install rails and i get it: ERRO, mkmf.rb can't find header files for ruby at /usr/lib/ruby/ruby.h
[16:59:05] epochwolf: latortuga: there's no need to reach for overkill on the abstraction. Small steps first.
[17:00:08] arabi: rushed here is the scss file http://pastie.org/5448607 :(
[17:00:19] crankharder: epochwolf: latortuga's suggestion was pretty awesome
[17:00:31] crankharder: i wouldn't call it overkill, even if it's used in one place
[17:00:49] epochwolf: crankharder: So, it's more important to write code that's "awesome" than simple?
[17:00:58] latortuga: being able to test a piece of (by asker's admission) complex logic in isolation is a win
[17:01:02] crankharder: PsciCOdeliXHAt: don't install ruby or rvm from yum, that just seems like a bad idea.
[17:01:13] crankharder: epochwolf: his suggestion was simple
[17:01:13] epochwolf: latortuga: okay, that would make sense then
[17:01:20] Lope: anyone here use Aptana Studio? I'm trying to set up the debugger. Google has not been yielding any guides or docs that are current or official.
[17:01:47] crankharder: abstracting logic out into a separate class isn't complicated
[17:02:17] workmad3: crankharder: well, it can be :) depends how coupled the logic is to the rest of the class and its dependencies
[17:02:41] PsciCOdeliXHAt: crankharder: should I remove them using yum?
[17:02:50] alx-: crankharder: got it to work! turns out a form_tag somewhere else on the page was coded incorrectly, without a proper closing tag.
[17:02:54] crankharder: def initialize(controller_instance)... in controller: MyAwesomeClass.new(self). done.
[17:02:58] crankharder: PsciCOdeliXHAt: yesa.
[17:03:15] crankharder: alx-: so you had nested forms?
[17:03:55] rushed: anyone using strong paramaters know of a way to turn off attr_accessible checking?
[17:04:14] alx-: crankharder: it wasn't supposed to be nested. form_tag somewhere else was given without a "do" statement, which screwed up the way that form closed, making my new form invalid
[17:04:20] workmad3: rushed: did you turn off the whitelist_parameters config option?
[17:04:49] workmad3: rushed: *whitelist_attributes
[17:06:13] Raimonds: Hi. Just wanted to clarify. Can't mass-assign protected attributes: psw means that I need to make a custom function in model to assign password?
[17:07:42] crankharder: Raimonds: no, it means you specifically have to assign password. attributes = {...} or update_attributeS({...}) won't assign it
[17:07:44] lectrick: FYI on chat channel help antipatterns: Don't ask about the specific thing you need help with without mentioning the ultimate goal (which might be satisfied more easily by a completely different specific thing that did not occur to you)
[17:10:14] rushed: workmad3: thanks for the suggestion, had it commented out, but changing to an explicit config.active_record.whitelist_attributes = false still triggers "Can't mass-assign protected attributes" if there are any attr_accessible calls so I suspect that's just there if you're pre-strong attributes and don't want to have to worry if you used attr_accessible at least once in all your models
[17:10:28] alx-: crankharder: workmad3: thanks for the help!
[17:11:44] workmad3: rushed: did you do 'include ActiveModel::ForbiddenAttributesProtection' and if you're using strong-params, I believe you should remove the attr_accessible lines
[17:22:18] PsciCOdeliXHAt: crankharder: where can i find tutorial for installing and starts with ruby on rails?
[17:23:29] crankharder: PsciCOdeliXHAt: start by installing rvm using their instructions
[17:23:56] havenn: PsciCOdeliXHAt: What OS/distro are you on?
[17:24:34] helpa: Awesome hat, crappy linux.
[17:24:57] jazzanova: hi, anyone wants to work in SF ?
[17:25:10] havenn: PsciCOdeliXHAt: RVM or chruby make install easy: https://github.com/postmodern/chruby
[17:25:23] havenn: PsciCOdeliXHAt: Or ruby-build
[17:25:45] workmad3: jazzanova: Santa Fe?
[17:25:58] Raimonds: Anyone aware of #<ActiveModel::Errors:0x3c5ba88> means? Trying to save model and got this in .errors
[17:26:04] jazzanova: san francisco
[17:26:23] workmad3: Raimonds: that would be the errors object
[17:26:52] workmad3: Raimonds: it's what stores all the validation errors that occured when attempting to save the model
[17:26:52] PsciCOdeliXHAt: havenn: rvm equivalent chruby?
[17:27:02] Sylario: Is there anyway to see logger.debug while running rspec tests?
[17:27:13] havenn: PsciCOdeliXHAt: Much more minimalist than RVM, but very slick!
[17:27:15] workmad3: Sylario: tail -f log/test.log
[17:27:25] Sylario: workmad3: thx!
[17:27:31] workmad3: Sylario: assuming that the debug log level is set in your test env
[17:27:40] PsciCOdeliXHAt: havenn: thanks..
[17:27:50] Raimonds: workmad3 Oh thanks, Im just so stupid (:
[17:27:53] Sylario: workmad3: it is
[17:29:11] PsciCOdeliXHAt: havenn: Prefer to install rvm...easyest
[17:29:30] havenn: PsciCOdeliXHAt: More widely used, by far. Chruby is really cool though. :)
[17:30:08] havenn: workmad3: The newest on the block is ry!
[17:30:19] slash_nick: hm, why would devise output erb with all the leading <%/<%= missing?
[17:30:23] workmad3: rbfu forever!!!!
[17:30:24] havenn: rvm, rbenv, rbfu, chruby, ry
[17:30:27] Raimonds: workmad3 should have used YAML::dump() for debug.
[17:30:32] havenn: workmad3: Have you looked at chruby?!
[17:31:04] workmad3: havenn: nah, it's probably going to be identical to rbfu except without the option cd hook for project-specific stuff :)
[17:31:25] havenn: workmad3: I'd say rbfu without the @
[17:31:27] havenn: workmad3: :P
[17:32:47] workmad3: havenn: either way, I cba to switch around to the newest 'minimal ruby env switcher' thing... rbfu does everything I need :)
[17:33:38] workmad3: havenn: I just felt like trolling a little with some rbfu love ;)
[17:34:27] workmad3: rbfu forevarrrrrrr!!!!
[17:34:41] elaptics: workmad3: cba, is the reason I'm still using rvm :)
[17:35:22] workmad3: elaptics: yeah, my cba to change got overridden by my cba to deal with removing their bundler integration
[17:36:31] elaptics: workmad3: y u no liek bundler integration?
[17:37:41] havenn: Chruby with Bundler is my cup of tea. I don't care for Gem Sets though.
[17:38:25] rushed: workmad3: the attr_accessible call is coming from a module, it seems like this will be a general issue until gems are updated to consider strong params, so far I've only had green with this uglyness: http://pastie.org/private/0iojuoy8pn86ticaruwhg
[17:39:07] havenn: Ry, the newest Ruby version manager this week: https://github.com/jayferd/ry
[17:41:15] workmad3: rushed: hmm, maybe something to move into a shim on AR::Base?
[17:41:45] workmad3: rushed: which is where I'm guessing you've put the include for strong-params too? :)
[17:47:20] rushed: workmad3: it can't hurt you if you don't see it as often... I like it :)
[17:47:21] FLeiXiuS: havenn, Mmm...I'll hold out for rvm2.
[17:47:54] havenn: FLeiXiuS: Pre-compiled static linked Ruby for OS X, yummy.
[18:12:19] Raimonds: Interesting :acceptance => true on checkbox seems to be true when its not checked but validation fail when its checked.
[18:14:14] tubbo: i like how there are all these choices
[18:16:29] tubbo: but i'm not sure what's so different in ry and rbfu from rbenv
[18:17:00] tubbo: chruby, however, is quite interesting. it's almost exactly what i'm looking for
[18:17:52] tubbo: i'm using brew-installed Ruby in /usr/local.. and if i install jruby or rubinius i could just `chruby` to use it
[18:18:09] tubbo: but this way i'm not installing crap to ~/.shit-up-my-dotfiles or some other home dir thing
[18:18:21] tubbo: never really liked having binaries in ~/...
[18:22:21] hubble: Yo anyone know if you can customize ActiveAdmin member/collection_action to configure URL params?
[18:22:38] hubble: (example: member action makes the :id param but i want to add another one in there)
[18:24:16] hubble: ACTUALLY i know a way to get what i want without the extra param
[18:34:30] djbpython: can anyone tell me why im getting a translation not found: https://gist.github.com/4163097
[18:35:21] hiall: Can I start a new rails app using rails4? Know i could edit the gemfile afterwards but curious if possible straight away
[18:38:54] ddd: gem install rails —pre should get you rails4. bear in mind i would NOT put it into production as its not 'release' software
[18:39:01] ddd: s/-pre/--pre/
[18:43:03] ddd: nope. I just tried it. it gets 3.2.9.rc3
[18:44:25] waseem_: hiall: Do a rails new <app-name> --edge. This will make your Gemfile point to the Rails repository.
[18:46:47] Spaceghostc2c: It's also better to clone the rails repo, then do railties/bin/rails new <app-name> --edge
[18:47:05] Spaceghostc2c: Where app-name is a path, not just the name of the app.
[18:47:11] ddd: wow nothing like being stupid deryl. rvm remove 1.9.3-p327@rails4 really? really??
[18:47:26] ddd: deleted my 1.9.3-p327 and have to reinstall it. idiot user
[18:47:42] waseem_: Spaceghostc2c: I usually do that with --dev.
[18:47:52] Spaceghostc2c: waseem_: --dev is for your own repo, no?
[18:48:10] waseem_: Spaceghostc2c: Yes. The repo checked out on your machine locally.
[18:48:18] Spaceghostc2c: I just had a trolldea (trolly idea)! Have your rvmrc empty your gemset before switching to it. Punishes you for switching away!
[18:48:44] waseem_: Spaceghostc2c: That will make a devops life a nightmare.
[18:48:46] Spaceghostc2c: waseem_: I prefer --edge just so I can bundle update without having to git pull --rebase origin master on the rails repo first.
[18:49:07] waseem_: Spaceghostc2c: That's nice.
[18:49:29] Spaceghostc2c: The reason to use the rails repo locally is so you get all the proper generated files for a rails 4 repo.
[18:49:57] Spaceghostc2c: Generating a rails 4 repo from rails 3 didn't work when I tried it. It generated a bunch of rails 3 files with the Gemfile pointing to the rails repo.
[18:50:21] waseem_: Spaceghostc2c: That sounds like a bug.
[18:50:35] Spaceghostc2c: waseem_: I already brought it up to the rails core team
[18:50:58] Spaceghostc2c: They said the way I did it with cloning rails and then generating from railties/bin/rails was the correct way to do it at this time.
[18:50:58] waseem_: Can you link me the issue?
[18:51:16] Spaceghostc2c: https://github.com/rails/rails/issues/7773
[18:52:10] Spaceghostc2c: waseem_: https://github.com/rails/rails/issues/7596#issuecomment-9059470
[18:52:51] waseem_: Yup. That explains it.
[18:55:36] bartell: how can I get rails to compile an asset that's not used site wide? (not included in the application.css file).
[18:57:25] ddd: manually add it to the manifest.yml
[18:58:28] elaptics: bartell: add it to the precompile list
[18:58:58] ddd: ahh yeah, the manifest is made *after*
[18:59:17] ddd: http://guides.rubyonrails.org/asset_pipeline.html about 1/2 way into Section 4.2
[18:59:25] ddd: config.assets.precompile += ['admin.js', 'admin.css', 'swfObject.js']
[19:00:14] bartell: elaptics: ddd: thanks!
[19:09:12] slash_nick: http://guides.rubyonrails.org/engines.html#controllers
[19:10:56] slash_nick: ^^^ that's cryptic for me... i'm looking for a nice way to extend a mounted engine's controller from within an app..
[19:11:33] slash_nick: I can just reopen the controller, but then I'd have to redefine every action in order to change just one
[19:12:20] Spaceghostc2c: slash_nick: You wouldn't.
[19:12:26] Spaceghostc2c: But then you'd be monkey patching it. :(
[19:13:20] slash_nick: Spaceghostc2c: wouldn't have to define them all?
[19:13:37] Spaceghostc2c: slash_nick: Why would you?
[19:14:23] slash_nick: It's what I observed... I defined the edit action, and the 'show' & 'index' actions stopped working..
[19:17:26] bricker: Fellas, I just want to check... Once an association is loaded for an object, calling that again won't make a database query unless you chain some scopes onto it, right? self.assets.all; self.assets.select { |a| a.id = 10 }; only 1 query?
[19:18:27] bricker: I wanted to test it with ActiveRecord::Base.count_queries, but I guess it was removed?
[19:19:43] Spaceghostc2c: slash_nick: Did you call super in the other actions?
[19:19:48] Spaceghostc2c: Or did you call super at all?
[19:28:25] TylerE: I'm having a really hard time wiht my first rails app. I'm getting a stack level too deep error in routes.rb, but only after several requests. I can load several pages fine, but then it'll stack level too deep on me
[19:28:45] dankest: TylerE: Does the error only occur on one path?
[19:28:47] hiall: TylerE: its a memory issue look up utime
[19:29:32] TylerE: dankest: Doesn't seem to be
[19:29:33] graft: hey folks, i'm trying to deploy an application to a subdomain (http://foo.com/bar) - i put my config/routes in a scope "/bar" block and set ENV['RAILS_RELATIVE_URL_ROOT'], but while it rewrites urls correctly it doesn't seem to find /bar/assets/* in the right place
[19:29:43] TylerE: also, after I get the one error all of routes stop working
[19:29:56] TylerE: until I restart the server
[19:30:25] bricker: TylerE: how do you know it's in the routes?
[19:30:36] TylerE: because the error says "in routes.rb"
[19:30:45] bricker: TylerE: then paste the error and your routes.rb file
[19:31:24] TylerE: working on it
[19:31:26] timhansen: question.. should the code in this gist between the if & else if be moved to the model? https://gist.github.com/c7f8b863e647489dd69e
[19:31:31] TylerE: will need to anonymize some stuff
[19:31:38] timhansen: i'm not really sure if it would be considered "logic"
[19:31:42] kollapse: Hello. I am getting this error when attempting to run an RSpec test - http://bpaste.net/show/xKf2G2ibURCxI6oUbruH/ I don't understand why, as I have RSpec, Capybara and Nokogiri all installed.
[19:33:04] TylerE: hrrm, so it might have been s sprockets bug
[19:33:08] TylerE: I did a bundle update
[19:33:13] TylerE: and it pulled in a new sprockets ver
[19:33:17] TylerE: and I haven't gotten an error since
[19:40:23] ddd: wish there was a simplistic way to auto-diff to gem versions :)
[19:40:24] bricker: kollapse: can you run it without "bundle exec"?
[19:40:39] ddd: s/to/two/
[19:41:48] jarib: ddd: yard can sort of do that
[19:42:09] jarib: it doesn't diff the source, but e.g. methods added/removed
[19:42:20] ddd: ahh what about modified (specifically)
[19:43:26] ddd: jarib: thinking i might need to learn how to 'git bisect' and pull specific commits. there is a whole lot i don't know how to do with git that would probably make bug hunting a lot easier
[19:43:29] kollapse: bricker, No, running it directly without bundle exec shows me the same thing.
[19:44:15] ddd: i use only about 1/100th of the power that is git hehe
[19:44:56] jarib: yeah, bisect can be useful
[19:45:11] jarib: i don't use it often, but i'm very happy it exists when i do :)
[19:46:58] ddd: Spaceghostc2c gave me a link to the online book, which i totally forgot existed. i'll start there, and then see about hitting youtube for more indepth videos if need be
[19:47:36] hubble: Any formtastic users out there? My select box isn't "selecting" the assigned option in my belongs_to record
[19:47:57] hubble: it assigns the ID in the database correctly but when i load the edit form the select box is blank
[19:48:27] ddd: youtube has come in *quite* handy. I was looking for a really in-depth training course on rails and rspec, found this one: http://www.youtube.com/watch?v=ra8Q0M3DJYk&list=PLGVLF46WupSnMdTomDTFV-Cx9aG78b8Vo
[19:48:37] hubble: basically every aspect of it works as expected except the Option is not Selected
[19:48:57] ddd: couple of the guys in ruby-lang put me on to it indirectly, been digging through youtube ever since :)
[19:49:07] tubbo: ddd: bisect is hella useful. in a past life, i did that kind of shit by hand with SVN...
[19:49:44] tubbo: however, bisect is only useful if you or your team's commit msgs suck
[19:50:04] tubbo: committing properly removes the need for bisect. i still haven't really used it much here.
[19:50:23] ddd: tubbo: still probably worth learning.
[19:50:53] hubble: Anyone wanna take a stab at why my select box in Edit view is not showing what should be the Selected Option?
[19:51:27] hubble: here's the attribute in the DB: contact_link_type_id: 4,
[19:51:33] ddd: I started using Spaceghostc2c's format for commits on a private project and like it. Generic one-liner followed by a newline then * More extremely specific information here
[19:51:37] hubble: but when i load up Edit, that contact link type is not Selected
[19:51:48] ddd: I use * rather than - but its all the same
[19:52:09] Spaceghostc2c: ddd: Should I blogpost about it?
[19:52:10] hubble: I tried using _id instead of the association name as the field name but it didn't change anything
[19:52:21] joonas: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html ?
[19:52:25] hubble: (contact_link_type vs. contact_link_type_id)
[19:52:42] hubble: neither one "selects" the option in the select box
[19:52:48] rapha: I need to implement a route where the processing of controller & id is a little more involved. Should I put the needed method directly into routes.rb or is there a "better" way?
[19:53:06] hubble: (even though the correct associated record is CLEARLY assigned when i load up console and query the DB)
[19:53:11] joonas: rapha: try elaborating first what it is that you want to do
[19:53:25] joonas: what you just said is very vague
[19:53:35] ddd: Spaceghostc2c: I would. Give an example of a bad one, like from an actual commit, and a good one showing the actual commit, and then a paragraph or 3 on why the 2nd is better. Aim it at new git users with a comment that even old hands at git itself might want to take advantage of the style and why
[19:54:07] hubble: Actually i think i have an idea why it's happenign, You Guys
[19:54:31] tubbo: ddd: absolutely worth learning. but realize that if you have to use it, you're doing something wrong in your commits
[19:54:51] tubbo: ddd: lol i'm pretty sure that's the recommended way to commit to Git, as recommended by its developers
[19:55:05] tubbo: if you store on github, your first message can only be like 50 chars or so
[19:55:08] astronaute: can someone suggest an editor with rails auto completion (.all and such on models) ?
[19:55:11] tubbo: err first line*
[19:55:15] tubbo: astronaute: vim
[19:55:33] tubbo: astronaute: what's your favorite editor right now?
[19:55:40] parndt: astronaute: sublime has some completion but not like that
[19:55:43] parndt: it uses buffers
[19:55:46] Ogredude: man, Selenium tests might be super-slow but they're pretty cool to watch
[19:55:50] Ogredude: even cooler to show to $client
[19:55:54] astronaute: tubbo i actually use aptana
[19:56:01] naquad: how do i run separate script in rails environment?
[19:56:17] parndt: Ogredude: poltergeist <3
[19:56:27] tubbo: astronaute: check out RadRails or RubyMine, you may enjoy the IDE thing more than a shell editor like Vim or a generic editor like Sublime/Textmate
[19:56:41] tubbo: Ogredude: check out the headless gem if you want to run selenium tests on CI
[19:56:43] astronaute: parndt which kind of completion is in Sublime? can you give an example please?
[19:56:53] parndt: or for the alternate viewpoint: use an editor not an IDE because you don't need an IDE ;)
[19:57:12] parndt: astronaute: things inside the current context like the same class file etc, it won't scan Rails libraries
[19:57:20] parndt: Ogredude: tubbo: or use poltergeist
[19:57:24] tubbo: parndt: give him time, he will eventually figure out that it's harder to write ruby in an IDE
[19:57:26] parndt: https://github.com/jonleighton/poltergeist
[19:57:29] astronaute: tubbo I checked RadRails has no completion, and RubyMine no thank you, there is a autosave feature in it which makes me vomit :)
[19:57:38] parndt: completion is a net loss
[19:57:43] tubbo: parndt: that's not the same thing at all.
[19:57:51] Ogredude: going to be switching to poltergeist
[19:57:55] parndt: you never actually learn the language or framework you just learn to hit tab a lot
[19:58:00] parndt: tubbo: I know, it's superior
[19:58:09] rapha: joonas: my app is a sort of e-book, and i have to deal with legacy data. i have a json file that contains the starting page of each chapter. right now my urls look like this: /chapters/12#5, but i want urls like /pages/182 instead. so if i get a /pages/nnn url, i want to read the json file and figure out what chapter the requested page belongs in and what page relative to the chapter starting page it is.
[19:58:10] Ogredude: but I wanted Selenium for the time being so I could actually watch while I tried to get the javascript driver working
[19:58:11] tubbo: agreed, but not useful for my cucumber tests :)
[19:58:13] astronaute: parndt yea inside same file is easy :)
[19:58:20] parndt: tubbo: it doesn't work with cucumber?
[19:58:21] tubbo: on my capybara tests? absolutely. i will be using this on CI
[19:58:29] mlang: How would I remove an association from an object without removing the object itself?
[19:58:32] tubbo: parndt: well if i was using capybara w/cucumber, i guess it would...
[19:58:39] astronaute: tubbo so there is completion on vim?
[19:58:41] Ogredude: and I'll keep it on here till after $client leaves today, because you gotta admit it's pretty impressive to watch if you weren't the one who built it
[19:58:42] tubbo: but what's the point of that honestly
[19:58:59] tubbo: astronaute: yeah, but if you're coming from an IDE i would not recommend vim. it's best used as an editor in the shell.
[19:59:01] Iszak_: So I've got a model with a polymorphic association, how can I get a specific set of association? scope?
[19:59:21] tubbo: astronaute: personally, UNIX is my IDE…so I'm always in the shell. vim is useful to me as one piece of a larger machine that is my workspace
[19:59:28] Ogredude: I've been playing with the idea of switching over to vim, mostly because I find myself shelled in to places so much anymore
[19:59:35] Ogredude: I keep catching myself trying to issue vim commands to TextMate
[19:59:55] tubbo: astronaute: took me a while though, I used to use Eclipse back when I was writing Java and just this year stopped using a "project pane" in all my editors
[20:00:02] cableray: Ogredude: doesn't text mate have a vim mode?
[20:00:02] astronaute: tubbo me too but inside a VM, but for coding I prefere an IDE like Aptana for Git support (visual)
[20:00:07] tubbo: so the contents of my project aren't in my face all the time
[20:00:13] Ogredude: cableray: you know, I've never checked.
[20:00:26] astronaute: tubbo that's not something I'm ready to do :)
[20:00:36] tubbo: astronaute: right. you can make vim do everything an IDE can do, but it requires a bit of study. if your machine can handle it, why not RubyMine?
[20:00:44] tubbo: it's like, designed for Rails...
[20:00:50] tubbo: also doesn't Aptana have RadRails?
[20:00:53] cableray: Ogredude: I switched to sublime a few months ago, so I don't remember anymore.
[20:00:53] ddd: tubbo: sorry was busy in email with wife-to-be. It may be the recommended way, however, looking at the trough of commits that are out there that don't conform to it, seems the message isn't getting out. Sometimes its just a matter of flaunting it, and doing so via a blog or something.
[20:00:56] centrelink: I've never used rails with anything but vim
[20:01:10] tubbo: astronaute: http://www.aptana.com/products/radrails
[20:01:12] Ogredude: tubbo: they renamed it, but yeah there's an Aptana Rails environment set up inside Eclipse
[20:01:22] astronaute: tubbo it is called Aptana Studio 3 now
[20:01:25] mlang: RubyMine is quite good?
[20:01:27] tubbo: ddd: if you got it, flaunt it i guess <3
[20:01:34] astronaute: tubbo I'm using it but no completion
[20:01:35] tubbo: mlang: if your computer can handle it
[20:01:43] mlang: tubbo: No problems here on my Air.
[20:01:50] ddd: mlang: if your system can handle it. Its more than a bit of a memory hog.
[20:01:51] tubbo: mlang: how much RAM?
[20:01:56] astronaute: mlang RubyMine autosaves files without your consent, so no thank you :)
[20:01:58] benlieb: Is there a way with ActiveRecord to get back instances of model other than the original model called on. For example if a lesson has_one :instructor => Lesson.where(:level => 2).get_back_association(:instructor)
[20:01:59] mlang: tubbo: 8GB
[20:02:00] RyanD: Probably a silly question, I've got an array @unique_nodetypes with a series of numbers, I want to check a table (NodeTypes) with a field for name that has another column that would have the node type listed. I want to get the names for each of the corresponding node types.
[20:02:01] Ogredude: I like TextMate, but I don't like being tied to OSX for it
[20:02:04] tubbo: mlang: that's why
[20:02:11] mlang: astronaute: you can turn that off.
[20:02:14] tubbo: you need at least that to run RubyMine effectively IMHO
[20:02:16] ddd: astronaute: thats totally configurable and not a reason to hate it
[20:02:20] astronaute: mlang you can't
[20:02:22] rapha: joonas: if you need more info than that i'm at a loss as to what specifically?
[20:02:25] mlang: astronaute: Yepp, you can.
[20:02:29] naquad: i need to run a script from cron in rails environment. how do i do that?
[20:02:32] astronaute: ddd & mlang try to modify something and close your tab
[20:03:00] astronaute: ddd & mlang just do it and come back to report :)
[20:03:05] RyanD: So, @unique_nodetype_names = NodeType.find( #find only records that have a node_type_num = @unique_nodetypes)
[20:03:13] mlang: astronaute: Didn't save it.
[20:03:14] RyanD: What would I need to replace my commentary with?
[20:03:25] RyanD: (Have poked a bunch through documentation, and can't quite get it right.
[20:03:41] RyanD: using active record 2.3.14
[20:03:54] astronaute: mlang I just uninstalled it because of that, so that is not possible, and yes I checked all settings including the asterisk
[20:04:16] ddd: sigh. disable it under Syncronization under IDE settings
[20:04:43] astronaute: ddd did you try it ? disable anything you want and then close the tab?
[20:04:58] ddd: using v4.5.4 here
[20:05:03] joonas: rapha: sorry, I'm not actually here to help anyone right now, I was just making a general comment about your message
[20:05:07] joonas: I'm sure someone else can help you out though
[20:05:08] cableray: so I'm looking for some projects to contribute to. Anyone know of some interesting projects that need help? Preferably smaller ones with active maintainers.
[20:05:10] mlang: ddd: Thanks :)
[20:05:17] ddd: mlang: :)
[20:05:28] cableray: open source projects, that is.
[20:05:31] mlang: Yeah, i was just looking for it, because I had it turned off too - just didn't remember where it was.
[20:05:44] ddd: its IDE Settings, General then under the Syncronization section
[20:06:02] astronaute: what is called ?
[20:06:10] astronaute: ddd the setting, what it is?
[20:06:21] mlang: astronaute: To not Auto Save the files on exit: "General -> Synchronize files on frame activiation"
[20:06:36] astronaute: ddd this is not same as CLOSE THE TAB
[20:06:52] daniel__: how do i use twitter bootstrap with assets pipeline and not use a gem?
[20:06:52] ddd: Go to Preferences, then in the left section under IDE Settings go down to General, then in the main part that gets displayed the bottom half is Syncronization. disable saving there
[20:07:01] ddd: err what are you talking about then?
[20:07:27] mlang: ddd: I think, he means it autosaves the file as soon as you close the tab inside RM.
[20:07:32] astronaute: ddd & mlang I'm talking about 1) opening a file 2) modifing it 3) closing it without saving -> result: it is ninja saved
[20:07:44] cableray: Ogredude: re text mate: sublime text is multi platform and does everything text mate does, although it requires more manual configuration.
[20:07:51] slash_nick: weird...swapping from text_field_tag to f.text_tag resulted in 98.6 displaying as 98.5999999999999943
[20:07:59] slash_nick: err, f.text_field
[20:08:30] parndt: astronaute: which editor are you wanting to do that n?
[20:08:33] GoGoGarrett: I have a app/model/comment.rb I also have a lib/social/app/models/comment.rb When I do Comment.new it expects the social engine's comment to define come.. but does not. How can I make it use the app/models instead?
[20:08:37] Ogredude: cableray: I'll have to take a look at it
[20:08:46] parndt: GoGoGarrett: lib/social/app/models ? what?
[20:08:48] astronaute: parndt RubyMine does it, it ninja save your modified files without asking
[20:08:57] parndt: astronaute: right; so do many editors
[20:09:01] parndt: it's just a preference
[20:09:09] astronaute: it is not, it cannot be disabled
[20:09:18] cableray: slash_nick: that's because of the floating point conversion algorithm. base 2 fractions are often repeating when base 10 fractions aren't
[20:09:42] cableray: there are some algorithms that help with that though.
[20:09:46] astronaute: parndt the preference is just that, preference, in RubyMine is third reicht, you have no choice :)
[20:10:01] parndt: yet another reason not to use rubymine
[20:10:03] parndt: surprise surprise
[20:10:27] slash_nick: so f.text_field(:temperature, value: f.object.temperature) does the trick, thanks cableray
[20:10:30] Scient: autosaving is the most awesome feature tho :>
[20:10:35] mlang: parndt: Its not that bad?
[20:10:42] astronaute: parndt I don't I was just explaining the difference to ddd and mlang between frame activation and closing the tab
[20:11:22] Scient: i find it so annoying having to save files manually when using other editors nowadays
[20:11:26] mlang: astronaute: I get what you are saying, Its just not a problem for me. :)
[20:11:30] Scient: with the exception of vim though
[20:11:54] astronaute: Scient I'm glad you like it, I just want to have choice because I don't like it, it is about choice
[20:11:56] ddd: ehh well it does do that, but thats typical of most editors to save on close. Even Numbers, pages, and a slew of other office word processors do that. And I've not seen a single solitary one offer the ability to turn that off. but I find that quite useful actually. But I can see that being a valid point for you
[20:12:03] parndt: I look for editors that are seriously great instead of ones that are not that bad
[20:12:05] Scient: may i ask why dont you like it?
[20:12:18] parndt: sublime and textmate that's configurable
[20:12:20] cableray: GoGoGarrett: are you trying to override an engine model?
[20:12:24] parndt: though I have it turned on because I hate having to save
[20:12:25] astronaute: mlang & ddd glad we understand each other, it is about choice again, I don't want an IDE to ninja save my files if I don't want it
[20:12:30] Scient: or is it "just because"?
[20:12:33] GoGoGarrett: well there's an engine's model that has the same name as the model in my normal app
[20:12:36] rapha: joonas: hmm k thx anyways
[20:12:41] aaronmcadam: hey can someone take a quick look at this please, it's a very simple selenium file I want to run standalone https://gist.github.com/4163911
[20:12:41] GoGoGarrett: but when I try to do Comment.new it expects the engine's library to be used
[20:12:49] aaronmcadam: getting: require': cannot load such file -- selenium-webdriver (LoadError)
[20:12:52] GoGoGarrett: engine's object*
[20:12:58] mlang: parndt: We all know that VIM is awesome. Just very hard to get into :(
[20:13:01] rapha: so is it a good idea to put a more than rudimentary method into routes.rb?
[20:13:07] astronaute: ddd that's not true, RubyMine is the only one IMPOSING the feature on you without any choice
[20:13:11] parndt: I don't use vim either
[20:13:14] tubbo: Scient: it's a pretty cool feature, but i fail to see why I need RubyMine over a custom Vim setup if I really need autosaving?
[20:13:16] parndt: I use at the moment sublime text 2
[20:13:32] Scient: astronaute: i repeat myself - whats your specific reason why you dont like it?
[20:13:35] parndt: GoGoGarrett: but why is the engine inside your lib dir?
[20:13:36] cableray: GoGoGarrett: is the engine model in it's own namespace? it should be.
[20:13:44] mlang: parndt: How do you like it? Tried it for a few weeks, couldn't stand it. Only had problems with it.
[20:13:47] Scient: tubbo: obviously you would not use an ide/editor because of one feature, would you?
[20:13:49] GoGoGarrett: It's Social::Comment
[20:13:53] Antiarc: I use sublime primarily, but I use a good amount of vim, too
[20:13:57] GoGoGarrett: but Comment.new still tries to call Social::Comment for osme reason
[20:13:59] tubbo: Scient: hehe of course. :)
[20:14:00] astronaute: Scient because I sometimes want to discard what I typed withoit developing a carpal tunnel with CTRL-Z
[20:14:13] Scient: so use local history
[20:14:16] ddd: astronaute: i A) don't see it as imposing, B) don't close tabs and expect it NOT to save, C) see other apps not following along with RubyMine's way. However, if its this big an issue for you, then open a ticket at jetbrains for that specific feature support
[20:14:17] cableray: GoGoGarrett: try ::Comment
[20:14:18] GoGoGarrett: @parndt I didn't write it :P
[20:14:21] Scient: you can roll back to any autosave point
[20:14:24] GoGoGarrett: @cableray I've tried that as well
[20:14:27] Scient: just like with git commits or something
[20:14:29] parndt: GoGoGarrett: but you have to maintain it ;-)
[20:14:30] Scient: better than undo
[20:14:33] tubbo: astronaute: `git checkout HEAD <your-file>` ;)
[20:14:39] parndt: GoGoGarrett: try calling ::Comment.new
[20:14:42] GoGoGarrett: @parndt have to *fix it
[20:14:46] Scient: and autosave has a good reason just because it offers rollback points due to it
[20:14:46] GoGoGarrett: Doesn't work either
[20:14:47] astronaute: Scient I don't want to work around something that shouldn't be in there, I just don't use RubyMine because of that
[20:14:50] tubbo: undo is way better than checkout though
[20:14:52] parndt: GoGoGarrett: that's the same thing :P
[20:14:53] GoGoGarrett: It just breaks alltogether when referencing Comment at all
[20:15:01] tubbo: because you can't go back (easily) when you checkout HEAD..
[20:15:03] Scient: all i hear is "wah wah wah" tbh :>
[20:15:24] ddd: astronaute: it *should* be there. the autosave functionality with rollback support was actually a highly requested feature. but oh well, not everyone has to agree and like it.
[20:15:26] cableray: were are you trying to call Comment from?
[20:15:47] astronaute: Scient there should be an option for me to disable the auto save if I don't need it
[20:15:50] ddd: brb gotta get the kids off the bus
[20:16:01] Scient: i disagree
[20:16:05] mlang: I would use Sublime, I guess - If it would save my Preferences :(
[20:16:06] astronaute: ddd it still should be a choice, not a forced feature
[20:16:17] cableray: GoGoGarrett: were are you trying to call Comment from?
[20:16:30] ddd: astronaute: then as i said, open a feature request ticket
[20:16:34] cableray: s/were/where/
[20:16:43] astronaute: ddd and rollback should be exceptional, not a way of life
[20:16:45] ddd: you're picking a VERY small bone over the entirety of the editor
[20:16:49] Scient: there has been a ticket i think
[20:16:55] parndt: let's paint the shed blue
[20:16:56] GoGoGarrett: an application contorller @cableray
[20:17:00] Scient: i dont really see ANY reason it should be toggleable
[20:17:01] Scient: none at all
[20:17:02] GoGoGarrett: well a controller within the applicaiton, not the engine
[20:17:08] astronaute: ddd already did, they don't care about putting an option, they think they know what is good for us I guess :)
[20:17:11] ddd: Scient: I'm in agreement with you. but thats me
[20:17:34] Scient: because not being able to disable it takes _nothing_ away, it doesnt prevent you from doing anything
[20:17:36] cableray: GoGoGarrett: in the global namespace then?
[20:17:39] Scient: if anything, it helps you
[20:18:02] cableray: GoGoGarrett: gist the relevant code then.
[20:18:14] Scient: so far the only reason ive head is that "i dont like that its not something i can control"
[20:18:17] Scient: and thats not a reason
[20:18:25] Spaceghostc2c: ddd: Not a bad idea.
[20:18:31] astronaute: Scient how it helps you if you don't want to save the file?
[20:18:38] Scient: its like "i dont like iphone making the "click" sound when locking it, it should be configurable"
[20:18:49] ddd: astronaute: that one little feature (or lack thereof because you don't want to be have to hit Ctl Z) doesn't make it a total peice of shit
[20:18:49] Scient: why would you not want to save a file? explain
[20:19:04] Scient: you cant delete a file thats autosaved and you dont need anymore?
[20:19:09] Scient: you cand use undo or local history?
[20:19:30] Scient: it offers more pros than cons, hence it has a good reason being there
[20:19:35] cableray: GoGoGarrett: Oh, and what is the gem name for the engine?
[20:20:11] ddd: Scient: actually completely flies in the face of the most common of requested features actually. VERY surprised over the venom he's generating, but ok, to each's own
[20:20:15] astronaute: Scient well if you always type everything at perfection, and prefere using the history when you don't, I cannot argue with you, I am unfortunately not perfect, I do mistakes and want to discard them without hitting CTRL-Z 20 times
[20:20:31] Scient: i use undo a lot
[20:20:36] Scient: i also delete files on a regular basis
[20:20:45] Scient: i rarely use local history, but there are times its really useful
[20:21:05] Scient: and i literally cannot imagine a situation where saving a file, even a temp one, would somehow have a negative effect
[20:21:10] ddd: hahaha, how does not agreeing with him suddenly mean you or i write perfect code?
[20:21:20] astronaute: Scient that's great, that why usually we have options for featuers that different users find useful
[20:21:21] parndt: ddd: you don't?!!?
[20:21:28] mlang: EDITOR WARS!
[20:21:32] ddd: parndt: off the hop?? rarely ;)
[20:21:35] astronaute: Scient my point being that I don't have the option that suits me
[20:21:35] dankest: Bad news guys, I am perfect.
[20:21:36] Scient: thats not the point
[20:21:38] Antiarc: I'm only slightly following this conversation, but...just don't use rubymine?
[20:21:47] parndt: yeah, Antiarc, I agree
[20:21:51] parndt: it's like, you have a choice, you know
[20:21:53] Scient: i fail to understand how not being able to turn it off has a negative effect on _anything_
[20:21:55] parndt: there are lots of options
[20:22:03] astronaute: Scient it is, I don't want the IDE to save my files without my permission to do so
[20:22:05] Antiarc: It doesn't bother me. It has line-by-line revert options to the last hard save.
[20:22:10] ddd: Antiarc: he agrees with that, he just thinks rubymine is an *utter* peice of crap because of that one 'feature'.
[20:22:14] Scient: right now the only issue i see is that you just want to control this feature "just because"
[20:22:17] Spaceghostc2c: Correct editor: Vim.
[20:22:17] lekima: Is anyone using Linode to deploy Rails app? Is is good?
[20:22:20] astronaute: Scient I want to save files myself, with CTRL S
[20:22:20] parndt: ddd: noobin aint easy
[20:22:22] Scient: i am correct it seems :)
[20:22:27] parndt: astronaute: you're on Windows?
[20:22:29] Spaceghostc2c: lekima: It's wonderful.
[20:22:30] Antiarc: ddd: Okay, that's a valid opinion. So he should use something else.
[20:22:31] helpa: http://linode.com - A hosting company that provides a box that you can install Ruby on Rails on to.
[20:22:33] mlang: Spaceghostc2c: Please. Notepad.
[20:22:43] Spaceghostc2c: mlang: Psh, that's a bit too immature.
[20:22:44] astronaute: parndt is it relevant?
[20:22:51] parndt: astronaute: no, just interesting ;-)
[20:22:57] astronaute: parndt are you homo?
[20:23:15] parndt: am I the same as what?
[20:23:26] mlang: Spaceghost|cloud: You're right.
[20:23:28] Spaceghostc2c: astronaute: He's a homosapien, yes.
[20:23:42] Spaceghostc2c: I think. Do gingers count as homos?
[20:24:05] ddd: Antiarc: opinion yes, fact no. we were really just initially trying to suss out more details. I don't think we're dogging him for saying its a peice of shit, more like saying that it was a heavily requested feature they implemented (similar to Numbrs, pages, and Mountain Lion's versioning capability) and we were trying to figure out why that made the *entirety* of the application a hunk of junk.
[20:24:07] parndt: Spaceghostc2c: it depends, that's a word with many different meanings depending on "actual meaning" and social convention
[20:24:17] astronaute: parndt of course I'm on windows surface
[20:24:57] Spaceghostc2c: astronaute: It's sad that you chose the way of the microsoft. I shall forgive you in time, but until then I will have my warrior clan pray for you fervently and without respite.
[20:25:01] mlang: I love the escalation here. CHAOS!
[20:25:02] cableray: whoa, suddenly way off topic. ;)
[20:25:04] ddd: Antiarc: but we did all agree that he should use something else if he wasn't willing to put in a feature request ticket, which he says he did. (can't find it but that doesn't mean he didn't)
[20:25:21] Spaceghostc2c: cableray: We get like that all the time. Go with the flow. :D
[20:25:22] mlang: ddd: You're using RM yourself, right?
[20:25:30] mlang: Okay, good :)
[20:25:38] astronaute: Antiarc I use something else, I was just explaining why I'll never use a Jetbraing product :)
[20:25:40] ddd: though I also bounce between vim and TextMate too
[20:25:40] Antiarc: I like rubymine, but I don't use it because its best features don't play well with my setup.
[20:25:45] ddd: I'm not dedicated to the IDE
[20:25:46] bricker: mlang: I remember my first time trying to program, I didn't know WTF was going on, I just opened notepad and copied some PHP into it, saved it as a .txt file and opened it in the browser, was shocked when it didn't work. That was in 1998 or something
[20:25:48] mlang: Yeah, it doesn't really matter what you use. For God's sake, you even can use Chocolat or whatever there is.
[20:25:51] aaronmcadam: anyone have any idea on why I need to use `rvm ruby` in order to get at my gems in a standalone file
[20:26:01] aaronmcadam: I know it's my PATH but how to fix it
[20:26:06] cableray: Spaceghostc2c: Usually when I'm here it'a all business.
[20:26:15] Spaceghostc2c: cableray: That's nice.
[20:26:17] aaronmcadam: PATH and file I'm trying to run are here: https://gist.github.com/4163911
[20:26:32] natte: if you don't like your IDE saving files without your permission, you should use git
[20:26:37] mlang: bricker: I feel you. I remember back in the days when I tried to write some windows bash and saved it in word.
[20:26:38] Spaceghostc2c: aaronmcadam: What's your problem?
[20:26:48] bricker: mlang: haha
[20:27:01] aaronmcadam: I can't run the file with just `ruby file.rb`, it can't find the gem
[20:27:18] aaronmcadam: and if I do run it with `rvm ruby file.rb` it runs twice
[20:27:30] mlang: bricker: Those where the days, when they teaches us how to program. on a sheet of paper.
[20:27:38] mlang: *teached*
[20:27:42] astronaute: Spaceghostc2c well windows is great if you don't have time to tweak your system at daily basis and want things to just work :)
[20:27:44] Spaceghostc2c: aaronmcadam: So are you sure that's a PATH problem and not a LOAD_PATH problem?
[20:27:49] parndt: mlang: that's how I learned
[20:27:54] parndt: paper programming ftw
[20:27:55] aaronmcadam: I'm just guessing
[20:27:56] Spaceghostc2c: astronaute: I disagree, but you're welcome to be wrong. :)
[20:28:03] mlang: parndt: Me too. in my Freshman Year in Uni, 2009.
[20:28:06] parndt: while loops were the best man
[20:28:07] mlang: No wait.. 2008!
[20:28:16] parndt: that was several pieces of paper
[20:28:23] parndt: as you traced state manually
[20:28:34] aaronmcadam: writing code on paper never made any sense to me haha
[20:28:42] parndt: astronaute: that's why most people use a mac, incidentally. Interesting.
[20:28:43] mlang: parndt: Bitch, please - 5 Boolean Statements on one line. THATS how you do it.
[20:29:08] Spaceghostc2c: If your code don't got no pipes, I don't know you.
[20:29:10] parndt: I always loved making up the ridiculously long flow charts too
[20:29:14] ddd: i do that. I write on paper and I bought a digital voice recorder for making notes and sometimes verbatim defining code :)
[20:29:15] cableray: Yah know, i would have thought asking for open source projects to contribute too would have generated a ton or responses from a channel like this.
[20:29:18] astronaute: parndt well I hate macs even more then jetbrains, I was talking about *nix :)
[20:29:39] Spaceghostc2c: astronaute: You are clearly misinformed about life, the unixverse and everything.
[20:29:57] Spaceghostc2c: cableray: Contribute to your own projects!
[20:30:06] ddd: parndt: hey don't be knockin flowcharts. They've helped me multiple times :)
[20:30:06] CoverSlide: the answer is 54
[20:30:06] aaronmcadam: Spaceghostc2c: any ideas on load_path?
[20:30:39] Spaceghostc2c: aaronmcadam: Have you checked if the gem is in your load path?
[20:30:39] parndt: ddd: I'm not knocking them ;)
[20:30:42] parndt: that's how I learned
[20:30:52] parndt: astronaute: does hating work out well for you, in life?
[20:30:59] Spaceghostc2c: aaronmcadam: ruby -e "puts $LOAD_PATH"
[20:31:01] parndt: (out of interest)
[20:31:03] tubbo: aaronmcadam: you need to be a bit more specific than that
[20:31:08] parndt: feel free not to answer.
[20:31:30] astronaute: parndt it is a friendly hate, as in "does not suits me" I love everything in life :)
[20:31:52] Spaceghostc2c: aaronmcadam: ruby -e "puts $:"
[20:31:54] parndt: so that you know, your actions say different
[20:32:16] astronaute: parndt my actions wow :)
[20:32:25] aaronmcadam: Spaceghostc2c: weird, it's not there
[20:32:42] astronaute: parndt are you on mac ? :)
[20:32:44] aaronmcadam: but I did install it globally
[20:32:48] Spaceghostc2c: astronaute: One who puts so much negative energy out into the world but claims he loves everything is a liar, either to himself or to the world at large.
[20:33:01] TylerE: Okay…next dumb question. I have a model with an after_save call back that downloads a file and attaches it to the object via paperclip. I can't actually save the object though or I get an infinite loop
[20:33:05] TylerE: so what the heck do I do?
[20:33:13] astronaute: Spaceghostc2c care to explain where you see negative energy?
[20:33:15] Spaceghostc2c: TylerE: before_save
[20:33:20] parndt: I'm not speaking to the mac/pc or editors discussion. It's based on your reactions to people asking simple questions
[20:33:32] parndt: ACTION is done on this offtopic
[20:33:42] Spaceghostc2c: astronaute: Not interested.
[20:33:42] TylerE: Spaceghost: That doesn't work for me. This us atually run via delayed_jobs so the model has to hit the db first
[20:33:45] aaronmcadam: this is weird
[20:34:07] bricker: TylerE: since you're using delayed_job, enqueue the callback
[20:34:13] astronaute: parndt this is how you perceived the thing maybe, I never meant to be mean to you so sorry
[20:34:41] TylerE: bricker: That's what I'm doing. But my callback ITSELF calls save again…which triggers another ound of callbacks ad infinutyn
[20:35:03] parndt: astronaute: check your answer when I asked if you were on Windows
[20:35:11] Spaceghostc2c: astronaute: I think your communication skills could use quite a lot of work.
[20:35:12] bricker: TylerE: why does the callback have to call save if you're just enqueuing something into DelayedJob?
[20:35:15] parndt: and while the answer to your question is "no" you would do well to not be offensive
[20:35:22] parndt: because you meant if offensively
[20:35:24] TylerE: bricker: the callback modifies the object
[20:35:25] latortuga: TylerE, maybe don't do it after_save? can you do it before_save?
[20:35:32] parndt: and that's unwelcome in the Ruby community
[20:35:40] TylerE: latortuga: before_save and delayed_job don't play nice
[20:35:47] astronaute: parndt I was just asking an equally irrelevant question, this is nothing mean, but I said sorry if you perceived it that way
[20:36:08] jwb010: does anyone know the solution to undefined less variables in the production environment? i feel like i have tried everything. on my server i see did have a proper compiled file once, but thats 2 hrs ago :(.
[20:36:12] latortuga: TylerE, I'm sorry?
[20:36:25] astronaute: Spaceghostc2c thank you, I appreciate you trying to help me and make the world better place
[20:36:32] latortuga: TylerE, oh you mean before it has been persisted?
[20:36:34] Spaceghostc2c: astronaute: Knowing the platform with which you use is kind of a relevant thing when you're in a development related channel...
[20:36:38] TylerE: latortuga: yea
[20:36:41] aaronmcadam: got it, I had to add it to bundler
[20:36:47] huoxito: Anyway ever had an issue where Haml is undefined in production only? Can't boot Rails in production while everything looks fine in development
[20:36:49] parndt: Spaceghostc2c: exactly, it helps to recommend good editors
[20:36:49] TylerE: let me explain what I'm really trying to do
[20:36:53] TylerE: might be a better approach
[20:36:56] latortuga: TylerE, there are ways to save to your model without triggering callbacks, use them
[20:36:57] Spaceghostc2c: Besides, ruby still kind of sucks a bit on windows.
[20:37:06] bricker: TylerE: Why does it modify the object, if you're just enqueuing into DelayedJob? That doesn't make any sense. It's like, `self.delay.attach_file` or whatever.
[20:37:08] TylerE: user creates object, with reference to a remote file
[20:37:12] bricker: latortuga: that's the smelliest of smells
[20:37:16] Spaceghostc2c: parndt: Sir, do you happen to know of a good place to acquire a lulzy?
[20:37:22] aaronmcadam: huoxito: you sure haml is listed outside group: development?
[20:37:36] TylerE: bricker: I'm attachign a file programitically using paperclip - if I don't then save the object again that attachment is lost
[20:37:42] parndt: Spaceghostc2c: :D
[20:37:48] latortuga: bricker, he's using a delayed job in a callback which will trigger the same callback, something's gotta give
[20:37:49] TylerE: bricker: In otherwords, my callback is actually doing work that needs to be persisted
[20:37:49] huoxito: aaronmcadam, actually it's a dependency of rails_admin, it's not in my gemfile
[20:38:09] huoxito: and it loads just fine in development
[20:38:12] aaronmcadam: ah, you'd think the engine would load that. sorry, just shooting for the obvious
[20:38:27] latortuga: TylerE, can you only enqueue the job if an attribute is set?
[20:38:38] havenn: astronaute: Here's a gem i cut this morning, will tell you what OS you're on. >.>: https://github.com/Havenwood/os-name
[20:38:43] bricker: TylerE: you need to refactor to figure out how to get it into a before_save callback. Saving without triggering callbacks is not a solution, it's a hacky workaround.
[20:38:44] astronaute: Spaceghostc2c I don't get it but anyway, I never meant to be mean, and still think that the plateform is irrelevant
[20:39:11] Spaceghostc2c: astronaute: And you're wrong that the platform is irrelevant, so if you continue to insist it is, I have nothing to say to you.
[20:39:46] aaronmcadam: What's the argument about platforms?
[20:39:46] TylerE: bricker: I'm just at a loss as to how to procede
[20:39:52] havenn: The platform you're on should be an icon next to your nick in irc.
[20:40:04] Spaceghostc2c: aaronmcadam: Some twit thinks that this channel is Java™
[20:40:07] astronaute: Spaceghostc2c talking about crossplatform editors, it is, but I get your point :)
[20:40:11] aaronmcadam: oh sweet jesus
[20:40:11] TylerE: bricker: I mean, I could just do it in the controller, but this will have an api attached to it eventually as well and I'm trying to keep my business logic in the model...
[20:40:14] mlang: Quick question: How to I remove the association of two objects without removing the object itself?
[20:40:15] Iszak_: I've got a polymorphic association, how can I join a specific type?
[20:40:16] latortuga: TylerE, in your before save, you have some check to see if you should be queueing the job, right?
[20:40:21] Spaceghostc2c: astronaute: The answer is Vim, move one.
[20:40:25] daniel__: how do i use twitter bootstrap with assets pipeline and not use a gem?
[20:40:37] aaronmcadam: It is funny how the IDE space is mostly powered by Java
[20:40:49] Spaceghostc2c: daniel__: Black magic.
[20:40:50] TylerE: latorouga: No, I cannot use a before_save. delayed_job CANNOT enqueue a job on a non-persisted object
[20:40:54] Spaceghostc2c: aaronmcadam: It's where it was born.
[20:40:59] latortuga: TylerE, I'm sorry, after_save
[20:41:07] jwb010: hey daniel___, im trying the same thing, just put the .less files in assets, and import bootstrap.less
[20:41:12] Spaceghostc2c: TylerE: SO USE A FUCKING HAS OF ATTRIBUTES AND ENQUEUE THE JOB
[20:41:20] aaronmcadam: the language as an IDE, or is the IDE the language
[20:41:23] jwb010: you might run into trouble once youre in production though
[20:41:32] astronaute: Spaceghostc2c FYI I code in a debian VM using vagrant, so I could use VIM, but I want an IDE with rails autocompletion which obviously doesn't exist so this whole discussion is useless maybe
[20:41:35] Spaceghostc2c: Instead of depending on saving it in the controller. Take the attributes and pass those into the background worker to persist the object.
[20:41:38] Spaceghostc2c: astronaute: Don't care.
[20:41:39] ddd: Scient: back to RubyMine, do you know of anyone keeps a central git or something of RM file templates? I was thinking of taking the time to update the templates that RM comes with now for like RSpec changes, and was going to make one of my own for the new respec-rails+capybara2 feature-scenario capabilities
[20:41:49] ddd: oops, wrong channel lol
[20:41:50] Scient: not that i know of
[20:41:51] Spaceghostc2c: astronaute: Also, vim has autocomplete stuff.
[20:41:53] aaronmcadam: jwb010 I'd probably symlink the files into vendor or something
[20:41:59] Scient: i have like one template i use all the time :P
[20:42:04] aaronmcadam: just watch an external directory
[20:42:20] daniel__: can i just included the less files in assets/stylesheets/bootstrap and then add that to application.css? or is that naive?
[20:42:21] latortuga: TylerE, after saving queue the job unless the file is setup properly?
[20:42:36] aaronmcadam: or just make my life easier and use bootstrap-sass
[20:42:37] Spaceghostc2c: daniel__: Any reason why using a railtie isn't good enough?
[20:42:38] ddd: ahh gotcha. i've been writing vim snippets and was going to move on to RM's template files.
[20:42:44] ddd: figured you might know a shared resource
[20:42:47] TylerE: you're missing the plot. That's what I'm doing. THe problem is my callback has to *itself* call save
[20:42:48] astronaute: Spaceghostc2c it is not an IDE, hey look let's say you are right about everything so you can stop answering without reading, because that is rude actually
[20:42:50] TylerE: and thus infinite loop
[20:43:07] daniel__: Spaceghostc2c: its annoying to customize
[20:43:26] Spaceghostc2c: daniel__: Why are you customizing it? That's a weird thing to do.
[20:43:39] Spaceghostc2c: Just override your app-specific stuff in your app, and keep the third-party stuff separate.
[20:43:48] Spaceghostc2c: TylerE: No, you're missing what I said.
[20:43:48] jwb010: daniel__, there is bootstrap.less, which imports all the bootstrap files, so you want to import that on into your application styles
[20:43:55] Spaceghostc2c: Don't save the object in the controller.
[20:44:03] daniel__: Spaceghostc2c: the idea of bootstrap is that it's a starting point
[20:44:04] latortuga: TylerE, why is it enqueuing the job the second time you call save?
[20:44:07] TylerE: I'm saving it the callback
[20:44:13] TylerE: because the callback is the after_save callback...
[20:44:14] jwb010: Spaceghostc2c, what if you do not want to use all the components?
[20:44:18] TylerE: thus when you save...
[20:44:21] Spaceghostc2c: Just pass the attributes without ever saving it into a background worker who does the image fetching before save.
[20:44:25] latortuga: TylerE, that's the point I'm making
[20:44:25] Spaceghostc2c: No save callbacks.
[20:44:43] latortuga: TylerE, write a method that only enqueues the job if whatever the job has to do hasn't been done
[20:44:43] Spaceghostc2c: I wouldn't vendor into the app, that is all.
[20:44:44] TylerE: soaceghost: the delayed worker gem I'm using requires a saved model
[20:44:51] Spaceghostc2c: TylerE: !autocomplete
[20:44:56] Spaceghostc2c: TylerE: Then it's a shit gem you're using.
[20:45:01] TylerE: it's delayed_job
[20:45:04] daniel__: jwb010: and it works just like that? i dont really understand why there are gems for this
[20:45:07] TylerE: I thought that was rather the standard?
[20:45:09] parndt: use sidekiq
[20:45:21] latortuga: TylerE, it works fine
[20:45:24] Spaceghostc2c: It's just a gem.
[20:45:26] bricker: TylerE: Show us some code if you want help, we're just guessing now
[20:45:36] parndt: TylerE: you could look into sidekiq
[20:45:44] parndt: wow ragequit
[20:46:01] Spaceghostc2c: I don't think delayed_job actually requires a saved model.
[20:46:04] aaronmcadam: aw you guys didn't write the code for him, tut tut
[20:46:18] Spaceghostc2c: It should just be able to enqueue the job with whatever object you pass it and define a worker to handle the work.
[20:46:21] jwb010: daniel__, guess one benefite would be that gems are easier to update?
[20:46:22] helpa: davidcelis is Spaceghostc2c
[20:46:24] smw_: hi all, does anyone know how to tell if I am using my entire passenger pool? I have PassengerMaxPoolSize = 40 and I want to know if requests are waiting
[20:46:35] foucist: !autocomplete
[20:46:45] helpa: If you type a few letters of another user's name and then press tab, if you have a proper client, it'll autocomplete towards their name. You might have to press tab more than once to get there though.
[20:46:46] helpa: If you type a few letters of another user's name and then press tab, if you have a proper client, it'll autocomplete towards their name. You might have to press tab more than once to get there though.
[20:46:46] davidcelis: !tabcomplete
[20:46:47] bricker: smw_: try `passenger-status` or `passenger-memory-stats`
[20:46:48] ddd: and gems are the easiest way to share blocks of code along with being easy to update
[20:46:56] Spaceghostc2c: The best way to use a passenger pool is to empty that pool and replace it with unicorns!
[20:47:04] davidcelis: and/or rainbows
[20:47:13] tubbo: what a fanboy
[20:47:29] davidcelis: Spaceghostc2c: tubbo
[20:47:45] tubbo: <Spaceghostc2c> The best way to use this tool that just came out is to replace it with a similar tool that already exists but is more difficult to set up
[20:47:48] tubbo: fixed 4 ya
[20:47:55] Spaceghostc2c: tubbo: Ah, yes, except fuck you. :D
[20:48:09] aaronmcadam: I had no problem setting up unicorn as a first timer
[20:48:12] smw_: bricker, awesome :-D
[20:48:18] Spaceghostc2c: It takes a bit of work, but it's superior.
[20:48:23] foucist: why fix it if it ain't broke?
[20:48:26] foucist: oh wait.. wrong channel
[20:48:32] parndt: Spaceghostc2c: tubbo: isn't that why the asset pipeline
[20:48:35] tubbo: foucist: it is broke. and yes, absolutely the wrong channel ;)
[20:48:40] Spaceghostc2c: parndt: Ain't dat so.
[20:48:42] tubbo: incidentally i'm somewhat puzzled as to where Puma's been all my life
[20:48:49] Spaceghostc2c: tubbo: In jruby land.
[20:48:54] Spaceghostc2c: Where it was born!
[20:49:03] foucist: tubbo: what isn't broke would be 'passenger', the fix would be unicorn or pumas or whatever
[20:49:13] tubbo: i mean the multithreaded thing is cool but it's got unicorn speeds and thin-like logs
[20:49:34] jwb010: i guess there are neater ways though daniel__ , like "symlink the files into vendor", guess thats also what these gems do
[20:49:36] aaronmcadam: ah shit, i gotta change right now! :p
[20:49:44] tubbo: foucist: passenger sucks if you like 0-downtime deploys and you don't like paying for your server.
[20:49:56] Spaceghostc2c: jwb010: They don't symlink, no.
[20:50:03] Antiarc: I'd like to use puma except for that whole GIL because I'm on MRI thing.
[20:50:05] Spaceghostc2c: They extend asset paths.
[20:50:08] Spaceghostc2c: Antiarc: LOLOLOL
[20:50:13] Spaceghostc2c: I mean.... oh. how sad.
[20:50:26] Antiarc: *shrug* it works for me. Unicorn's a champ.
[20:50:44] jwb010: Spaceghostc2c, i see, any idea though why less imports go wrong in production? its not really a bootstrap specific option
[20:50:48] jwb010: problem, sorry
[20:50:51] aaronmcadam: oh hey Antiarc, still loving Varnish? :p
[20:50:58] Spaceghostc2c: jwb010: I don't use less.
[20:51:23] aaronmcadam: jwb010: is there a reason why you don't want to use bootstrap-sass?
[20:51:43] Spaceghostc2c: aaronmcadam: Bad opinions!
[20:51:43] aaronmcadam: sorry, meant for daniel
[20:51:58] tubbo: Antiarc: boot times are a lot faster even on MRI. i use it in place of Thin as my dev app server
[20:52:12] Antiarc: tubbo: Yeah, I use it in both dev and prod. Works dandy.
[20:52:18] jwb010: well, not really, but id like to be able to import any less/sass file in my assets, not just bootstrap. once its in production the @imports dont seem to work anymore and i get undefined variable errors in my logs
[20:52:37] Spaceghostc2c: I, for one, don't value boot times. I value speed of runtime.
[20:52:47] aaronmcadam: you need to set it up in a specific way, jwb010
[20:52:59] tubbo: Spaceghostc2c: puma isn't slower than thin..
[20:53:01] aaronmcadam: so you can use vars anywhere
[20:53:27] Spaceghostc2c: tubbo: What does that have to do with the difference between cruby and jruby?
[20:54:23] tubbo: Spaceghostc2c: you were responding to my comment about how boot times were faster on MRI in a test btwn thin & puma?
[20:54:50] jwb010: aaronmcadam, its a file called frontend.less, it doesnt even precompile for some reason (doesnt end up in public/assets). locally it does. anyway, will have to keep trying i guess
[20:56:49] jacobat: Where can I read up on figuring out why my rails processes grow so much? Any good blog posts or something?
[20:56:58] jacobat: grow in terms of memory usage that is
[20:57:07] Spaceghostc2c: jacobat: Depends. Benchmark.
[20:57:09] bakis: can someone help me get a postgresql server working properly? i'm getting the "no password supplied" error when trying to run the server
[20:57:48] jacobat: Spaceghostc2c: How would newrelic help me? What I'm seeing is that over time the processes grow very large - like 500MB large
[20:57:55] jacobat: They start out at around 140MB
[20:58:01] bricker: jacobat: that sounds like a memory leak
[20:58:08] jacobat: bricker: Indeed
[20:58:12] bricker: jacobat: in your app, not in Rails
[20:58:19] parndt: how *wouldn't* new relic help you
[20:58:25] Spaceghostc2c: jacobat: BEcause it's fucking awesome.
[20:58:31] Spaceghostc2c: Have you not used newrelic before?
[20:58:38] jacobat: Spaceghostc2c: Yes, I have
[20:58:48] Spaceghostc2c: jacobat: Then how can you ask such a question?
[20:58:51] tubbo: jacobat: you can see *when* the processes grow very large, and then inspect those issues.
[20:59:02] jacobat: Spaceghostc2c: And I've got it running, I just can't see how I would use newrelic to figure out why my processes keeps growing
[20:59:19] jacobat: It seems I'm missing something obvious
[20:59:40] bakis: and i did the whole edit /etc/postgresql/9.1/main/pg_hba.conf to trust but it still doesn't work
[21:01:16] jacobat: tubbo: Sure I can see that at somewhere between 6 and 7 it gres larger, but how does that help me?
[21:01:22] jacobat: gres -> grew
[21:01:31] tubbo: jacobat: check the logs, what happened during that time?
[21:01:42] Spaceghostc2c: Every request generates lots of objects in rails.
[21:01:43] jacobat: tubbo: Very much happened during that time
[21:01:44] parndt: like someone probably hit an exotic URL
[21:01:51] parndt: and that exotic URL opened a DB query
[21:01:54] parndt: and that DB query never finished
[21:01:56] parndt: something like that
[21:01:58] tubbo: that could be it
[21:02:07] parndt: or you used .includes() on a query where you really, really didn't want to
[21:02:07] tubbo: check if there are any user connections on your DB
[21:02:42] tubbo: jacobat: look at the top queries by time, see if any of the ones on the list were called btwn 6-7
[21:03:56] parndt: these are things that have caused the same for me in the past
[21:04:04] jacobat: I'll go investigate
[21:04:45] jacobat: parndt: Shouldn't queries with big includes get garbage collected though?
[21:04:56] parndt: hopefully
[21:04:59] parndt: if they finish
[21:05:17] parndt: it's probably something else if your DB isn't still locked
[21:06:32] jacobat: Wouldn't Rails kill of those kinds of things when the request ends?
[21:07:33] smw_: passenger question: What is wrong with these stats? http://fpaste.org/8sgM/
[21:07:35] jacobat: I mean terminate the query? Instead of leaving it hanging and continually sucking up memory?
[21:07:45] smw_: 26 active but 124 waiting?
[21:07:46] parndt: rails can't
[21:07:54] parndt: it's request based
[21:08:08] smw_: I have 16 inactive processes and 124 in the queue
[21:08:54] ddd: hrmm, isn't there a way to tell the GC to run more often?
[21:09:09] ddd: not sure if that would help in this but..
[21:09:20] tubbo: jacobat: if the query was already sent to the DB, it's the DB's responsibility to terminate that query. no longer in Rails' hands...
[21:09:47] ddd: could check out something like http://snaprails.tumblr.com/post/241746095/rubys-gc-configuration
[21:09:54] jacobat: tubbo: It is in Rails hands to stop allocating memory for the result of the query thoguh
[21:10:14] ddd: older but might be able to play with the settings
[21:10:18] jacobat: Anyways, I doubt that it's a long running query, I just checked the postgres console and I can't see any long running queries
[21:10:36] tubbo: ddd: still works. i have custom settings in my zshenv
[21:11:17] ddd: yeah I have them too, just I set them when I wasn't coding rails stuff. Not sure how well they play with rails
[21:11:43] bricker: jacobat: I don't think a query would quadruple the size of the process anyways
[21:12:01] ddd: something else to look at i just found cruising google http://www.railsknowledge.com/2012/09/memory-management-in-ruby.html
[21:12:09] Antiarc: RUBY_HEAP_SLOTS_INCREMENT and RUBY_HEAP_SLOTS_GROWTH_FACTOR don't do anything in 1.9
[21:12:10] ddd: but that covers rails 2
[21:12:15] Antiarc: and RUBY_HEAP_FREE_MIN is RUBY_FREE_MIN in 1.9
[21:12:20] bricker: STOP YELLING
[21:12:26] jacobat: bricker: Right
[21:12:54] parndt: bricker: constantly yelling amirite
[21:13:02] Spaceghostc2c: WHAT IS WITH ALL THE YELLING IN HERE?
[21:14:42] tubbo: RAILS_IS_EXCITING!
[21:14:54] slash_nick: I'M USING A NORMAL VOICE... EVERYONE ELSE IS WHISPERING
[21:15:48] smw_: With passenger, I have 16 inactive processes and 124 in the global queue. How does that happen?
[21:16:08] smw_: I also have a max of 40 and a count of 42...
[21:16:35] smw_: oh great, looking again I have more inactive than active. A queue of 128
[21:16:52] bricker: smw_: nginx or apache
[21:17:49] smw_: bricker, http://fpaste.org/R57E/
[21:17:59] bricker: smw_: did you set max_pool_size?
[21:18:00] smw_: bricker, these numbers are illogical
[21:18:03] smw_: yes I did
[21:18:10] bricker: maybe max_instances_per_app?
[21:18:11] smw_: the current count is 42...
[21:18:19] bricker: max requests?
[21:18:26] bricker: oh wait that's different
[21:18:52] smw_: bricker, PassengerMinInstances 20
[21:18:52] smw_: PassengerMaxPoolSize 40
[21:19:36] bricker: smw_: if you sighup apache, it should restart passenger as well - does the problem still occur?
[21:20:37] smw_: bricker, sudo kill -hup 24283, right?
[21:21:00] bricker: /etc/init.d/httpd restart will probably work too
[21:21:07] bricker: assuming you're on that kind of platform
[21:21:17] smw_: heh, wasn't sure the init restart did a hup :-)
[21:21:57] smw_: bricker, same problems
[21:22:38] smw_: bricker, http://fpaste.org/KQZq/
[21:23:18] Spaceghostc2c: Good riddance!
[21:23:24] bricker: smw_: weird, maybe it's apache that is causing the problem
[21:23:52] smw_: bricker, any idea on what I should do to debug?
[21:23:59] smw_: why would they be inactive?
[21:24:09] smw_: why would count exceed max?
[21:24:54] gaffo: can anyone recommend a good gem / patch that lets me diff / do equals on json regardless of hash order? also not care about :sym vs strings?
[21:26:47] Radar: gaffo: .symbolize_keys
[21:33:13] cableray: isn't stringify_keys better to avoid memory leaks?
[21:33:48] bricker: cableray: why would that method avoid memory leaks
[21:34:24] ryanf: because symbols don't get garbage-collected
[21:34:25] Antiarc: because strings get GC'd, symbols don't
[21:34:33] Antiarc: symbolizing arbitrary content is a memory leak vector
[21:34:35] bricker: oh I didn't know that
[21:34:39] cableray: anytime you make a symbol, it adds it to a persistent table in memory. strings get garbage collected, sumbols never do.
[21:34:57] Spaceghostc2c: But surely your keys aren't super non-unique.
[21:35:06] ryanf: if it's json that's provided by users
[21:35:24] dankest: What exactly does rake db:test:prepare do?
[21:35:36] Spaceghostc2c: dankest: !rtfs
[21:35:38] bricker: dankest: copies the schema into the test db
[21:35:41] helpa: dankest: I believe you will find the answer to that question in the documentation, good Sir or Madam.
[21:35:41] Spaceghostc2c: dankest: !rtfm
[21:35:45] dankest: bricker: thanks
[21:35:46] davidcelis: GC.collect_symbols!
[21:36:02] dankest: bricker: that's what I figured, but my tests were acting really funny
[21:36:09] cableray: davidcelis: really?
[21:36:17] davidcelis: cableray: try it
[21:36:47] bricker: dankest: like, eddie murphy funny, or like, nikki minaj funny
[21:37:08] dankest: bricker: Jim Carrey funny.
[21:37:14] erichmenge: dankest: That's terrible.
[21:37:16] bricker: that's the worst
[21:37:20] Spaceghostc2c: Or drowning kittens funny?
[21:37:25] dankest: Spaceghostc2c: nailed it.
[21:37:28] davidcelis: def memory_lol() 1.upto(1_000_000_000) { |x| x.to_sym } end
[21:37:32] ddd: hah i love JimM Carey
[21:37:38] bricker: davidcelis: makes sense
[21:37:38] ddd: funny funny boy there
[21:37:46] davidcelis: to_s.to_sym*
[21:37:51] dankest: ddd: I loved him in like, Ace Ventura and Dumb & Dumber
[21:38:01] ddd: The Mask
[21:38:05] dankest: Spotless mind was pretty good too, but not laughy
[21:38:09] dankest: oh yeah, Mask was awesome
[21:38:13] erichmenge: dankest: Spotless mind wasn't a comedy!?
[21:38:16] davidcelis: spotless mind was hilarious
[21:38:18] ddd: he also made an awesome Grinch
[21:38:24] bricker: dankest: it's always under "Comedies" on Netflix, never understood that (spotless mind)
[21:38:25] dankest: was it? I no loled
[21:38:34] parndt: bricker: the comedy is people watch it
[21:38:34] davidcelis: dankest: you didn't get it, then
[21:38:35] bricker: davidcelis: *
[21:38:35] dankest: bricker: yeah, I think it's just because of Carrey
[21:38:56] davidcelis: parndt: ಠ_ಠ
[21:39:09] erichmenge: (ノಠ益ಠ)ノ彡┻━┻
[21:39:19] erichmenge: I stole that from parndt. I love it.
[21:39:33] parndt: I took it from helpa
[21:39:37] erichmenge: Helpa has it?
[21:39:42] helpa: Just the tips: http://logs.ryanbigg.com/tips
[21:40:17] erichmenge: ! jesusatthetemple
[21:40:40] Spaceghostc2c: Fuck you helpa .
[21:40:48] helpa: Spaceghostc2c: (ノಠ益ಠ)ノ彡┻━┻
[21:40:48] erichmenge: Spaceghostc2c: !table
[21:41:01] erichmenge: why doesn't jesusatthetemple work...
[21:41:18] parndt: erichmenge: the space after the bang?
[21:41:26] erichmenge: parndt: lol.
[21:41:28] helpa: ┻━┻ ︵ヽ(°Д°)ノ︵ ┻━┻
[21:41:28] Spaceghostc2c: !jesusatthetemple
[21:41:33] xargoon: where does logic like emailing a user for some action belong, or actions coordinating multiple models? controller? model? should i add a service layer between the controller and models?
[21:41:42] erichmenge: parndt: I copy pasted ;)
[21:41:54] xargoon: does anybody actually implement service layers in rails?
[21:42:13] helpa: YOUR HEAD ASPLODE!
[21:42:44] cableray: davidcelis: GC doesn't have a collect_symbols method in 1.9.2-p180 irb
[21:43:03] Spaceghostc2c: davidcelis: Which rubeh were you using?
[21:44:07] ddd: even under 1.9.3-p327 it doesn't know anything about collect_symbols
[21:44:15] dangerousdave: Getting "The single-table inheritance mechanism failed to locate the subclass: 'ExtendedShop'" I am trying to use STI, the correct class name is in the type column, and is capitalised. The class ExtendedShop exists, and inherits off shop. What else can i check?
[21:44:18] davidcelis: guys i made it up
[21:44:27] davidcelis: (but not really)
[21:44:34] davidcelis: ((i mean i did make it up, i'm just not really sorry))
[21:44:46] Spaceghostc2c: davidcelis: 2.0.1 :D
[21:45:08] davidcelis: Spaceghostc2c: ᶘノᵒᴥᵒ ᶅノ彡┻━┻
[21:45:25] skyjumper: dangerousdave: does ExtendedShop inherit from the class that's associated with the table?
[21:45:39] dangerousdave: skyjumper: yep
[21:46:25] cableray: how would a an algorithm to gc symbols even work?
[21:46:41] ddd: rvm use jruby-1.7.0@global && rvm docs generate all
[21:47:09] davidcelis: cableray: it wouldn't
[21:47:25] ofcan: anyone here implemented check-in like model in rails? Not actual check-in with smartphone, but something like virtual check-in? Where you check-in/out via clicking a button? I am just wondering how to measure the total time user has been 'checked-in' in a place?
[21:47:25] davidcelis: the object_ids of symbols are important, they can't be GCed
[21:47:28] dangerousdave: skyjumper: fixed, forgot .rb off end of model file, doh
[21:47:49] cableray: davidcelis: that's what I thought, but maybe if you implemented symbols differently than in a table you could figure something out.
[21:48:03] davidcelis: ofcan: CheckIn(in:datetime, out:datetime, user_id:integer)
[21:48:37] dangerousdave: ofcan: record time when checking in and checking out
[21:48:57] davidcelis: cableray: the lookup table isn't why they can't be GC'd, it's the need to track their object_ids and then never touch them
[21:49:05] ofcan: davidcelis: ok, but when the user checks out - do I destroy that record? that check in?
[21:49:08] davidcelis: doesn't matter how the symbol lookups are stored, they can't be baleeted
[21:49:09] cableray: although exploring the phantom collect_symbols method I stumbled on a curiosity: how do you check if a symbol exists already?
[21:49:20] davidcelis: ofcan: you still need the check out time.
[21:49:30] doug: hm, is an "A tag" synonymous with an "anchor?"
[21:49:36] doug: i figure <A NAME="here"> is an "anchor," what about <A HREF="#here" /> ?
[21:49:49] ddd: doug: the second is not the first
[21:50:09] ddd: the first is a link creation. the #blah in the second is the actual anchor
[21:50:21] parndt: they're both anchor tags what
[21:50:24] doug: a "link creation?"
[21:50:25] parndt: but don't use capitals
[21:50:32] davidcelis: cableray: Symbol.all_symbols
[21:50:46] ofcan: davidcelis: ok, so the principle is > on the first check in create CheckIn model between User and Place, than on check-out, just log the datetime?
[21:50:50] ddd: hah! i read that too fast
[21:51:05] davidcelis: cableray: Symbol.all_symbols.map(&:to_s).include?("cableray")
[21:51:11] ddd: I saw A NAME as a href for some psychopathic reason
[21:51:22] cableray: If you do Symbol.all_symbols.include? :symbol_to_find, it always works, because it makes the symbol to find it.
[21:51:32] cableray: oh, yeah, map to string first.
[21:51:34] ddd: ACTION fades to black taking his mouth with him
[21:51:35] davidcelis: cableray: hence the #map bro
[21:51:50] doug: i only use capitals because all the rest of the code is in COBOL
[21:53:40] cableray: Does a string object exist with all symbols, or is it stored differently?
[21:54:18] tbuehlmann: cableray, say what?
[21:54:32] maodun: I'm getting this error: https://gist.github.com/a7a655b89c40f8088879
[21:54:51] maodun: Ruby says it can't find the openssl file, but it's definitely there
[21:55:03] cableray: or rather, does symbol.to_s create a string from scratch or provide a string that is stored as an instance variable or something like that?
[21:55:06] maodun: I followed the instructions here: http://askubuntu.com/questions/134806/cannot-load-such-file-openssl-when-running-bundle
[21:55:14] maodun: What am I doing wrong?
[21:55:24] davidcelis: cableray: it creates a string
[21:55:25] doug: w3 seems to think they are *both* "anchors:" http://www.w3.org/History/19921103-hypertext/hypertext/WWW/Terms.html
[21:55:33] davidcelis: cableray: strings are just created and garbage collected
[21:55:37] doug: w3c, that is...
[21:55:58] davidcelis: cableray: referencing a symbol checks the lookup table and, if no Symbol is found, initializes a frozen string and shoves it in the table
[21:56:09] davidcelis: (symbols are just frozen strings under the hood)
[21:56:10] cableray: maodun: openssl just hates you. that's all.
[21:56:29] maodun: cableray: :(
[21:56:53] cableray: davidcelis: ok, that's what I was wondering.
[21:57:10] cableray: maodun: don't worry, it hates me too.
[21:57:57] davidcelis: maodun: which instructions? the RVM ones?
[21:58:05] cableray: maodun: how did you compile ruby / what's your platform?
[21:58:51] maodun: davidcelis: yes, the rvm ones
[21:59:11] maodun: cableray: on centos 5.5, compiled ruby via rvm
[21:59:23] davidcelis: maodun: do you have SSL cert files installed?
[21:59:54] maodun: davidcelis: i'm not sure.
[22:00:06] maodun: how would I tell?
[22:01:32] davidcelis: maodun: i dunno what kind of package manager centos uses
[22:01:35] maodun: davidcelis: I did get this message after 'rvm pkg install openssl': Updating openssl certificates
[22:01:47] davidcelis: well then, you probably do
[22:01:54] maodun: davidcelis: it uses yum, but i installed openssl via rvm
[22:02:13] maodun: since centos 5.5's openssl is apparently too old
[22:02:39] danneu: man, i'm trying to like the jvm but it's hard to go from Bundler to sbt. it's making my nose bleed.
[22:02:56] danneu: i don't know how people do it
[22:03:45] jacobat: Today I learned: memory will not be released to the os once it's allocated, that explains a lot
[22:04:35] Antiarc: jacobat: Ruby 1.9 can free unused heaps
[22:04:40] GeekOnCoffee: not in the jvm
[22:05:02] jacobat: Antiarc: I'm not sure what goes on the heap
[22:05:08] Antiarc: jacobat: Everything :)
[22:05:16] jacobat: Antiarc: So how can you get it to free heaps?
[22:05:53] Antiarc: jacobat: It'll attempt to free unused heaps after it finishes a GC sweep
[22:06:18] jacobat: Antiarc: As far as I can tell it does not release the memory to the OS though
[22:06:39] Antiarc: It most certainly does
[22:06:59] Antiarc: after_gc_sweep -> free_unused_heaps -> aligned_free -> free(ptr)
[22:07:43] Antiarc: Memory used by GC'd objects isn't immediately freed. It's only returned to the OS if the entire heap is freed.
[22:08:07] Antiarc: Ruby manages multiple heaps, each larger than the last, based on how many live objects your app has and how many it cleans up in a GC pass
[22:09:08] jacobat: Antiarc: Is there a way to force the release then?
[22:09:21] Antiarc: Not sure what you mean?
[22:09:25] jacobat: GC.start does not seem to cut it
[22:09:45] jacobat: Antiarc: https://gist.github.com/4165023
[22:10:29] cableray: Apparently it's garbage collection hour.
[22:10:41] Antiarc: Well, there are two things in play -
[22:10:53] GeekOnCoffee: GC.start isn't going to free up memory the JVM has claimed for its own
[22:11:06] jacobat: GeekOnCoffee: This is MRI 1.9.3
[22:11:10] Antiarc: Wait, are we talking about jruby?
[22:11:22] tbuehlmann: isn't GC.start disabled in jruby?
[22:13:24] Antiarc: jacobat: (Not ignoring you, just double checking what I believe to be true against the ruby source)
[22:13:47] jacobat: Antiarc: Reading the source? Isn't that like cheating? ;)
[22:13:58] jacobat: (I wish I knew how to read the Ruby source)
[22:14:02] Antiarc: It's just C :)
[22:15:10] jacobat: Antiarc: This post claims that it's not possible: http://www.ruby-forum.com/topic/217490#943730
[22:15:31] Antiarc: Correct. There is no "hard" way to say "Ruby, let go of that"
[22:15:38] Antiarc: You can say "I'm done using this, collect it when you feel like it"
[22:15:46] Antiarc: But the actual mechanics of when free() is called are left up to the GC
[22:15:49] jacobat: Sorry, that's not the one
[22:16:07] jacobat: This is the one http://www.ruby-forum.com/topic/217490#943734
[22:16:27] jacobat: Though it's old so it might have changed
[22:16:41] ofcan: davidcelis: what datatype should I use to calculate total time spend checked-in in one location? Datetime or timestamp?
[22:16:43] Antiarc: That's not true as of 1.9 anymore
[22:16:51] Antiarc: In 1.8, a heap, once allocated, was forever allocated
[22:16:56] Antiarc: 1.9 will deallocate unused heaps now
[22:17:18] Antiarc: Which means you can potentially get into a boundary condition where you're allocating/deallocating heaps frequently if you're generating and collecting a ton of garbage per pass
[22:17:31] jacobat: Interesting
[22:17:56] Antiarc: (I'm working on a post about all of this, FWIW. Just haven't had time this week to finish it.)
[22:18:21] jacobat: That would be interesting to read
[22:19:55] ner0x: Are there any reasons the 1.9.1 ruby wouldn't be sufficient for a rails app? (Ubuntu build)
[22:21:49] jacobat: ner0x: http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/ "Under no circumstance should you install Ruby, Rubygems or any Ruby-related packages from apt-get."
[22:22:13] ner0x: jacobat: Thank you. I'll read that
[22:22:41] ner0x: I assume building my own would be fine.
[22:25:02] jsmonkey: hi, have anyone done single page apps in rails particial with angular but otherwise as well. how do I best serve the templates? I don't want to be adding routes for each new view. So then I thought of public. But then I saw someone using the asset/template dir what is that about?
[22:26:31] jacobat: jsmonkey: https://github.com/sstephenson/sprockets#javascript-templating-with-ejs-and-eco
[22:27:31] jsmonkey: jacobat: can I just serve ordiany html pages as well?
[22:27:38] jsmonkey: my angular views is just plain html pages
[22:27:41] Antiarc: jacobat: So there are two things happening. One, you have obj_free() which is responsible for freeing the memory for an object which occupies a given heap slot which has been marked for collection. T_STRING values have some stuff going on with their flags that may potentially make them ineligible for freeing in your benchmark there, but I haven't quite sussed out where those flags are set.
[22:27:49] jacobat: jsmonkey: Sure
[22:27:58] jsmonkey: jacobat: what gem for that?
[22:28:10] jacobat: jsmonkey: I don't think you'll need a gem for that
[22:28:20] jsmonkey: but how will I acess them?
[22:28:23] Antiarc: The second thing is your heap allocations. Ruby allocates "heaps", where each heap is basically a memory area for a list of pointers to other objects (each pointer being a "heap slot", much like the C heap)
[22:28:29] jsmonkey: do I need to create routes, add templates folder somwhere?
[22:28:30] jacobat: jsmonkey: A plain HTML template is just a special case of an ejs template
[22:28:48] Antiarc: If you have no references to any objects in a heap, Ruby may now deallocate that heap. There is no way to force that, though. You just have to let the GC do it when it decides it wants to.
[22:29:28] jacobat: jsmonkey: You need to do what the link I pasted tells you to
[22:29:41] jsmonkey: jacobat: say I have a main.html in app/assets/javascripts/templates and have added ./templates to application.js
[22:29:42] jacobat: jsmonkey: That is require the template somewhere in your application.js
[22:29:55] jsmonkey: jacobat: ah okey
[22:30:24] jacobat: Antiarc: I'm seeing the same with loading a set of activerecords though
[22:30:37] jacobat: Antiarc: So basically I can just wait until Ruby decides it wants to free stuff
[22:30:48] apeiros_: anybody else who thinks `config.action_controller.include_all_helpers = true` is a horrible default?
[22:31:02] Antiarc: Yup. You can invoke GC.start to tell it to perform a GC pass, but depending on object flags and references and whatnot you may not get things cleaned up like you expect.
[22:31:06] jacobat: apeiros_: helpers are a horrible default ;)
[22:31:29] Radar: Oops, wrong channel. But whatever.
[22:31:51] jacobat: Antiarc: "users = User.all; users = nil" will increase memory by 100MB… and it doesn't seem to get freed
[22:32:01] apeiros_: jacobat: different dimension of the problem, but yeah, I think I concur.
[22:32:17] Antiarc: Even if you GC.start?
[22:32:21] jacobat: Antiarc: Yup
[22:32:35] Antiarc: Are you super ultra mega positive there are no references to any of those objects anywhere?
[22:32:47] jacobat: Antiarc: This is in a clean rails console
[22:33:10] jacobat: Antiarc: So at least no references that I hold onto
[22:33:14] Antiarc: Right, but the models themselves might be sticking references into places that keep things from being marked for GC
[22:33:44] jacobat: Except: ObjectSpace.each_object(ActiveRecord::Base).count => 0
[22:33:49] Antiarc: Look at ObjectSpace.count_objects before and after a GC pass
[22:34:15] Antiarc: Okay, so that's probably just a heap allocation that isn't being deallocated because there are still objects free in it. Are you using custom GC tuning params?
[22:34:54] Antiarc: hm, you shouldn't be getting huge objects then.
[22:35:03] ryanf: apeiros_: yes and no
[22:35:20] Antiarc: well, you can become a ninja and use gdb to figure out where that memory is allocated :)
[22:35:22] ryanf: the thing about helpers is that dividing them up by controller is still kind of crappy, because partials can get rendered from different controllers
[22:35:24] apeiros_: ryanf: conclusive answer :D
[22:35:36] apeiros_: ryanf: you can still manually add them
[22:35:37] Antiarc: But my guess is it's a heap that Ruby's keeping around because it thinks you need room for those objects.
[22:36:19] jacobat: Antiarc: I guess I'll just have to go fix the places that loads all those activerecords :)
[22:36:35] Antiarc: jacobat: Use find_each rather than .all or whatnot
[22:36:44] jacobat: Antiarc: Indeed
[22:37:16] Antiarc: That'll instantiate one record at a time rather than all of them at once, which means that when the GC runs it can clean up a few objects at a time, rather than having to allocate a whole new heap to hold those 100k objects or whatnot.
[22:39:31] ryanf: apeiros_: yeah, I agree that it would be better still
[22:39:41] ryanf: I wonder why they made that change?
[22:39:58] apeiros_: it wasn't really a change
[22:40:05] apeiros_: only the way all helpers got added changed
[22:40:15] ryanf: didn't rails 2 default to not including everything?
[22:40:16] apeiros_: before it was `helper :all` in the ApplicationController.
[22:41:52] ner0x: So on a production box, can you build ruby and just put it in a ~/.rubies/@version dir and add it to the path?
[22:42:27] tubbo: ner0x: typically, production boxes only have 1 version of Ruby…no need for RVM
[22:42:33] tubbo: but yeah, you can do that
[22:42:37] davidcelis: plenty of people run RVM in production
[22:42:49] Antiarc: I use rvm in production because I don't plan on using one ruby in perpetuity
[22:42:56] Antiarc: upgrades and all.
[22:43:05] Antiarc: Nice to have both envs to switch between in case I need to roll back or whatnot.
[22:43:17] tubbo: yeah definitely
[22:43:30] jacobat: I prefer to start a new server if a new ruby is warranted
[22:46:30] parndt: well that's one way of doing it
[22:46:58] graft: yo - so i have some stuff that is added to my path in /etc/profile.d/, but it doesn't seem to get picked up by apache/passenger - what do i do?
[22:47:31] davidcelis: graft: that would probably need to be in the PATH of whatever user is running apache/passenger
[22:47:42] davidcelis: erichmenge: ಠ_ಠ wut
[22:47:46] graft: davidcelis: well, yes, but how do i do this?
[22:47:54] davidcelis: graft: what user is running it?
[22:47:55] erichmenge: davidcelis: I had to download Textual to test it.
[22:48:00] davidcelis: graft: and why not just use the full path?
[22:48:22] davidcelis: like i don't add /etc/init.d/ to my PATH, i just call /etc/init.d/nginx restart
[22:48:41] graft: davidcelis: kind of negates the point of PATH, doesn't it?
[22:49:09] davidcelis: i'd rather not munge around with the PATH of, say, root
[22:49:13] graft: davidcelis: also the program in question is being called by a gem
[22:49:20] graft: well, i'm not running as root, i'm running as apache
[22:49:35] davidcelis: then, by all means, edit the apache user's PATH
[22:49:53] graft: well, i thought having an entry in /etc/profile.d/ would suffice, but it apparently doesn't
[22:50:02] graft: so how do i edit the apache user's path?
[22:50:13] davidcelis: same way you edit any user's PATH, their profile file
[22:50:17] graft: this is probably not a rails question
[22:50:23] davidcelis: it isn't, it's a UNIX question ;)
[22:50:39] davidcelis: edit the .bash_profile file in apache's home directory
[22:50:39] graft: the apache user has no home dir and no profile file
[22:50:43] davidcelis: give it a home dir
[22:50:50] graft: that seems wrong to me
[22:50:59] davidcelis: not if you want to give it an environment
[22:51:07] davidcelis: otherwise just use full filepaths
[22:52:32] jacobat: graft: http://blog.phusion.nl/2008/12/16/passing-environment-variables-to-ruby-from-phusion-passenger/
[22:53:12] davidcelis: oh; yeah i guess that works too lolol
[22:55:55] graft: i guess i could do it in rails, that seems ugly if it's a machine-specific problem... SetEnv PATH doesn't allow me to append to an existing path
[22:57:02] graft: apparently i can do this via /etc/sysconfig/httpd in centos
[22:59:14] graft: now my only issue is that the urls in stylesheets are wrong
[23:00:10] graft: is there a safer alternative to url(/assets/blah.png) in /assets/stylesheets/foo.css.scss?
[23:01:32] bricker: graft: "safer"?
[23:01:34] davidcelis: asset-url() ?
[23:03:22] graft: asset-url, eh?
[23:03:41] jacobat: graft: http://guides.rubyonrails.org/asset_pipeline.html#coding-links-to-assets
[23:04:06] graft: jacobat: ah, nice
[23:09:42] matenia: Hi All, I have some awesome dynamic whitelabelling view inheritance stuff (triggered by subdomain) working using the following setup: https://gist.github.com/4143196 I was just wondering if anyone can point me in the right direction to write some rspec tests to make sure this is working and rendering the correct 'overridden' views / layouts. Are they view / controller / request specs?
[23:12:12] libryder: can anyone think of a way to pull a .where query that will only pull 1 record per day? i don't know if i'm explaining this well
[23:12:40] libryder: it might return 50 results but i only want results from a particular day once
[23:13:08] bricker: libryder: use DISTINCT or do it with some good old fashioned Ruby
[23:14:36] libryder: it looks like distinct will only work with exact matches
[23:15:01] libryder: i'm thinking ruby, just don't know the best way to go about it
[23:15:34] Radar: libryder: http://github.com/radar/by_star => Model.by_day(<date goes here>).first
[23:15:44] bricker: libryder: You'd have to typecast it into a DATE or something, I forget
[23:15:59] bricker: oh look Radar already solved this problem :P
[23:16:08] Radar: magically
[23:16:22] Radar: You may also like http://github.com/radar/humanize and http://github.com/radar/dotiw.
[23:18:04] libryder: Radar: i want to find all dates but i don't want any 2 records to fall on the same day
[23:18:29] Radar: libryder: So you want a list of all dates that records happen on?
[23:19:16] Antiarc: Sounds like distinct or group by to me.
[23:20:01] libryder: it's for a series chart where each date might have more than 1 data points, but for the sake of the chart, i only want to show the latest data point for each day
[23:20:07] graft: cool, seems to be working! thanks for your help, everyone
[23:23:11] libryder: Radar: right
[23:23:37] libryder: Antiarc: the points that fall on the same date won't have the same timestamp. just the same day
[23:24:07] Antiarc: If you're using MySQL you can use the DATE() function.
[23:24:18] Antiarc: select distinct DATE(created_at) from widgets;
[23:24:41] Antiarc: (warning, full table scan)
[23:24:56] libryder: ok i'll try that
[23:25:10] libryder: that would be pretty magical
[23:25:13] Antiarc: or group by DATE(created_at) would work as well.
[23:25:27] Antiarc: But again, full table scan, expect performance to suck ass if you have any appreciable number of records in the table.
[23:26:57] libryder: well, it definitely worked
[23:27:49] cableray: so I'm planning on building an app that is api based, basically a one page ajax app. some things I want to do on this are use push state, and responses will always serve the same static page, except for some pre-loaded json data. I was also planning on using gate keeper to manage authentication. Couple questions: does this sound sane and advisable, and how do I use gatekeeper to authenticate my front-end, especially
[23:27:49] cableray: is it different than third-party app use?
[23:27:50] libryder: thanks Antiarc
[23:29:40] mlang: cableray: Backbone-on-rails?
[23:30:04] erichmenge: That sounds painful.
[23:30:08] cableray: mlang: basically
[23:30:30] mlang: cableray: Doable. Backbone-On-Rails is not bad, ToughtBot has a great book on that.
[23:30:34] cableray: with preloading of json.
[23:30:35] Spaceghostc2c: erichmenge: Hawt.
[23:30:46] erichmenge: Spaceghostc2c: ?
[23:31:52] cableray: mlang: any gems I should look at?
[23:34:28] mlang: cableray: https://github.com/meleyal/backbone-on-rails
[23:34:44] mlang: And https://learn.thoughtbot.com/products/1-backbone-js-on-rails
[23:35:15] Spaceghostc2c: mlang: Were you the bro doing that backbone on rails stuff?
[23:35:21] davidcelis: +1 on backbone, or if you don't want to use a client-side MVC framework, write your rails app as per usual and implement PJAX or turbolinks
[23:35:47] Spaceghostc2c: I prefer not using either!
[23:35:57] mlang: Spaceghostc2c: No, I'm the Bro who's still learning.
[23:36:08] Spaceghostc2c: Keep on learnin'
[23:36:58] mlang: Spaceghostc2c: yeah.. Problem: Got hired as an intern, Mentor left, now I'm alone doing the entire dev work.
[23:37:08] hiall: Can I create a new rails app with rails 4?
[23:37:53] Axsuul: Can someone please recommend me a AB test gem?
[23:38:54] jarib: Axsuul: i haven't used it, but chili looks pretty sweet http://balvig.github.com/chili/
[23:39:02] ofcan: is there some plugin that determines your location based on your IP?
[23:39:58] mlang: ofcan: RubyToolbox?
[23:40:07] jarib: Axsuul: perhaps it's more of a feature toggle library..
[23:40:14] Axsuul: jarib: yea, thanks
[23:41:22] Spaceghostc2c: mlang: Oh dear! Perhaps look for work elsewhere before giving your two weeks notice.
[23:42:22] mlang: Spaceghostc2c: Quite hard, only 6-8 months of professional experience. And my Work Visa right now is quite stupid, still waiting for the Card to arrive :(
[23:42:47] Spaceghostc2c: mlang: Oh! Then trudge on! We're here for you!
[23:43:14] mlang: Spaceghostc2c: US Government is quite slow those days. Submitted my papers in may. Yeah, still waiting :(
[23:43:28] Spaceghostc2c: mlang: It is quite slow.
[23:44:46] mlang: Spaceghostc2c: Yeah.. Speaking of, can I pick your mind a little bit?
[23:46:49] mlang: Spaceghostc2c: Issuing Ajax Requests at a Change Event to the Controller.. Got time for that? :)
[23:47:05] Spaceghostc2c: Which controller? Client side?
[23:47:12] foucist: mlang: i hope your boss is understanding of your lack of a mentor
[23:47:24] Spaceghostc2c: Also, in English, we don't make important words proper nouns. :)
[23:47:32] mlang: foucist: Just the typical screaming. :(
[23:47:45] Spaceghostc2c: mlang: Oh dear.
[23:47:45] mlang: Spaceghostc2c: Yeah.. in german, we capitalize everything we can!
[23:48:04] mlang: Spaceghostc2c: Yep.
[23:48:15] Spaceghostc2c: mlang: And you don't lay him out or scream back?
[23:48:32] jwg2s: I'm trying to render a 401 page… but getting a deprecation notice in Rails 3.2.9. DEPRECATION WARNING: Passing the format in the template name is deprecated. Please pass render with :formats => [:html] instead.
[23:48:40] jwg2s: render file: 'public/401.html'
[23:48:45] mlang: Spaceghostc2c: Well. I would! Just waiting for a dark night.
[23:48:58] jwg2s: Any ideas here? I've googled everywhere
[23:48:59] Spaceghostc2c: mlang: Have someone record it!
[23:49:03] mlang: Spaceghostc2c: No, I need to hit the update action of a controller.
[23:49:04] jwg2s: Read the docs…
[23:49:05] foucist: mlang: try to alleviate the pressure, lay it out for the boss, i.e. that you've only got so much work experience, you're learning everything that you're developing, and that just about any feature that they ask for they should expect to take 2-3 weeks
[23:49:25] Spaceghostc2c: Sure, query me, and we'll see what's up.
[23:49:39] mlang: foucist: Sad part is, the "feature" is not a feature, its a complete new Website.
[23:49:50] Spaceghostc2c: That's one hell of a feature!
[23:49:50] mlang: Thanks mate :)
[23:49:52] foucist: mlang: yeah, but any feature of the website.. :P
[23:50:16] mlang: It really is :>
[23:51:47] foucist: mlang: might need to do some form of agile web development methodology.. manage your "client" aka, the boss better, manage his expectations, help him to evaluate what features are necessary, what the priority is etc
[23:52:35] mlang: foucist: I tried to introduce Pivotal Tracker. No chance.
[23:52:46] mlang: The problem is, he has NO technical understanding.
[23:53:05] mlang: Tried to explain to him, why the data on the production and the development environment is different. No chance of understanding that.
[23:54:39] foucist: mlang: pivotal isn't really all that good of a fit for non-tech people either imo
[23:54:43] foucist: maybe something simpler, like kanban
[23:54:47] foucist: with post-it notes
[23:55:07] foucist: then he can get a general feel for how many features you have in your backlog
[23:55:24] foucist: and how many post-its/units you can do per week or whatever
[23:55:38] foucist: much more visceral and simpler
[23:57:21] Spaceghostc2c: There's a nice one that ddd was using a week or two ago.
[23:57:31] Axsuul: K, split gem is pretty awesome @ AB tests