« Back to channel list

#RubyOnRails - 23 August 2013

« Back 1 day Forward 1 day »
[00:00:23] Lewix: Senjai: dsrx: [:xxx, :yyy, :zzz].each(&:after_save)
[00:01:08] Senjai: Lewix: Don't think that works. One is symbol to proc, another is method to proc
[00:01:21] Senjai: or my ruby is getting very rusty
[00:08:00] Lewix: Senjai: thanks
[00:16:04] rhizome: LOWER is an SQL function
[00:50:36] argentum: according to wolfram alpha, $85k in SF translates to about $43k here in memphis, tn (http://www.wolframalpha.com/input/?i=%2485%2C000+from+san+francisco+to+memphis)
[00:50:50] argentum: which is on the low side but in the entry-level range
[00:53:10] Senjai: argentum: 78% more crime
[00:53:13] rhizome: "su to admin"
[00:53:26] argentum: more like 300%
[00:53:41] rhizome: in memphis? i believe it.
[01:04:19] Senjai: Honk Honk
[01:12:35] zveljkovic: Hi, How to get nested form field Id?
[01:13:10] zveljkovic: I need it to implement js deletion of associated records (and adding)
[01:13:24] drewwyatt: I am using a nested form for a model (asset) inside of another controller (article) in Rails 4. The article has_many assets. How would I go about deleting just one asset?
[01:14:50] bricker: drewwyatt: are you using `accepts_nested_attributes_for`?
[01:14:52] zveljkovic: drewwyatt: seems we are swimming in the same watters
[01:15:06] drewwyatt: bricker: yessir
[01:15:20] drewwyatt: aveljkovic: Haha, it's tricky!
[01:15:26] zveljkovic: You can allow users to delete associated objects by passing allow_destroy: true to accepts_nested_attributes_for
[01:15:38] bricker: drewwyatt: the answer lies within http://api.rubyonrails.org/classes/ActiveRecord/NestedAttributes/ClassMethods.html
[01:15:44] JimmyNeutron: I'm trying to run this command from my linux shell prompt: rails runner -e development "Record.where('created_at < ?', 1.hours.ago.destroy_all)" but getting a error about undefined method "destroy_all"
[01:15:55] zveljkovic: http://guides.rubyonrails.org/form_helpers.html#removing-objects
[01:15:56] bricker: drewwyatt: you'll want the _destroy checkbox, and add the allow_destroy option to accepts_nested_attributes_for
[01:16:06] pzuraq: for some reason one of my css files isn't precompiling
[01:16:12] pzuraq: everything else is working, just this one
[01:16:15] bricker: JimmyNeutron: your syntax is incorrect
[01:16:16] JimmyNeutron: Not sure why I'm getting that error
[01:16:51] bricker: pzuraq: could just be cached, try restarting your server or changing the assets version in application.rb
[01:17:26] JimmyNeutron: bricker, What do I need to do to make the syntax correct?
[01:17:55] bricker: JimmyNeutron: learn ruby, and then move `.destroy_all` outside of the parenthases
[01:18:00] bricker: prentheses*
[01:18:04] bricker: you know what I mean
[01:18:10] JimmyNeutron: Thanks bricker!
[01:21:45] mike2315: i have a tree made by Mongoid Ancestry (same as ancestry mostly) - need to count number of records
[01:21:48] mike2315: under a node
[01:21:57] mike2315: best practices?
[01:25:42] zveljkovic: Anyone knows how can I get element Id from FormBuilder
[01:27:03] Senjai: mike2315: Time to learn about recursion!
[01:27:20] sevenseacat: google recurtion. its funny.
[01:27:27] sevenseacat: oh ffs i cant type today
[01:27:40] Senjai: Becker fail
[01:28:03] mike2315: i know how to use it
[01:28:29] mike2315: i wondered if there was maybe a better way to do it than to pull every entry from the database and count them
[01:28:51] dsrx: 'mongoid ancestry' is getting on the verge of being quite offensive
[01:28:52] Senjai: mike2315: No, the best way is to recursively count
[01:28:58] Senjai: mike2315: It's a typical tree problem
[01:29:11] mike2315: nevermind it says how to do it right on the page
[01:29:26] mike2315: i HOPE node.descendants.count is lazily evaluated
[01:29:40] Senjai: mike2315: Is it a binary tree?
[01:30:00] mike2315: nah it's one of the useful kind of trees ;P
[01:30:34] sevenseacat: an evergreen tree?
[01:31:01] Senjai: sevenseacat: lol!
[01:31:10] Senjai: This is why functional programmers have good sense of humors.
[01:31:20] Senjai: All of us oopers are just lame as fuck
[01:31:27] sevenseacat: i nearly typed everdeen instead. too much hunger games for me.
[01:31:41] Senjai: sevenseacat: Beckers, this is an intervention
[01:32:01] mike2315: googled edible evergreen
[01:32:19] mike2315: found http://www.florum.fr/img/F/8/5/1188-Feijoa-sellowiana.jpg
[01:32:25] mike2315: pineapple guava
[01:32:38] mike2315: cool enough to link
[01:32:39] Senjai: mike2315: but seriously, is it a binary tree?
[01:34:04] mike2315: no, child nodes for any n >= 0
[01:37:03] lethjakman: when you load balence across several servers do you usually store your sessions inside of the DB?
[01:38:22] mike2315: if your clients are being load-balanced dynamically
[01:39:27] lethjakman: mike2315: what's my other option?
[01:39:59] lethjakman: statically routing certain ip blocks?
[01:41:43] Senjai: mike2315: I would keep track of every descendent, everytime a new decendent is created, it adds to its parents array on initialize. Then its as simple as counting whats in the array
[01:42:17] Senjai: mike2315: or if there can only be one decendent for each parent, just loop through until a child doesnt have a decendent, incrementing a counter each loop
[01:43:57] Senjai: lethjakman: You can configure each server to store and read from the same session cookie
[01:44:03] Senjai: lethjakman: that's your other option
[01:44:23] lethjakman: Senjai: but they'd be stored locally on different servers wouldn't they?
[01:44:34] Senjai: lethjakman: No, sessions are stored on the clients browser
[01:44:38] Senjai: lethjakman: via a cookie
[01:44:53] lethjakman: yes, but isn't there local data stored for that session on the server?
[01:44:56] sevenseacat: no they are not
[01:45:03] lethjakman: it's a cookie pair.
[01:45:25] Senjai: sevenseacat: doesnt the server just store the auth token?
[01:45:35] sevenseacat: should kinda be the other way around
[01:46:33] lethjakman: hrm, I guess I just want to know if there's a faster way to share sessions across load balanced servers than in the database?
[01:46:40] Senjai: whoa okay
[01:46:54] Senjai: lethjakman: yes there is, I just obviously don't understand sessions.
[01:46:55] Senjai: http://rack.rubyforge.org/doc/classes/Rack/Session/Cookie.html
[01:48:26] sevenseacat: sessions are supposed to be server side
[01:48:58] Senjai: sevenseacat: I know right?
[01:49:14] dsrx: the official rails philosophy on that has changed i thought
[01:49:16] quazimodo: destroy all software is decent, but good lord that guys color scheme is only *juuuust* better than white on black
[01:49:17] Senjai: lethjakman: The gist of it is, you can set up each app to use the same secret key.
[01:49:19] quazimodo: i cant read shit
[01:49:58] Senjai: lethjakman: Which is set somewhere in your configuration. As long as they share the same domain, the cookies will be persistent across servers
[01:50:24] lethjakman: hrm interesting.....
[01:50:53] Senjai: lethjakman: config/initializers/secret_token.rb
[01:51:25] lethjakman: so when I set data to my sessin it's actually going into the clients browser?
[01:51:35] Senjai: lethjakman: in the format of an encrypted cookie yes
[01:51:44] Senjai: lethjakman: the cookie is decrypted based on the secret_token
[01:51:45] dsrx: is there any reason not to use an env var for teh session secret on a 12factor host?
[01:52:01] Senjai: lethjakman: So copy the secret token across all apps, and cookies should be valid for all apps
[01:52:06] Senjai: lethjakman: and let me know how it goes
[01:52:20] lethjakman: very interesting, that's very different than my understanding was.
[01:52:29] Senjai: lethjakman: If you store sessions in the database, it's a different story. But cookie sessions are still pretty damn secure
[01:52:33] Senjai: lethjakman: so you have nothing to worry about
[01:52:52] Senjai: lethjakman: you can use rake secret to generate a key
[01:52:54] lethjakman: Senjai: it'll probably be a while before I get a chance to actually try that, I'm just trying to figure out how to load balance this properly before I actually try.
[01:52:56] Senjai: lethjakman: and distribute it
[01:53:02] lethjakman: brilliant, that's super easy!
[01:53:30] Senjai: lethjakman: and its stored in config/initializers/secret_token.rb by default ..
[01:53:34] Senjai: Let me know how goes
[01:53:41] lethjakman: Senjai: will do, thank you so much for your help :)
[01:54:14] lethjakman: that all makes perfect sense, you learn something new every day!
[01:54:44] lethjakman: hrm, other question I had is does anyone use jRuby with rails paired with glassfish?
[01:56:12] lethjakman: if so I'm curious about the performance of clustering.
[01:56:14] Senjai: lethjakman: that's a bad questions :P.
[01:56:23] Senjai: lethjakman: most people will just say try it and see
[01:56:28] lethjakman: Senjai: sorry, I'm trying to figure out how to word it.
[01:56:36] Senjai: lethjakman: odds are someone in the history of the world has tried :P
[01:56:40] Senjai: so it's kind of rhetorical
[01:56:47] lethjakman: Senjai: fair enough
[01:56:59] lethjakman: I've just heard a lot of horror stories of different stratedgies in here.
[01:57:27] Senjai: lethjakman: Just make sure any gems your using with jruby are threadsafe, and you have config.threadsafe! set.
[01:57:40] Senjai: lethjakman: if they aren't threadsafe, shit won't work properly
[01:57:42] lethjakman: Senjai: where do you set that?
[01:57:43] Senjai: Then you'll know
[01:57:50] Senjai: lethjakman: what version of rails
[01:59:43] Senjai: lethjakman: got a railscasts subscription? If not get one, then watch http://railscasts.com/episodes/365-thread-safety
[02:01:25] Senjai: lethjakman: IMO unless your using java classes... there is no point to use jRuby over MRI unless you're trying to take advantage of threads
[02:01:52] Senjai: lethjakman: also, unicorn and some other servers don't benefit from threadsafe, as they use worker processes. the Puma server would probably be your best bet
[02:03:08] lethjakman: Senjai: that's what I'm thinking, I want to take advantage of the threads. I'm worried about performance in this application as it's expected to get thousands of requests at once.
[02:03:24] Senjai: lethjakman: that being said, unicorn manages just fine
[02:03:46] lethjakman: Senjai: my choices are probably between passenger and glassfish
[02:04:52] Senjai: lethjakman: https://github.com/blog/517-unicorn
[02:05:48] sevenseacat: personally, i'd worry about it if it becomes a problem.
[02:05:57] sevenseacat: for now, and in the foreseeable future, it isnt a problem.
[02:06:52] Senjai: lethjakman: ^^
[02:07:09] Senjai: And unicorn is pretty easy to get up and running with nginx.
[02:07:42] lethjakman: sevenseacat: I'm not going all out, but I'm trying to archatect this in a way that it will be expandable.
[02:08:00] sevenseacat: you have nothing to architect at the moment.
[02:08:02] lethjakman: Senjai: what makes you go with unicorn over something like passenger?
[02:08:16] lethjakman: sevenseacat: just planning with pencil and paper, is that bad?
[02:08:31] sevenseacat: not bad, just a waste of time
[02:09:04] Senjai: lethjakman: Honestly
[02:09:08] Senjai: lethjakman: seven is right.
[02:09:16] Senjai: lethjakman: You cant solve a problem before it is a problem
[02:09:44] Senjai: And odds are when/if that problem shows up, you won't be fixing it how you thought you were going to
[02:10:11] sevenseacat: you might do all this work on scaling application servers, only to find the bottleneck is your db server.
[02:10:54] lethjakman: alright, thanks.
[02:10:55] sevenseacat: being prepared is good, but until you have an app that will need it, its all irrelevant
[02:11:45] lethjakman: sevenseacat: alright, I trust your advice
[02:12:37] lethjakman: I do know the DB server is more of a problem, I have some of that planned out too, honestly I'm done planning and ready to get to work.
[02:12:44] lethjakman: thanks you guys for helping me out :)
[02:13:22] Senjai: lethjakman: good luck.
[02:13:41] lethjakman: Senjai: thank you! I'll keep you posted when I'm further along.
[02:16:39] ner0x: How can I use .tablize and .pluralize in a model spec test?
[02:18:55] sevenseacat: same way you'd use them anywhere else? whats the context?
[02:21:02] Senjai: ner0x: https://gist.github.com/Senjai/6314914
[02:21:41] Senjai: ner0x: You could read the source code and see how it's defined ;)
[02:22:40] Senjai: It uses some string filters from active_support
[02:24:19] ner0x: I'm just an idiot. It's complaining about mass assigning the polymorph cols.
[02:24:31] ner0x: Is there a way around putting them in the attr_accessible?
[02:24:36] ner0x: Mocking or something like that?
[02:25:09] Senjai: ner0x: code or no help
[02:27:51] ner0x: Senjai: Let me read some docs and get a gist together.
[02:28:07] Senjai: ner0x: good plan is good ^^
[02:33:22] ner0x: Senjai: https://gist.github.com/fswitalski/6314972
[02:34:38] sevenseacat: did you misspell tableize?
[02:35:06] sevenseacat: http://api.rubyonrails.org/classes/ActiveSupport/Inflector.html#method-i-tableize
[02:35:30] lethjakman: hrm, I'm looking to return only certain fields of a collection in some json, is there a method that allows me to select what fields to return or do I have to iterate over this?
[02:35:48] sevenseacat: i like rabl for dealing with json responses.
[02:36:02] Senjai: lethjakman: Use RABL :) It's fantastic
[02:36:19] Senjai: lethjakman: or activemodel serializers
[02:36:56] Senjai: lethjakman: http://railscasts.com/episodes/409-active-model-serializers << Free rails cast
[02:37:06] lethjakman: reading rabl documentation now
[02:37:13] lethjakman: thanks guys! this does look really cool!
[02:37:28] ner0x: sevenseacat: fuck
[02:37:44] lethjakman: sevenseacat: you're a huge fan of railscasts aren't you?
[02:37:53] Senjai: lethjakman: you mean me?
[02:37:56] lethjakman: er sorry meant Senjai
[02:37:56] sevenseacat: not a super huge fan, but i keep a subscription.
[02:38:09] lethjakman: he did that right when I was typing
[02:38:11] Senjai: lethjakman: I have a subscription, odds are if I'm looking to figure something out, it's there
[02:38:26] lethjakman: Senjai: are the subscription ones pretty accurate?
[02:38:32] lethjakman: I've tried using several and gotten huge problems
[02:38:36] Senjai: sevenseacat: I think i should stop answering questions that would be in the top three results of a google search.
[02:38:58] Senjai: lethjakman: Uhh, he talks about the rails version in every episode, so. It's your own issue if things don't work out properly
[02:38:59] sevenseacat: this place would be pretty boring and also kinda inhospitable if we did
[02:39:16] sevenseacat: i like pointing to lmgtfy if things are *really* obvious.
[02:39:29] Senjai: sevenseacat: I used to, but now people recognize the domain name
[02:39:35] Senjai: I gotta start bit.ly'ing that.
[02:40:23] sevenseacat: you're getting awfully jaded for someone thats only been here a couple months :P
[02:41:37] ner0x: sevenseacat: So I did everything right; just brought my extra chromosome to work with me today.
[02:41:49] sevenseacat: ner0x: all good :)
[02:41:58] Senjai: sevenseacat: I'm a highly adaptable person
[02:46:42] ssb123: why would one use Cucumber over Rspec for integration testing?
[02:46:44] ner0x: Mocking/Stubbing is WAY better than fixtures...
[02:47:18] sevenseacat: ssb123: if they have people other than developrs writing their acceptance tests - plain english is easier for them.
[02:47:50] sevenseacat: mocking and stubbing is a pain in the butt
[02:47:53] ssb123: sevenseacat: anything else?
[02:48:08] sevenseacat: ssb123: not really.
[02:48:20] Senjai: Isn't cucumber kind of falling out of meta?
[02:48:28] ner0x: sevenseacat: It would save so much time without having to touch the DB.
[02:48:42] ner0x: sevenseacat: But I guess I haven't used it enough to have that anal pain.
[02:48:46] sevenseacat: ner0x: at the expense of more brittle and convoluted tests
[02:49:09] ner0x: sevenseacat: I'm not doing anything too heavy so I assume it's fine.
[02:49:12] sevenseacat: ive worked on codebases where people thought stubbing was *the answer to everything* - it turns out half the tests werent actually testing anything.
[02:49:19] sevenseacat: or were testing the entirely wrong things.
[02:50:16] sevenseacat: it gives me great joy to rip out such poorly written tests whenever i modify the code that those tests work on
[02:50:52] ssb123: I've got this pretty sizable legacy code with no tests at all. I'm trying to figure out which tools to use - I've never done testing myself so I'm sort of lost.
[02:51:22] sevenseacat: rspec is a good base to start from. smart small, test the little things, like model methods.
[02:51:40] sevenseacat: or start from the other end, test the overall behaviour, up to you :P
[02:52:18] ssb123: sevenseacat: I think behavior is the way we're going to go.
[02:52:48] sevenseacat: cool, so who's going to be reading/.writing/maintaining these tests?
[02:53:08] ssb123: Me and the CTO.
[02:53:10] sevenseacat: your options are pretty much code specs like rspec, or gherkin-flavoured specs like cucumber or spinach
[02:53:33] sevenseacat: do you want/need that gherkin layer over the top
[02:54:19] sevenseacat: i just realized how bizarre 'gherkin-flavoured specs like cucumber or spinach' sounds
[02:54:26] sevenseacat: im writing tests, not cooking
[02:55:04] ssb123: I'm not sure. We are using pivotal with user stories - but they don't have much thought put into them as of now.
[02:55:37] sevenseacat: maybe the best option then is to write a few - see which way works for you
[02:56:49] ssb123: So basically the question is do we want the gherkin layer or now.. if we do Cucumber is the way to go, if not Rspec
[02:57:18] pontiki: yeah, but as a person who does both QA and Kitchen wizardry, I love those terms :) i love pickles a lot, too :)
[02:57:49] ssb123: pickle backs!
[02:58:35] pontiki: ssb123: given trying to start testing a legacy site that already exists, writing some high level stories about it might seem .. well.. worthless
[02:58:35] sevenseacat: do you like things like https://gist.github.com/karpah/4f837bdbe9f4d80c4bc6 or things like https://gist.github.com/karpah/43f253224b465cb26914
[02:59:31] pontiki: but the cool thing is just writing those high level stories to then drive the testing of the major features, building a pretty nice regression suite using cabybara or watir
[03:00:46] pontiki: i was doing that at the last gig, and let the testing and ba folks stop having to do all sorts of manual regression testing
[03:00:56] ssb123: sevenseacat: it's really not up to what I like sadly.
[03:02:47] pontiki: ssb123: who is making this decision, and what are they struggling over if they haven't already made it?
[03:03:43] pontiki: to me, the major difference between those is that gherkin seems more comfortable for non-techie people to write and read
[03:04:29] ssb123: pontiki: CTO, and not really struggling. I think he prefers the lower level rspec tests but I prefer Cucumber. He is giving me the opportunity to convince him.
[03:04:30] pontiki: to the techie, the rspec one, the second one, means they don't have to implement a lot more steps; that *is* the test, right there.
[03:04:49] ssb123: exactly his point.
[03:05:02] brownies: i used to be pro-cucumber, but now i prefer rspec
[03:05:14] sevenseacat: same, brownies
[03:05:22] ssb123: I just like how the stories in pivotal can line up directly with cucumber tests.
[03:05:24] brownies: you do have to be more careful with writing your specs in a readable fashion though
[03:05:37] sevenseacat: ssb123: they cant line up with rspec features?
[03:05:44] brownies: you can use feature specs
[03:05:47] ner0x: sevenseacat: I'm only going to use it to fake relationships pretty much.
[03:05:49] pontiki: ssb123: that is one of the advantages with gherkin: they read nearly the same
[03:05:56] ner0x: sevenseacat: associations* sorry.
[03:07:07] ssb123: I like the name cucumber too.
[03:07:19] rhizome: start with unit tests, trust me.
[03:07:46] pontiki: ssb123: here's the thing with cuke: if you take those high level stories as your features, you *still* have to develop the steps, and support, and you're basically back to nearly writing rspec
[03:07:48] rhizome: if you have sizable legacy, forget about BDD for like a year
[03:08:21] ssb123: rhizome: what is 'sizable'
[03:08:27] rhizome: you tell us
[03:08:44] pontiki: an application already in production with users engaged
[03:08:51] pontiki: that's sizable
[03:09:09] rhizome: that doesn't denote an amount of technical debt in testing
[03:09:18] pontiki: it doesn't
[03:09:35] pontiki: but it doesn't need to either, really. if you have done *none* it's already enormous
[03:10:30] rhizome: regardless of enormity, start with units
[03:10:41] rhizome: that's just me
[03:10:47] pontiki: it's an approach
[03:11:30] ssb123: I don't know what a good measure of complexity is.. models? There's ~50 different models. thousands of users.
[03:11:30] pontiki: you can pay people to bang on your site
[03:11:53] pontiki: you're already past the threshhold
[03:12:06] pontiki: more or less complexity doesn't make all that much difference
[03:12:26] ssb123: shitty untestable code does :)
[03:12:30] pontiki: have you been experiencing lots of problems?
[03:12:46] pontiki: or difficulty finding bugs?
[03:12:48] pontiki: i don't know
[03:13:07] pontiki: ones that users report, or that your metrics report, or that crash your system, or lose data, or or or
[03:13:38] sevenseacat: basically 'why are you spending time to go back and add these tests'
[03:13:39] pontiki: what prompted your CTO to start thinking you all need an automated test suite?
[03:13:45] ssb123: Well yes. Adding one new feature starts a chain reaction of bugs. But they usually caught before production.
[03:14:22] pontiki: you don't remove bugs by writing tests
[03:14:33] pontiki: you may be able to find some
[03:14:34] ssb123: But they're easier to find.
[03:14:38] rhizome: units and functionals.
[03:15:04] ssb123: We have some pretty important things that we want to make sure don't break.. like checkout.
[03:15:08] pontiki: but you remove bugs and improve the quality of your app by *refactoring*, and writing unit tests before the refactoring to determine your path and achieve your outcome
[03:15:47] pontiki: you don't have to write a suite of tests to start out with
[03:16:14] pontiki: notice some area that's particularly buggy, or breaks often, or looks confusing, or generates > 10 WTF/hr
[03:16:20] pontiki: or something
[03:16:36] ssb123: We're not planning on it. We're going to start some major refactoring and writing tests along the way.
[03:17:16] ssb123: haha most of the code generates > 10 WTF/hr.
[03:17:42] pontiki: in which case, rspec makes much more sense to me as a testing approach; *however* -- *also* write the stories that may be missing about the area of functionality
[03:17:59] pontiki: well, it's a local constant, you can change it
[03:19:09] ssb123: Why is writing behavioral tests first a bad idea? Our theory is that the behavior of the app isn't going to change in the longterm.
[03:19:26] pontiki: true story: i was reading some code from our legacy devs, and when i got to WT*A*F everyone laughed. it was already about 10 in about 20 mintues
[03:20:00] pontiki: it's not -- but at the point you are already at, it may not have any value
[03:20:20] pipecloud: I'm not sure I agree.
[03:20:26] pontiki: if the behaviour isn't going to change, why document it some more?
[03:21:01] pontiki: if you take a piece your know you're going to change, and describe the behaviours, there is value
[03:21:38] ssb123: Because if checkout breaks we lose money?
[03:21:45] pipecloud: How do you know that new behaviour that changes doesn't effect the behaviour of something that never changes?
[03:21:46] sevenseacat: documenting it prevents regressions
[03:21:52] pontiki: but when you're starting out? or adding a new piece of functionality? not knowing or specifying how your users will use it is bad
[03:22:10] pontiki: pipecloud: please explain how writing stories determines that?
[03:22:18] pontiki: you need the tests
[03:22:28] pipecloud: Execute those stories as tests?
[03:22:37] pipecloud: Actions at a distance are sometimes subtle and even completely unintentional.
[03:22:47] pontiki: you need to write all the underlying steps and support to do that
[03:22:57] pontiki: why not just put that into a spec at that point?
[03:23:00] pipecloud: I don't know what you mean.
[03:23:02] pontiki: where it *can* do more good
[03:23:09] pontiki: have you used cucumer, pipecloud ?
[03:23:19] pipecloud: Of course. I also dislike it.
[03:23:35] pontiki: so you know you have to write step definitions?
[03:23:43] pontiki: and support code for some of the steps?
[03:23:47] pipecloud: What's your argument here?
[03:24:06] pontiki: you spend nearly the same effort in that as you do writing them in rspec
[03:24:23] ssb123: All I know is that I spend like 10x more time manually testing a new feature than actually writing it. I'd love to reduce that.
[03:24:43] TheMoonMaster: Cucumber is horrible for documentation imo.
[03:24:43] pontiki: this is for an app already out in the field with users
[03:24:54] TheMoonMaster: I can't stand the stuff.
[03:25:01] pontiki: BAs love it
[03:25:04] pipecloud: You do know that cucumber is just Regex Driven Development, right?
[03:25:06] pontiki: and so do non-techies
[03:25:25] lethjakm1: big thumbs up on that RABL suggestion guys. this is great!
[03:25:34] lethjakm1: thanks again :)
[03:25:34] pontiki: that's an amazingly narrow pipe to look through
[03:25:34] brownies: lethjakm1: just don't read the source code
[03:25:42] pipecloud: pontiki: What's your overall argument here?
[03:25:44] lethjakm1: brownies: lol is it bad?
[03:25:49] brownies: lethjakm1: horrendous.
[03:25:56] lethjakm1: brownies: hrm...is it particularly slow?
[03:26:05] TheMoonMaster: You could always write real documentation like rdoc or yard.
[03:26:10] TheMoonMaster: I hear that works out great.
[03:26:21] pipecloud: pontiki: Do you know how cucumber works? You know it does nothing that you can't do in rspec already except it comes with the ability to parse lines of text and run code depending on the content of that string?
[03:26:39] brownies: lethjakm1: no, it's just somewhere between a clusterfuck and an insane labyrinth
[03:26:52] brownies: lethjakm1: plug in Oj with MultiJSON and it'll be fast enough for most use cases
[03:26:57] pipecloud: Cucumber adds human language to the specification equation.
[03:27:06] brownies: if you need to optimize for speed beyond that, you'll have to serialize by hand anyway.
[03:27:08] TheMoonMaster: So does rspec in a sense.
[03:27:16] TheMoonMaster: Rspec just doesn't explain every single line.
[03:27:25] pontiki: given where ssb123's company is, and some of the problems they're experiencing, going back to write all the stories for features that already exist, and are implmented in the product, and then writing the underlying steps and support, is not actually going to buy them as much as focusing on some areas to refactor, and write *those* specs, and use cucumber if wanted for new features
[03:27:26] pipecloud: TheMoonMaster: It tries to make readable specs, yeah
[03:27:29] TheMoonMaster: Which there is almost never any need for that.
[03:27:33] pontiki: it's really *very* specific
[03:27:48] lethjakm1: brownies: Oj? is that a gem?
[03:27:56] pipecloud: I think that I disagree entirely.
[03:28:09] pontiki: your perogative
[03:28:32] pipecloud: Documenting and testing the features and flows that the users of ssb123's company's application use the most is of the utmost importance.
[03:28:33] pontiki: but just disagreeing isn't going to help anyone
[03:28:36] TheMoonMaster: In a gem context I will just use RSpec, but in a Rails context I find that writing Capybara feature specs is far more productive and valuable than a cucumber feature.
[03:28:44] TheMoonMaster: Disagreeing helps a lot of people.
[03:28:51] TheMoonMaster: It shows that there is more than one mindset.
[03:29:01] ssb123: We don't plan on writing tests for the entire codebase. Just checkout. And then writing tests as we refactor.
[03:29:02] pontiki: that's actually not a disgreement, pipecloud
[03:29:09] brownies: lethjakman: yeah.
[03:29:22] pipecloud: pontiki: You still haven't answered me about what you're driving at.
[03:29:32] brownies: TheMoonMaster: yes, there is the right mindset, and then several wrong ones
[03:29:35] pontiki: then i don't understand what you're looking for
[03:29:35] brownies: ACTION ducks
[03:29:44] TheMoonMaster: brownies: I completely agree with that.
[03:29:49] helpa: http://i.imgur.com/m9m3wr9.gif
[03:30:01] TheMoonMaster: But I'd also say there are several valid, yet different mindsets.
[03:30:03] pipecloud: TheMoonMaster: Cucumber is an overzealous code runner.
[03:30:06] pontiki: i don't even see a disagrement here
[03:30:13] TheMoonMaster: pipecloud: I also agree with that.
[03:30:17] helpa: Regex Driven Development. See cucumber.
[03:30:29] pipecloud: pontiki: It's hard when you refuse to summarize your argument cogently. :)
[03:30:40] pontiki: [20130822|2220.06] < pontiki> given where ssb123's company is, and some of the problems they're experiencing, going back to write all the stories for features that already exist, and are implmented in the product, and then writing the underlying steps and support, is not actually going to buy them as much as focusing on some areas to
[03:30:45] pontiki: refactor, and wite *those* specs, and use cucumber if wanted faor new features
[03:30:58] pontiki: that's not an argument
[03:31:00] pipecloud: ssb123: I'd consider identifying your most important features and filling in those with high level functional tests
[03:31:14] pipecloud: Then your point is silly, just as you are silly, sir.
[03:31:15] sevenseacat: pontiki: however that doesnt help that at all with the regression aspect, which seems to be the purpose of the test suite
[03:31:35] pontiki: pipecloud: you just said the same thing i did
[03:31:45] pipecloud: pontiki: I have no clue what you're saying.
[03:31:53] sevenseacat: pontiki: you said a totally different thing
[03:32:11] pipecloud: You seem to be talking about some difference in underlying steps and time cost differentials. I, however, am not.
[03:32:13] ssb123: To reiterate; if checkout breaks we lose money.
[03:32:33] pontiki: i don't know you
[03:32:36] pipecloud: ssb123: Do your shit, write your tests, go home before 3pm.
[03:32:45] pontiki: you *clearly* don't know me
[03:33:05] pontiki: and irc is the absolute worst way to communicate absract ideas
[03:33:17] pipecloud: pontiki: I think you might be taking this a bit too personally here. I'm merely complaining about your lack of succinctness about what your specific point is.
[03:33:17] TheMoonMaster: I could find a few worse ways.
[03:33:19] TheMoonMaster: Twitter for instance.
[03:33:28] pontiki: but the next time you call me "sir", remember this is a wider place than you think it is
[03:33:37] sevenseacat: he calls everyone sir.
[03:33:39] pipecloud: pontiki: sir, calm your shit. :)
[03:33:41] sevenseacat: including me.
[03:33:50] pontiki: calm my shit
[03:33:54] pontiki: let me ask you this
[03:34:13] pontiki: i'll just take that as an ad hominem, then
[03:34:22] ssb123: fuck you both; i've decided to just not write any tests.
[03:34:28] pontiki: good, sevenseacat
[03:34:29] pipecloud: You seem rather intent on being upset because I had the gall to suggest a different point of view than you would accept.
[03:34:32] TheMoonMaster: ssb123: Write tests for me? Please?
[03:34:35] pontiki: good, ssb123
[03:34:35] pipecloud: ssb123: Go you! :D
[03:34:51] pontiki: that's probably the sanest thing you could do
[03:35:27] pipecloud: ssb123: As long as you can manage never to get blamed, no test suite is a really good way to promote job security .
[03:35:40] TheMoonMaster: I've seen people skip tests for the checkout process on a decently large site.
[03:35:51] TheMoonMaster: It doesn't turn out well. The amount of Airbrake emails I received....
[03:36:06] ssb123: I'm just going to quit and find a job at a company who already has tests.
[03:36:15] TheMoonMaster: On the bright side I didn't have to deal with it either!
[03:36:20] ssb123: problem solved.
[03:36:23] TheMoonMaster: ssb123: That's smart.
[03:36:26] pipecloud: ssb123: Also, a good idea! You're full of them tonight! Consider writing these down.
[03:37:31] ssb123: see sarcasm
[03:38:04] pontiki: no one can actually tell you what will work
[03:38:12] ner0x: ajax request to create a new "folder" on the server, if the "folder" already exists I want to return json, what would be the appropriate HTTP Response Code so that it hits the error in $.ajax?
[03:38:16] pontiki: no one can actually tell you what is best for you to do
[03:38:34] pontiki: just pick a way , start it, see what you get, and if it's not working, correct it
[03:38:35] ssb123: There's no such thing as best.
[03:38:37] pipecloud: ner0x: Non.
[03:38:56] ner0x: pipecloud: none or non?
[03:39:15] ner0x: pipecloud: That's a new answer.
[03:39:21] pontiki: exactly, all the agile rules apply. YAGNI, DTSTTW, TMTOWTDI, DRY, so on and so on
[03:40:03] ssb123: All I know is that the backend is messed up.. but the frontend is fucked.
[03:40:18] TheMoonMaster: What's the front end?
[03:40:20] ner0x: I can make it send 200 and check the json for errors?
[03:40:24] pipecloud: ner0x: There is no HTTP response code appropriate to describe the failure to create that 'folder'.
[03:40:38] pipecloud: I'd suggest a response that describes the problem with an http 200
[03:40:53] ner0x: pipecloud: That works.
[03:41:04] pipecloud: ner0x: I hope it will! For your sake.
[03:41:29] ssb123: there's like 20 ish pages on the site. It's not a complex design at all.. the css has >2000 lines just media queries nested within media queries.
[03:41:41] TheMoonMaster: ner0x: Oddly enough, 409 maybe?
[03:42:06] ner0x: 403 forbidden
[03:42:20] TheMoonMaster: I don't think that's right.
[03:42:24] ner0x: I just used the 200, it works fine.
[03:42:36] ssb123: frontend = html, css, js
[03:42:51] TheMoonMaster: ssb123: Ah, didn't know if it was Backbone or some such.
[03:43:53] ssb123: TheMoonMaster: I don't know if whoever wrote this code even knows what backbone is.
[03:44:04] TheMoonMaster: You inherit the project?
[03:45:22] ssb123: We're a startup - they outsourced the mvp like 2 years ago, got funded, grew a ton, and now I'm enjoying the project.
[03:45:39] TheMoonMaster: Ouch. I've had some projects passed onto me like that.
[03:45:41] TheMoonMaster: They're never fun.
[03:46:04] pipecloud: Unless you're into kinky stuff like that.
[03:46:23] ssb123: it's kinkly alright.
[03:46:48] TheMoonMaster: pipecloud: Well, I once ran into a project where they were using ActiveRecord but in a terribly wrong way.
[03:46:49] pipecloud: ssb123: Do you know what you want to do with the project? Like directions you want to take it in?
[03:47:04] TheMoonMaster: They made all these methods on the model to open and retrieve models from a CSV.
[03:47:08] TheMoonMaster: Completely ignoring the database.
[03:47:20] pipecloud: TheMoonMaster: I half-suspect that most projects using ActiveRecord are doing it wrong, and that's an optimistic half.
[03:47:47] TheMoonMaster: pipecloud: I doubt you've seen one that uses it to load a CSV and find "models" from the CSV.
[03:47:58] TheMoonMaster: I was pretty shocked. In fact, I'm gonna find it real quick.
[03:48:07] ssb123: Directions meaning? I'm one of two devs, i'm pretty jr the other dev has much more experience.
[03:48:08] pipecloud: TheMoonMaster: I've done worse, but I had a good head about me to not use ActiveRecord.
[03:48:27] pipecloud: ssb123: What technical change do you want to introduce or add?
[03:49:08] pipecloud: Do you feel like having more unit tests would be good? Or pulling out as many dependencies that aren't really necessary?
[03:49:53] TheMoonMaster: @@models || self.all_from_csv # <- Code like that, but everywhere
[03:50:09] ssb123: pipecloud: I mean we have zero testing right now. So any unit tests would be good.
[03:50:34] pipecloud: ssb123: So start by adding one unit test. Then add another.
[03:51:09] pipecloud: Find the places that you want to add unit tests to the most and add them one by one.
[03:51:55] ssb123: pipecloud: I suppose that's the idea. I was really trying to understand the benefits of cucumber vs rspec - but I think I have a pretty good understanding now.
[03:52:26] pipecloud: ssb123: RSpec is a testing framework, cucumber is a tool that runs code based on the content of files containing text.
[03:53:35] ssb123: pipecloud: right. RSpec it is.
[03:54:10] brownies: TheMoonMaster: but putting everything in class variables is just so convenient
[03:54:15] ssb123: Who has time for Cucumber!
[03:54:41] pipecloud: ssb123: It's never non-technical people who do! :(
[03:54:46] TheMoonMaster: brownies: It was horrible, they made a model into a CSV and they had to redeploy every time a user emailed them a new instance of that model...
[03:55:03] pipecloud: brownies: It's funny when people do that when they actually want instance variables on the class.
[03:56:17] pipecloud: class MyClass < Yourclass; @@models = nil; end; # Because you wanted this to happen.
[03:57:01] ssb123: pipecloud: you know yakko, don't you? I think i'm remembering this correctly.. anyways I worked with him for a couple months in ATL.
[03:57:19] pipecloud: ssb123: Oh yeah? Down in the biltmore or somewhere else?
[03:57:42] pipecloud: Unfortunately, I too, am in ATL. :(
[03:57:47] tallwhite: ssb123, rspec is ok, but I believe most are using minitest instead these days, especially when allowed to roll your testing from scratch
[03:58:22] pipecloud: I wouldn't know about what 'most' are doing. I'd just suggest choosing something based on what you and your team already knows unless they want to learn something else.
[03:58:23] ssb123: pipecloud: out of Hype at CrowdEndowed. I moved to NYC.
[03:58:51] tallwhite: pipecloud, if you know rspec, you know minitest
[03:58:55] pipecloud: ssb123: Yeah. I work up on the 8th doing network security. Maybe we met once? I'm the redhead.
[03:59:02] pipecloud: tallwhite: If you know Linux, you know OSX.
[03:59:06] brownies: TheMoonMaster: hahah
[03:59:29] pipecloud: tamird: They're highly similar, but they each have their own specific differences.
[03:59:52] pipecloud: tallwhite: ^
[04:00:02] pipecloud: tamird: Get out of my highlights, dammit. :D
[04:00:14] tamird: ha, sorry
[04:00:20] tallwhite: pipecloud, exactly :), one is lean and clean, the other is bloated and nasty
[04:01:00] pipecloud: tallwhite: I'm not incline to disagree. But then again, python is lean and clean compared to ruby, and I don't like python.
[04:01:16] ssb123: wtf is minitest?
[04:01:24] tallwhite: pipecloud, haha I feel the same way about ruby and python
[04:01:26] jrobeson: another way of writing unit tests
[04:01:29] pipecloud: ssb123: It's the test framework that ruby 1.9 ships with.
[04:01:55] pipecloud: ssb123: Do you have much experience with rspec yet?
[04:01:56] ssb123: Ohhh. I think I knew that.
[04:02:16] ssb123: I haven't been doing much testing lately...haha
[04:02:39] pipecloud: If you have the capacity, try them both. I prefer rspec myself, but know enough minitest and unit::test to handle myself. At work, we use a mixture of RSpec and baseline testing.
[04:03:55] ssb123: I think I'm just going to pick rspec and stop making excuses.
[04:04:09] TheMoonMaster: ssb123: I was big on minitest for a while, then I went back to RSpec.
[04:04:13] pipecloud: ssb123: We may or may not have met though. I'm the redheaded guy with the long hair. I came down there to hang out a couple times to hang out.
[04:04:17] TheMoonMaster: It just has so many nice features that make it a pleasure to work with.
[04:04:37] TheMoonMaster: I also jumped back and forth between the two quite a bit but ended up sticking with RSpec.
[04:05:19] ssb123: pipecloud: I'm not sure. I was usually in a shitty mood and running on 3 hours of sleep.
[04:05:40] pipecloud: Lol, I repeated myself. :(
[04:05:57] pipecloud: ssb123: Oh dear. I hope where you are now affords you more sleep.
[04:06:22] ssb123: pipecloud: much more.. and I actually get paid for my work now :)
[04:07:20] pipecloud: ssb123: The people who work up in the eighth floor with me call that place hipsterpotamus.
[04:07:53] ssb123: pipecloud: haha, that's pretty good.
[04:07:55] pipecloud: It made me giggle a bit.
[04:08:28] pipecloud: ssb123: Before I worked there, my company used to be in the space hipsterpotamus is now.
[04:09:42] ssb123: pipecloud: orly. interesting. It's kind of a hard place to work out of.. if you actually want to get some work done.
[04:10:43] pipecloud: ssb123: It seemed like a good place to hang out if you had a sufficiently rockin' pair of headphones.
[04:14:02] ssb123: pipecloud: Yeah, I couldn't afford one of those.
[04:14:25] pipecloud: ssb123: Oh gosh gosh. But you're happily and gainfully employed now, right sir? :D
[04:15:00] ssb123: pipecloud: yes yes yes. I'm working at Plated now.
[04:15:13] pipecloud: ssb123: http://www.plated.com/ ?
[04:16:28] pipecloud: ssb123: Seems cool. I'll look into it more. I'm currently removing all page refreshes from an admin frontend. Not super fun, but not boring either.
[04:17:04] pipecloud: Also, this is fucking awesome.
[04:17:13] pipecloud: Too bad Craplanta doesn't have these things.
[04:17:18] ssb123: We not currently in ATL but we should be lunching soon.
[04:17:38] pipecloud: lol, lunching soon! hilarious.
[04:17:49] ssb123: or launching
[04:18:02] tallwhite: pipecloud, that's cool, you in silicon valley?
[04:18:18] pipecloud: I'm unfortunately in Atlanta, Georgia. :(
[04:19:14] tallwhite: ah, ok, I'm looking for devs in mountain view, lots of competition here tho
[04:19:15] ssb123: Atlanta isn't that unfortunate.
[04:19:49] pipecloud: tallwhite: What sort of things do you work on? The only thing I like about this city is the place I work.
[04:19:56] ssb123: Isn't everyone looking for devs in mountain view?
[04:20:31] pipecloud: My manager challenges me and also prefers to write things the right way over just delivering the simplest thing quickly. There's cost analysis of what 'right' is, but you get the idea.
[04:20:59] tallwhite: pipecloud, ruby/rails/js/mongo/redis/ec2/postgres/heroku/git
[04:21:02] pipecloud: He's also a developer who happens to manage his team.
[04:23:54] pipecloud: tallwhite: So, what business domain do you work in?
[04:24:43] ssb123: I'm out. pipecloud when we launch in atl i'll shoot you a promocode to give it a try :)
[04:24:54] pipecloud: ssb123: That'd be pretty bitchin'.
[04:25:56] ssb123: I must say, it's a pretty awesome product =)
[04:28:33] ssb123: thanks for the advice.. later!
[04:31:36] rhizome: bundle package means deploys take a year now
[04:33:11] bricker: Has matz ever put up a notable web application? I don't mean anything negative by this, I'm just trying to prove to a colleague that it's stupid to seek a "ruby developer" when really what you want to hire is someone who can build web apps.
[04:34:11] bricker: And wanted to use matz an example of someone who (obviously) knows ruby very well, but we wouldn't want to hire him because he doesn't know how to build customer-facing web apps as another candidate might. But I also don't want to be eating my foot in 2 minutes.
[04:34:16] pipecloud: bricker: I don't think he's into the web in that way/
[04:38:35] dopie: anyone experienced with rackspace , nginx , capistrano and rails :)
[04:42:01] FLeiXiuS: dopie, You could just ask your question...
[04:42:11] dopie: FLeiXiuS, yeah I could
[04:42:18] dopie: just trying to break it or make it work
[04:49:55] rhizome: bricker: ruby is not rails
[04:53:19] bricker: rhizome: lol
[04:53:26] bricker: rhizome: you missed the point but thanks for the sermon
[04:55:39] Senjai: bricker: Yeah, I don't think matz does too much with the web.
[04:55:47] Senjai: bricker: I think he's more into systems programming
[05:07:14] rhizome: it's good to spend a day on systems so i can see freaky shit go on
[05:08:48] lethjakman: should my Gemfile.lock be in git?
[05:08:59] lethjakman: seems like it needs a bundle update every time anyways
[05:09:59] lethjakman: jrobeson: any reason why?
[05:10:03] jrobeson: lethjakman, it won't need a bundle update on deployment
[05:10:37] jrobeson: the lock is so other people get the same versions you get.. to guarantee consistency
[05:11:04] lethjakman: jrobeson: ahhh ok.
[05:11:06] jrobeson: you wouldn't want your co developers getting other perhaps broken versions
[05:11:16] lethjakman: that makes sense, ok
[05:11:31] lethjakman: seemed to break when I was deploying to my server, must have been another issue though
[05:11:43] pipecloud: lethjakman: you want to commit your Gemfile.lock, yes.
[05:12:04] pipecloud: It's essentially a manifest of the versions of the gems specified by your gemfile.
[05:12:07] pipecloud: And their dependencies.
[05:17:18] Xander1: what could cause for the route in the app to work on localhost, but when deployed it doesn't work
[05:18:45] Xander1: i ran migrations on heroku and route still not showing up
[05:19:05] Xander1: looked at the logs and it says that it's not found
[05:19:19] Xander1: but when i start app on my localhost, it all works
[05:20:20] FLeiXiuS: Xander1, post your routes. Also, are you using any source code management? IE git, etc? Did you forget to commit a file ;-P
[05:20:37] Xander1: yeah, using git
[05:21:07] Xander1: looked at git status and it says Nothing to update
[05:21:12] Xander1: or everything's up to date
[05:21:25] FLeiXiuS: Push / Pull - easiest way
[05:21:46] Xander1: to pull from heroku?
[05:22:41] rhizome: ugh, execjs needed to run rake -T
[05:22:50] FLeiXiuS: rhizome, eww
[05:23:02] rhizome: dying here
[05:23:11] FLeiXiuS: rhizome, Which OS?
[05:23:28] rhizome: whole thing is fubar
[05:23:35] FLeiXiuS: Fortunately, should be easy to get.
[05:23:53] rhizome: oh, i installed execjs and rubyracer, but still complains. i don't have root.
[05:23:55] FLeiXiuS: Xander1, Check your files make sure they match both on server and local.
[05:24:04] FLeiXiuS: rhizome, rvm?
[05:24:10] jhgaylor: Hi guys. I've been writing django code for a while now, and though I'm still pretty new at it I was hoping to expand my horizons and learn a new style of thinking about developing web applications. is rails a large shift in perspective? do you have other suggestions?
[05:24:24] rhizome: rvm wasn't working right earlier, maybe i should re-enable
[05:24:44] FLeiXiuS: rhizome, *Wasn't working* sounds like user error ;-)
[05:24:54] rhizome: jhgaylor: other suggestions that what?
[05:25:16] rhizome: FLeiXiuS: all computer errors are human error
[05:25:28] FLeiXiuS: rhizome, Never.
[05:25:53] jhgaylor: rhizome: a web application stack. ive done some python w/ django, some js w/ node. is rails different than them? im trying to learn a new way of thinking about the problems and not necessarily just a new set of tools to get the job done w/ the same mindset
[05:25:55] FLeiXiuS: jhgaylor, Asking that sort of question means you're generally fishing for an answer thats based on biased opinions. Give it a try - if you like it .. go with it.
[05:26:01] jhgaylor: ie functional programming vs oo
[05:26:14] jhgaylor: FLeiXiuS: asking that question was to get opinions
[05:26:28] jhgaylor: FLeiXiuS: id hate to spend 12 hours working in rails only to realize ints django in ruby
[05:26:34] rhizome: only you have and know your goals. doesn't sound like it has to do with any language
[05:27:08] jhgaylor: fair enough guys. thanks for fielding it and not /banning me :)
[05:27:17] FLeiXiuS: jhgaylor, They're both frameworks.
[05:28:16] rhizome: oh, now i remember. the host does not have libyaml installed.
[05:28:21] rhizome: rvm bye bye
[05:29:34] FLeiXiuS: Ruby compile bye bye!
[05:29:51] rhizome: it's a pretty retarded situation, but money's money.
[05:29:51] lethjakman: hrm, I'm trying to figure out how to redirect to the home URL from all other pages if you're not currently logged in and this is what I have in my application_controller: https://gist.github.com/anonymous/6315821
[05:30:06] lethjakman: anyone know how to stop the endless loop of redirects?
[05:30:12] lethjakman: not sure what I should be checking for in this instance
[05:30:22] rhizome: def require_user; unless current_user; rediredt_to root_url; end; end
[05:30:30] rhizome: before_filter require_user
[05:30:52] rhizome: uh, don't require a user on your root_url?
[05:32:52] lethjakman: rhizome: still a constant redirect?
[05:33:27] krz: https://github.com/sferik/twitter/blob/master/lib/twitter/rest/api/friends_and_followers.rb how does friend_ids get called via Twitter::Client.new().friend_ids
[05:33:40] lethjakman: it's because current_user still doesn't exist on the home page.
[05:34:15] krz: does FriendsAndFollowers inherit from a special class?
[05:35:27] pipecloud: krz: What's a special class?
[05:36:36] rhizome: lethjakman: if you require a user before every action, how is anbyody supposed to log in?
[05:37:10] pipecloud: rhizome: A temp user.
[05:39:26] pipecloud: jhgaylor: Rails is a bit different and a bit better than django, imo.
[05:39:40] lethjakman: rhizome: figured it out, needed some skip_before_action's
[05:40:00] tagrudev: morning peeps
[05:40:19] jhgaylor: pipecloud: what makes you say 'better'? i take it you have experience in both? im nervous about the 'convention over configuration' given that i know none of the conventions
[05:40:44] pipecloud: jhgaylor: Here's a reasonable synopsis. http://www.brandonbloom.name/blog/2009/08/19/dropping-django/
[05:40:56] jhgaylor: pipecloud: thank you :) i like reading material
[05:52:03] tagrudev: certainty, you know what day it is :D
[06:14:55] helpa: pipecloud: !!!!!!!!!!
[06:14:55] waseem_: pipecloud: !!!!
[06:15:36] waseem_: pipecloud: I'm going to die for next six hours.
[06:16:11] pipecloud: waseem_: It is unfortunate that it will be for such a short time. I was looking forward to being more proximally close to you in the next life.
[06:42:22] EvilEpoch: Warm Greetings to all, I am The EvilEpoch.
[06:43:55] pipecloud: Are you sure?
[06:47:29] IlyaLevin: Guys. Anyone has experience using nokogiri? Is there a way I can create a Nokogiri::HTML object, change couple attributes at some points and then return the html back as a string?
[06:47:44] EvilEpoch: The EvilEpoch is having difficulties. He is moving his app to Rails 4 and The EvilEpoch is stuck on how to use replace finder_sql for an association. He uses it to add an or condition to the finder.
[06:48:40] EvilEpoch: He wants to be able to grab all rows who's id's match along with all rows which match a "visible" field regardless of key
[06:50:58] jrobeson: EvilEpoch, not sure.. but isn't that sitll available if you install the proper gem.. if you don't wanna deal with it now?
[06:51:24] jrobeson: i have never done an app before rails 4.. but i did read that many removed methods were still available as gems
[06:53:01] EvilEpoch: jrobeson: Probably, however The EvilEpoch would be thrilled if he could find a nice solution to this. Even before, finder_sql seemed a little hackish. It'd be greatly appreciated if someone maybe had a better approach that The EvilEpoch could not think of. The EvilEpoch will look to see if a gem you speak of is available. The EviEpoch is thankful for your response.
[06:53:24] jrobeson: the EvilEpoch will have to wait for more experience :)
[06:53:31] jrobeson: err people with more experience
[06:53:47] lethjakman: hey, I'm trying to make a post that looks like this for a test: user[email]
[06:53:57] lethjakman: what I have is: post(:new, :user => {'email' => 'test@email.com'}) but it's telling me there is no param user
[06:55:29] lethjakman: anyone know why that's not returning right?
[06:55:36] lethjakman: I've tried a couple different ways and can't seem to figure it out
[07:11:05] rhizome: EvilEpoch: i've been working with Sequel this week, and it would probably work well for that. not sure if you want to drop everything for another ORM tho :)
[07:11:21] rhizome: it has an .append_select() method
[07:11:28] tagrudev: any problems with ruby 2.0 and rails 4 (wurkin tugether )
[07:11:59] rhizome: tagrudev: rails 4 was targeted to ruby 2
[07:12:14] rhizome: and by was, I mean "is"
[07:12:23] tagrudev: yeah but the last time I tried with rc2 it's aim wasnt close enough
[07:13:02] tagrudev: I am talking production here :)
[07:13:30] rhizome: it may have worked those kinks out by now, but that said, that's why i wait for 4.1 :)
[07:25:52] maloik: Anyone know if something like this is a bad idea? https://gist.github.com/hannesfostie/3c38229fe816fbb52426
[07:26:18] maloik: it returns the pid of the new process and it's always 2 above the last, so I'm wondering if I'm not supposed to close any connections or stuff like that
[07:26:39] maloik: went out of memory the last time and quite unsure what caused it
[07:27:12] pipecloud: maloik: Well, why are you forking?
[07:27:26] maloik: uhm, to create a new redis worker, obviously? :-)
[07:27:31] pipecloud: I'd suggest writing a small daemon that takes some kind of message, maybe a fifo, and forks processes from there.
[07:27:46] Olipro: Resque? I thought Sidekiq was the new "in" thing
[07:27:50] pipecloud: Forking from big processes is shitty.
[07:28:04] maloik: pipecloud: problem is that we want to stop and start workers from our app
[07:28:16] pipecloud: maloik: Use signals?
[07:28:27] maloik: sorry what ?
[07:28:29] pipecloud: Or do you just want to depend on them to be children of your app's process?
[07:28:39] pipecloud: Because that sucks a bit.
[07:28:47] maloik: okay so the thing is that resque will allow you to register and unregister a worker
[07:29:01] maloik: which works fine for us, the only issue is that the pid remains the same if we do so without forking
[07:29:12] maloik: which is causing weird errors when unregistering
[07:29:34] maloik: hence my attempt at forking like in the gist
[07:30:32] pipecloud: ForkService.fork('resque-worker') # Writes to a socket that the Forking Service Daemon is listening to and forks a process and doing whatever it needs to based on the arg to #fork
[07:31:00] pipecloud: Have it write back the pid of the forked process to your app as the return value.
[07:31:25] maloik: could you explain why such a thing is required or recommended? I don't quite get it
[07:31:39] pipecloud: maloik: What happens when you take rails and fork a process from it?
[07:31:48] maloik: I have no clue honestly
[07:32:05] pipecloud: working with unix processes might help
[07:32:24] pipecloud: That's a book.
[07:32:57] pipecloud: maloik: So why are you using Process.fork to register a new worker?
[07:33:08] maloik: pipecloud: to get a new pid for the new worker
[07:33:50] maloik: a resque worker's id is hostname:pid:queue_name... if I want to start 2 workers for the same queue without forking, I cant
[07:33:59] pipecloud: maloik: Doesn't Resque::Worker already fork for you?
[07:34:07] maloik: and if I start 2 workers for different queues they'll have the same pid causing some issues when stopping all workers
[07:34:10] maloik: apparently not
[07:34:29] maloik: well I assume it doesn't based on the pid that's not going up
[07:34:35] pipecloud: Oh I see what's going on.
[07:34:48] maloik: maybe I'm wrong in that assumption, but then I have no clue where to look for a solution
[07:35:09] pipecloud: maloik: So, the resque worker itself should have your app loaded and it just forks itself off to do worker stuff.
[07:35:53] maloik: up until now we used a rake task to spawn workers, but always just one for all queues
[07:36:12] maloik: we wanted to change that for a new feature, but also want control over one of the queues from within the app, so we changed the way they are spawned
[07:36:23] pipecloud: maloik: Try tracking down what the +1 of the current pid is to see what's up.
[07:36:27] maloik: no longer using the rake task, instead using Resque::Worker... so here I am
[07:36:34] maloik: k lets see
[07:37:15] maloik: i can't find anything
[07:37:56] maloik: Could it be the actual forking of the process, which gets closed down after it's complete ?
[07:38:02] maloik: (that's a complete guess)
[07:38:31] pipecloud: I guess it depends on what the Resque::Worker class does after your initial fork.
[07:39:03] clocKwize: I've got a queue of jobs in a mongo table, if i write a worker rake task that finds the next pending one, updates pending = false and works it, will I have any problem with concurrency? best way to ensure only one worker will try and work a given job
[07:39:22] pipecloud: clocKwize: It depends on your mongodb setup.
[07:39:40] clocKwize: pipecloud: 2 server replica set
[07:39:54] pipecloud: clocKwize: So you have 3 nodes total?
[07:40:24] clocKwize: no 2.. like servers: ["server1", "server2"]
[07:40:42] pipecloud: That goes against what mongodb says you should do.
[07:40:48] pipecloud: You should have an odd number.
[07:40:56] pipecloud: Or employ an arbiter.
[07:41:23] clocKwize: well, it's hosted mongo
[07:41:26] maloik: pipecloud: https://github.com/resque/resque/blob/master/lib/resque/worker_registry.rb#L110:L117
[07:41:39] maloik: trying to fine the pipelined part now
[07:41:46] pipecloud: clocKwize: Well, they're doing mongodb wrong. This means you can't ensure proper consistency without at least an arbiter.
[07:42:07] pipecloud: maloik: Open the Redis library and see.
[07:42:07] clocKwize: well, either way, not the current issue
[07:42:26] clocKwize: I'm looking at using $findAndModify to find the next pending job, and update it to pending false and return it to me
[07:42:40] clocKwize: thats an atomic operation, so should be fine right?
[07:42:45] pipecloud: clocKwize: Your question was about concurrency, with only two nodes, you can't ensure that you're safe from concurrent writes.
[07:42:54] pipecloud: Atomic to the one node.
[07:43:13] pipecloud: If your workers only read from one node that's probably maybe okay.
[07:43:49] clocKwize: well, they have both hosts in the mongoid.yml
[07:44:21] pipecloud: http://docs.mongodb.org/manual/core/write-operations/
[07:44:51] clocKwize: could use safe with $findAndModify
[07:45:34] pipecloud: You have a fundamentally flawed database server setup.
[07:45:54] pipecloud: Unless your host has a third node in there as a replica set or arbiter, you can't trust any of it.
[07:46:05] pipecloud: That's the issue with the distributed model they chose, but it's not a mistake.
[07:46:29] pipecloud: They intentionally don't address these kinds of transactions, it should be an app-level thing.
[07:47:25] clocKwize: how can it be?
[07:48:08] clocKwize: we use http://www.mongohq.com/pricing SSD backed replica set ($100/month)
[07:49:27] pipecloud: Ah, we used to use them at a project I was on.
[07:49:45] pipecloud: We were their biggest customer, they had to change a lot of infrastructure plans to handle us.
[07:50:43] pipecloud: clocKwize: Look into how they handle the replica sets to make sure it's an odd number for the database servers to reconcile.
[07:51:06] clocKwize: well, I'm not sure of the set up, they give us 2 end points to put in our config though
[07:51:09] clocKwize: not sure what happens in the background
[07:51:15] clocKwize: how can I see?
[07:51:23] clocKwize: I'm sure they know what they are doing
[07:52:05] pipecloud: And don't ever assume a SaaS knows what they're doing.
[07:52:37] clocKwize: can you point me to the document that says replica sets should be an odd number and why?
[07:53:06] pipecloud: http://docs.mongodb.org/manual/core/replica-set-architectures/
[07:54:04] pipecloud: http://docs.mongodb.org/manual/core/replica-set-architecture-three-members/
[07:54:48] pipecloud: They may use arbiters that you aren't exposed to, but I'd just ask them.
[07:54:54] clocKwize: yeah, I have
[07:55:00] krz: where is a good place to dump modules? /lib/modules/foobar/foo.rb?
[07:55:54] pipecloud: Where they are appropriate.
[07:56:24] pipecloud: A chunk of code being a module doesn't really matter, it's intent and behaviour help direct you to where it might belong in a file structure.
[07:57:21] mupkoo: Good morning guys :)
[07:57:35] mupkoo: I have a problem
[07:57:44] mupkoo: get '/:locale', to: 'home#index', as: 'home', constraints: { locale: '/hu|en/' }
[07:57:56] mupkoo: this route won't match /en or /hu routes?
[07:58:20] mupkoo: I am using Rails 4
[07:58:28] clocKwize: what is locale: meant to be?
[07:58:35] clocKwize: ' ' indicates its a string
[07:58:44] clocKwize: but /hu|en/ indicates you want a regex
[07:58:46] pipecloud: mupkoo: Dont' pass a string, pass a regex
[07:59:04] mupkoo: Dump ass me
[07:59:08] clocKwize: constraints: {locale: /hu|en/}
[07:59:16] pipecloud: http://guides.rubyonrails.org/routing.html#segment-constraints
[08:03:24] krz: pipecloud: huh?
[08:05:25] krz: surely there is a practical location
[08:05:25] krz: i was thinking app/modules as well
[08:05:39] pipecloud: I'd probably not ever do that.
[08:06:07] pipecloud: If you just have arbitrary chunks of ruby wrapped in modules that doesn't have any real purpose that would help you figure out where to best put it, I'd just delete the code. :)
[08:07:05] krz: 27 signals treats them as concerns. but we use service objects. regardless. both patterns are stored in /app
[08:07:14] krz: so i dont see why they cant be placed in /app
[08:07:28] krz: app/modules or app/services
[08:08:55] pipecloud: You haven't once described what the content of the module does.
[08:09:14] pipecloud: It being a module means absolutely nothing other than you might be into namespaces, maybe.
[08:09:44] ljarvis: please dont ever create an app/modules folder
[08:10:23] pipecloud: Unless that's a conceptualized part of your application architecture.
[08:10:39] mupkoo: Hey guys, what do you think is the problem here?
[08:10:39] mupkoo: No route matches {:controller=>"home", :action=>"index", :locale=>"hu"} missing required keys: [:locale]
[08:10:42] pipecloud: Don't use app/modules for any old code you wrapped in a ruby module .
[08:10:56] pipecloud: mupkoo: What's the requested URL?
[08:11:22] mupkoo: site.dev/en
[08:11:31] pipecloud: Have you restarted your rails server recently?
[08:12:03] mupkoo: I haven't
[08:12:08] mupkoo: so I did it now
[08:12:10] mupkoo: and it works
[08:12:15] mupkoo: thx again pipecloud
[08:14:55] Syrit: guys, my rspec tests are failing, i am using mongoid, and in my model, i am using field aliases like "fn" , so the test is expecting to find fn, but it's finding First_name and failing, any solution for this ?
[08:15:11] TwinkleHood: Hm. Just stumpled upon a migration that doesn't work. It's creating default rows of itself, within the migration. This is bad, right? It should be in the seed?
[08:17:33] pipecloud: Syrit: !gist
[08:17:45] Syrit: ok, one sec pipecloud
[08:21:47] Syrit: pipecloud, https://gist.github.com/anonymous/1dd92196bdb500fba238
[08:24:09] ljarvis: TwinkleHood: not if you've asked it to
[08:25:27] TwinkleHood: ljarvis: https://gist.github.com/kholbekj/368100751725b0e34d4f
[08:25:41] TwinkleHood: This throws an unitializaed constant error, besides from weirding me out.
[08:25:43] pipecloud: Syrit: Consider using a diffable matcher.
[08:25:56] ljarvis: TwinkleHood: right yeah you shouldn't do that
[08:26:03] Syrit: oh, i will google that pipecloud , thanks !
[08:26:11] TwinkleHood: _I'm_ not doing that, I'm working on fixing it :P
[08:26:32] ljarvis: TwinkleHood: fixing it = deleting it :)
[08:26:49] TwinkleHood: Myeah. Not to menion how freaking useless this database table looks
[08:26:54] TwinkleHood: I mean, try and figure what it DOES
[08:27:17] ljarvis: it looks like something that could be hardcoded
[08:27:35] TwinkleHood: So, it creates a two-state thing, that custommers can have.
[08:27:45] TwinkleHood: I wonder how we could write that without an entire extra table.
[08:28:04] ljarvis: right, add a status field to a (customer?) and have it either 'active' or 'inactive'
[08:28:18] TwinkleHood: Or a boolean active field.
[08:28:34] ljarvis: even better
[08:28:58] TwinkleHood: Apparently, the previous programmer gave up on getting his migrations to run, and just hardcoded the database <
[08:29:01] TwinkleHood: I love my job.
[08:30:50] TwinkleHood: But halt - it gets better. We have a simulation-client that reads and writes to the same database as the webapp - and it is C, with hardcoded database interaction. So changing ANYTHING is a huge deal.
[08:32:45] omarqureshi: could be worse
[08:33:02] omarqureshi: could be RPG II
[08:57:59] quazimodo: elaptics: hi
[08:58:19] elaptics: quazimodo: hi
[09:17:27] dopie: Hey I have sqlite3 in production
[09:17:39] dopie: I deploy using capistrano
[09:18:03] dopie: and my database keeps on getting overwritten
[09:20:14] le_gars: hello, Im having problems with displaying the error messages in simple_form
[09:22:07] omarqureshi: dopie: firstly, dont use sqlite3 in production
[09:22:23] omarqureshi: secondly, are you sure you arent overwriting it on deploy?
[09:22:27] omarqureshi: is it in your shared folder?
[09:22:49] omarqureshi: if you do the right thing (by not using sqlite), all your problems will be solved.
[09:23:19] dopie: omarqureshi, im pretty sure im overwriting on deploy
[09:23:28] dopie: how do i not overwrite it
[09:23:34] omarqureshi: dont fucking use it
[09:23:56] TwinkleHood: But no. Don't.
[09:24:28] TwinkleHood: He's mad. Get Maria
[09:24:49] omarqureshi: yeah, use a fork of the worlds shittest database by a guy who has a track record of selling out.
[09:25:15] omarqureshi: or, use a community driven real database that is acid compliant.
[09:25:37] TwinkleHood: Or just fuck relational and go redis og neo4j
[09:25:49] omarqureshi: he already went full retard by using sqlite3
[09:25:54] omarqureshi: don't encourage him
[09:26:00] TwinkleHood: Nah, rails went full retard on him
[09:26:06] TwinkleHood: How could he know it would try such trickery
[09:26:10] dopie: omarqureshi, just used what was ootb
[09:26:27] dweeb_: how do I test a simple method as this: http://pastie.org/private/be0uvy5kwhgaw2l05mruzg
[09:26:53] omarqureshi: i really disagree that sqlite3 should be a default
[09:27:03] TwinkleHood: I have nothing against postgres, but if you're not an idealist, i suggest MariaDB.
[09:27:13] TwinkleHood: Postgres is for wardriving <3
[09:28:01] dopie: well i would like to make it work with PG
[09:28:25] dopie: what i installed pg
[09:28:29] dopie: wtf do i do now
[09:28:35] omarqureshi: replace gem 'sqlite3' with gem 'pg'
[09:28:57] omarqureshi: change your adaptor in config/database.yml accordingly (see the rails docs)
[09:29:10] omarqureshi: and install postgres, by using the pgdg repositories for your distro
[09:29:10] dopie: using rails 3.2
[09:29:27] omarqureshi: http://yum.postgresql.org/repopackages.php < redhat based
[09:30:16] omarqureshi: http://wiki.postgresql.org/wiki/Apt < debian
[09:30:56] omarqureshi: http://wiki.postgresql.org/wiki/YUM_Installation < infact that's better for redhat
[09:36:40] TwinkleHood: omarqureshi: Btw, did you hate neo4j?
[09:38:15] certainty: haters gotta hate
[09:39:36] TwinkleHood: Apparently today isn't gonna be a railsday. It's gonna be a C day. Such a volatile thing to be the sole dev.
[09:39:56] certainty: pun intended?
[09:44:53] certainty: the volatile one ;D
[09:47:17] TwinkleHood: certainty: There may have been intentions of puns in the wording there, admittedly.
[09:48:44] TwinkleHood: So i was like, yay, at least it's C++. And then it hit me. It's C++03.
[09:48:48] TwinkleHood: Imma need so much more coffee.
[09:51:26] certainty: TwinkleHood: that wont give you (a) boost ;p
[09:51:34] certainty: enough of the puns
[09:51:55] TwinkleHood: It's never enough
[09:54:20] omarqureshi: TwinkleHood: never had a need for a graph db
[09:57:53] certainty: graph = edge-list = relation :p
[09:57:57] certainty: => postgres
[10:02:00] Sep1: Hello guys, I have an app on Amazon EC2 and I am trying to add my custom domain. I created the ElasticIP for this EC2 instance, but when I try to put into the browser the generated IP address, it doesn't work. Do I miss something or is it correct behavior?
[10:06:35] dopie: ok awesome
[10:06:41] dopie: i switched over to PG
[10:12:43] dopie: TwinkleHood, omarqureshi , after installed and running what do i do?
[10:18:09] jammanbo: Anybody using Tire and know how to define a custom analyzer globally?
[10:22:09] TwinkleHood: dopie: You installed PG?
[10:22:44] TwinkleHood: Or you put it in rails?
[10:22:59] dopie: installed and put it on rails
[10:23:16] TwinkleHood: Had a look at config/database.yml ?
[10:23:32] TwinkleHood: Okay, so what do you need? :)
[10:23:43] dopie: postgres=# create database dcaclab_development owner guy_on_stackoverflow;
[10:24:45] TwinkleHood: I guess re-run migrations?
[10:24:49] TwinkleHood: Haven't used pg.
[10:32:18] elaptics: dopie: do rake db:create; followed by rake db:migrate
[10:33:28] dopie: works in development
[10:33:34] dopie: bombs in production
[10:36:06] elaptics: dopie: bombs how?
[10:36:13] dopie: FATAL: Peer authentication failed for user "guspares"
[10:36:16] dopie: in production
[10:36:41] jammanbo: google is. you'll find instructions on how to modify your pg config.
[10:37:21] jammanbo: http://infostub.com/postgresql/postgresql-error-fatal-peer-authentication-failed
[10:42:20] AzizLight: Hi everybody
[10:44:01] AzizLight: I haven't precompiled my assets, and for some reason, when I add some css styles to a file in development they don't get picked up. Any ideas what might be the problem please?
[10:45:22] kaspergrubbe: AzizLight: Try to run rake assets:clean
[10:47:01] AzizLight: kaspergrubbe: didn't fix the problem..
[10:47:38] kaspergrubbe: AzizLight: And you are including this css file as part of your manifest?
[10:47:38] dopie: jammanbo, thats for development
[10:47:43] dopie: i need for production
[10:47:52] AzizLight: kaspergrubbe: yep
[10:48:27] jammanbo: dopie: excuse me??
[10:48:36] dopie: i changed it
[10:48:40] dopie: and same error
[10:49:05] AzizLight: kaspergrubbe: I'll have to go with inline styles for now, don't have the time to fix the problem now...
[10:49:07] jammanbo: and you restarted postgres of course? Because that is definitely the source of the error.
[10:49:12] AzizLight: kaspergrubbe: thanks for the help though
[10:49:30] kaspergrubbe: AzizLight: np, I hope you get the error at some point
[10:49:37] dopie: ofcourse not
[10:49:49] AzizLight: kaspergrubbe: yeah, inline styles are not ideal
[10:50:36] boytoy: Question. How would you guys like to see Snorby (https://github.com/Snorby/snorby) as a Rails Engine so you can just plug it into your apps?
[10:50:46] dopie: jammanbo, trying to figure out how to restart it
[10:50:53] dopie: pg_ctl restart doesnt work
[10:52:09] illbyte: Hi, I got this weird issue while upgrading to Rails 4, I got the protected_attributes gem installed and I about to move to strong parameters, but when I call permitted on an ActionController::Parameters object it always returns true?
[10:52:18] jammanbo: well your other option is to make sure that the unix user you are using is the same user you want to connect to the db as.
[10:52:46] dopie: i use deployer
[10:52:53] illbyte: correction: permitted?
[10:53:05] boytoy: Correction:
[10:53:09] boytoy: How would you guys like to see the Snorby intrusion detection system (https://github.com/Snorby/snorby) as a Rails Engine so you can just plug it into your apps?
[10:56:42] dopie: jammanbo, the unix user is not the same one... im guspares on the local machine and deployer on the server
[10:57:46] jammanbo: what I'm saying is that unless you make that change ^, you will need to make sure that you connect to postgres as deployer as well.
[11:32:25] lessless: a rspec question: how to test that instance method calls other method with new syntax?
[11:33:24] elaptics: lessless: what are you testing?
[11:35:16] lessless: elaptics, https://gist.github.com/dirty-hippie/6318359#file-test-rb-L7
[11:35:35] lessless: that perform method is calling a reciver,recive
[11:35:55] lessless: also it will be good to test arguments supplied :)
[11:36:03] elaptics: lessless: do you have any specs at the moment for it?
[11:36:15] lessless: elaptics, nope
[11:36:40] elaptics: where is calculations_result coming from?
[11:40:02] elaptics: lessless: anyway, what I would do is create 'reciver' as a mock object and then set an expectation on it that it receives 'recive' with whatever calculations_result is supposed to be
[11:40:48] disgrntld: Hello, I am trying to use WebMock in some RSpec model tests, but my stubs don't seem to be registering when placed in the RSpec before(:each) hook. The model in question has an elasticsearch mapping that I think is making a web request before the RSpec hook runs. What can I do?
[11:40:48] elaptics: lessless: I can knock up a quick example if it'd help if you're new to testing
[11:41:07] helpa: disgrntld: 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.
[11:41:07] elaptics: disgrntld: !code
[11:41:44] lessless: elaptics, be so kind please :)
[11:42:59] robbanp: Anyone using Rubber? It's impossible to get it working all the way :/
[11:45:32] disgrntld: http://pastebin.com/b3CufME1
[11:46:18] disgrntld: http://pastie.org/8262504
[11:48:51] disgrntld: the tests don't fail because of the exception, they fail because of a non-stubbed web request at line: "mapping do"
[11:50:58] elaptics: lessless: https://gist.github.com/andyh/9da1a5238e4c7c1e363c
[11:51:41] elaptics: disgrntld: love the naming :)
[11:51:57] disgrntld: lol, sorry, I was just getting frustrated
[11:52:34] elaptics: disgrntld: what specs are you trying to run. Can you add them?
[11:52:58] disgrntld: specs are completely empty
[11:53:05] disgrntld: well, the spec in question is
[11:53:14] disgrntld: other specs fail with the exception
[11:53:41] disgrntld: literally "describe Whatev do; end"
[11:54:00] lessless: elaptics, I see... but how to test what arguments are passed to perform method?
[11:54:39] disgrntld: weird, huh?
[11:56:20] elaptics: disgrntld: what error do you get then?
[11:56:48] disgrntld: WebMock::NetConnectNotAllowedError
[11:57:45] elaptics: lessless: just updated the gist to show you
[12:01:24] disgrntld: ohh, this looks promising, I can disable the Tire gem that makes the elasticsearch calls: https://gist.github.com/dvdplm/2214961 but then I won't be able to do proper integration tests later
[12:01:36] disgrntld: lemme try this though
[12:03:29] disgrntld: actually, this should work fine, it defines the stub in Tire's module
[12:06:23] starfox21: the app I am working on has a post model. A post has a status field, which is a string that is usually made up of several words separated by underscores: eg. 'active_rating', 'active_progress'. I want to have a scope on post that returns all the posts that have a status which includes active (so posts with both 'active_rating' and 'active_progress' status fields would be returned). How would I do this? I am using Postgres
[12:10:02] elaptics: starfox21: why do you have multiple words for statuses?
[12:12:10] Xeago: How do I scope a relation in rails3?
[12:12:25] starfox21: elaptics: no, I am essentially using status in a state machine
[12:12:30] Xeago: in 4, it is belongs_to :rel, lambda { ;; }
[12:13:27] luist: hey guys… one my gitorious init script runs this command (only): init script runs this command: /bin/su - git -c "cd /var/www/gitorious;RAILS_ENV=production script/poller $@" but its not running the daemon… any help?
[12:13:29] elaptics: Xeago: iirc you specify the conditions in the belongs_to call. Check the docs
[12:13:57] elaptics: starfox21: right, but why are they active_foo, active_bar, why not just foo and bar?
[12:14:38] elaptics: Xeago: 3.2 docs are here: api.rubyonrails.org/v3.2.13
[12:15:17] Xeago: elaptics: so like belongs_to :rel, conditions: "deleted_at IS NULL"
[12:15:33] elaptics: Xeago: sound about right
[12:15:47] Xeago: what I want to do is override the default scope for the related model
[12:16:53] elaptics: Xeago: dunno if default scope gets applied to the relations - I really try to avoid default_scope it's more pain than it's worth
[12:16:59] Xeago: I am using paranoia/acts_as_paranoid gem, which gives a default_scope { where(deleted_at: nil) }
[12:20:14] lessless: elaptics, how to check public_send(method_name, attrs) if respond_to?(method_name.to_sym) ? :)
[12:20:20] lessless: in Performer class ;)
[12:20:50] lessless: how to check that method is called when it is defined
[12:22:10] elaptics: lessless: not sure I understand what you're wanting to do
[12:23:25] aaronmcadam: I keep having an annoying issue with Cucumber. If there are any errors in the Controller, it only shows the errors raised by capybara (page.should...). I'm sure that's not the way it used to work?
[12:23:25] aaronmcadam: In order to actually see the error, I have to `puts page.body` in order to see the Controller erorr
[12:23:25] aaronmcadam: is that expected?
[12:36:18] ravionrails: i have to save email in mysql database for displaying it to user, what is the best way, or any other alternative for this
[12:42:19] msimkins: ravionrails: You can just use a standard controller, just restrict by user_id
[12:44:01] arefaslani: Hi guys! Is there a standard way to comment ruby and rails code?
[12:44:16] ljarvis: Does anyone know if there's a stub_chain equivalent in the new rspec? all these doubles are annoying
[12:44:31] ljarvis: arefaslani: yes, rdoc
[12:46:22] ravionrails: msimkins, actually problem is when i save email with html tags, some ending tags are truncated due to it's width , complete email doesn't get saved in db due to its size
[12:46:47] arefaslani: ljarvis: thanks. I saw another tool named Yard. Which you prefer? for me the there is no difference. Just how many people will use it is the matter. For example I don't like Haml because pure HTML is more popular!
[12:46:53] msimkins: ravionrails: are you storing it in a 'text' column
[12:47:05] ravionrails: msimkins, yes
[12:47:09] lessless: elaptics, I have method that call other method only if it exist and check is performed via respond_to? method, how to test this logic?
[12:47:23] ljarvis: arefaslani: I dont really like yard myself, but a lot of people do so it's entirely down to preference
[12:47:50] ljarvis: arefaslani: both are easy to add to your app, rdoc comes with ruby so it's already there, yard can be installed as a gem
[12:47:52] paxvox: if not via id, how is a record associated with a row?
[12:48:06] arefaslani: ljarvis: Thanks again :)
[12:48:14] lessless: if I understand right, than should_not_receive(:some_really_random_name) test creates a some_really_random_name method in the receiver and because of that respond_to? gives a false positive
[12:49:10] msimkins: ravionrails: Wow, must be some big emails :(
[12:50:16] ravionrails: msimkins, yes, but html tags for formatting spaces all this take up all text column space
[12:51:01] msimkins: ravionrails: mind you I suppose 65k.... - You probably need to alter the column to LONGTEXT, but Im not sure if it is supported in Rails (I dont use MySQL)
[12:51:44] bonhoeffer: moment of confusion -- after a long time on heroku, i'm setting up an ubuntu server, i'm getting You don't have write permissions for the /usr/local/bin directory. when i try to bundle
[12:51:51] ravionrails: msimkins, is there any other alternative you suggest
[12:53:26] msimkins: bonhoeffer: You need to be root (or use sudo) to write there
[12:55:50] msimkins: ravionrails: Hmmm, not totally sure - I think the mysql2 gem may translate it to the rails 'text', you would probably need to run a migration like 'change column :mymodel, :mycolumn, :text, :limit => 4294967295'
[12:56:15] msimkins: ravionrails: make sure you have a DB backup before you run it, because Im not totally sure the format is right
[12:58:44] ravionrails: msimkins, ok but i dont't think text will solve this problem, may be i have to save them in files, or save in database in some other compact format
[12:58:51] msimkins: paxvox: Dont understand the question
[12:59:31] msimkins: ravionrails: Well, the text column is stored in the database, just off from the main table (IIRC)
[12:59:49] paxvox: msimkins: how can Model.select(:not_id).where(:not_id=>smth).delete_all ?
[13:00:45] msimkins: paxvox: you want to delete everything apart from the 'smth' record ?
[13:04:03] msimkins: paxvox: or you just want to delete the smth record
[13:04:46] paxvox: msimkins: sec
[13:07:15] paxvox: paxvox: actually i was wondering about destroy taking models without the id property. but it seems it cannot do that
[13:11:54] paxvox: msimkins: thanks for being willing to help. bye
[13:19:00] ZenCoder: How can I convert this (http://pastie.org/8262682) to json? I'm getting the error 'stack level too deep'..
[13:19:15] ksinkar: what is the channel for rails development?
[13:20:15] elaptics: ksinkar: this one?
[13:20:47] ksinkar: elaptics: #rails-contrib is the one
[13:21:22] elaptics: ZenCoder: presume your problem is the page-image value - should that be a string?
[13:21:27] helpa: ZenCoder: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[13:21:27] DouweM: ZenCoder: !gist your error
[13:21:53] elaptics: ksinkar: ah, you mean actually developing rails the framework, not just an app using rails :)
[13:23:27] Xander1: hi everybody :)
[13:23:34] Xander1: happy friday!
[13:24:29] Xander1: i need help figuring out routes in my app - all routes work on my localhost, but on heroku they are missing - and the route that i'm trying to access has underscore in it - does that matter in routes?
[13:24:34] ZenCoder: helpa:DouweM: https://gist.github.com/anonymous/6319294
[13:24:55] ZenCoder: elaptics: Why should that be a string ?
[13:25:17] Xander1: i have a route "progress_reports_path" - works on my localhost, but on heroku, it says that it's missing
[13:26:58] DouweM: ZenCoder: gist the error, the backtrace
[13:27:06] DouweM: ZenCoder: and what is the type of the page-image value right now
[13:27:12] ZenCoder: DouweM: https://gist.github.com/anonymous/6319294
[13:27:44] DouweM: oh you're right, with stack level too deep there might not be a stacktrace
[13:27:54] DouweM: but anyway, if you leave out the page-image, does it work?
[13:29:17] ZenCoder: DouweM: elaptics: I just made the page-image to be a string (.to_s) and it's now working. Can someone explain why this wasn't working before ?
[13:29:29] DouweM: again: what was the type of page-image?
[13:31:35] ZenCoder: DouweM: it was a file.cfile
[13:32:20] ZenCoder: DouweM: paperclip path of the file
[13:32:57] elaptics: ZenCoder: because I imagine the json renderer can't do anything with that. But a string is fine
[13:33:31] elaptics: ZenCoder: depends what you actually want as a json representation of a file path
[13:34:04] ZenCoder: elaptics: Ok, thanks. Where can I check what types are accepted by json?
[13:41:03] tagrudev: friday friday
[13:41:44] tagrudev: http://d24w6bsrhbeh9d.cloudfront.net/photo/aM1wbWX_460sa.gif
[13:50:53] sedrickcz: hi guys. How can I escape html tags. I tried html_safe, sanitize and nothing
[13:51:53] rvanlieshout: sedrickcz: show us the code from your attempts
[13:54:02] sedrickcz: rvanlieshout: "<b>some text</b>".html_safe sanitize("<b>some text</b>")
[13:55:05] rvanlieshout: sedrickcz: in a console? and what would be wrong about that?
[13:55:40] sedrickcz: rvanlieshout: it returns the same text "<b>some text</b>"
[13:55:46] rvanlieshout: sedrickcz: as it should
[13:55:51] rvanlieshout: only html_safe
[13:56:18] rvanlieshout: you should see difference if you would do <%= "<b>test</b>" %> or the same with .html_safe in a view
[13:57:50] |RicharD|: hi to all i have a options_for_select like options_for_select([['0', '0'] and it say: can't convert String into Integer
[13:57:53] sedrickcz: rvanlieshout: yeah I know. I find out that strip_tags("<b>some text</b>") works just fine
[13:58:36] |RicharD|: i tried to remove the ' first to the number that is the string in drop down, and also in field that is the value of select, but nothing
[13:58:38] Xeago: I am getting this warning: DEPRECATION WARNING: You're trying to create an attribute `action'. Writing arbitrary attributes on a model is deprecated. Please just use `attr_writer` etc. (called from realtime at /home/vagrant/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/benchmark.rb:295)
[13:59:10] Xeago: where does it come from? https://gist.github.com/Xeago/ca74c4c615dc0728f50b
[13:59:17] Xeago: I get it during AddonController#create
[14:00:47] True_False: Hi everyone, i'm making my first rails project and i have a many to many relation between 2 entities(comics and topics). Now i want to select only those topics that are assosiated with at least one comic. But i didn't really understood the where syntax and don't want to do it with an if in the view.
[14:02:03] fryguy: True_False: change from has_and_belongs_to_many to has_many :through, create an explicit join model, and then select all distinct topics from that join model
[14:03:03] True_False: but that's not a nice database then
[14:04:48] True_False: can i keep it like it is and join the tables and the select the distinct topics?+
[14:05:35] Xeago: What would I modify if I want to render json with a relation included
[14:06:30] kape: check as_json method
[14:09:42] qwebirc18283: what are your guys' thoughts on those 3-month dev bootcamps for RoR?
[14:10:07] Xander1: @qwebirc18283 which one?
[14:10:58] BrianJ: how would i go about adding a caption to a photo that gets uploaded via paperclip?
[14:11:21] qwebirc18283: I applied to General Assembly. A 3-month RoR bootcamp in LA
[14:12:08] qwebirc18283: From what I've seen, most RoR jobs require mid-senior level instead of junior. When it comes to RoR is it all about your GitHub profile versus years of experience?
[14:12:11] TheMoonMaster: BrianJ: Probably have an image model with a caption attribute.
[14:13:24] BrianJ: ok I have an asset model (basically the same thing I think). So I would just need to add an attr_accessible :caption and make that a string?
[14:13:32] BrianJ: and add a db migration etc
[14:14:42] nivoc_: I've a simple documentation-question. If I what to read in the official documentation about the use and parameters of the controllers before_action-method - were do I look?
[14:15:29] nivoc_: ri before_action givs me only a redirect
[14:15:45] nivoc_: to _insert_callbacks
[14:16:01] nivoc_: and ri _insert_callbacks returns "Nothing known about _insert_callbacks"
[14:22:52] dknight: how can I find out http version used by net http module ?
[14:29:57] |RicharD|: hi to all i have a options_for_select like options_for_select([['0', '0'] and it say: can't convert String into Integer
[14:31:15] Macaveli: What is the best place to set environment variables? And can I set it to true?
[14:43:03] joshsmith: how do I retrieve multiple records with an Arel query at once?
[14:43:10] joshsmith: like if I have an array of user ids
[14:43:50] joshsmith: oh, I guess it's .find
[14:53:38] Lewix: I saw a foo_path(with_a_hash). How does that work
[14:59:56] sporkbomb: I have been following along Hartl's railstutorial.org. I am a little confused on the logic on when to use double vs single quotes.
[15:00:07] sporkbomb: I know you need double quotes for interpolation
[15:00:30] sporkbomb: and ... from what I have googled, many people feel you could use single quotes otherwise
[15:01:14] sporkbomb: ... but does anybody know why Hartl switches between either throughout the tutorial? Is there a pattern that I am not seeing?
[15:01:34] kaspergrubbe: sporkbomb: Our codebase is also like that, people switch between them
[15:01:46] max96at: I just use single quotes whenever I have a literal string
[15:02:13] sporkbomb: OK ... so there is truly no "standard" to date
[15:02:48] sporkbomb: thanks for the feedback. I know this sounds petty to most, but I was just curious, since I am really loving my Rails and Ruby learning
[15:03:58] max96at: anyone got an idea why rails would reinclude my scripts and only my scripts with turbolinks enabled?
[15:04:26] max96at: resulting in having <amount of page loads> versions of each script
[15:04:37] kaspergrubbe: max96at: your scripts are defined outside of your layout?
[15:05:13] max96at: the only script line I have is in application.haml
[15:05:20] max96at: = javascript_include_tag 'application', 'data-turbolinks-track' => true
[15:07:04] max96at: and I end up with something like this after browsing around for a bit: http://puu.sh/48W5b.png
[15:07:09] max96at: kaspergrubbe: ^
[15:08:05] kaspergrubbe: Could you look in the returned HTML from turbolinks to see if it contains a reference to these assets?
[15:08:17] kaspergrubbe: Look in the network tab
[15:10:43] max96at: it does, but it also references the stylesheets and those don't get included multiple times
[15:11:36] kaspergrubbe: That is probably just your browser trying to clean it up, Chrome can sometimes hide these errors.
[15:12:52] boytoy: For things like blocking old versions of IE (http://ruby-journal.com/how-to-block-old-ie-version-with-rails/) and blocking Tor IPs (http://en.wikipedia.org/wiki/Wikipedia_talk:Blocking_policy/Tor_nodes), is it better to make a Rack Middleware from scratch or use something like Rack::Attack (https://github.com/kickstarter/rack-attack)?
[15:13:05] kaspergrubbe: max96at: so your layout is included with turbolinks? I am not that familiar with Turbolinks yet, but I thought it excluded the layout, and that was the point.
[15:13:27] max96at: no, the point is to not reload the assets
[15:13:44] DaniG2k: hmm...I'm calling the new action from a link_to and it all works nicely. However, this exposes the /new route, and if I go to that it tells me there's no template
[15:13:47] DaniG2k: i dont want a template
[15:13:55] DaniG2k: is there a way to not let it complain about that?
[15:14:03] DaniG2k: or to not expose that route?
[15:14:31] kochis: Does anyone know if there's a way to disable console.log in capybara tests?
[15:16:43] fryguy: DaniG2k: what do you think link_to is doing that isn't route related?
[15:17:15] ljarvis: kochis: sounds more like a js adapters job
[15:17:37] DaniG2k: fryguy: <%= link_to "#{tutor.user.first_name} #{tutor.user.last_name}", new_conversation_path(:recipient_id => tutor) %>
[15:17:57] DaniG2k: fryguy: it hits the action properly and does what i want it
[15:17:57] fryguy: DaniG2k: right, so that new path is going to be accessible by anything
[15:18:33] kochis: ljarvis: js adapter?
[15:18:36] fryguy: so how do you want to make it go away and be accessible at the same time
[15:19:06] DaniG2k: fryguy: thats a good question. I want it to only be accessible if it includes that :recipient_id param
[15:19:30] DaniG2k: fryguy: otherwise it doesnt provide the right info for the form on that new page
[15:19:43] fryguy: ok, so add that check to your action
[15:20:12] DaniG2k: fryguy: ur probably right
[15:25:43] DaniG2k: fryguy: brilliant
[15:25:56] DaniG2k: fryguy: i did a redirect if that param is nil and it works amazingly now :D
[15:26:11] DaniG2k: my controller is getting a bit thick though
[15:26:31] DaniG2k: wondering if I should leave all this logic in the controller or move it somewhere else
[15:29:03] starfox21: hey guys I want to do an has_many posts, conditions: {status: 'pending' || 'active' } . What is the syntax to do a OR in the status condition?
[15:32:16] timhansen: anyone around with experience deploying to CentOS 6.3?
[15:32:35] timhansen: i keep getting a "Forbidden" error on my precompiled assets
[15:52:32] rhizome: surely the error is something more than "forbidden"
[15:58:58] obelich: hiyas good morning
[15:59:08] tubbo: timhansen: permissions?
[15:59:10] rhizome: good morning
[15:59:28] obelich: rhizome: ohayou gozaimasu jejejeje :P
[15:59:35] tubbo: running `rake assets:precompile` as one user and starting the server as another will certainly cause errors like that..
[16:03:38] obelich: rhizome: do itachimachite tomodachi o genki desu ka
[16:04:46] rhizome: sorry, i'm out of words
[16:06:03] obelich: rhizome: jejeje im newbie to :)
[16:06:16] obelich: rhizome: o genki desu ka = how are you
[16:06:29] obelich: rhizome: genki desu = im good
[16:06:57] obelich: rhizome: i dont remember how is for say im bad give that for studing jejeje :P
[16:07:25] boytoy: jajajaja :D
[16:07:41] boytoy: i gotta learn that language too
[16:09:09] obelich: boytoy: excelent more people to practic jeje :) im speak spanish
[16:11:10] boytoy: thats cool thats cool
[16:12:27] obelich: one question about delegate
[16:14:54] obelich: i have a table name workingdays and table name paysheets and other one name clients i try to delegate clientname to table workingdays but this table is not Foreign key paysheets is Foreign key
[16:14:54] obelich: sorry me english is very bad:(
[16:15:27] obelich: nvm i have resolve jejeje
[16:15:34] obelich: i love ruby on rails jejeje
[16:22:46] fuzzyhorns: @invitation = ::Invitation.where(campaign_id: @campaign.id, retailer_id: retailer.id).first if retailer
[16:22:57] fuzzyhorns: in the above, if there is no retailer, does that mean @invitation will not be set at all?
[16:23:04] fuzzyhorns: or just not retailer_id?
[16:24:34] rhizome: it will not be set. if your associations are set up, you should be doing retailer.invitatios.where(campaign_id: @campaign.id)
[16:25:10] rhizome: and it shouldn't be called at all if there's no retailer ;)
[16:25:21] obelich: fuzzyhorns: i recomended use gist https://gist.github.com/ :)
[16:25:49] tbuehlmann: funny thing, @invitation wouldn't be defined. if it was a local variable, it would at least be defined as nil
[16:27:11] rhizome: the world of nil checks
[16:33:28] rhizome: time to convert this to environment variables for database.yml
[16:33:54] ljarvis: psh, just use DATABASE_URL
[16:34:31] rhizome: not sure what that refers to
[16:34:53] ljarvis: ActiveRecord uses ENV['DATABASE_URL'] if it's set
[16:35:18] ljarvis: or is that sequel D:
[16:35:42] rhizome: oh, a sequel head! i might have some questions for you this afternoon. :)
[16:35:54] ljarvis: Yeah it's AR http://api.rubyonrails.org/classes/ActiveRecord/ConnectionHandling.html#method-i-establish_connection
[16:35:56] rhizome: no, this is just for user/pass...in 3.x
[16:36:54] rhizome: that's handy, though
[16:37:26] starfox21: does devise have support for verified email change?
[16:48:54] lethjakm1: starfox21: probably has an event, check out the model.
[16:59:47] Senjai: Hello everyone!
[17:06:55] lethjakm1: Senjai: hello!
[17:07:18] lethjakm1: Senjai: what time zone are you in? you seem to be pretty close to mine
[17:07:27] lethjakm1: or maybe you just don't sleep much.
[17:14:20] v8energy: should I use Faye or is there something similar to faye and better out there which i am not aware of?
[17:16:47] rhizome: v8energy: ruby-toolbox.com
[17:24:06] v8energy: i am getting this weird error with faye. any ideas?
[17:24:07] v8energy: WebSocket connection to 'ws://localhost:9292/faye' failed: Error during WebSocket handshake: 'Upgrade' header is missing
[17:24:22] timhansen: tubbo: i can't find any problem with permissions. everyone says to do 755, and all files (including parent directories) are 755. i tried making a single image 777, and i still get forbidden
[17:25:01] rhizome: never use 777
[17:31:00] EvilEpoch: Warm Greetings to all, I am The EvilEpoch.
[17:33:10] Senjai: EvilEpoch: o/
[17:33:24] EvilEpoch: Greetings to Senjai from The EvilEpoch.
[17:33:31] Senjai: HUZZAH, I got hired as a full time rails dev!
[17:33:48] Senjai: ACTION dances
[17:34:12] esparkman: congrats Senjai
[17:34:26] Senjai: Thanks, I'm super stoked!
[17:34:57] EvilEpoch: Congrats Senjai. The EvilEpoch has embarked on that path in the past and wishes you much luck.
[17:40:06] argentum: congratulations, Senjai
[17:42:17] Senjai: argentum: Thanx!
[17:46:14] palam: does anyone use sunspot? is there a way to limit the selected fields when using @search.results?
[17:58:16] rhizome: limit? it'll use will_paginate
[17:59:24] rhizome: fun: ((Date.today - Date.parse(u.birthdate.to_s)).to_i/365.25
[18:03:37] |RicharD|: i have this in the routes:
[18:03:37] |RicharD|: get "/search", :to => "welcome#index"
[18:03:37] |RicharD|: post "/search", :to => "plans#search"
[18:04:01] |RicharD|: but when i submit the form, it take the welcome#index action and no plans#search
[18:07:25] rhizome: how are you submitting it?
[18:07:32] rhizome: check your logs to see what method is being used
[18:08:51] rhizome: brain fart: u = User.new(...); u.signup_type = "foo"; # u.signup_type returns "foo" but u.inspect doesn't reflect it
[18:14:03] jlebrech: i'm looking to add a hidden div to the beginning of every partial and template like so <div style="display:none"> is there a method i can hook into to do this?
[18:14:28] louism2wash: Hey everyone, when I perform a raw sql query using ActiveRecord each row returned is a hash with both named keys as well as numeric keys representing duplicate data. Essentially two sets of the same data with different keys. Any ideas why this is? https://gist.github.com/louism2/6322286
[18:16:56] codezomb: I just found some interesting behavior with has_many through on a polymorphic association. Can anyone tell me if this is right? https://gist.github.com/codezomb/717dc6eeddea5d0df688
[18:17:57] |RicharD|: rhizome: post method
[18:18:44] |RicharD|: ok but this is the method of form
[18:18:52] |RicharD|: http method are a different things no ?
[18:20:05] dopie: Hey guys im currently using sqlite3 for my database in production
[18:20:10] dopie: there is a ton of data in it
[18:20:19] EvilEpoch: The EvilEpoch is trying to have a custom association finder. He used to do this with :finder_sql, now moving to rails 4. What The EvilEpoch wants to do is, have a :has_many relationship where the foreign_id matches the current models ID OR the model id is 0. Want to be able to pick up records where foreign_id==id or foreign_id==0
[18:20:22] dopie: how can i pull it out where it doesnt get over-written?
[18:20:26] EvilEpoch: Anyone have any ideas?
[18:24:19] rhizome: EvilEpoch: should work with a parameterized where with raw sql, no?
[18:24:48] rhizome: actually, :foreign_id => [model.id,0]
[18:25:27] palam: rhizome: i mean, is it possible to specify the fields that should be retrieved?
[18:25:27] louism2wash: dopie: what do you mean "so it doesn't get overwritten"
[18:25:35] dopie: basically i do a cap
[18:25:40] palam: rhizome: like .select('id, name')
[18:25:43] dopie: cap deploy and it overwrites everything
[18:25:51] dopie: how do i make it not overwrite database stuff?
[18:26:09] EvilEpoch: rhizome: The EvilEpoch will try that, he wondered if :foreign_id would accept an array, wasn't sure.
[18:30:23] rhizome: EvilEpoch: .where with an array should do a SELECT...IN
[18:31:00] rhizome: palam: retrieved or searched?
[18:31:57] palam: rhizome: retrieved. i have the search results in @search. if i do @search.results, it does a 'select * from' query. i want it to do 'select id, name from' instead
[18:32:20] louism2wash: dopie: still not sure what you're asking are you saying you have data in development that you want to have populated on your production db?
[18:33:01] rhizome: palam: "setting up objects" https://github.com/sunspot/sunspot
[18:35:04] palam: rhizome: i mean after performing @search = Sunspot.search...; in the view, i'm looping through @search.results which is triggering a 'select * from query'
[18:35:25] rhizome: i think i don't know what you mean
[18:35:29] louism2wash: anyone have any idea why a raw sql query returns each record as a hash with both attribute names as keys as well as numbered keys? https://gist.github.com/louism2/6322286
[18:35:45] palam: rhizome: ok, thanks
[18:35:59] rhizome: louism2wash: without looking, sounds like an OrderedHash
[18:36:17] louism2wash: rhizome: thanks, ill take a look
[18:37:32] rhizome: { "0" => { object }, "1" => { obj }, ... }
[18:39:01] louism2wash: rhizome: it returns data like so {:first => 'first_result', :second => 'second_result', 0 => 'first_result, 1 => 'second_result'}
[18:39:14] lessless: how to stub a class method of the module?
[18:39:38] rhizome: i'm confused: https://gist.github.com/rhizome/08b63c5ddc08f07fa1e9 line 6 signup_type is still nil, even though it's set on the obj
[18:40:07] tubbo: rhizome: is that an active_record object?
[18:40:09] rhizome: louism2wash: you sure the number stuff isn't in a separate hash?
[18:40:11] rhizome: tubbo: yes
[18:40:29] tubbo: rhizome: check the definition for inspect(), it might be returning values from the database and not values of each attribute
[18:40:40] dopie: louism2wash, actually the data is in production
[18:40:44] rhizome: User.new wouldn't be persisted, though
[18:40:44] tubbo: you can customize what u.inspect returns.. :)
[18:40:52] dopie: i have nothing in development
[18:41:02] dopie: the data is in production
[18:41:13] rhizome: AND IT'S BUGGING ME
[18:41:30] louism2wash: rhizome: definitely one hash
[18:41:37] tubbo: rhizome: what happens when you set signup_type: "something" in the new() attributes hash?
[18:41:40] rhizome: dunning-krueger in effect
[18:41:43] tubbo: rhizome: and then re-set it later on?
[18:41:46] louism2wash: only happens when I make a raw sql query using AR
[18:41:55] rhizome: louism2wash: gonna need more detail, then. gist it up
[18:42:04] rhizome: tubbo: let's see
[18:42:45] codezomb: okay, yep I think has_many through on a polymorphic association is busted.
[18:42:46] louism2wash: rhizome: I appreciate the help https://gist.github.com/louism2/6322286
[18:42:50] rhizome: tubbo: huh, still comes up nil. investigation is in order
[18:46:33] rhizome: the beauty of old code: a bunch of attributes listed as accessors
[18:47:21] louism2wash: dopie: I still don't know what you are asking.
[18:47:25] rhizome: not sure how this ever worked, mass assignment must punch through that
[18:47:33] louism2wash: dopie: make a gist
[18:48:08] dopie: I have a website which is in production , in the production website I have a sqlite3 database which the client entered a bunch of data already
[18:48:27] dopie: now in development I dont have the information the client entered
[18:48:31] s2013: dopie: why is it in sqlite3 for proudction?
[18:48:33] dopie: so when i do a cap deploy
[18:48:40] dopie: s2013, i couldnt get PG working
[18:48:41] s2013: you can export the data and import it
[18:48:46] s2013: is it on heroku?
[18:48:56] s2013: digital ocean? where is it?
[18:49:01] dopie: rackspace
[18:49:06] s2013: you can export the data and import it
[18:49:25] codezomb: Would someone mind taking a look to ensure I'm not insane? It looks like the has_many through is caching the first query, and appending the conditions for the second, when they should be unrelated. https://gist.github.com/codezomb/717dc6eeddea5d0df688
[18:50:07] s2013: whats the issue codezomb
[18:50:35] louism2wash: dopie: sounds like s2013 is right, you just have to import that data into your production env
[18:50:51] s2013: from prod to dev rather but yeah
[18:50:59] s2013: you can even import/export data between diff db
[18:51:02] louism2wash: s2013: right-o
[18:51:06] s2013: but if you cant get pg to work i suggest trying mysql
[18:51:08] codezomb: s2013: has_many through on a polymorphic association... When calling the first association it works... however, if you call the second association, it's modifying the query to look for BOTH source types. You can see the output in the gist I linked.
[18:52:56] s2013: codezomb: paste your ohter models
[18:53:36] s2013: but it might be an issue with your source
[18:53:49] codezomb: s2013: https://gist.github.com/codezomb/717dc6eeddea5d0df688
[18:54:10] joshsmith: hi all, I'm using PostGISAdapter for AR and getting a really mind-numbing stack level too deep
[18:54:21] joshsmith: I used Ruby's tracing to output the following: https://gist.github.com/JoshSmith/3b40d5b01ebd19ae920c#file-gistfile1-txt
[18:54:37] joshsmith: I'm kind of at a loss for how to figure out where the circularity is arising
[18:55:46] louism2wash: joshsmith: what version of rails?
[18:56:18] v8energy: is there a way to pass a javascript variable into <% %> ?
[18:56:31] joshsmith: I can reproduce the issue on the console by trying to create a new AR record
[18:56:39] rhizome: louism2wash: that is something funky i don't have time to work through right now, sorry. gotta think it's in that query, though
[18:57:00] louism2wash: rhizome: no problem, thanks for looking
[18:57:35] louism2wash: v8energy: gist?
[18:58:01] joshsmith: anyone have any debugging tips on how to work through this?
[18:58:27] joshsmith: never really had to deal with infinite recursion in someone else's library
[18:58:31] v8energy: var test = "hello"; <%= rails_helper test %>
[19:00:06] louism2wash: v8energy: without being 100% sure I am assuming you can't ( I could be wrong ). Erb is functioning on the server while js is happening on the client. No way to pass a client-side js variable into erb that is happening on the server.
[19:00:26] v8energy: louism2wash: gotcha.
[19:00:52] joshsmith: yeah you're going to have to do some sort of AJAX
[19:00:58] tubbo: there is it just sucks
[19:01:01] louism2wash: v8energy: You could however use ajax to send that js variable to the server and then have the server build up your html and respond with that
[19:01:05] tubbo: ajax is your best bet
[19:01:35] tubbo: you can use erb in your assets *but* there's a major catch
[19:01:51] tubbo: first of all, if your asset fails to compile Rails will wait to tell you until you're running `rake assets:precompile` lol
[19:02:17] tubbo: second of all, for pretty much every reason you'd want erb in your JS, you could just make a hidden DOM element and read its value/attrs with jQuery
[19:02:25] tubbo: imho ERb in your JS is not really necessary, ever.
[19:03:20] daze21: Is it okay to remove the format.json from controller actions if we don't need any json data for that action ever?
[19:03:42] tbuehlmann: daze21, sure
[19:04:50] codezomb: s2013: no idea huh?
[19:05:06] codezomb: I cleaned up the gist a bit for anyone else who's willing to take a look: https://gist.github.com/codezomb/717dc6eeddea5d0df688
[19:05:06] Dreamer3: grrr feels like grape was designed to make it hard to do jsend
[19:05:12] Dreamer3: the formatters don't have access to the HTTP status
[19:07:26] jlebrech: how ca you monkey patch actioncontroller to prepend a string to render?
[19:10:04] ryanf: jlebrech: consider rack middleware
[19:10:24] OhGodWhy: got a quick design question
[19:10:27] OhGodWhy: anyone interested?
[19:10:40] jlebrech: ryanf: would that work for every template rendered?
[19:11:43] ryanf: I'm not sure what that means. it would let you modify the response arbitrarily
[19:11:50] ryanf: I think you might be able to use an after_filter too
[19:11:59] ryanf: there is definitely no need to monkeypatch actioncontroller
[19:12:02] ryanf: (for this)
[19:13:19] lethjakman: OhGodWhy: just ask it.
[19:13:39] anime4christ: Does anybody know any good services for letting users upload videos through your Rails app that's not too expensive, reliable and works for playing the videos back on all devices through the web and native app interfaces?
[19:14:57] anime4christ: I know there's a number out there, but I wanted to know which are popular among Rails developers
[19:15:27] louism2wash: anyone have any idea why a raw sql query returns each records with both attribute names as hash keys as well as numbered keys like so: {:first => 'first_entry', :second => 'second_entry', 0 => 'frist_entry', 1 => 'second_entry'} ? https://gist.github.com/louism2/6322286
[19:16:19] jlebrech: ryanf: i want to insert the template path as hidden element's text for every template rendered
[19:16:19] OhGodWhy: lethjakman: I have "groups" with a group controller that allows users to "join groups"
[19:16:29] OhGodWhy: i.e, create entries in the join table between the two
[19:16:40] OhGodWhy: the user has to enter a "group password" though
[19:16:46] OhGodWhy: what would be the best way to accomplish this?
[19:17:50] OhGodWhy: i have a password field in groups at the moment, and in the particular action, if the user enters a correct password and the params[:entered_pass] = group.password then create entry in the join table. Is this right?
[19:18:11] louism2wash: OhGodWhy: that sounds right
[19:19:47] s2013: codezomb: sorry i have a realy bad headache and went to take some medicine. im not even working today cause i feel sick. hoefully someone else can help you out
[19:20:02] codezomb: s2013: no worries, thanks for taking a look.
[19:22:05] lethjakman: OhGodWhy: join_through I believe is what you're looking for
[19:22:15] lethjakman: join through another model (the group model) and give it a password field
[19:22:19] lethjakman: that's what I'd do
[19:23:05] lethjakman: np, lemme know how it goes
[19:27:32] dopie: any jquery guys out there
[19:27:33] dopie: https://gist.github.com/staycreativedesign/5ea0bcdff82f145ba92e
[19:31:48] zr2d2: what comes after the controller method is done executing? I have a stack too deep error that i'm trying to debug
[19:32:42] louism2wash: dopie: what's the question?
[19:32:46] louism2wash: why doesn't this work?
[19:33:05] dopie: i get this error
[19:33:10] dopie: [15:29:41.069] TypeError: $(...).nivoSlider is not a function @ http://mcfps.staycreativedesign.com/:146
[19:34:00] louism2wash: dopie: sounds like that library isn't loading
[19:34:21] dopie: why not?!
[19:34:51] louism2wash: dopie: that is the question
[19:35:00] louism2wash: dopie: why are you loading it twice?
[19:35:22] dopie: how am i loading it twice?
[19:36:10] louism2wash: dopie: you have the src listed twice
[19:36:34] dopie: jquery.nivo.slider
[19:36:42] dopie: jquery.nivo.slider.pack
[19:38:09] tubbo: dopie: check the source for jquery.nivo.slider.pack
[19:38:16] tubbo: does it also include the source for jquery.nivo.slideR?
[19:40:06] dopie: tubbo, ugh how do i fiind that out?
[19:42:42] tubbo: dopie: read the source?
[19:43:32] tubbo: dopie: i'm 99% sure that you need to take out one of those src files
[19:43:55] dopie: im trying :)
[19:44:35] tubbo: dopie: look at the html page source for http://demo.dev7studios.com/nivo-slider/ ... notice what it's *not* doing?
[19:44:49] tubbo: it only seems to <script src="jquery.nivo.slider.pack.js">, and not the other file.
[20:07:49] zr2d2: does anyone here use themes for rails?
[20:10:56] zr2d2: lifofifo: https://github.com/lucasefe/themes_for_rails, its a gem that allows for your app to have configurable themes that can override views and layouts
[20:18:55] lethjakman: does anyone know of a way to integrate phantomjs into rake test?
[20:19:12] lethjakman: I would really like to start using it, but I want it to be convenient
[20:24:42] lethjakman: oh hey, poltergeist looks good
[20:32:43] coulbourne: Hey everyone
[20:33:10] coulbourne: Does anyone have any experience with ExecJS on PPC?
[20:33:28] coulbourne: I'm trying to setup rails on lubuntu on an old G5
[20:33:44] coulbourne: and because V8 doesnt support PPC
[20:33:55] coulbourne: I dont seem to have a JS runtime and cant install node
[20:36:42] coulbourne: Does anyone have any experience with ExecJS on PPC? Trying to set up rails on a old PowerMac g5 running lubuntu 12.04. Don't have a JS runtime and cant install Node or therubyracer because V8 doesnt work on PPC
[20:38:27] jrobeson: coulbourne, you're likely out of luck for anything modern
[20:39:08] jrobeson: perhaps an old java build with rhino
[20:39:12] jrobeson: that might work..
[20:39:22] jrobeson: but it'll be likely not worth the hassle
[20:39:42] coulbourne: I mean i guess I could run a vm....
[20:39:46] coulbourne: but at that point
[20:40:00] coulbourne: shits getting out of hand
[20:40:18] coulbourne: I just feel so bad about having this big beautiful machine sitting here
[20:40:23] coulbourne: that literally is useless to me
[20:44:18] obelich: hiyas one question i have a midle table with 3 tables the midletable name es paydaystotals, the others 3 tables is paysheets, totalshours and workingdays here are my gist https://gist.github.com/obelich/aa3a03458af467101329 and here the photo databse example http://www.flickr.com/photos/49049339@N07/9576204349/
[20:44:43] |PiP|: how can i replace the default t() method to use the the keys value in title case in case a translation is missing? eg. t('users.first_name') returns "First Name"
[20:50:23] zr2d2: anyone have experience with partials not being found in the path that ActionView is looking in?
[20:51:39] helpa: zr2d2: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[20:51:40] slash_nick: zr2d2: !gist the error... you might even add the output from `ls path/to/view_folder` so we can help verify it's there
[20:54:55] lethjakman: where is the bcrypt salt stored in rails?
[20:55:12] lethjakman: is it the standard rails secret key?
[20:58:32] zr2d2: https://gist.github.com/zr2d2/1c9b2b3b0bd30c7d5475
[21:05:51] zr2d2: slash_nick: you have a chance to look at the gist?
[21:16:51] rhizome: |PiP|: titleize(t(...))
[21:18:10] zr2d2: anyone have experience with partials not being found in the path that ActionView is looking in? https://gist.github.com/zr2d2/1c9b2b3b0bd30c7d5475
[21:20:15] rhizome: lethjakman: with the hash
[21:20:42] lethjakman: rhizome: what hash?
[21:20:57] rhizome: the bcrypt hash
[21:21:09] rhizome: https://github.com/codahale/bcrypt-ruby "salts"
[21:21:54] rhizome: zr2d2: looks like the problem's with whatever your theming stuff is
[21:28:45] lethjakman: rhizome: ahh ok, that's what I figured
[21:33:18] zr2d2: rhizome: yeah, i have a ticket open for that. I've been looking to find anyone with experience with it on here. It worked fine on rails 3.0, but fails on rails 3.2
[21:34:59] drewwyatt: Best practices question: if anyone is up for it.
[21:36:08] drewwyatt: About to start a project on my first rails site fora new client that needs to have it's content maintained. Should I turn to a CMS, or just use the general rails scaffolding to handle it?
[21:38:10] skyjumper: scaffolding isn't too popular
[21:38:23] aarkerio: drewwyatt, CMS are easy and you can learn a lot developing it
[21:38:25] drewwyatt: What do you recommend for Rails 4? So far the only CMS I have found that looks to support it is Comfy Mexican Sofa.
[21:39:21] drewwyatt: I have never used a rails CMS before.
[21:41:19] aarkerio: It will take you a week to develop a basic CMS. You only need Page, User, Images, Comments models
[21:42:04] aarkerio: Is a perfect chance to code something from scratch
[21:43:30] drewwyatt: aarkerio: This is what I was leaning towards before coming here. It seems super easy.
[21:46:05] aarkerio: yea, even with the Rspec part, should take you a week
[21:46:22] boytoy: Is it a bad to try to render Rails views from a Rack middleware? Seems like this guy had some problems: http://stackoverflow.com/questions/11512825/rack-middleware-how-to-redirect-to-a-view-in-my-rails-application
[21:46:26] boytoy: I was trying to move this IE blocker from the application controller to a Rack middleware: http://ruby-journal.com/how-to-block-old-ie-version-with-rails/ -- but now I'm not so sure it's a good idea.
[21:47:20] boytoy: * Is it bad
[21:57:06] MrPunkin: is there a reason why a :get based form_tag isn't merging the query string in the url_for options with the form element values when submitting?
[21:57:49] siaW: so i made a factor reset to my mac and now i need some quick help. my ruby version still says 1.8.7 and i can't install rails. can anyone help me.
[21:58:04] siaW: i already checked the respective sites run some commands but still not working :(
[21:59:15] MrPunkin: siaW: just take the time to install and setup RVM
[21:59:19] MrPunkin: siaW: it's totally worth it
[22:00:01] siaW: MrPunkin: i already did
[22:00:21] siaW: and my ruby is still 187
[22:00:41] siaW: don't know what to do with rvm
[22:00:49] aarkerio: siaW, did you run : \curl -L https://get.rvm.io | bash -s stable --ruby ?
[22:01:11] MrPunkin: siaw: Have you closed and re-opened terminal on your mac?
[22:01:20] siaW: let me try that
[22:01:23] MrPunkin: siaW: just to ensure that the proper session variables and such were set
[22:01:32] MrPunkin: profile variables and paths that is
[22:01:33] aarkerio: current ruby is 2.0.0p247
[22:01:48] siaW: arrkerio: i know. that's what i'm afte
[22:02:23] Senjai: Hello all
[22:02:37] Senjai: pontiki: PING
[22:02:52] aarkerio: you must remove ~/.rvm and ~/.gem dirs
[22:03:52] Senjai: siaW: type rvm install 2.0
[22:03:56] Senjai: then rvm use 2.0 --default
[22:04:02] Senjai: then see what ruby you're using
[22:04:24] Senjai: you might have installed 2.0 already, in that case just try rvm use 2.9
[22:04:30] Senjai: siaW: rvm use 2.0*
[22:04:46] Senjai: Test with ruby -v and which ruby after that
[22:04:49] siaW: Senjai: ok. currently my terminal is doing "something"
[22:05:23] siaW: emmanuels-imac:~ siaW$ rvm use 2.0 --default
[22:05:23] siaW: ruby-2.0.0-p247 is not installed.
[22:05:26] siaW: that's what i get
[22:05:30] Senjai: siaW: so type rvm isntall 2.0
[22:05:47] Senjai: siaW: without the typo ofc, then do rvm use 2.0 --default
[22:05:56] siaW: Senjai: on it
[22:07:35] Senjai: pontiki: pingalingling
[22:09:13] siaW: Senjai: thanks now i have ruby 2.00
[22:09:27] siaW: now rails :D
[22:09:34] siaW: i did sudo gem install rails
[22:09:53] siaW: but every time i type rails -v nothing show
[22:10:06] siaW: instead it tells me rails is not currently installed on this system
[22:11:24] Senjai: siaW: dont do gem
[22:11:26] Senjai: siaW: err
[22:11:30] Senjai: siaW: You CANT use sudo
[22:11:34] Senjai: siaW: with vm
[22:11:42] Senjai: siaW: did you rvm use 2.0 --default
[22:11:48] siaW: heap i did
[22:11:51] Senjai: siaW: you should just be able to gem install rails
[22:11:54] aarkerio: you should have something like:
[22:11:56] aarkerio: export PATH=$PATH:/home/aarkerio/start/.rvm/bin
[22:11:59] Senjai: siaW: if you used sudo, you installed it on your local installation
[22:12:06] aarkerio: in your ~/.bashrc file
[22:12:07] Senjai: aarkerio: uhh, RVM does that already
[22:12:32] Senjai: aarkerio: siaW: Don't listen to ark, if RVM is working your path is proper.
[22:12:56] siaW: now i'm doing
[22:12:58] siaW: gem install rails
[22:12:59] Senjai: siaW: If anything you can just restart your shell as a LOGIN shell to use gem install without sudo
[22:13:03] Senjai: siaW: are you getting errors?
[22:13:17] siaW: got a /n and nothing
[22:13:21] siaW: it's not doing anything
[22:13:24] Senjai: siaW: give it a sec
[22:13:32] siaW: a sec passed :P
[22:13:37] Senjai: siaW: just be patient,
[22:13:42] Senjai: siaW: It wont freeze
[22:13:53] aarkerio: RVM insert the path in .bashrc?
[22:13:55] Senjai: siaW: Rails is a large package with MANY dependencies that have to be resolved.
[22:13:58] Senjai: aarkerio: yes
[22:14:21] Senjai: aarkerio: It modifies your path for you. You just have to source the script or restart your shell
[22:14:49] aarkerio: siaW, type "bash" and then "echo $PATH"
[22:15:04] aarkerio: you see your rvm path?
[22:15:10] siaW: now i got
[22:15:18] siaW: ERROR: While executing gem ... (Errno::EACCES)
[22:15:19] siaW: Permission denied - /Users/siaW/.rvm/gems/ruby-2.0.0-p247/gems/i18n-0.6.5/ci/Gemfile.no-rails
[22:15:57] siaW: and i have the solution on my own blog http://www.siawmensah.com/error-while-executing-gem-errnoeacces-fix/
[22:16:53] Senjai: siaW: lol
[22:17:02] Senjai: siaW: Make sure your using a login shell
[22:17:14] Senjai: siaW: Its a login shlel issue not that one
[22:17:30] siaW: ok already started the solution from my blog
[22:17:39] Senjai: siaW: dont
[22:17:40] siaW: let's see if it fixes it
[22:17:41] Senjai: siaW: ugh
[22:17:48] Senjai: siaW: NONO. OKay hear me out
[22:17:48] siaW: :D already started
[22:17:51] Senjai: go into your terminal settings
[22:17:58] siaW: listening
[22:17:59] Senjai: make sure your using /bin/bash with a LOGIN shell
[22:18:03] Senjai: it might be a checkbox
[22:18:15] Senjai: or it might say using /bin/bash as shell, and you'd have to change that to /bin/bash -l
[22:18:25] Senjai: or zsh if your using zsh
[22:19:07] siaW: you mean preferences
[22:19:13] Senjai: siaW: sure, I use linuex
[22:19:17] Senjai: siaW: Something like this: http://i.imgur.com/1a2Ono7.png
[22:19:18] Senjai: but for mac
[22:19:39] Senjai: yours will be bin/bash unless you use zsh
[22:19:44] Senjai: and its -l
[22:20:08] siaW: this is what i see
[22:20:09] siaW: http://gyazo.com/bf0cc42052d2a6c10175050f8e631d33
[22:20:24] siaW: don't worry i think rails is installing now
[22:20:34] siaW: now install ri documentation
[22:20:40] Senjai: siaW: you WILL HAVE MORE PROBLEMS if you dont use a login shell
[22:20:46] Senjai: siaW: Shells open with
[22:20:48] Senjai: see that?
[22:20:52] Senjai: Click command
[22:20:56] Senjai: and then add -l to the end of that
[22:21:03] Senjai: so its: "/bin/bash -l
[22:21:25] Senjai: siaW: actually scratch that
[22:21:30] Senjai: siaW: It appears mac uses login shells by default
[22:21:35] Senjai: so I guess its only for linux peoplez
[22:21:42] siaW: no problem
[22:21:47] siaW: you're using ubuntu right?
[22:22:23] Senjai: siaW: Kubuntu, a variant of Ubuntu yes
[22:22:42] siaW: how's that better than ubuntu?
[22:22:44] Senjai: siaW: Ubuntu uses the Unity desktop, Kubuntu uses KDE, which is more windows like.
[22:22:56] Senjai: siaW: otherwise they're essentially the same
[22:23:00] Senjai: siaW: just different looks
[22:23:33] siaW: ok i'm getting it
[22:23:38] siaW: i have ubuntu
[22:23:44] siaW: i'm playing with it...
[22:23:55] Senjai: siaW: http://www.design-by-izo.com/wp-content/uploads/2011/02/Ubuntu-Ubunity-Screenshot-3.png is how Ubuntu looks by default. though its a custom theme in that example
[22:24:15] siaW: last time i messed my PATH up in mac and things started getting messy so it'll be better to run on some other UNIX
[22:25:35] Senjai: siaW: unix feels hostile at first
[22:25:39] Senjai: siaW: but when your used to it, you get unimagineable productivity
[22:25:43] Senjai: siaW: I rarely use my mouse
[22:25:50] siaW: really??
[22:25:58] siaW: i wonder how that's possible
[22:25:59] Senjai: siaW: I run any program by pressing Alt + F2 and typing it hitting enter
[22:26:08] siaW: well i'm new to UNIX on a personal computer
[22:26:13] siaW: just about 5 months now
[22:26:21] Senjai: siaW: Which is a program called KRunner which comes with KDE, another reason why I prefer Kubuntu
[22:26:30] Senjai: Even opening URL's, everything
[22:26:35] Senjai: ANd I use a terminal, for a lot.
[22:26:47] Senjai: It takes a while to get used to. But once you do, you can't go back
[22:26:56] siaW: you get sort of addicted :D
[22:27:03] siaW: you're addicted
[22:27:14] aarkerio: what KDE version comes with Kubuntu?
[22:27:34] Senjai: aarkerio: Probably the latest that's in the repositories
[22:27:48] Senjai: siaW: You do, I mean I have windows on dual boot, but I never use it
[22:27:48] siaW: Senjai: so my blog solution worked :D
[22:27:56] siaW: i have rails 4.0.0 now hehe
[22:28:03] Senjai: siaW: *clap* you also know RVM has a fix-permissions command right?
[22:28:06] siaW: Senjai: thanks a lot
[22:28:11] Senjai: siaW: But at least you got it fixed, np :P
[22:28:19] Senjai: siaW: I would set a gemset
[22:28:22] siaW: but there's another thing
[22:28:28] siaW: do i need home-brew at this time?
[22:28:34] Senjai: siaW: on mac, I'd get it
[22:28:42] Senjai: siaW: On ubuntu, it's apt-get
[22:28:48] Senjai: er.. Aptitude
[22:28:54] Senjai: It's macs version of Aptitude
[22:30:13] Senjai: siaW: Use a gemset. rvm gemset use rails4 --create
[22:30:37] Senjai: siaW: keep all your rails4 stuff there. and set it as the default. Then if you want to use 3.2 or older versions you can just create seperate gemsets
[22:30:38] siaW: type just the command please
[22:31:03] dopie: when i deploy using capistrano
[22:31:06] Senjai: siaW: https://rvm.io/gemsets read through it, it's worth it
[22:31:11] dopie: where in the world is my db??!?!
[22:31:20] dopie: i goto current and type rails c
[22:31:25] dopie: and I get nothing
[22:31:35] Senjai: dopie: Cap doesnt deploy database services... Did you specify the db in database.yml?
[22:31:45] dopie: yes i did
[22:31:46] rhizome: probably not using the right environment
[22:31:49] Senjai: dopie: LIke it doesnt install the database software
[22:31:55] Senjai: dopie: are you using sqlite?
[22:32:02] Senjai: dopie: in production?
[22:32:10] dopie: for the 3000th time
[22:32:15] dopie: i know its wrong
[22:32:26] dopie: ill switch it when i have time
[22:32:27] Senjai: dopie: Rule #1, don't use sqlite in production. Lol. Where are you deploying to?
[22:32:39] dopie: what do you mean?
[22:32:43] dopie: where am i deploying too?
[22:32:45] Senjai: dopie: WHAT SITE IS HOSTING YOU
[22:32:50] dopie: rackspace
[22:32:58] Senjai: dopie: Okay, does rackspace support sqlite?
[22:33:03] dopie: i guess so
[22:33:03] Senjai: dopie: did you create the database?
[22:33:05] dopie: its working
[22:33:07] Senjai: dopie: with rake db:create
[22:33:17] Senjai: dopie: and rake db:schema:load ?
[22:33:24] dopie: wtf is that
[22:33:39] Senjai: dopie: It's like db:migrate, but better for consistency
[22:35:13] Senjai: dopie: Try now
[22:35:34] dopie: im scared is it going to wipe out everything i did
[22:36:45] siaW: so make a backup dopie
[22:37:01] Senjai: dopie: uhm
[22:37:03] siaW: and you can always use rake db:rollback
[22:37:11] Senjai: dopie: thats not how it works
[22:37:26] Senjai: dopie: You dont copy the database over. It starts as a fresh database.
[22:37:37] Senjai: dopie: you can create seed data in seeds.rb
[22:37:46] Senjai: and load that into the db with rake db:seed
[22:40:48] waseem_: madnificent:
[22:45:34] whowantstolivefo: is there anyone worked with Firebird DB in RoR before ?
[22:50:02] emanu: any good tools to rsync a directory to an s3 bucket?
[22:50:13] emanu: s3sync hasn't been updated since 2008 apparently?
[23:01:55] v8energy: @id is "RG6GeUD0hTQ=\n" <- when outputting that to the view, i am losing the \n, is there a way to prevent that from happening?
[23:04:28] iliketur_: how can I access an instance variable from ActionMailer::Base.deliveries.last in a capybara test?
[23:21:47] drewwyatt: Can I get some quick help? I think I have a very easy question, I am just in unfamiliar terriitory
[23:22:43] drewwyatt: I have a class: Gallery - I gallery has_many assets (model)
[23:22:58] drewwyatt: assets use Paperclip to upload photos
[23:23:46] drewwyatt: in the gallery index, I would like to display a thumbnail - any thumbnail. So in my galleries.each do - how do I reference an asset.
[23:23:58] drewwyatt: gallery.asset does not seem to work, since those are a separate model
[23:27:15] rhizome: drewwyatt: depends on what you want to use as a thumbnail. @gallery.asset.first.image will get the first associated asset's image
[23:29:30] drewwyatt: that gives me undefined method `asset' though
[23:29:44] rhizome: oops, plural
[23:30:21] drewwyatt: ah hah - that was my issue
[23:33:23] drewwyatt: argh - one more hangup
[23:34:29] drewwyatt: gallery.assets.first.photo is giving me undefined method `photo' for nil:NilClass
[23:35:03] v8energy: i am trying to access one of my actions from outside of the application or browser. I am using Net::Http, but i am getting ActionController::InvalidAuthenticityToken. I understand it's to protect from csrf attacks. now, how do i get the correct token?
[23:35:38] drewwyatt: just outputting gallery.assets.first gives me: #<Asset:0x007fef4d782190>
[23:38:53] drewwyatt: everything is accessibly in a gallery.assets.each do |asset|
[23:40:15] rhizome: maybe you don't have any assets on that gallery
[23:40:51] rhizome: v8energy: pls google first. very common
[23:41:56] drewwyatt: rhizome: if that was the case, why would the do each work?
[23:42:08] v8energy: rhizome: i found skip_before_action :verify_authenticity_token, only: [:action etc].. I guess I need to generate my own authentication token between the client and the server in order to ensure security?
[23:44:27] hellion: Hello all! Im working on strong params with dynamic hstore keys. If I enter the keys manually…everything works. But, since keys will evolve over time…I don't want to have to go in and add new keys to the params. So, I want to generate them dynamically. Ive tried whitelisting the params.require..permit. But, that didn't work. What is the "correct" way to do this?
[23:50:46] v8energy: any ideas how to get rid of all these slashes and convert it to json? "{\"user\":\"1\",\"room\":\"1\",\"token\":\"ascxsafcasdSADSADsadasfWQ@@fewfewffewf\"}"
[23:52:00] brendan6: v8energy: if you are using jquery, $.parseJSON('{\"user\":\"1\",\"room\":\"1\",\"token\":\"ascxsafcasdSADSADsadasfWQ@@fewfewffewf\"}')
[23:52:16] v8energy: i double checked, the client sends the data as this: {:user=>"1", :room=>"1", :token=>"ascxsafcasdSADSADsadasfWQ@@fewfewffewf"} to the rails server
[23:52:24] v8energy: brendan6: it ends up this way on the rails server
[23:53:06] brendan6: v8energy: have you tried using the params hash?
[23:53:07] v8energy: brendan6: i tried to do to_json but i end up getting this: "\"{\\\"user\\\":\\\"1\\\",\\\"room\\\":\\\"1\\\",\\\"token\\\":\\\"ascxsafcasdSADSADsadasfWQ@@fewfewffewf\\\"}\""
[23:53:36] brendan6: v8energy: yea don't use #to_json on the server, you don't want json, you want a hash I assume?
[23:53:39] v8energy: brendan6: I am sending this data to the server using: Net::Http
[23:53:48] v8energy: brendan6: oh true.
[23:54:02] rhizome: you're receive json, don't turn it into more json
[23:54:52] v8energy: rhizome: yap lol
[23:55:00] v8energy: trying to figure out how to convert it into hash now
[23:55:33] rhizome: JSON.parse?
[23:56:46] v8energy: ACTION bangs his head against the table
[23:57:41] hellion: is it less secure to user "params.require(:whatever).permit!" ?