« Back to channel list

#RubyOnRails - 04 December 2012

« Back 1 day Forward 1 day »
[00:04:11] joonas: Spaceghostc2c: I agree
[00:08:06] doncarlockeone: bricker: that does not seem to have worked.
[00:08:24] Spaceghostc2c: doncarlockeone: Thank the gods.
[00:17:02] cableray: Gah! my api routing is working now, and I don't know what I changed to fix it! I updated rocket pants so I could use the prefix option, and changed root to get '/', to: 'v1/entry_point#index'.
[00:18:02] cableray: but it didn't seem to work right after I made those changes, it was like i played around and then came back and my tests had a different error.
[00:18:46] doncarlockeone: Spaceghostc2c: I think you may have misread that ;-) Sadly, it did not work.
[00:19:04] Spaceghostc2c: doncarlockeone: No, I'm glad it didn't work. :D
[00:19:10] cableray: which leads me to my next question: why does the respond_to matcher complain when there are more options than controller and action?
[00:19:54] cableray: and can I use the rspec dsl to override it?
[00:22:42] doncarlockeone: Spaceghostc2: Meaning b/c this is a hack? Apparently my understanding of AP is a little lacking. So if you have scss files in dirs on the search path, how do you get them to be compiled?
[00:28:43] smw_: Hi all, is there anything like pprof but for rails? Specifically, I want a graph of what functions take the most time and what calls those functions
[00:45:08] the_jeebster: does try not work with active_record queries? I'm performing something along the lines of Product.try(:find, 5)
[00:45:37] the_jeebster: and I'm still receiving ActiveRecord::RecordNotFound errors
[00:46:16] bricker: the_jeebster: what are you expecting that to return
[00:46:48] irb: when you have a "has many" association table and model, it seems like the same sequence id value is used for the two models that are associated into this table...is this correct?
[00:47:16] the_jeebster: I get the desired response if I wrap the query in a begin-rescue block
[00:47:49] bricker: the_jeebster: Why are you using try there
[00:47:54] bricker: the_jeebster: I don't think try is what you think it is
[00:48:09] the_jeebster: bricker: I was under the impression try handles error with a return value of nil
[00:48:15] bricker: the_jeebster: what is your desired behavior
[00:48:17] Spaceghostc2c: irb: puts "My name is Doof and you do what I say.\nWoot!\nWoot!"
[00:48:30] the_jeebster: bricker: to return nil if no record is found instead of error out
[00:48:33] Spaceghostc2c: D'aw, doesn't work as expected. BUG!
[00:48:48] bricker: the_jeebster: #try returns nil if the receiver is nil, runs the method if not.
[00:48:56] irb: Spaceghostc2c: wow helpful
[00:48:58] bricker: the_jeebster: use find_by_id
[00:49:24] bricker: the_jeebster: or where(id: 5).first
[00:49:45] the_jeebster: brick: I'll try that out. so it's just running a find method without the arguments?
[00:49:48] irb: so basically is the same sequence value used for in the 2 columns of an association table?
[00:49:48] Spaceghostc2c: davidcelis: At least you got the idea.
[00:50:06] bricker: the_jeebster: you're doing Product.try(:find, 5) which will always run the method "find" with an argument of "5" because Product is not nil.
[00:50:27] the_jeebster: bricker: ah, so it's running directly against the class
[00:50:41] the_jeebster: well that works, thanks!
[00:51:15] irb: what is the reason for that rule?
[00:59:59] CodaBottle: Hi, I'm learning rails with Hartl's tutorial, but I am having issues with rspec, anyone gone through his tutorial and willing to help me out for a bit?
[01:00:10] helpa: CodaBottle: How to ask good questions and get great answers: http://www.mikeash.com/getting_answers.html
[01:00:10] bricker: CodaBottle: !ask
[01:00:35] Antiarc: CodaBottle: Just ask the question, if someone can help, they will :)
[01:02:11] bricker: wait here's a better one
[01:02:12] helpa: Rather than guru hunting and asking if someone has used this or that, just ask your question with as much detail as possible. Even if someone hasn't used X Y or Z, there's a high chance someone can help, but only if they have details to work with.
[01:02:40] CodaBottle: okay I will do my best thanks.
[01:02:59] CodaBottle: I am running through the tutorial and have executed " bundle exec rspec spec/requests/static_pages_spec.rb"
[01:03:19] CodaBottle: right away I get error "<top (required)>': undefined local variable or method `spec' for main:Object (NameError)"
[01:03:40] Antiarc: what does your static_pages_spec.rb look like?
[01:03:51] Antiarc: (You can put it in a gist at http://gist.github.com if it's more than 2 lines)
[01:05:12] CodaBottle: git://gist.github.com/4199578.git
[01:05:52] bricker: https://gist.github.com/4199578
[01:06:40] bricker: CodaBottle: Can you add your spec_helper file
[01:09:01] CodaBottle: https://gist.github.com/4199601
[01:10:27] bricker: CodaBottle: just checking, line 1 in the first gist is just something you added for the gist, right?
[01:11:23] CodaBottle: bricker: nope, following the tutorial, it looks like that line is included
[01:11:46] bricker: CodaBottle: okay, I think the tutorial had that first line in there just to show you which file you were looking at. Remove that line (or comment it out with a # before it)
[01:14:02] CodaBottle: New error now: /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746:in `load': cannot load such file -- /Users/MacBook/rails_project/sample_app/spec/spec/requests/static_pages_spec.rb (LoadError)
[01:14:22] bricker: CodaBottle: see how `spec/spec` is in there twice? Check your paths
[01:16:10] CodaBottle: bricker: that worked.
[01:16:16] bricker: :thumbsup:
[01:16:19] Dreamer3: https://github.com/burke/zeus
[01:16:21] Dreamer3: does this not work on mac?
[01:16:32] Dreamer3: i get a really weird unending printout when i run start
[01:16:39] Spaceghostc2c: Dreamer3: Don't use it.
[01:16:48] Dreamer3: it needs ruby 1.9
[01:16:58] bricker: Dreamer3: "Requirements: OS X 10.7+ OR Linux 2.6.13+"
[01:17:11] Spaceghostc2c: Use kicker and spin.
[01:17:13] Dreamer3: bricker: but this app is on 1.8 :)
[01:17:22] Spaceghostc2c: zeus ia bad news.
[01:17:22] bricker: Dreamer3: WHAT YEAR DO YOU LIVE IN
[01:17:28] Dreamer3: i just saw DHH link to it
[01:17:34] Dreamer3: Spaceghostc2c: you have issues with it?
[01:17:56] Spaceghostc2c: Dreamer3: With how it's implemented.
[01:18:06] Spaceghostc2c: Dreamer3: If DHH linked to it, I don't think that makes it a good thing.
[01:18:25] Dreamer3: bricker: will be 1.9 soon, lots of other priorities
[01:18:33] Dreamer3: and nothing is wrong with 1.8 :)
[01:18:37] Dreamer3: other than age
[01:18:49] bricker: Dreamer3: just kidding
[01:19:13] bricker: I'm leaving
[01:19:17] Dreamer3: Spaceghostc2c: on spin is just for tests? i was looking forward to instant consoles :)
[01:19:42] Spaceghostc2c: Isn't it hilarious how it patches shit?
[01:20:28] Spaceghostc2c: Not worth it bro.
[01:21:30] djbpython: having trouble with a checkbox. The hidden input value is true, but when i uncheck the actual checkbox it still submits true
[01:21:54] djbpython: i dont think im doing anything out of the ordinary
[01:22:21] Spaceghostc2c: sevenseacat: HI
[01:22:34] sevenseacat: Spaceghostc2c: OMGHIHOWRU
[01:24:25] Radar: djbpython: Bro.
[01:24:41] Radar: 92 days. Surely by now you would know to post your code.
[01:25:19] sevenseacat: Radar: how is now being an old fart treating you
[01:25:24] Radar: sevenseacat: OFF MY LAWN
[01:25:26] sevenseacat: Radar: ps. happy birthday
[01:25:42] Radar: thanks oyu
[01:25:53] sevenseacat: i remember being 25, that was fun
[01:26:03] parndt: you are hardly old Ryan :P
[01:26:23] Radar: parndt: I am ancient. My hair will probably start turning grey next year
[01:26:38] parndt: would serve you right
[01:28:30] djbpython: Radar, https://gist.github.com/4199691 but i was more looking to see if it was a known bug in rails
[01:28:44] djbpython: im obviously doing something wrong
[01:29:13] Radar: Why is the value "true"?
[01:29:20] Radar: I thought it was 0 or 1.
[01:29:21] djbpython: (fyi, exempt_from_schedule_policy is in fact a true value in the model, but I am trying to make it a false value)
[01:29:29] parndt: it's a hidden, ryanf
[01:29:30] parndt: Radar: ***
[01:29:33] parndt: sorry ryanf
[01:29:46] Radar: parndt: mhm
[01:29:46] parndt: does it have to be true in a hidden for the checkbox?
[01:29:53] parndt: I mean 1/0
[01:29:57] parndt: ugh, hot bad brain day
[01:30:02] djbpython: Radar, no idea rails makes a hidden companion input for this exact situation it seems
[01:31:10] irb: if i have a model which represents an association table, is there a way where I can get an inflated collection of model objects based on the id of one of the columns?
[01:31:31] irb: or do i have to inflate each object and stick it into a collection then pass that to the erb page
[01:32:48] Radar: irb: codeplzkthx
[01:32:54] irb: will do
[01:34:52] irb: http://pastie.org/5476798
[01:35:41] irb: so if i have a datacenter id, and i want to get all the associated device objects, is there a way to auto-inflate all the associated device objects or do i have to iterate and build the collection myself?
[01:36:16] sevenseacat: call @datacenter.devices ?
[01:36:34] sevenseacat: or am i missing something here
[01:36:46] sevenseacat: Datacenter.find(id).devices
[01:37:45] Radar: pretty much what sevenseacat said
[01:37:58] irb: testing now
[01:42:06] irb: cool, that worked
[01:42:12] irb: thx, getting the hang of things
[01:42:37] the_jeebster: I'm leaving one controller and going to another as follows: redirect_to new_order_path(@line_item). It seems that this object argument is lost in the new controller. is there anyway to persist this line_item?
[01:43:30] sevenseacat: the_jeebster: its not lost, the ID is available in the new action in the params.
[01:43:40] the_jeebster: sevenseacat: ah it's in the params
[01:44:28] the_jeebster: I figured it might be in the params but I'm not exactly sure how rails formats the params hash when an object is passed
[01:44:53] sevenseacat: the_jeebster: look at the parameters your route expects, thats what you get in params.
[01:45:31] the_jeebster: sevenseacat: I might have to setup some nested routes. I don't think I'm accounting for the params directly in the routes. I've just called resources on the object
[01:45:59] sevenseacat: if thats what you need to do, do it - i dont know your domain or anything about your code
[01:46:13] the_jeebster: sure. just talking out loud.
[01:53:12] Billiam: I have a model (a) with a many-to-many association to (b) which belongs_to (c) which belongs_to (d). How do I actually eager load all the way down do (d)? Ex: I want something like a.b.includes(:c => {:d})...
[01:59:59] Dreamer3: how is a 2007 bmw cheaper to insure than a 2001 lexus? insurance is weird
[02:01:54] sevenseacat: if lexus are statistically in more crashes than bmws
[02:02:05] parndt: ^ yep that
[02:02:16] parndt: bmw is also likely safer
[02:02:26] parndt: with assistive features that mean you're less distracted etc
[02:02:28] parndt: better security systems
[02:02:30] parndt: the list goes on
[02:03:05] Drewch: Has anyone run daemons on Heroku? Do you need a paid plan to do it?
[02:04:16] Spaceghostc2c: You need dynos.
[02:04:35] Drewch: Spaceghostc2c ok, thought that might be the case, thanks
[02:05:45] foucist: Billiam: A many to many to B, B belongs_to C, C belongs to D, eager load.. maybe A.includes(:B => {:C => :D})
[02:06:49] Billiam: foucist, what if you wanted that in the context of a given row only? a.b.includes(magic).all or some such?
[02:08:15] Spaceghostc2c: ABC, as easy as 123.
[02:09:20] popol: /msg nickserv help
[02:11:25] Spaceghostc2c: ABC, 123 baby you and me.
[02:12:24] parndt: shameless plug for Radar: https://twitter.com/parndt/status/275784324442386432
[02:12:34] parndt: that'll teach him to step away from the computer
[02:13:44] bricker: Now the in-between solfege! All together now! Do Ra Re Ri Mi Fa Fi Sol Si La Li Ti Do !
[02:13:47] Spaceghostc2c: Is a kickstarter out of the question?
[02:13:53] parndt: I am not a US citizen
[02:14:21] parndt: plus I think that'd violate the ToS of kickstarter :P
[02:14:54] parndt: given how many people Radar helps on a daily basis I expect there to be hundreds of donations
[02:14:54] Spaceghostc2c: Well, paypal it is!
[02:15:16] bricker: I have but my love to give
[02:15:22] Spaceghostc2c: bricker: Poorer.
[02:15:36] parndt: send him a lovely email then; you all have his address now ;-)
[02:16:02] Spaceghostc2c: Sorry, trying too hard.
[02:16:04] parndt: RT ftw :)
[02:16:09] bricker: Subject: IOU
[02:16:30] Spaceghostc2c: bricker: subject="I'm not that thankful"
[02:17:59] parndt: sweet got a retweet from ryanbigg
[02:18:01] bricker: Spaceghostc2c: I bought his book, does that count?
[02:18:08] Spaceghostc2c: parndt: How weird.
[02:18:13] Spaceghostc2c: bricker: How many times?
[02:18:22] bricker: Spaceghostc2c: at least one times
[02:18:44] Spaceghostc2c: I bought his book a couple times. :D
[02:19:01] bricker: Spaceghostc2c: :applaud:
[02:19:04] parndt: he gets like 10% of the price of that
[02:19:15] parndt: ACTION is speculating based on most publishers
[02:21:39] Spaceghostc2c: parndt: Now he gets 90-something.
[02:21:43] kkiero: any good tutorial on quick restful authentication and facebook connect? I found this http://madebymany.com/blog/tutorial-for-restful-authentication-on-rails-with-facebook-connect-in-15-minutes but it's from 2009
[02:21:47] parndt: yeah leanpub ftw
[02:21:50] bricker: did you guys miss me
[02:25:26] jrabolli: has anyone here gone through the 'share box - Build a Dropbox-like Sharing App using Ruby on Rails' tutorial?
[02:25:59] jrabolli: doing good overall but can't get some JS to work out - not sure if its a js issue or assets etc
[02:27:16] joonas: jrabolli: can't say I have, post the relevant code in question to gist or pastie
[02:27:25] joonas: and maybe someone here can help you
[02:29:48] jrabolli: ok - its rails 3.1 as an FYI so it could be a assets/location issue
[02:34:27] jrabolli: i think this is the relevant code --- http://pastie.org/5476978
[02:35:17] jrabolli: when i press the 'Share' button next to a folder - I get nothing to pop open, just a # shows up at the end of the URL
[02:36:21] foucist: jrabolli: does the browser source code view show the proper js? check the link to the js
[02:37:54] jrabolli: what do u mean check the link to js? whats the easiest way to check that?
[02:39:01] jrabolli: i can tell you that developer mode of safari shows -type issue 'undefined' is not a function (evaluating '$.share a")
[02:39:43] Spaceghostc2c: lolsafaridevelopertools
[02:40:04] jrabolli: u know the develop menu
[02:40:13] jrabolli: firebug basically says the same
[02:40:20] bricker_: the biggest tragedy in browser development this year
[02:40:42] jrabolli: but no, simply a 'show source of the page does not show the js
[02:41:28] helpa: Did you mean lolfari?
[02:41:40] jrabolli: i will try in firefox - seems like we have some mac haters here, hold on
[02:41:55] bricker: jrabolli: I think 95% of the people in this room use mac
[02:42:01] sevenseacat: the other 5% have rains
[02:42:37] joonas: mac haters?
[02:42:42] joonas: haters gonna hate
[02:42:45] parndt: life's too short guys
[02:43:04] joonas: parndt: you remind me of slexton
[02:43:14] jrabolli: here is source of the page --http://pastie.org/5476996
[02:43:27] joonas: parndt: yes, not the one that comes up with slexton google query tho
[02:43:36] parndt: I don't know what you're talking about ;-)
[02:43:41] joonas: parndt: alex sexton :P
[02:43:54] parndt: I discovered a while back that life's too short to argue OS
[02:44:10] parndt: android/iOS/windows; OS X/windows/linux/*
[02:44:24] sevenseacat: i dont argue, i just rebel when people are all like PRAISE JOBSUS
[02:44:26] bricker: parndt: no, it's just the most pointless, neverending conversation you can have
[02:44:31] joonas: parndt: is life too short for penis jokes and assdicks?
[02:44:39] parndt: far, far too short
[02:44:48] bricker: it's like politics and religion - there is no "right" answer. If there was, everybody would know what it was.
[02:45:45] parndt: well there is a right answer obviously
[02:46:00] parndt: you give humans too much credit, perhaps, that everyone would know what it was
[02:46:04] parndt: but that's philosophy
[02:46:35] bricker: parndt: there can't be a right answer, because it's just "whatever works for you".
[02:46:45] parndt: relative truth isn't real
[02:47:02] bricker: ACTION thinks
[02:47:05] joonas: truth is lies
[02:47:19] parndt: and yet it will set you free
[02:50:56] parndt: http://24.media.tumblr.com/tumblr_me5a7bA2Qw1qljt4ro1_250.gif
[02:51:54] jrabolli: Timestamp: 12/3/12 9:42:01 PM
[02:51:55] jrabolli: Error: TypeError: $(".share a").button is not a function
[02:51:56] jrabolli: Source File: http://localhost:3000/assets/application.js?body=1
[02:54:40] jrabolli: i don't think the js should be in the application.js if i were doing things the rails 3.1 way
[02:54:44] jrabolli: but it should still work
[02:55:26] jrabolli: so i don't think that is the issue. when i take it out and try to put it in the assets directory i think it should be the page won't even load
[02:56:02] jrabolli: maybe the route - match "pages/share" => "pages#share"
[02:56:07] sevenseacat: where are you defining this button method?
[02:56:22] sevenseacat: i have not heard of a button() jquery method
[02:57:47] parndt: wonder if Ryan has enough to buy a bike yet
[02:58:28] jrabolli: i think that comes from jquery UI
[02:58:59] jrabolli: which I believe is a part of jquery-rails
[02:59:13] parndt: lol RyanD sorry I was referring to https://twitter.com/parndt/status/275784324442386432
[02:59:19] parndt: the *other* Ryan
[03:01:34] jrabolli: i have things names a bit different but i am following this essentially http://pastie.org/5477040
[03:02:18] sevenseacat: jrabolli: are you including jquery ui?
[03:02:49] jrabolli: no because I thought it was a part of jquery-rails gem
[03:03:18] sevenseacat: it is, but you still have to include it
[03:03:33] jrabolli: ah ok - how best should i do that
[03:03:50] sevenseacat: wherever you're requiring jquery, also require jquery ui
[03:06:53] jrabolli: would that mean just add -- //= require jquery-ui to the top of the application.js file?
[03:07:08] Tref: guys, best quick and dirty tagging gem?
[03:07:10] sevenseacat: after jquery, yep
[03:08:25] jrabolli: ok well the nice thing after doing that is i don't see any error like i did before
[03:08:56] jrabolli: now i just need to figure out why the box doesn't pop up with the two fields when i click share
[03:09:04] jrabolli: but i don't get the function error now
[03:15:20] naumant: Hi, how i convert back this to string "string\x00" without "\x00"
[03:18:17] jrabolli: any idea why it simply wouldn't open? I get a '#' in the url when i click share but noting else
[03:18:33] jrabolli: i should say '#' at the end of the URL
[03:18:45] naumant: anyone, how i convert back this to string "string\x00" without "\x00"
[03:18:53] sevenseacat: jrabolli: something js related.
[03:19:03] sevenseacat: possibly missing js.
[03:19:23] sevenseacat: you have a href="#" on your links, right?
[03:20:42] jrabolli: what do u mean?
[03:20:53] jrabolli: in the view?
[03:20:59] naumant: anyone, how i convert back this to string "string\x00" without "\x00" ?
[03:21:02] sevenseacat: 'when i click share' is share not a link?
[03:21:31] jrabolli: yes it is a link
[03:21:55] jrabolli: <div class="share">
[03:21:56] jrabolli: <%= link_to "Share", "#", :folder_id => folder.id, :folder_name => folder.name %>
[03:22:13] Spaceghostc2c: How is that supposed to do anything?
[03:22:19] Spaceghostc2c: Are you using js to watch the dom element?
[03:22:22] sevenseacat: Spaceghostc2c: JS
[03:22:28] sevenseacat: which doesnt appear ot be present
[03:23:24] naumant: anyone, how i convert back this to string "string\x00" without "\x00"
[03:23:27] jrabolli: things only turned sad when i started including js
[03:23:42] sevenseacat: jrabolli: you havent included the js for the buttons yet
[03:23:50] sevenseacat: hence the # is being triggered
[03:24:01] jrabolli: ok that seems to make sense
[03:24:34] jrabolli: maybe i will look more into the fact that i though jquery-rails was all i needed
[03:25:15] jrabolli: the tutorial did seem to have things like <%= javascript_include_tag "jquery-1.4.4.min", "jquery-ui-1.8.9.custom.min" %>
[03:25:35] naumant: anyone, how i convert back this to string "string\x00" without "\x00"
[03:25:36] jrabolli: which i don't because i thought the rails 3.1 application.js include took care of it
[03:25:47] Radar: jalcine: spam spam spam
[03:25:47] sevenseacat: jrabolli: if you want JS to be watching your share links, you need to actually have JS for that.
[03:25:50] Radar: Whoops, wrong person
[03:25:53] Radar: naumant: Stop spamming.
[03:25:57] sevenseacat: naumant: we heard you the first hundred times
[03:26:11] parndt: "string\x00".gsub("\x00", '')
[03:26:16] naumant: Radar: yes so no one knows or ignoring or its stupid question
[03:26:17] parndt: (trolling)
[03:26:44] Radar: naumant: do you know what \x00 represents?
[03:27:01] naumant: Radar: binary?
[03:27:08] Radar: naumant: nope. It's a null character.
[03:27:11] Radar: http://stackoverflow.com/questions/7525652/ruby-delete-null-values-of-a-string
[03:28:06] naumant: Radar: thanks for help, was keep doing gsb(""."") which was wrong spelling
[03:30:07] jrabolli: thanks sevenseacat - i will work on it
[03:30:30] jrabolli: i think u pointed me in the right direction - suck at js
[03:30:45] Spaceghostc2c: It's okay to suck at JS
[03:30:50] Spaceghostc2c: Just don't suck at learning.
[03:31:15] parndt: very nice
[03:38:37] slash_nick: naumant: saw this the other day... haven't tried it: https://github.com/AndrewVos/metherd-missing
[03:39:12] Spaceghostc2c: slash_nick: I hope you know it's a loljoke.
[03:39:31] slash_nick: ACTION smiles
[03:40:28] GeekOnCoffee: https://twitter.com/parndt/status/275784324442386432 << if you've ever been helped by Radar, a great opportunity to give back :)
[03:40:39] parndt: hey that's my name
[03:41:08] naumant: slash_nick: thanks ...its some other prob ...my format is binary not that string which i quoted thats why not working
[03:41:09] ner0x: How can I add null: false to a rails g model my_model must_have:text ?
[03:41:23] slash_nick: naumant: oh sorry :)
[03:41:29] Radar: ner0x: Open up the migration and edit it.
[03:41:45] ner0x: Radar: Alright. Just curious if there was a creation switch.
[03:41:55] Radar: ner0x: yeah no
[03:42:09] ner0x: Radar: Thank you sir.
[03:42:52] naumant: slash_nick: np ... frustrated day already :)
[03:44:21] diggitydane: do you guys use factory_girl to load dev data? I have 80+ models and loading yml files in tasks is getting out of hand
[03:45:00] danshultz: diggitydane: why not use raw sql?
[03:45:25] sevenseacat: i have seeds, some yaml.
[03:45:32] bricker: diggitydane: factory_girl is good, a lot of people use it.
[03:45:43] diggitydane: danshultz: to see how reports look with 1,000's of user, it would be a ton of work in sql
[03:45:49] bricker: not for loading data like seed-style though
[03:46:26] sevenseacat: diggitydane: in thast case i'd just generate 1000 records in the console, then reset my db
[03:46:28] danshultz: diggitydane: no, instead of loading and dumping yaml files to create your seed data, load and dump raw sql files
[03:47:10] bricker: diggitydane: Why not just do a loop? (1..3000).to_a.each { |i| User.create(name: "Joe #{i}") }
[03:47:40] bricker: in console that is
[03:47:53] diggitydane: do you put that in seeds.rb? That's where I put the actual application data
[03:48:05] diggitydane: yeah, that's tough to keep track of all foreign keys though
[03:48:09] danshultz: no - so, we ran into the same issue in the past
[03:48:15] sevenseacat: why in seeds? its not necessary for the app
[03:49:06] danshultz: you can dump the entire schema and data with mysqldump
[03:51:06] danshultz: mysqldump --skip-add-drop-table --skip-add-locks --skip-comments --skip-disable-keys --skip-set-charset --no-create-db --tz-utc --no-data --create-options --result-file={schemafile} {database}
[03:51:27] RubyPanther: If I have different dev data, I just have the seeds.rb check the environment and load the right one, that way I'm expressing my data in Ruby all the time, instead of some of it in Ruby, some of it in YAML or SQL
[03:51:40] danshultz: diggitydane: that will dump a schema file and you can use mysqldump to also dump your database tables to uniq files also
[03:52:05] RubyPanther: It would be bad to dump the schema, if you're going to dump SQL just do the data not the schema, because schema.rb is supposed to be authoritative
[03:52:27] diggitydane: i've just always done initial app data in seeds. RubyPanther: same file? just wrapped in Rails.env.development?
[03:52:31] diggitydane: daneshultz: awesome thanks
[03:52:48] danshultz: RubyPanther: schema.rb can't handle some more complex things and if you have to load a large amount of data for dev, it'll take forever in plain ruby
[03:53:27] danshultz: diggitydane: in ruby and yml files, it would take ~8 minutes on a ssd drive to load a new db
[03:53:28] RubyPanther: danshultz: schema.rb handles _everything_, it is authoritative. If you disagree, you're disagreeing with rails, not me, I'm right automatically here.
[03:53:34] danshultz: with sql sub 5 seconds on anything
[03:54:07] RubyPanther: yes, you can use an inferior non-railsy practice, the world won't end, but it would be "wrong" to recommend such a thing
[03:54:29] diggitydane: danshultz: but how do you get all the records into the database?
[03:54:43] diggitydane: danshultz: initially?
[03:55:25] RubyPanther: And you don't load the seeds all that often, if loading them with AR is really slow, you might have other problems. And of course you can optimize that if you're going non-agnostic, which you would have already using SQL.
[03:55:39] danshultz: diggitydane: they used to be all schema.rb and yaml files, but that was way to slow
[03:56:02] danshultz: diggitydane: so we eventually migrated it over to the sql dumps
[03:56:27] RubyPanther: You certainly wouldn't give up the advantages of modern practices assuming that ancient, rejected practices are faster, without some real reason like having actual slow data and some reason it needs to be reloaded constantly
[03:58:15] danshultz: RubyPanther: trolls gona troll
[03:58:25] danshultz: RubyPanther: ruby supports raw sql in the schema file
[03:58:26] danshultz: config.active_record.schema_format
[03:58:40] RubyPanther: No name calling, you lose
[03:58:52] danshultz: RubyPanther: and sometimes, your app outgrows running things in ruby
[03:59:08] RubyPanther: You're an angry name caller claiming ancient, rejected practices are recommended over the real Rails best practices
[03:59:44] Spaceghostc2c: You're a bunch of fuckwits, and I win.
[03:59:56] RubyPanther: so which is it, does "ruby support raw sql" or does using raw SQL mean your "app [outgrew] running things in [Ruby]"
[04:00:24] RubyPanther: That is the burden of arguing against best practices, the best practices are already in self-consistent form
[04:00:30] sevenseacat: this is funny.
[04:00:47] sevenseacat: theres no reason for loading SQL dumps as seed data
[04:01:58] Antiarc: Who cares, as long as it runs?
[04:02:42] RubyPanther: I've got COBOL code that still runs, that would be no excuse to maintain it though
[04:08:52] rhizmoe: word booty!
[04:09:14] Dreamer3: RubyPanther: dude, some of my best work is huge, unmaintained cobol apps!!!
[04:09:30] Spaceghostc2c: Dreamer3: I knew pastie wasn't ruby!
[04:09:35] rhizmoe: ACTION worked in COBOL once upon a time
[04:09:38] Spaceghostc2c: It scales too much!
[04:09:42] Dreamer3: pastie is assembler
[04:09:48] Dreamer3: i just don't tell people cause i'm modest
[04:10:50] kkiero: how to reset particular session in rails?
[04:11:05] RubyPanther: CobolOnSnails
[04:11:47] Spaceghostc2c: http://www.coboloncogs.org/INDEX.HTM
[04:11:59] rhizmoe: always a fave
[04:12:49] Dreamer3: i should do something stupid like that with pastie just for gags
[04:12:59] Dreamer3: pastie 2.0, now writing on Microsoft .NET!
[04:13:02] Dreamer3: .aspx everything
[04:13:09] Spaceghostc2c: That would be cruel, not funny.
[04:13:19] sevenseacat: april fools day next year
[04:13:26] Dreamer3: yeah, that's a good april fools
[04:13:32] RubyPanther: kkiero: generally sessions are cookie based so resetting is advisory, so the normal method is to delete it from the session store. It varies somewhat because there are a zillion ways to have sessions set up.
[04:13:37] parndt: GH sells to MS
[04:13:49] Spaceghostc2c: GH hosts not really open source MS code.
[04:13:55] Dreamer3: probably really easy to do with a few lines of ruby plus some varnish url rewriting
[04:14:42] RubyPanther: Well, if it is "as fun and lucrative as as fixing Y2k bugs" I'm there. At no other time could you write sed scripts and charge by the lines of input you fed to the script...
[04:15:14] Spaceghostc2c: There may still be Y2K bugs in your code! Hire me to find and squash them before it's too late!
[04:16:25] BoomCow: already installed mcafee y2k tool
[04:16:29] cableray: can you set an spec failure message outside a helper?
[04:16:35] RubyPanther: Please, somebody start a Y2012 bug scare
[04:17:07] joonas: it's coming
[04:17:17] BoomCow: dude did you guys hear
[04:17:19] sevenseacat: the mayan prophecy will put bugs in your code
[04:17:21] BoomCow: the y2k bug is coming
[04:17:23] sevenseacat: will it work after december 21?
[04:17:38] BoomCow: it's when aliens take over
[04:17:45] BoomCow: bug in our code
[04:17:46] parndt: I will sell my seal of guarantee for $2012 per site
[04:17:50] BoomCow: everything goes down
[04:17:52] joonas: maybe yours but not mine
[04:17:54] parndt: see what I did there
[04:17:55] joonas: my code is perfect
[04:17:59] BoomCow: no more startups
[04:18:02] sevenseacat: parndt: brilliant.
[04:18:06] RubyPanther: Yep, because some code uses a long baktun of 20 piktuns, and other code uses a short baktun of 13 piktuns
[04:18:10] BoomCow: economy collapses
[04:18:14] parndt: http://readwrite.com/2012/12/03/lets-all-shed-tears-for-the-crappy-startups-that-cant-raise-any-more-money
[04:18:16] parndt: no more startups
[04:18:35] cableray: when is the unix timestamp overflow date?
[04:18:54] cableray: that's closer than I thought.
[04:18:56] RubyPanther: Time.at(0xfffffff7) in Ruby :)
[04:19:08] RubyPanther: (useful for setting cookie expirations)
[04:20:21] cableray: why is it 0xffffff7 and not 0xfffffff (i think i have the wrong number of f's, but you get the idea)
[04:21:03] Antiarc: Time.at 0xfffffff7 => 2106-02-06 23:28:07 -0700
[04:21:06] Antiarc: I don't think that's quite right.
[04:21:44] rking: Yeah, 0xfffffff8 works fine.
[04:22:11] rking: Maybe it's to give you 8 seconds to grab your shotgun and run for the hills.
[04:22:23] Antiarc: Time.at (0xffffffff / 2) gets me 2038, I guess because epoch timestamps are signed?
[04:22:43] cableray: yeah wouldn't it be 0x7fffffff instead?
[04:23:09] cableray: and i'm not counting f's btw.
[04:23:15] rking: cableray: That would make more sense, and is indeed in 2038, but Ruby handles 0x8fffffff OK, too
[04:23:46] cableray: ruby may be using a different algorithm.
[04:24:07] Antiarc: Ruby can use ints larger than 32 bits for time computations
[04:24:13] cableray: and not one based on word.
[04:24:35] Antiarc: Time.at (0x7fffffffffffffff) => 292277026596-12-04 08:30:07 -0700
[04:24:36] rking: So all we have to do is port all C code to Ruby by 2038 and we're good.
[04:24:37] Spaceghostc2c: As long as you're on a system that's 64-bit, right?
[04:24:38] Antiarc: Yay for 64-bit ints
[04:24:48] joonas: long ways to go boys
[04:24:56] Antiarc: Ruby has bignums, which work even on 32-bit systems, no?
[04:25:05] Antiarc: (I don't have a 32-bit system to work with)
[04:25:08] RubyPanther: oops, sorry, Time.at(0x7fffffff)
[04:25:21] rking: Antiarc: Yeah, you can put as many darned f's as you want it seems.
[04:25:29] RubyPanther: Some days I can't even remember what C ints look like anymore
[04:25:34] Spaceghostc2c: IMO, you can never have enough F's
[04:25:36] Antiarc: Time.at (0x7fffffffffffffffffffffffffffffff) => 5391559471918239497011222876596-04-18 09:02:07 -0700
[04:25:39] Spaceghostc2c: Friday is my second facorite F word.
[04:25:42] Antiarc: Yay for 128-bit integer dates
[04:26:32] cableray: if you want to get it to break, you'd probably need to use the date command in a shell.
[04:26:48] cableray: or simmilar
[04:27:21] RubyPanther: One thing I discovered in the past is that beyond a few hundred years it pretends to work but actually starts dropping leap years and the days of week drift
[04:27:38] cableray: which does?
[04:27:42] rking: ruby -e 'p Time.at eval "0x"+("f"*9999)'
[04:27:58] RubyPanther: Ruby dates. Postgres dates do the same thing after 2300 or so.
[04:28:02] cableray: evil rking, evil
[04:28:23] RubyPanther: You know you're abstracting too far when you worry about those things.
[04:28:29] cableray: does it calculate leap seconds?
[04:28:37] parndt: goodnight all
[04:28:38] Antiarc: RubyPanther: I rather suspect that's due to float inaccuracies
[04:28:39] BoomCow: The great lie of these last few years is that anyone can be a tech entrepreneur. You don't need to know electrical engineering or computer science. You don't need to know anything about business. You just need a positive outlook and an ability to speak confidently while saying things that make little or no sense.
[04:28:41] BoomCow: great line
[04:28:51] RubyPanther: Aren't leap seconds ad-hoc and non-predictable?
[04:29:07] cableray: I think they're predictable.
[04:29:17] Antiarc: "Because the Earth's rotation speed varies in response to climatic and geological events, UTC leap seconds are irregularly spaced and unpredictable."
[04:29:24] cableray: but maybe not regular.
[04:29:27] Antiarc: I learned something today.
[04:29:48] cableray: I guess they are then.
[04:29:54] Antiarc: You got chaos theory in my date calculations! :|
[04:29:57] RubyPanther: Antiarc: I don't think it is, there is no reason it would be using floats for those calculations... I think that instead it uses shortcuts to get the leap years, and the shortcuts break down and so they are just skipped outside of a pre-determined limit
[04:30:22] Antiarc: I guess it depends on the implementation of BigNum
[04:30:35] Antiarc: I mean, it's not that hard to compute a year as 365.25 days
[04:31:00] Antiarc: For leap seconds to be a matter you'd be talking many, many zeros of years
[04:36:58] cableray: how many people here know that rspec's should takes two arguments?
[04:37:08] cableray: not this guy.
[04:37:25] cableray: or I learned it so long ago I forgot.
[05:04:55] machrider: hey guys... trying to get spork going to speed up my tests and it seems to be working, but when testdrb finishes, it always outputs a SystemExit exception backtrace
[05:05:03] machrider: coming from the minitest at_exit hook where autorun happens
[05:05:28] machrider: the test runs and passes otherwise (output appears in the spork terminal)
[05:07:38] Xapht: Quick question for anybody out there... I'm following the RoR tutorial book. http://ruby.railstutorial.org - And I have what I hope is a simple question regarding hashes.
[05:08:16] Xapht: Many times, the colon preceeds the hash key... And others, it follows it.. Is there any articles or anything regarding which to use where, and why?
[05:08:37] Spaceghostc2c: The preceding is a symbol
[05:08:45] Spaceghostc2c: The following is ruby 1.9 hash syntax.
[05:10:23] Xapht: Perfect example line of code: validates :name, presence: true, length: { maximum: 50 }
[05:10:45] Xapht: :name and presence: two completely different concepts?
[05:11:02] Spaceghostc2c: :symbol, key: value
[05:11:12] Spaceghostc2c: The first is a symbol.
[05:11:12] Xapht: Gotcha... TY Spaceghostc2c
[05:11:25] Spaceghostc2c: You can have any object as a key in a hash though, even symbols.
[05:11:45] Xapht: I'll have to read up on exactly what a symbol means, I got the hash concept down fairly well (written my own in python), but symbols are new.
[05:11:47] Xapht: to me anyways
[05:15:58] Xapht: So :name is a symbol - in this example - as part of the model - it points to the :name attribute of the class. While presence: true assigns the value true to the hash table with a key of presence:
[05:17:38] hisa_py: hi guys what is the proper way to initialize a class depending on the route requested?
[05:28:23] dougfu: i'd like to give the user the ability to check off people across different pages that they'd like to email, then be able to write a short blurb, and send off the email
[05:28:33] dougfu: localstorage the right way to go?
[05:29:36] dougfu: or is this more appropriate as a shopping cart of sorts?
[05:30:14] dougfu: (and actually saved down to a database, until the email is sent and the element is deleted)
[05:44:34] Ayse: What is your favorite way to learn Ruby?
[05:51:44] hisa_py: is it ok to add multiple before_filter?
[06:11:49] kingcrawler: would you say that a web app that works in all browsers to be "portable" or "compatible"?
[06:12:29] kingcrawler: i think i agree
[06:12:38] kingcrawler: i here people say portable all the time
[06:12:47] sevenseacat: portable is moving it from one place to another
[06:13:25] dcope: Is it possible :default => null in a migration?
[06:13:53] slash_nick: dcope... not when generating... open the migration and edit the file
[06:13:58] sevenseacat: dont see why not
[06:14:08] kingcrawler: I'm pretty sure yes
[06:14:40] dcope: it keeps throwing an error. undefined local variable or method `null'
[06:14:44] dcope: when trying to migrate
[06:14:49] sevenseacat: dcope: does ruby have null>
[06:15:25] sevenseacat: dcope: so why dont you try that then :)
[06:15:47] kingcrawler: i just finished writing an app using Java EE 6, and it was not fun
[06:16:21] kingcrawler: you have any experiences with the web-tier?
[06:18:36] dcope: argh bah, now the migration fails saying the relationship on the column already exists
[06:20:04] kingcrawler: dcope what are you trying to do exacty?
[06:20:24] kingcrawler: change the default column?
[06:20:53] dcope: kingcrawler: i added a column and had ":default => null" in the migration
[06:21:04] dcope: it added the column but broke when trying to migrate again
[06:21:18] kingcrawler: drop the column
[06:21:42] sevenseacat: you're running the same migration twice?
[06:22:00] sevenseacat: and wondering why it fails?
[06:23:39] maloik_: when working with a model that can have 2 'forms', for instance drafts and published articles, what is a good way to handle that? I feel like scopes arent bomb-proof enough (ie more prone to human error) then when I would make use of single table inheritance or so, but im not sure if that's such a good idea
[06:23:58] sevenseacat: scopes are fine
[06:26:04] kingcrawler: by scope do you mean in regards to ActiveRecord?
[06:26:48] kingcrawler: because they are pretty awesome under the covers
[06:27:19] eph3meral: maloik_: you "feel" like that?
[06:27:34] eph3meral: maloik_: well, might as well go with it, seems like a reliable way to make a decision
[06:28:27] kingcrawler: what are your alternatives?
[06:30:57] maloik_: kingcrawler: I'm not sure on any alternatives, I thought someone may have a very clever idea :-)
[06:35:25] jon___: Hey! I'm working on a simple friend request model and the sent requests are being accessed through current_user.requests_sent and then the user object through request.user.first_name once it's put through a for loop. The issue is request.user grabs the user_id column from request (and I want it to grab friend_id instead to see the friend you sent the request to). Would this be possible or would I have to change my associations s
[06:36:07] sevenseacat: jon___: code?
[06:37:19] eph3meral: jon___: also, why do you want blah.foo to do something other than foo?
[06:37:31] eph3meral: jon___: what's wrong with request.friend … ?
[06:38:30] jon___: haha, I figured it was something simple, request.friend works!
[06:39:20] eph3meral: glad to see you know what you're doing
[06:41:22] eph3meral: jon___: now read this http://guides.rubyonrails.org/association_basics.html so that you can understand what's actually going on
[06:44:56] rvanlieshout: generic issue: i have several resources nested in a resource :organisation. For a administrator this feels logic, since he has access to all of them. However, a 'common' user only has access to one. All uris now start with /organisation/123. What woud be a nice way to remove this part? I would still like to have an @organisation var available :)
[06:45:50] sevenseacat: rvanlieshout: make it a singaulr resource on the frontend
[06:46:06] sevenseacat: @organisation = current_user.organisation
[06:46:10] dcope: ACTION has recovered from the botched migration
[06:46:18] dcope: i'd like to tip my hat to the fine folks here!
[06:47:13] rvanlieshout: sevenseacat: it is current_user.organisation, but if i link to [@organisation, :children] it will still link to /organisation/123/children
[06:47:32] sevenseacat: rvanlieshout: then dont link to that?
[06:47:51] rvanlieshout: but then it would be [current_user.admin? ? @organisation : nil, :children]
[06:47:52] sevenseacat: use the rails route helpers instead of magic
[06:48:12] sevenseacat: link_to children_organisation_path
[06:48:16] sevenseacat: no argument required
[06:48:28] brianpWins: organisation/organizations/g
[06:48:53] brianpWins: organisation/organization/g (no 's' my bad)
[06:49:15] rvanlieshout: this it not an american project :)
[06:49:42] sevenseacat: brianpWins: good for you.
[06:50:06] rvanlieshout: sevenseacat: thanks... i'll try that. hope this will work even if @organisation is set
[06:50:34] brianpWins: i googled organisations and could only find 1 site that spelt it that way. I legitimately thought it was an error. what areas use it?
[06:50:44] sevenseacat: brianpWins: everywhere except the states
[06:50:52] tagrudev: organisation - the persons (or committees or departments etc.) who make up a body for the purpose of administering something; "he claims that the present administration is corrupt"; "the governance of an association is responsible to its members"; "he quickly became recognized as a member of the establishment"
[06:50:56] brianpWins: I'm not american
[06:51:13] sevenseacat: then we should be correcting your misspelling
[06:51:16] tagrudev: rvanlieshout, it would be set for one resource so I don't think the helper
[06:51:27] brianpWins: weird. I wonder if that was google at work not giving me results for organisations
[06:51:36] brianpWins: due to locale
[06:51:43] rvanlieshout: tagrudev: hmm.. other suggestions?
[06:52:15] brianpWins: sevenseacat: corrected!
[06:53:44] rvanlieshout: i can't try them now, so i'll come back later with results :)
[06:54:13] tagrudev: maybe some kind of constraint
[06:54:30] brianpWins: I actually feel like an ass now lol. When I saw it my first thought was "Weird I've never seen that spelling" so i googled it to try and see who does and got no results.
[06:54:35] rvanlieshout: the contraining part works. a common user is just not allowed to access other organisations
[06:54:48] rvanlieshout: brianpWins: no worries :)
[06:56:00] tagrudev: then sevenseacat is right :P
[06:56:18] sevenseacat: i like being right.
[06:56:37] rvanlieshout: but will that work if @organisation is set?
[06:56:41] sevenseacat: it should really happen more often
[06:56:54] rvanlieshout: defined in the controller
[06:57:10] rvanlieshout: cause the common user can edit his own organisation, thus having an @organisation
[06:57:21] rvanlieshout: won't all links be wrong then?
[06:57:24] rvanlieshout: and yes i know... i need to try
[07:05:12] tagrudev: yolo certainty
[08:12:32] redmaverick: I am new to Ruby on Rails. I need to pass a parameter from a text box to another page. Any open source example I can use or online resource that can help me?
[08:13:07] rvanlieshout: redmaverick: start with a rails tutorial
[08:13:19] tagrudev: http://guides.rubyonrails.org/security.html#sessions
[08:13:33] tagrudev: and use the website as a start point :)
[08:13:37] helpa: http://guides.rubyonrails.org/getting_started.html - Getting started with Ruby on Rails guide written by Mike Gunderloy
[08:13:37] sevenseacat: !gettingstarted
[08:21:20] redmaverick: ok. Thanks. I hope this tutorial will help me get started with all I need. I completed Rails for Zombies, but I forgot most of it. Will come back here when I have any other issues.
[08:22:25] tagrudev: ping certainty
[08:43:37] clocKwize: ooo, I just found AR::Base#pluck
[08:44:57] eph3meral: yeh, pluck is quite handy
[08:47:12] clocKwize: Its rare I've had to do that, but I know when I have I've done Blah.select(:id).collect { |b| b.id }
[08:47:24] tagrudev: button_to defaults to the post method ... boy that escalated quickly
[08:49:01] clocKwize: tagrudev, huh?
[08:49:23] tagrudev: button_to 'Make me awesome', new_awesome_path
[08:49:37] tagrudev: sends a post request
[08:49:58] clocKwize: buttons are for submitting forms
[08:50:04] clocKwize: forms are by default posted
[08:50:05] tagrudev: button_to 'Make me awesome', new_awesome_path, :method => :get
[08:50:20] clocKwize: links are for linking to things, with gets
[08:50:25] clocKwize: it kind of makes sense
[08:55:43] certainty: tagrudev: you here?
[08:57:32] Kilian]: i have a hospital, which has embedded departments, and i have doctors, which have embedded employments, which belongs to a department of a hospital, now i have one hospital and its departments and want to query all doctors for each of the department, thats what i tried https://gist.github.com/34ef6d151fd59e99ad97#file__sd.html.erb but i always got an empty collection as result can anyone help me?
[09:07:10] Criztian: hey everyone
[09:09:53] Kilian]: hi Criztian
[09:10:01] Criztian: I'm new to RoR but I managed to get everything up and running building new code. My problem is that I downloaded the sample app of the rails tutorial book and it says that abstract-1.0.0 is missing. Doing build install doesn't change a thing
[09:10:27] Criztian: even if installs everything...
[09:10:44] Criztian: Hi Kilian] wassup?
[09:11:25] elaptics: Criztian: what tutorial is it? abstract is a gem which you typically install via bundler
[09:12:09] elaptics: if it's an older tutorial which predates bundler then you would need to do: gem install abstract
[09:12:52] Criztian: http://ruby.railstutorial.org/ruby-on-rails-tutorial-book but the code I got is from git https://github.com/railstutorial/sample_app
[09:13:50] Criztian: so even if build install does tell me "1 gem installed" with the abstract-1.0.0 name I should try that out?
[09:14:01] elaptics: Criztian: that has a gemfile in it so you should just do: bundle install from the project's root directory
[09:14:14] Criztian: did that even twice
[09:15:05] dukz: criztian: when does it show abstract-1.0.0? When you access the page through a browser?
[09:15:35] dukz: i mean missing abstract-1.0.0?
[09:16:20] Criztian: does the fact that I use rvm affect anything?
[09:19:42] elaptics: Criztian: are you using gemsets?
[09:22:09] Sylario|2: Is there a popular gem to use prawn with rails?
[09:25:43] elaptics: Sylario|2: you don't need anything else but prawn
[09:26:29] elaptics: Sylario|2: https://github.com/prawnpdf/prawn/wiki/Using-Prawn-in-Rails-3
[09:26:32] Sylario|2: elaptics: ho, ok, so that's why rails-prawn gems are not up to date
[09:27:07] elaptics: I have used those instructions in the past and it works great
[09:28:37] Sylario|2: prawn seems to be not really difficult to use, something i never associated with PDF ^^
[09:28:43] mikecmpbll: following rails convention, should += instead be +!? :D
[09:28:52] Sylario|2: there must be a tarp!
[09:33:05] mikecmpbll: on a srs note. when I do .to_param on a hash, insert it as the value of a hidden input field, get it back as a param
[09:33:48] mikecmpbll: when i convert it back to a hash i get an "amp"=>nil in my hash
[09:37:55] elaptics: mikecmpbll: can you paste your code?
[09:38:05] mikecmpbll: yep, one sec
[09:39:02] royvandermeij: darn it. trying to do ydd, but it seems i'm not suitable for that kind of development :(
[09:40:22] helpa: royvandermeij: YOLO driven development
[09:40:22] elaptics: royvandermeij: !ydd
[09:42:56] tagrudev: I am here to help royvandermeij :D
[09:43:48] clocKwize: problem with furniture order -> useless unresponsive staff offering very little help -> email MD yesterday -> get call from them sorting it all out today :D
[09:49:13] royvandermeij: tagrudev: thnx :)
[09:49:48] royvandermeij: I have some local gems which needed some changes for another app. So I made those chages blindly and used it in the app. Did not end so well :P
[09:49:49] mikecmpbll: elaptics: got there in the end : http://pastie.org/5478046
[09:49:59] mikecmpbll: hopefully that shows enough
[09:50:39] Kilian]: i have this association, but instead of the IDs in the select drop down i want the another attribute to be displayed, but the id should be saved, so i cant change _id to another attribute, how can i do that? https://gist.github.com/13ed8e80791773980920#file__partial.html.erb
[10:00:59] Kilian]: i need help with this association example for different value / label https://github.com/plataformatec/simple_form#associations can anybody tell me how is done correct? https://gist.github.com/1c1e5690ea9a7a0782f4 is what i tried
[10:05:32] aaronmason: is anyone aware of a gem that supports MMS (multimedia messaging?)
[10:06:02] mikecmpbll: oh, looks like the JS is escaping my ampersands.
[10:06:25] elaptics: mikecmpbll: sorry, got sidetracked with phonecall
[10:06:40] mikecmpbll: i think it's my single quotes
[10:06:50] elaptics: mikecmpbll: fyi you can clean up your controller code to 1 line :)
[10:07:08] mikecmpbll: teach me! heh
[10:07:59] mikecmpbll: @filters = params[:filters].blank? ? {} : Rack::Utils.parse_nested_query(params[:filters])
[10:08:26] elaptics: mikecmpbll: yep
[10:08:53] elaptics: mikecmpbll: well 1 sec, misread the code to start with but you can tidy up by using .fetch on params
[10:09:18] mikecmpbll: not come across fetch before.
[10:09:32] workmad3: it's a little bit different from doing .blank? ?
[10:10:09] workmad3: hsh.fetch(:key, whatever) will return the value stored at :key if :key is present in the hash, otherwise whatever
[10:10:29] workmad3: which hsh[:key] will return the value of key or the default value if key isn't present
[10:10:34] workmad3: s/which/while
[10:10:53] mikecmpbll: yeah, param[:filters] will always return something
[10:11:00] mikecmpbll: but if it's "" i want to make it {}
[10:11:20] clocKwize: Rack::Utils.parse_nested_query params.fetch :filters, ""
[10:11:51] mikecmpbll: will fetch return "" if params[:filters] = ""?
[10:12:01] elaptics: probably want some brackets in that clocKwize
[10:12:03] aaronmcadam: Hi guys, is there a way to pass config settings when running a server?
[10:12:08] clocKwize: elaptics, maybe ;p
[10:12:29] elaptics: mikecmpbll: no, fetch just returns a default value if the key doesn't exist
[10:12:45] clocKwize: elaptics, "" and not existing are different
[10:12:49] aaronmcadam: as in `rails s --config 'assets.compress = false'`
[10:12:53] aaronmcadam: that's what I'd like to do
[10:13:02] clocKwize: <input type="hidden" name="blah" value="" /> still exists
[10:13:38] elaptics: mikecmpbll: whether you can use it with your code or not depends if :filters is always getting sent in the params or not
[10:13:52] mikecmpbll: yeah, it is, but ta for making me look at that method.
[10:14:05] mikecmpbll: made me realise i should probably have read a bit more before i wrote the caching class i wrote last week
[10:14:48] elaptics: mikecmpbll: I would recommend using fetch where possible when you're using hashes, to remove one more source of nil checking
[10:15:01] mikecmpbll: will do in future (y)
[10:18:03] workmad3: elaptics: it doesn't prevent nil checking if there's a chance that the key has been set to nil ;)
[10:18:29] workmad3: elaptics: a = {}; a[:key] = nil; a.fetch(:key, 0) #=> nil
[10:19:56] mikecmpbll: so anyway, as i'm putting a param string as a parameter, it html encodes the ampersands, how should I decode them in the controller?
[10:20:51] elaptics: workmad3: no, you're right :) I'm not paying attention this morning. I meant to say that fetch is useful for removing conditionals when you're after a default value
[10:20:59] elaptics: need moar coffee!!
[10:21:06] workmad3: elaptics: yeah, it's much safer for default values
[10:21:12] mikecmpbll: nvm, CGI::unescapeHTML looks to do the trick.
[10:21:16] workmad3: elaptics: because it allows for an explicit nil or false to be passed in
[10:21:38] workmad3: elaptics: !moar
[10:21:45] helpa: elaptics: drink moar coffeeeee
[10:21:45] workmad3: elaptics: !coffee
[10:26:11] workmad3: aaronmcadam: I have this fantastic idea for windscreen-wipers for submarines
[10:26:12] aaronmcadam: seems rails server takes a config file, but it's not picking up the config properly
[10:26:22] aaronmcadam: you're amazing
[10:26:41] workmad3: it's gonna revolutionize sub-mariner nautical engineering!
[10:26:47] aaronmcadam: sounds like it
[10:27:12] clocKwize: its probably not a bad idea
[10:27:28] aaronmcadam: I'm getting a AssetNotPrecompiledError for an env i've set up that's only in production mode
[10:27:29] workmad3: clocKwize: I have a chocolate teapot here for you
[10:27:43] clocKwize: I guess there must be dust and crap in the water, over time it probably sticks to the windscreen
[10:27:43] aaronmcadam: it's a stop gap solution for white labelling
[10:27:51] workmad3: aaronmcadam: sounds like you have an asset you're referencing that's not been precompiled
[10:27:54] universa1: wouldn't it be waterscreen-wipers?
[10:28:04] clocKwize: universa1, hell yeah
[10:28:11] workmad3: aaronmcadam: so fix it :P
[10:28:11] aaronmcadam: and I've run the rake task locally
[10:28:36] aaronmcadam: I guess I could hack it to check the host it's running on
[10:28:42] workmad3: aaronmcadam: just make sure you've added the missing asset(s) to the list of assets to precompile
[10:29:00] aaronmcadam: but shouldn't it find it anyway
[10:29:03] workmad3: aaronmcadam: no
[10:29:13] aaronmcadam: but it's within my normal assets area
[10:29:20] workmad3: aaronmcadam: only application.js/css are *precompiled* by default
[10:29:23] aaronmcadam: it's not like it's in vendor or anything weird
[10:29:26] Kilian]: i feel kind of stupid not understanding how different value /labels work with the simple for associations https://github.com/plataformatec/simple_form#associations can someone tell me what iam doing wrong? https://gist.github.com/1c1e5690ea9a7a0782f4
[10:29:28] universa1: aaronmcadam: And i usually compile on deployment
[10:29:41] aaronmcadam: my issue is trying to run it locally
[10:29:49] workmad3: aaronmcadam: if you have other manifest files, you need to add them to the list of precompiles
[10:29:58] aaronmcadam: and I don't want to have to clone the env to set it to dev
[10:30:17] aaronmcadam: just changed my favicons
[10:32:06] aaronmcadam: I added the magical line `config.assets.precompile = [/^[-_a-zA-Z0-9]*\..*/]`
[10:32:15] workmad3: aaronmcadam: eww
[10:32:18] workmad3: aaronmcadam: don't do that
[10:32:23] aaronmcadam: I know I removed it before
[10:32:54] workmad3: aaronmcadam: 'grep -R stylesheet_link app/views' and 'grep -R javascript_include app/views'
[10:33:05] workmad3: aaronmcadam: that will tell you all the files that are referenced and need to be precompiled
[10:33:30] workmad3: aaronmcadam: and then do 'config.assets.precompile += %w( whatever.js whatever.css ...)'
[10:33:41] aaronmcadam: I was hoping for a way to just set precompile to false
[10:33:52] workmad3: aaronmcadam: you can turn on compilation in production
[10:33:59] workmad3: aaronmcadam: that's just config.assets.compile = true
[10:34:12] aaronmcadam: I don't want 2 env files
[10:34:16] aaronmcadam: that's my whole issue
[10:34:16] clocKwize: MAN MY GF IS AMAZING, chorizo and smoked cheese and mayo rolls for lunch
[10:34:22] workmad3: aaronmcadam: well... suck it up
[10:34:32] workmad3: aaronmcadam: you have 2 environments from the sounds of things
[10:34:43] aaronmcadam: It's not going to scale for me
[10:34:57] aaronmcadam: It was just a quick way to white label
[10:35:30] workmad3: aaronmcadam: there isn't a quick and easy way to white label
[10:35:47] aaronmcadam: But it does my job for now so I can rewrite
[10:35:51] workmad3: aaronmcadam: you need to put in work either setting up multiple environments, or put in work setting up automation pipelines to do that for you
[10:36:09] aaronmcadam: I need to rewrite what I have first
[10:36:26] workmad3: aaronmcadam: and obviously it isn't doing the job, because otherwise you wouldn't be in here complaining about the situation and saying that the solutions aren't any good because you 'don't like them'
[10:36:28] aaronmcadam: but I'm not even sure multiple envs is the right way to do it
[10:36:48] aaronmcadam: I just said it's not scalable
[10:36:58] aaronmcadam: obviously it's not, to have 2 files for every app
[10:37:18] workmad3: aaronmcadam: do you need it scalable *right now*?
[10:37:29] workmad3: aaronmcadam: or do you need something that just fricking works right now so you can get on with your job?
[10:37:46] workmad3: aaronmcadam: and then you can worry about scaling when you actually fecking need it
[10:38:04] aaronmcadam: I've been looking at multi-tenant stuff
[10:38:20] Kilian]: can someone tell me why Hospital.all.speciality_departments is a unknown method but i have embeds_many :speciality_departments in my hospital class?
[10:38:27] aaronmcadam: that's probably the way to go, it's a straight forward enough notion, but looks tough to implement
[10:38:48] universa1_: Kilian]: All returns an Array...
[10:39:12] workmad3: universa1_: even worse, Kilian] is using mongoid :P
[10:39:52] universa1_: workmad3: Yeah, then Most likely something like an array
[10:40:10] aaronmcadam: an array of hashes probably
[10:40:17] clocKwize: an array of cheeses
[10:40:17] Kilian]: so how can i access all documents from the hospital class?
[10:40:21] workmad3: or an array of object ids
[10:40:21] aaronmcadam: least it's not a view collation :/
[10:40:52] workmad3: Kilian]: I'm not sure that what you just said even makes sense
[10:40:53] universa1_: Kilian]: Hospital.all.map(&:speciality_deps).flatten.uniq
[10:42:15] clocKwize: Kilian], stop thinking like a relation db
[10:42:29] Kilian]: clocKwize: thats not that easy :(
[10:42:34] clocKwize: also, using mongoid is jamming mongo in to a relational db structure
[10:42:36] Kilian]: universa1_: i got https://gist.github.com/2b990ffec3101de44593
[10:42:40] clocKwize: which is whats making it "not that easy"
[10:43:11] Kilian]: clocKwize: i didnt decided to use mongoid for this project
[10:43:50] clocKwize: Kilian], but you are right?
[10:44:19] Kilian]: clocKwize: what do you mean?
[10:44:28] clocKwize: you are using mongoid
[10:44:48] mikecmpbll: where's the documentation for Rails.cache?
[10:44:55] workmad3: mikecmpbll: in the cloud!!!!
[10:45:40] Kilian]: clocKwize: i have to use it, because i have to continue the project from someone else
[10:45:48] Kilian]: would never do that again
[10:46:12] clocKwize: ok, well, expect to delve deep in to Mongoids code then
[10:46:27] clocKwize: when I did it, I basically had another TextMate open on the Mongoid source
[10:46:27] workmad3: Kilian]: two options - learn how to use mongo and mongoid properly, or pull out mongo and mongoid and replace it with something else
[10:46:31] aaronmcadam: why would you use mongo if your data is relational?
[10:46:50] clocKwize: aaronmcadam, because its web 2.0!
[10:47:01] clocKwize: all the cool kids are doing it
[10:47:04] workmad3: Kilian]: because your current option of 'hack away, hack away, hack away, hope something works' is going to make no one happy and leave you with a fucking awful codebase
[10:47:13] universa1_: Kilian]: Please read the error messages carefully and check what methods you're trying to call on which objects
[10:47:24] aaronmcadam: especially when you just end up hacking arrays
[10:47:47] clocKwize: Kilian], NEVER assume something that works for ActiveRecord works in Mongoid. Even though it maybe should
[10:48:23] aaronmcadam: I really don't see the point in using a nosql db with a sql-like orm
[10:48:30] elaptics: I haven't used mongoid much but it seems to have been a bad idea to copy AR's api
[10:48:41] elaptics: when things don't line up exactly
[10:48:43] workmad3: yeah, first step to learning how to use mongo and mongoid properly - ignore stuff that talks about AR
[10:49:04] clocKwize: I think in theory, it *should* work because AR implements ActiveModel, and so does Mongoid
[10:49:13] clocKwize: but you know, real world and all that.
[10:49:21] elaptics: hard in here too when they neglect to mention mongoid when they just paste the code and we assume it's AR code
[10:49:35] workmad3: clocKwize: sure, that's fine for the stuff that is active-model
[10:49:57] workmad3: clocKwize: but not things like queries, and relationships, and all the other AR-specific stuff :)
[10:50:48] workmad3: AM gives you things like consistent naming for url-params, validations, some callback mechanisms, dirty tracking
[10:50:58] workmad3: which I bet all work really well in mongoid :)
[10:52:21] workmad3: aaronmcadam: the 'point' is that 'nosql is webscale! but I likes activerecord... lets make a franken-orm that combines them and makes my app buzzwordy'
[10:52:52] clocKwize: nosql is 'webscale' mainly because its not relational
[10:53:01] aaronmcadam: lets just use postgres, the best ever db ever!
[10:53:02] clocKwize: so to then jam it back in to an ORM
[10:53:13] workmad3: aaronmcadam: it's also to do with people jumping on the nosql bandwagon but not actually wanting to actually relearn how to do data-modelling
[10:53:31] aaronmcadam: that's the point, nosql can be mindbending
[10:53:43] aaronmcadam: if you're just hacking your way through
[10:53:54] aaronmcadam: which is why you end up having to do crazy array manipulations
[10:54:16] aaronmcadam: like above, the uniq.flatten.make_into_a_sql_query
[10:54:50] aaronmcadam: speaking from experience not learning couchdb properly
[10:54:54] workmad3: what's even better - mongo actually has a vaguely workable query language
[10:55:09] aaronmcadam: yeah it seems to give you much more of a hand than couch
[10:55:11] workmad3: but no, lets just pull it all into ruby and do array manipulations
[10:55:38] workmad3: aaronmcadam: nothing wrong with the couch approach - you just write all your queries as map-reduce functions in erlang...
[10:56:20] aaronmcadam: maybe it's just not made clear enough what nosql is good at
[10:56:42] aaronmcadam: without the big over-hyped drama around it
[10:57:39] aaronmcadam: lack of migrations is a good example, and was a big draw for me, but then you have the same integrity problems without them.
[10:57:40] helpa: aaronmcadam: http://browsertoolkit.com/fault-tolerance.png
[10:57:40] workmad3: aaronmcadam: !couchdb
[10:57:40] slainer68: http://isphpagoodlanguage.com
[10:58:04] aaronmcadam: hahaha workmad3 :D
[10:59:33] aaronmcadam: even in the docs they basically say "you can do amazing things, if you learn Erlang, read the source and write your functions in it"
[11:00:17] aaronmcadam: they even had this awful section entitled "Map/Reduce for SQL Jockeys"
[11:00:33] mikecmpbll: is Rails.cache.fetch('foo') { 1+1 } the same as cache = ActiveSupport::Cache::MemoryStore.new; cache.fetch('foo') { 1+1 }
[11:00:37] workmad3: aaronmcadam: you only need the first 2 bits of that to still be accurate - 'you can do amazing things, if you learn Erlang' :)
[11:00:39] aaronmcadam: which had 2 or 3 awfully trivial example
[11:01:13] workmad3: mikecmpbll: no, because Rails.cache isn't necesarily going to be a memorystore cache
[11:01:22] workmad3: *necessarily
[11:01:26] mikecmpbll: where's it defined?
[11:01:36] aaronmcadam: in the settings I thought
[11:01:40] workmad3: mikecmpbll: it's part of your app configuration
[11:02:03] workmad3: mikecmpbll: it could be memory store, it could be memcached, it could be redis, it could be filestore...
[11:02:16] aaronmcadam: mikecmpbll: config.cache_store = :mem_cache_store
[11:02:21] workmad3: mikecmpbll: Rails.cache gives you a consistent interface and access mechanism
[11:03:28] workmad3: mikecmpbll: if you're creating the cache store yourself, you're probably doing things wrong
[11:04:51] mikecmpbll: ah, I see, was just looking at this: http://api.rubyonrails.org/classes/ActiveSupport/Cache/Store.html#method-i-fetch
[11:05:06] mikecmpbll: where it creates it explicitly
[11:05:16] mikecmpbll: but had also seen Rails.cache, but now it makes sense.
[11:05:36] workmad3: mikecmpbll: sure, if you're using activesupport on its own, you want code examples that create it explicitly ;)
[11:07:36] mikecmpbll: indeed, couldn't find any documentation for Rails.cache though! my googling needs some improvement, probably.
[11:07:37] workmad3: http://guides.rubyonrails.org/caching_with_rails.html
[11:07:39] mikecmpbll: ACTION hangs head.
[11:08:13] aaronmcadam: any handy way to make include? a fuzzy matcher?
[11:08:39] workmad3: aaronmcadam: .any? with a block? :)
[11:09:22] workmad3: aaronmcadam: e.g. ary.any?(&:even); ary.any? {|i| i =~ /whatever/}
[11:09:55] aaronmcadam: still learning Ruby's API, it's awesome
[11:10:05] workmad3: aaronmcadam: look up the enumerable docs
[11:10:12] aaronmcadam: ah, i'm on Array
[11:10:21] aaronmcadam: maybe that's why I missed it
[11:10:39] workmad3: yeah, learn what Enumerable gives you and you'll be a happy ruby coder :)
[11:10:42] aaronmcadam: got it, thanks :)
[11:10:55] aaronmcadam: yeah I've played with its map/reduce functions
[11:11:17] aaronmcadam: thanks workmad3 :)
[11:14:13] aaronmcadam: mainly want to check if i is a substring of the string
[11:14:42] aaronmcadam: could do string.split(substring).size > 0
[11:15:38] elaptics: aaronmcadam: string.include?(substring)
[11:15:58] aaronmcadam: I really don't know the API well yet :D
[11:16:03] aaronmcadam: thanks elastics :)
[11:16:15] clocKwize: aaronmcadam, rule of ruby: if you have to write a line of code that isn't calling at least 5 standard functions, you are doing it wrong
[11:16:42] elaptics: aaronmcadam: http://www.ruby-doc.org/core-1.9.3/String.html#method-i-include-3F
[11:16:54] clocKwize: that rule doesn't exactly work out
[11:16:55] aaronmcadam: don't you mean, if it doesn't read idiomatically, there's probably a better way
[11:17:18] elaptics: generally speaking that's the case :)
[11:17:59] aaronmcadam: If I did have to do some backflipping, I'd make it a function
[11:18:41] aaronmcadam: just a quick q, you know in js, where you can just pass a callback
[11:18:53] aaronmcadam: can you just pass a function instead of writing a block?
[11:18:57] clocKwize: or maybe: if writing a line of code is comparable to dragging your nut sack across sandpaper, you're not doing it "the ruby way"
[11:19:00] aaronmcadam: (I need to read up on Procs)
[11:19:25] tagrudev: backfliping yolo
[11:22:54] clocKwize: I just donated to wikipedia
[11:23:21] tagrudev: now the internet will crash down
[11:23:25] universa1: houston we got a problem!
[11:35:20] crazyhorse18: planning on upgrading my rails 2.3.5 app to rails 3.whateverthelatestversionis .. my friend says that upgrading from 2 to 3 is very labour intensive
[11:35:27] crazyhorse18: now this app i've got is quite huge
[11:35:50] crazyhorse18: 300 models, 60 or so controllers a ton of stuff in lib
[11:36:00] crazyhorse18: and 3 vendored plugins which in themselves are entire applications
[11:36:39] crazyhorse18: any idea on how long it might take to upgrade? .. what's the main thing you end up doing.. switching activerecord commands over?
[11:36:53] crazyhorse18: and do i upgrade to rails 2.3.14 first.. then go for 3.2.. or
[11:37:02] crazyhorse18: and then of course there is ruby as well
[11:37:03] universa1: crazyhorse18: depends on your code, but usually
[11:37:10] universa1: go for 3.0 first
[11:37:17] universa1: then 3.1 and then 3.2, not straight to 3.2
[11:37:35] crazyhorse18: then 3.1 then 3.2
[11:37:49] universa1: crazyhorse18: there's a upgrade gem which generates new configs etc
[11:38:01] universa1: crazyhorse18: and tells you at least some deprecations etc
[11:38:14] crazyhorse18: what about unit tests?
[11:38:17] crazyhorse18: will they still run?
[11:38:18] krz: if one is using a custom script for a particular view. do they store the js file in the asset pipeline? or other?
[11:38:22] crazyhorse18: using rspec 1.3.whatever
[11:38:48] universa1: crazyhorse18: they surely need some fixing too
[11:39:03] universa1: but most should be syntactical
[11:39:26] crazyhorse18: yeah.. i'm damn good with regex so hopefully if that's it.. i can just do the entire lot with a few commands
[11:39:39] krz: or should the js, be placed directly in the view?
[11:39:53] helpa: crazyhorse18: mwahahahahaha
[11:39:53] elaptics: crazyhorse18: !mwa
[11:39:55] universa1: krz: i'd put the js file as coffeescript in the asset-pipeline
[11:40:07] krz: universa1: do you nest folders?
[11:40:07] universa1: krz: don't forget to add it to the precompile list.
[11:40:12] universa1: krz: depends.
[11:40:23] crazyhorse18: krz: hey... i don't know anythign about asset pipelines.. but i like keeping my javascript completly away from rails.. pretend the front end and the backend are separate apps
[11:40:51] crazyhorse18: but then again... our app is all javascript
[11:40:59] crazyhorse18: like 60% js 40% rails
[11:41:35] krz: universa1: something like //= require views/users/form ?
[11:41:56] krz: /= require views/users/new etc
[11:42:18] universa1: krz: in which fiel do you want to put that?
[11:42:28] krz: application.js
[11:42:38] universa1: krz: so you're including it in all views.
[11:42:54] universa1: krz: gtg, off to lunch.
[11:42:59] krz: that would be a bad idea, i guess
[11:44:01] krz: lets say i have js that should run only for a particular view. should this be placed in the asset pipeline for better file organization?
[11:44:48] rvanlieshout: krz: you should include the js within your application.js and have it determine if it needs to execute something itself
[11:45:25] rvanlieshout: it would be slower to have multiple js files downloaded for your page
[11:46:17] krz: "determine if it needs to execute". something like if ($(#foo).length) { …do something here } ?
[11:47:19] krz: rvanlieshout: in that case. if you had a js block of code for users/new.html.erb. where would this js file exist in /app/assets/javascripts?
[11:47:55] rvanlieshout: i guess that would be users.js
[11:47:57] krz: like so: /app/assets/javascripts/users/new.js.cofee ?
[11:48:38] rvanlieshout: how much javascript would you have for new? why not users.js?
[11:48:47] rvanlieshout: it's really up to you to decide here
[11:49:22] krz: i thought of better separation by having: /app/assets/javascripts/users/new.js.cofee, /app/assets/javascripts/users/edit.js.cofee, /app/assets/javascripts/users/index.js.cofee, etc
[11:49:28] krz: but that might be overkill?
[11:49:51] clocKwize: its all going to be application.js in the end/
[11:50:37] krz: yea it is. i was just thinking in terms of finding which views the js code belongs to
[11:51:58] workmad3: krz: does the js code belong to a view, or does it perform some specific bit of functionality?
[11:52:14] krz: belongs to a view
[11:54:35] workmad3: krz: right, as for overkill... how much js are you anticipating?
[11:54:47] krz: some views have quite a bit of js
[11:54:56] workmad3: krz: as it's separated by view, I'm going to guess small amounts of 'view bling'
[11:55:27] krz: >100 lines of js
[11:55:33] krz: some less
[11:55:45] rvanlieshout: do you even have html? why so much js?
[11:55:46] workmad3: right, so in actual fact, still small amounts
[11:56:34] workmad3: krz: you probably don't need to overthink things too much, you're still in the realms of 'view bling' rather than complex JS app that needs good structuring
[11:56:49] workmad3: krz: just pick an organisation style you like
[11:56:50] krz: you are right
[11:57:14] workmad3: simple, complex, doesn't matter, just pick one you like and can work with :)
[11:57:28] workmad3: it probably wouldn't even matter if you weren't strict in adhering to it tbh
[11:57:40] krz: rvanlieshout: some views contain api js libs for Facebook, pusher, some upload stuff
[11:58:27] workmad3: why are the libs in view-specific files? why aren't they in vendor/assets/javascripts and pulled into application.js?
[11:58:37] workmad3: or in asset gems?
[12:01:47] cascalheira: Someone here uses any gem to format/add more info to rails development debug output?
[12:01:56] rvanlieshout: what more do you need?
[12:02:06] Freedom_: could anyone help me find the reason all my models return cache key without object id? Example: Project.first.cache_id # => "projects/1234"
[12:04:18] cascalheira: rvanlieshout: i would love to have it more organized... the date/time/host info is not needed most of the time when in development
[12:04:47] rvanlieshout: are you saving this debug output?
[12:05:26] workmad3: cascalheira: what 'debug output' are you meaning? do you mean the log? or something else?
[12:05:39] cascalheira: workmad3: the log
[12:05:48] rvanlieshout: why are you saving that?
[12:05:52] workmad3: cascalheira: right, so that is just called the log, not 'debug output'
[12:07:08] workmad3: cascalheira: and that morphs your question into 'are there any gems for formatting and adjusting the rails log output?'
[12:07:20] rvanlieshout: workmad3: don't you love it that people thank you for not answering your question? :)
[12:07:27] cascalheira: anyway, i am saving it as i sometimes just do a tail log/development.log -t from a co worker computer
[12:07:58] workmad3: rvanlieshout: yeah, I like to answer the actual question, rather than the question that was asked ;)
[12:08:09] rvanlieshout: cascalheira: aren't development logs outdated after the code has been modified?
[12:08:21] cascalheira: rvanlieshout: i was thanking him about the name of the thing :P and it was more a sarcastic thank you then anything
[12:08:28] workmad3: rvanlieshout: and sometimes just getting someone to arrive at their actual question is worthy of thanks :P
[12:09:17] rvanlieshout: that sure is true :)
[12:09:33] workmad3: hmm... I should clear out my dev and test logs...
[12:09:37] cascalheira: there are 2 of us developing here. when my co worker has a problem he cant solve, i usually ssh into his machine and take a look at his log
[12:09:51] cascalheira: thats why we save it
[12:10:09] rvanlieshout: cascalheira: but i can imagine you only need the current log at that time? What's wrong with a 'tail -f'?
[12:10:29] cascalheira: thats what i am doing, i am not keeping the logs for ever
[12:10:48] cascalheira: i just want to configure the way the log on the window that is runing my rails server loooks
[12:11:35] workmad3: cascalheira: as I said, your question is about log formatting
[12:11:43] workmad3: cascalheira: which is now a really googleable topic :P
[12:11:55] cascalheira: http://cbpowell.wordpress.com/2012/04/05/beautiful-logging-for-ruby-on-rails-3-2/ and yes i just found it
[12:12:10] cascalheira: i was googling it, but only found some old gems that didn't quite do what i wanted
[12:12:41] cascalheira: thank you for your time anyway
[12:48:31] soahccc: Anyone know a good Markdown editor for mac? I like Mou but it's renderer isn't compliant with Github's markdown.
[12:49:59] ddd: soahccc: mardown pro. also, use ia Writer and Marked
[12:50:10] ddd: s/mardown/markdown/
[12:50:43] rohit: soahccc, this showed on my twitter feed today - https://github.com/swaroopch/kalam
[12:50:55] ddd: marked has github.css specific support
[12:51:21] ddd: i use iaWriter to write my READMEs and stuff, and Marked to view them to ensure compliance
[12:51:27] soahccc: ddd: I saw marked but there was no demo so I disqualified it. Thanks for the other suggestions, 'll give it a try!
[12:51:54] ddd: ehh, its only a measley $3.99 USD in the app store :)
[12:53:01] yasu: how is this? http://mouapp.com/
[12:53:22] ddd: http://www.markdownpro.com for markdown but its not free either.
[12:53:48] ddd: *I* didn't like it but thats me (mouapp)
[12:54:01] universa1: why not just quickly write one yourself? redcarpet + some ajax => profit!
[12:54:07] soahccc: ddd: It's not about the price, I just don't want to support this customer inimical model... I really hate those app stores (not in general but that what it is in most cases)
[12:54:27] ddd: soahccc: you hate people making a living? ok
[12:54:30] soahccc: universa1: Then I can write my markdown on github.com and paste in into my file :D
[12:54:46] ddd: sure some of the rules for Apple's appstore are a bit hard to comply with but not many
[12:55:23] soahccc: ddd: You mean the programmer or the app store operator?
[12:55:42] ddd: soahccc: oh so let me guess. you hate apple because they run an appstore
[12:55:52] soahccc: no I hate it's regulations
[12:56:06] ddd: the programmer has to comply with certain rules like signing, sandboxing etc but they're done for security reasons.
[12:56:28] universa1: ddd: that part is great. the content filtering not so much.
[12:56:38] soahccc: ddd: You want to tell me that there are no nannying rules in the Apple world?
[12:56:42] rakl: Hey, I have an ajax call post method that is returning a 200 response, but not executing the success callback. (It is executing the error callback): Can someone tell what I'm doing wrong? http://pastie.org/5478717
[12:56:49] universa1: i'm not really happy that a company can dictate what i'm allowed to do in an app content wise
[12:57:07] ddd: universa1: they don't. unless you sell through their store
[12:57:34] ddd: its like people wanting to sell porn through a bible store
[12:57:36] universa1: ddd: yes! there's no other way to publish an app for ios ;)
[12:57:37] ddd: there's rules
[12:58:32] workmad3: universa1: apple devices come with a free lifetime nanny
[12:58:34] universa1: ddd: i don't care if i'm allowed to sell on their app store, i care if i'm allowed to create apps and ahve people use them with whatever content i want ;)
[12:58:45] universa1: workmad3: i know ;) i really like mine.
[12:58:59] universa1: but i'm not blindly happy with everything ;)
[12:59:35] workmad3: you can't sell porn through a bible store, and the only book store ever allowed is a single bible store...
[12:59:56] soahccc: It's funny though that there is no functional update mechanism. I won't get updates for my apps (and afaik a app isn't allowed to announce and update) unless I start the AppStore but why would I do that (unless I need an application)?
[13:00:27] universa1: hmm the appstore icon has a notifier-attachment with the number of updates available ;)
[13:00:31] soahccc: Anyway, thanks for the suggestions, I'll take a look at them any maybe I find a *chr* "demo" :D
[13:00:32] ddd: universa1: thats more because they have a specific target group and want to maintain that targetting with as little room for side-to-side as possible when it comes to commercial apps. I totally get what you mean, I agree in *some* instances* that they're too draconian, however, in most instances I do want to be saved from the hello-world-in-60-colors-now-pay-me-4.99 guys
[13:00:39] soahccc: universa1: which icon? :)
[13:00:57] ddd: soahccc: the appstore icon
[13:01:14] universa1: soahccc: the appstore icon on ios, and on mac it tells me there are software updates available
[13:01:36] ddd: software update is for their own internal updates now (and 3rd party business partners for devices you attach), appstore is for everything else.
[13:01:54] ddd: and even some of their main apps like xcode updates are indicated by appstore as well
[13:01:58] ddd: all without starting it
[13:02:01] soahccc: Ohh well the icon which is not in my Dock why I don't need it ;) I means why is there nothing like software update that checks it regardless where I have the application icon
[13:02:03] universa1: ddd: yeah, but the happy unicorn world of apple is only one side of the medal imho ;)
[13:02:10] omarqureshi: OS X updates are nowadays provided by the App Store too now, no?
[13:02:17] universa1: soahccc: it does?!
[13:02:28] ddd: soahccc: umm, there is, and it does
[13:02:40] ddd: just because you moved the *location* of the indicator to a place you can't see it is on you
[13:02:49] soahccc: hmm where? It only shows up in the icon in the dock afaik
[13:02:59] universa1: soahccc: i get a notification in the top right too ;)
[13:03:02] ddd: and the software update will tell you when there are security updates and driver updates etc
[13:03:10] ddd: universa1: yep
[13:03:20] soahccc: Really unapple like imho
[13:03:32] universa1: so, enough distraction ;) back to my not so happy haskell world.
[13:03:37] ddd: in fact it will actuall spawn the updater if there are updates available (sec etc, but not main apps)
[13:03:45] ddd: soahccc: hardly
[13:05:37] ddd: they've more than enough indicators around, spawned instances of software update when needed. they're quite on top of the update game. hell, not even linux does as good a job of notifying where there are available updates to include physical separation of whats system updates and whats addon updates. its lumped all together on everybody from RedHat to Ubuntu
[13:05:42] soahccc: No indicator in my case: http://files.sven.bmonkeys.net/images/Fullscreen-20121204-140525.png
[13:06:31] ddd: then you got something misconfigured on your end because it sure shows me on Lion and Mountain Lion
[13:06:55] ddd: (including for a few apps a friend installed for me using his account that I couldn't update due to account tie, whichi had to delete)
[13:08:32] soahccc: I saw this behaviour on all our macs here (all running lion, one mountain lion). My OS X is fairly configured but the only thing I did on most macs is to remove all the unnecessary Dock icons (including the Appstore) and installing word, configuring mail etc... So I would not know what might cause this (german OS X maybe?)
[13:09:05] ddd: could be. could be a regional sales requirements change.
[13:09:29] ddd: like differing requirements for the EU vs USA vs Canada
[13:09:57] ddd: (I'm in North America which is why I chose US and CA as representative examples)
[13:10:01] workmad3: I only get update notifications if I open the app store (which I rarely do)
[13:10:35] ddd: weird. i get them whether i have appstore open or not
[13:11:02] workmad3: I'm still on SL though :P
[13:11:12] ddd: my icon gives me a count of available updates embedded in the upper right of the icon itself. both in dock and in Applications
[13:11:32] ddd: that might be why. i don't remember SL doing that. I know Lion and definitely ML do
[13:21:55] maxer: i have included the rails tinymce gem and it works fine localhost but when i push to heroku it doesn't.. anyone idea on what i am missing?
[13:22:11] Arjan: Hi, I am using simple_form and active_attr. When I navigate to the page that should show my form I get the following error: undefined method `new_record?' for #<Message body: nil, email: nil, name: nil, subject: nil>
[13:22:26] tbuehlmann: maxer, migrated the db? and what's the actual error?
[13:23:08] maxer: tbuehlmann: from the firebug console "tinyMCE is not defined"
[13:23:24] Arjan: Please let me know if you require a gist of my model, controller and/or view
[13:24:00] maxer: tbuehlmann: didn't think you needed to migrate anything with tinymce
[13:29:28] elaptics: maxer: how are you including it into your app?
[13:29:47] maxer: elaptics: in the application.js -> //= require tinymce
[13:29:58] elaptics: maxer: my guess is that you have it outside of the application.js manifest so you need to add it to the precompile list
[13:30:54] maxer: elaptics: how do i go about that?
[13:30:56] elaptics: Arjan: the answer to whether we need code or not is always 'yes' :)
[13:31:30] helpa: 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.
[13:32:11] Arjan: elaptics I see
[13:32:34] Arjan: elaptics I created a stackoverflow post with all the info
[13:32:38] Arjan: http://stackoverflow.com/questions/13704111/error-with-simple-form-and-active-attr
[13:33:16] elaptics: maxer: you'll find it in your application.rb file
[13:33:23] fschuindt: Guys who using Paperclip... I've been searching how to show the default image url on views and how to do something like that: https://gist.github.com/4203909
[13:34:26] Arjan: fschuindt image_tag @smoke.picture.url
[13:34:54] Arjan: fschuindt or simple image_tag @smoke.picture\
[13:35:01] Arjan: fschuindt without the \
[13:35:16] fschuindt: Arjan: hm, It sounds great, thank you man!
[13:35:37] Arjan: fschuindt it is on the wiki
[13:35:46] Arjan: fschuindt i mean on the github page :)
[13:35:56] Arjan: fschuindt https://github.com/thoughtbot/paperclip
[13:36:12] fschuindt: Arjan: Thank you, I will search there next time :)
[13:36:43] Arjan: fschuindt you're welcome
[13:38:17] Arjan: Can anyone help me with my problem regarding simple_form and active_attr
[13:38:27] Arjan: All the details are on http://stackoverflow.com/questions/13704111/error-with-simple-form-and-active-attr
[13:42:15] krz: anyone use stated or batsd? any better alternatives?
[13:42:33] tagrudev: ping certainty
[13:42:45] omarqureshi: brief encouner with statsd
[13:42:51] omarqureshi: just seems a bit wasteful
[13:43:20] krz: omarqureshi: what do you use to track stats, instead?
[13:43:56] omarqureshi: depends on the kinds of stats
[13:44:32] omarqureshi: if its pageviews, then you have logs
[13:45:49] krz: atm we are using postgres. all is well, but looking into something more stats centric
[13:46:34] krz: batsd looks interesting
[13:47:03] omarqureshi: i dont see the benefits it brings for another bit of infrastructure though
[13:47:56] Klaymen: Is there a way to use validation inside the controller ?
[13:48:14] Klaymen: I only wee it coupled to models in the docs
[13:48:23] krz: we are kind of reaching the point where tracking 'everything' is creating a few bottlenecks on our rdbms. i considered mongo, but came across stated, which sounds like something we could benefit from
[13:48:36] krz: stated=statsd
[13:49:13] universa1: Klaymen: the controller mediates between view and model
[13:49:32] universa1: it would call some model method to validate data from the view/user
[13:50:07] Klaymen: universa1: well, say I want to search for a user but I want to check the email first but not the other fields... ?
[13:50:56] universa1: Klaymen: so query the db by the email? if it's invalid you won't get any results => done
[13:51:37] Klaymen: universa1: no need to "clean/validate" the params before database querying ? I'm still learning so sorry if noobish question :p
[13:52:16] universa1: Klaymen: if you don't do anything weird. no
[13:52:50] Klaymen: universa1: k, thanks !
[13:53:05] universa1: Klaymen: so User.where(email: paras[:email]).first is fine; User.where("users.email = '#{params[:email]}'" is NOT!
[13:53:47] Klaymen: universa1: I was going to use the first version but thanks for making sure I wan't going to do something "weird" ;)
[14:07:14] kahoj: Hey, I'm looking for a way to check my URL for a key that it isn't supposed to include, I'm using webmock and rspec (though i just started with webmock)
[14:08:33] kahoj: I have the key in a fixture, but i can't seem to figure how to check against the url. I have stub = WebMock.stub_request(:get,TEMPLATE)
[14:11:58] TwinkleHood: Hey, I'm looking for a way to check my URL for a key that it isn't supposed to include, I'm using webmock and rspec (though i just started with webmock)
[14:12:09] TwinkleHood: I have the key in a fixture, but i can't seem to figure how to check against the url. I have stub = WebMock.stub_request(:get,TEMPLATE)
[14:12:33] universa1: TwinkleHood: repeating the same question within minutes isn't going to help.
[14:12:46] universa1: TwinkleHood: gist the code + error
[14:13:03] TwinkleHood: Oh, I'm sorry, i thought i might have been missed since it replied that i needed to register with the nickserv
[14:13:21] TwinkleHood: Didn't mean to spam. Gist the code + error?
[14:14:36] helpa: TwinkleHood: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[14:14:36] universa1: TwinkleHood: !gist
[14:15:46] TwinkleHood: Well, it's not really a code/error situation, since i haven't really figured a way to do it. I could post something that doesn't make any sense, and an error that it doesn't make any sense at best.
[14:16:54] universa1: TwinkleHood: then read and adopt the examples on: https://github.com/bblimke/webmock ?!
[14:17:26] TwinkleHood: Read through it all, couldn't find an example that really matched.
[14:17:45] universa1: TwinkleHood: then explain what you want to do...
[14:19:15] TwinkleHood: I'm trying, I'm trying. I'm trying to stub a page, and then check the URL, and make sure it doesn't contain a key specified in my fixture. The reason for this is a proxy made to hide the key from the user.
[14:20:05] TwinkleHood: I am not 100% sure it makes sense to do though.
[14:26:46] elaptics: TwinkleHood: you probably need to explain the bigger picture, I don't understand what/why you're trying to do what you're doing
[14:26:48] RickSchmitty: is there a way to get this line to work? <%= item.image.blank? span+2 : span%> or do i need to calculate my value first then do <%= newvar %> ?
[14:27:26] RickSchmitty: derp nm, missed a ? :)
[14:27:28] elaptics: RickSchmitty: you're missing a ? if that's supposed to be a ternary
[14:27:42] RickSchmitty: ya lol figures soon as i paste it to others i see my folly, thx tho!
[14:30:39] clocKwize: the ? on methods always throws me off when doing a ternary
[14:33:29] krz: omarqureshi: about stated. you'd have to have it running on a totally different server and have it listen to events right?
[14:34:08] omarqureshi: if you want to do it properly, yes
[14:34:16] omarqureshi: which is why i didnt bother krz
[14:34:48] krz: any other alternative solutions, besides sql, that you have come across, in the past?
[14:37:27] TwinkleHood: elaptics: Right, I'll try. I have a proxy, which the end user interacts with, and sees the URL of. That, in turn connects to my adapter, which makes a call to a server with a database. In order to authenticate with the database, it carries an API-key. I want to make a test that ensures that this API-key is never in the URL on the other side of the proxy, the worry being that it IS on this site.
[14:37:47] loopAndAhalf: Where can i find generators that generate exactly the same stuff that rails generates, but without those extremely long comment-documentation.. ?
[14:38:03] loopAndAhalf: Didn't someone already do that? :O
[14:38:28] alecs: loopAndAhalf: what do you mean ?
[14:38:50] alecs: "rails generate " command ?
[14:39:04] loopAndAhalf: alecs: I am lazy enough to use default rails generators.. but i don't want those comments
[14:39:30] TwinkleHood: I hate asking this but.. Can't you just remove them?
[14:39:39] TwinkleHood: Recursively, if need be.
[14:39:59] loopAndAhalf: TwinkleHood: That's what I am doing.. I wrote a script to find all likes beginning with "#" and deleted them..
[14:39:59] workmad3: loopAndAhalf: just add your own templates for the generator without the comments
[14:40:34] loopAndAhalf: workmad3: Idk how to do that.. Link please?
[14:40:37] TwinkleHood: Sounds like something I'd do :) But yeah, if it's the same thing you're generating over and over you can make a template.
[14:41:05] alecs: loopAndAhalf: this is what you want ? http://pastie.org/5479074
[14:42:21] workmad3: loopAndAhalf: http://guides.rubyonrails.org/generators.html
[14:43:12] loopAndAhalf: workmad3: Thanks :)
[14:43:12] Kilian]: is there a way to create a new collection out of all embedded documents from one model?
[14:44:01] loopAndAhalf: alecs: Nope, That's not what I meant.. But workmad3 's link solves the prob... Thanks anyway.
[14:44:40] Kilian]: i always end up with an array if i iterate over an collection to pick up every embedded document
[14:49:17] somekool: anyone know if it is possible to make Rails skip the creation of a ActionDispatch::Http::UploadedFile and instead keep the HTTP headers and everything intact?
[14:50:28] workmad3: somekool: for what reason?
[14:56:08] _bart: Hey someone has starter to convert Ruby on Rails to PHP on Rails and calls it Laravel: http://laravel.com/ I wonder what dhh thinks of all this
[14:56:48] bigkevmcd: probably thinks they're crazy...
[14:56:49] universa1: _bart: so another clone? who cares? there's symphony, cakephp, django, play!, and what else ;)
[14:56:50] stephenorr: _bart: he probably won't care, since it'd never be quite as good
[14:57:48] elaptics: it's still php :)
[15:00:46] clocKwize: its like rolling a piece of shit in glitter
[15:02:19] stephenorr: clocKwize: absolutely, and I say that as a professional PHP developer
[15:02:33] stephenorr: (at least, as professional as we get)
[15:06:24] certainty: php is a lovely language
[15:06:59] certainty: no wait, that was scheme :p
[15:07:50] stephenorr: certainty: i was gonna say, in what universe? i've learned a lot from PHP, and it still pays the bills at the end of the month, but I'm moving across to Ruby as fast as I can (just need to convince my employer :P)
[15:09:50] d2dchat: stephenorr: certainty have you guys checked out Go? :)
[15:10:16] stephenorr: d2dchat: not as yet, I've been getting told "we're a PHP company, we do PHP"
[15:10:35] stephenorr: d2dchat: mind you, we use Chef and Capistrano for deploying stuff :)
[15:10:36] certainty: d2dchat: yes. not in depth though, i was a bit frightened because it looked C-ish
[15:11:05] certainty: i was expecting something higher level
[15:11:06] d2dchat: certainty: it does look a bit C-ish.. ironically makes it easy to learn
[15:11:25] certainty: i don't like algol syntax too much
[15:12:15] d2dchat: certainty: it's got the nice parts of C.. speed.. and gets rid of a lot of the headaches of C.. dependencies.. pointer craziness
[15:12:38] certainty: but it has some powerful applications in the distributed world. if i needed that i'd probably aim for clojure instead
[15:12:46] d2dchat: certainty: meh.
[15:12:59] certainty: i'm a lisper after all :D
[15:13:11] d2dchat: certainty: hate the JVM
[15:13:37] certainty: but clojure the language is nice
[15:13:40] d2dchat: ACTION wishes clojure was not on the jvm :)
[15:15:22] certainty: i don't know how go handles this but in distributed and concurrent environments i'd rather avoid shared mutable state instead of having fancy synchronization mechanism
[15:17:46] d2dchat: certainty: Go's models is much like erlang only nicer :)
[15:17:59] d2dchat: certainty: almost feels 'higher level'
[15:18:15] stephenorr: I was playing with Elixir the other day, but I don't really have a use for it so far
[15:20:28] certainty: d2dchat: actors?
[15:21:15] d2dchat: certainty: similar.. it's more about communicating
[15:21:34] d2dchat: looking for some docs that explain it better
[15:21:38] d2dchat: tons of stuff on it :)
[15:21:49] d2dchat: certainty: http://golang.org/doc/effective_go.html#concurrency
[15:22:05] d2dchat: "Do not communicate by sharing memory; instead, share memory by communicating."
[15:27:30] certainty: d2dchat: ah, i see. makes sense. also i hear google knows something about concurrency ;)
[15:27:55] workmad3: shared memory == infinite interface
[15:28:20] certainty: heh also infinite attack surface
[15:28:25] workmad3: certainty: exactly :D
[15:28:30] d2dchat: certainty: haha Google just might :)
[15:28:48] workmad3: certainty: and you can't necessarily know if what you're seeing is an attack, a bad client, or data you're meant to process...
[15:29:33] workmad3: not to mention that using shared memory requires that both sides of the communication be present on the same physical machine
[15:30:01] workmad3: whereas just about every other mechanism for concurrency allows an abstraction away from physical co-location
[15:32:16] clocKwize: I'm scared of go's ugly syntax
[15:32:45] clocKwize: why don't they make something pretty as well as awesomely concurrent etc
[15:33:11] Spaceghostc2c: It's not that bad, it's just not super pretty.
[15:33:18] d2dchat: Spaceghostc2c: agreed
[15:33:22] stephenorr: clocKwize: maybe some people don't believe a language can be both powerful and pretty
[15:33:30] clocKwize: stephenorr, they are wrong :)
[15:33:45] stephenorr: clocKwize: damn straight, but we're in #rubyonrails :D
[15:33:54] d2dchat: Spaceghostc2c: I think actually Go is pretty because it's so simple AND powerful
[15:34:42] d2dchat: prettiness is subjective :)
[15:35:04] stephenorr: beauty is in the eye of the beholder?
[15:36:13] stephenorr: this must be why i'm gradually rebuilding my company's main app in Ruby, as a side project ;)
[15:38:52] workmad3: really? this guy is the judge of beauty? http://24.media.tumblr.com/tumblr_m9y48faXVz1r3sy6wo1_400.jpg
[15:38:55] danneu: Go is ugly. Try Scala.
[15:39:06] workmad3: danneu: try erlang
[15:39:48] workmad3: danneu: try APL
[15:40:24] danneu: Scala is really Rubyist-friendly.
[15:40:46] Spaceghostc2c: d2dchat: I like most of the syntax, really. And looking at non-trivial programs seems to have a light cognitive load.
[15:40:49] danneu: map (_ * 2) vs map( |x| x * 2)
[15:41:02] Spaceghostc2c: I'm learning Common Lisp next.
[15:41:32] certainty: workmad3: lol, apl? :D
[15:41:33] danneu: Spaceghostc2c: What do you think bout Clojure
[15:41:58] workmad3: certainty: have you seen conways game of life in APL?
[15:42:07] Spaceghostc2c: danneu: I'll be learning that following. But starting our properly in CL
[15:42:16] certainty: workmad3: nope, should i check it out?
[15:42:22] workmad3: certainty: I'll paste it here
[15:42:25] workmad3: certainty: life←{↑1 ⍵∨.∧3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵}
[15:43:05] d2dchat: danneu: Scala runs on JVM. Therefore sux
[15:43:24] workmad3: d2dchat: the JVM is awesome... it's only java that sux
[15:43:25] danneu: d2dchat: nah, the JVM is dope. it's Java that sux
[15:43:34] certainty: Spaceghostc2c: be aware that CL as a lisp2 is substantially different from clojure and other Lisp1 ... that has implications on the style of coding
[15:43:36] Spaceghostc2c: The JVM is a beautiful thing.
[15:43:46] Spaceghostc2c: certainty: Yup.
[15:43:58] Spaceghostc2c: But I'd rather know CL then learn Clojure than just know clojure.
[15:44:04] Spaceghostc2c: It's not as if I can only learn one.
[15:44:13] Spaceghostc2c: And the lack of reader macros makes me a sad ghosty.
[15:44:21] d2dchat: I wish clojure didn't run on the JVM..
[15:44:35] Spaceghostc2c: d2dchat: Why not just learn lisp then?
[15:44:43] d2dchat: Spaceghostc2c: I do know CL. Love it :)
[15:44:46] certainty: Spaceghostc2c: reader macros can be uselfull but many things can be achieved without them
[15:44:47] Spaceghostc2c: Just because clojure is lisp without baggage?
[15:44:52] Spaceghostc2c: certainty: Naturally.
[15:44:56] d2dchat: Spaceghostc2c: I dunno- I learned clojure before CL
[15:44:59] Spaceghostc2c: I just think reader macros are awesome.
[15:45:23] danneu: i don't know clojure but i think the clojure community has among the better resources of jvm languages
[15:45:37] danneu: with tools like leiningen
[15:45:37] certainty: i try to avoid macros in general
[15:45:41] Spaceghostc2c: I prefer JRuby as my favorite ruby.
[15:45:50] danneu: right, me too
[15:45:55] danneu: meant 2nd fave
[15:45:56] clocKwize: wow, all my selenium tests passed!
[15:46:01] clocKwize: Its been weeks since that happened
[15:46:06] Spaceghostc2c: And most things on the JVM except Java the language.
[15:46:14] stephenorr: clocKwize: you have selenium tests? i'm jealous… that you have tests
[15:46:17] Spaceghostc2c: What's the preferred test framework in lisp?
[15:46:17] clocKwize: selenium is so flakey with js stuff.. it just doesn't work most of the time
[15:46:19] certainty: clocKwize: pending: true?
[15:46:36] Spaceghostc2c: Mine works reasonably, but I prefer capybara without selenium.
[15:46:37] clocKwize: usually 1 test will fail for a random unknown reason... different one each time
[15:46:44] clocKwize: today all passed!
[15:46:52] certainty: mere chance
[15:46:59] Spaceghostc2c: Flakey tests are a pain.
[15:47:03] Spaceghostc2c: Fix those pains.
[15:47:04] clocKwize: I prefer phantomjs / poltergeist
[15:47:13] clocKwize: but it didn't work on my bosses mac, so I had to switch it lol
[15:47:19] clocKwize: just core dumped
[15:47:25] clocKwize: more his problem than mine, but wh atever
[15:47:30] Spaceghostc2c: You can use poltergeist with capybara.
[15:47:38] Spaceghostc2c: Which is pretty awesome.
[15:47:38] certainty: Spaceghostc2c: if you're learning cl make sure that you get hold of LOL
[15:47:46] Spaceghostc2c: certainty: Which is?
[15:47:49] somekool: workmad3: sorry, got on a phone call and did not see your reply. the reason, is because I need to pass the file through a proxy. the proxy being another separate rails app. so, it seems the fact that rails consume the file removes some original headers, or I am missing some of them…
[15:48:00] certainty: Spaceghostc2c: let over lambda
[15:48:01] Spaceghostc2c: I already have the book.
[15:48:25] workmad3: clocKwize: yeah, selenium testing can be like that
[15:49:01] certainty: d2dchat: that's actually the book that everybody should read
[15:49:14] certainty: every programmer that is
[15:49:22] workmad3: clocKwize: I'd like to be able to use phantomjs on this project... but it actually works worse than selenium on this project (and capybara-webkit is flakey too)
[15:50:05] workmad3: clocKwize: that said, I have managed to bang selenium into enough shape here that only 1 test is intermittent :)
[15:50:22] Spaceghostc2c: Bang is right!
[15:50:44] Spaceghostc2c: If you're a bro, you'll use xvfb to keep it all headless.
[15:50:58] clocKwize: I had it headless
[15:50:59] workmad3: Spaceghostc2c: that's what the CI server is doing ;)
[15:51:03] clocKwize: the boss wanted it to open the browser
[15:51:08] Spaceghostc2c: workmad3: I like it headless in dev.
[15:51:08] clocKwize: because it "looked cool"
[15:51:16] Spaceghostc2c: certainty: What are the leading test frameworks in lisp?
[15:51:29] certainty: Spaceghostc2c: i'm happy with 5am
[15:51:29] workmad3: Spaceghostc2c: I'd like it headless too... but xvfb doesn't work with ff on a mac, because ff on a mac doesn't go through x-windows
[15:51:39] Spaceghostc2c: certainty: Link?
[15:51:40] workmad3: or at least, I've not figured it out on my mac
[15:51:51] Spaceghostc2c: workmad3: Hm, let me see.
[15:52:09] workmad3: and I've never had enough time to spend on getting it working
[15:52:26] certainty: Spaceghostc2c: http://common-lisp.net/project/fiveam/
[15:52:53] Spaceghostc2c: workmad3: Yeah, you need to get the x-server version working, not the cocoa one.
[15:52:57] certainty: there is also a blogpost comparing the various options, let me see if i can find it
[15:53:09] tjbiddle: if i want to match /projects/:name instead of /projects/:id in rails for show() - what do i need to change?
[15:53:17] certainty: Spaceghostc2c: http://aperiodic.net/phil/archives/Geekery/notes-on-lisp-testing-frameworks.html
[15:53:18] workmad3: Spaceghostc2c: I just run on two monitors instead :)
[15:53:58] workmad3: Spaceghostc2c: selenium pops up on the one to my side that I don't pay much attention to (which is where I *should* keep IRC... but it always seems to somehow end up on my main monitor... wonder how that happens :) )
[15:54:26] clocKwize: lisp has so many parenthesis I think it'd give me RSI
[15:54:53] certainty: clocKwize: nah, actually lisp code has structure beyond parens
[15:55:04] Spaceghostc2c: clocKwize: Use a better editor.
[15:55:10] certainty: you don't recognize and type them much ... you editor will help
[15:55:11] rakl: where's a good place to store a 120 mb zip file that I can download easily using send_file in a rails action?
[15:55:13] Spaceghostc2c: certainty: What do you mean about that?
[15:55:14] workmad3: certainty: you lie! parens is all the structure that exists!
[15:55:50] rakl: Spaceghostc2c i've never used it before. you think I can get it implemented in < 1 hr?
[15:55:56] workmad3: certainty: next you'll be saying that you don't manually car and cdr your lists...
[15:56:04] certainty: Spaceghostc2c: i mean that you can ignore parens when reading lisp code and will recognize patterns in the code structure
[15:56:16] Spaceghostc2c: rakl: I think you could get it done. The time it takes is purely up to you.
[15:56:23] Spaceghostc2c: certainty: Oh.
[15:56:26] certainty: workmad3: well i do somethimes
[15:56:42] yasu: tjbiddle: http://railscasts.com/episodes/314-pretty-urls-with-friendlyid?view=asciicast
[15:56:49] Spaceghostc2c: cddr bro. Twice the d for your cdr.
[15:56:52] Spaceghostc2c: Just being silly.
[15:56:53] rakl: ok thanks Spaceghostc2c. Was looking at dropbox, but you have to apply for API access I think
[15:57:00] Spaceghostc2c: rakl: Yeah, no.
[15:57:05] certainty: also be sure to use emacs with paredit, it allows for structural editing on sexps
[15:57:09] clocKwize: common lisp just doesn't look like it has the community
[15:57:13] Spaceghostc2c: certainty: Vim motherfucker.
[15:57:19] Spaceghostc2c: Embedded in emacs!
[15:57:31] workmad3: hmm, if I did more lisping, I'd probably use emacs for it
[15:57:32] Spaceghostc2c: I'll be that freak from both worlds!
[15:57:42] Spaceghostc2c: workmad3: If you ruby, in an abstract way, you lisp.
[15:57:48] certainty: workmad3: who doesn't like to access the decrement register :D
[15:58:05] certainty: but if i can i use higher order functions
[15:58:14] certainty: in scheme i sometimes use named let
[15:58:30] certainty: cl has the mighty loop
[15:59:18] certainty: Spaceghostc2c: greenspun's 10th rule :)
[16:01:21] tjbiddle: yasu: perfect, thank you!
[16:03:01] Spaceghostc2c: certainty: Where is this?
[16:03:05] Spaceghostc2c: I'm just learning lisp.
[16:03:41] certainty: Spaceghostc2c: http://en.wikipedia.org/wiki/Greenspun's_tenth_rule
[16:05:22] JustinAiken: So I have this proc I use that logs an error, renders a response, and returns from the calling method: https://gist.github.com/804f4ad41850e674fdc6
[16:05:39] JustinAiken: How could I DRY that up? it's in many methods...
[16:06:46] certainty: why don't you make it a method of ApplicationController?
[16:07:58] JustinAiken: the return in the proc is returning from whichever method it calls it, so in some_method, no code will be executed after it's called
[16:08:19] certainty: ok i was wondering if that was intended
[16:09:31] certainty: the only other way to have this kind of non local exit is an exeption
[16:09:55] certainty: at least the only other way i can think of now
[16:15:24] Spaceghostc2c: certainty: That's funny.
[16:17:30] certainty: Spaceghostc2c: yeah and also there is some truth in it. at least it appears so
[16:22:16] leostera: Hi there everybody! I'm having quite a weird problem submiting a radio group and accessing it via params[:groupname]
[16:22:37] leostera: It never gives me the appropiate value but rather an "on" string.
[16:22:59] leostera: Can anyone give me a handa?
[16:25:02] universaL: leostera: can't help you without you showing your code.
[16:25:09] universaL: did you check the docs etc?
[16:25:36] leostera: yup, checked the docs for radio_button, checked on stackoverflow as well for a couple questions related to the issue but nothing just as I got
[16:25:58] leostera: also a quick google for rails radio button params value is "on" didn't retrieve useful stuff neither
[16:26:01] universaL: leostera: so show your code...
[16:26:10] leostera: making a quick gist
[16:29:25] leostera: universaL: https://gist.github.com/4205822
[16:30:16] leostera: universaL: the view had a typo, there is no action tag in the form field
[16:30:34] universaL: leostera: please use the rails form helpers.
[16:31:25] leostera: i'd rather not, I'm quite sure there must be a way to make this radio groups work without recurring to the rails form helpers
[16:31:38] universaL: leostera: then learn basic html form elements.
[16:32:02] universaL: leostera: this has nothing to do with rails.
[16:32:25] universaL: and then there's only one radio button in your code.
[16:32:27] leostera: universaL: as you can see the radio is in place, it has a name for the group, a value as well, but rails shows me it's value is "on" instead of "1"
[16:33:16] universa1: leostera: so look what rails radio_button helper generates as html code and compare that with yours...
[16:33:44] universa1: leostera: if you want to do it the hard way, happily do so, but don't be lazy...
[16:34:32] leostera: universa1: i'm not being lazy, but in any other platform this would work out of the box just by using basic html form elements
[16:35:01] universa1: leostera: you're doing something wrong. it works in rails, since all the form helpers do is generate valid html
[16:35:53] elaptics: the question is why are you choosing to not use the helpers?
[16:35:54] leostera: universa1: and I can't quite get why is it that rails isn't working with this. according to the w3c html reference the only thing radio groups need is a common name and each individual item needs a value. I have them both.
[16:36:25] stephenorr: leostera: instead of slagging rails off, how about you gist us the actual HTML your code is producing?
[16:36:27] universa1: leostera: what is so hard to just fucking do a radio_button_tag on your site and compare the output?!
[16:37:14] roychri: In ruby, when I define a method, can I cast the parameters to make sure they are the proper objects? Or is the right thing to do is: raise RuntimeError, "Invalid Parameter type" if !param1.is_a? WoodHouse
[16:37:34] stephenorr: roychri: the first question i have to ask is, why do you want to do this?
[16:37:48] stephenorr: roychri: that kind of breaks the whole concept of duck-typing
[16:38:06] leostera: universal: the only difference is in the value, rails adds "name_" where name is the radio group name
[16:38:10] roychri: duck-what?
[16:38:20] workmad3: roychri: duck typing
[16:38:31] workmad3: roychri: 'if it walks like a duck and quacks like a duck, it's a duck'
[16:38:47] Spaceghostc2c: If it gives fuck like a duck, it's a wombat.
[16:38:48] roychri: and... with ruby... I want to be a duck?
[16:38:51] universa1: leostera: http://apidock.com/rails/ActionView/Helpers/FormTagHelper/radio_button_tag -- don't see any addition of name_ to the value...
[16:38:57] helpa: roychri: Learn about Duck Typing here: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/100511
[16:38:57] elaptics: roychri: !ducktyping
[16:39:01] stephenorr: roychri: if you need to make sure your object supports a given method, use responds_to?
[16:39:04] workmad3: roychri: more vebosely - if the object responds to the correct methods, treat it as though it's the right object
[16:39:14] workmad3: roychri: rather than throw type errors
[16:39:18] leostera: this: = radio_button_tag :sharesize, "1", :id => "1", :class => "share-size"
[16:39:23] Spaceghostc2c: Also, keep in mind to "Tell, don't ask."
[16:39:32] leostera: outputs this: <input checked="checked" id="sharesize_1" name="sharesize" type="radio" value="1">
[16:39:34] roychri: intersting...
[16:39:42] leostera: instead of this: <input checked="checked" id="1" name="sharesize" type="radio" value="1">
[16:40:12] stephenorr: roychri: it's part of the power that ruby gives you :)
[16:41:10] roychri: stephenorr: Thank you! I am reading that right now :)
[16:41:14] workmad3: stephenorr: it's hardly a ruby-exclusive power... it's there in pretty much any dynamic OO language :)
[16:41:35] stephenorr: workmad3: true, but you've got to remember that i work with PHP all day :)
[16:41:38] universa1: leostera: check the method definition of radio_button_tag carefully
[16:41:45] workmad3: stephenorr: you can duck-type in php :P
[16:42:13] stephenorr: workmad3: yep, but the majority of modern OO PHP code explicitly checks for certain types
[16:42:52] elaptics: stephenorr: is that just because the majority of php coders aren't well versed in OO?
[16:43:04] workmad3: stephenorr: right, so 'modern OO PHP code' translates to 'brain-dead OO code from people who wish they were in a static typed language and are using techniques from about 20 years ago'
[16:43:15] leostera: universaL: sure, that's what docs say
[16:43:21] workmad3: stephenorr: good to know these things :)
[16:43:23] stephenorr: elaptics: possibly, but i even see that attitude coming through in Symfony2, which is the main framework I have to work with. it has serious java envy
[16:43:31] leostera: universaL: but it's definitely not what the tag generated over here
[16:43:33] stephenorr: workmad3: damn straight
[16:43:56] leostera: universaL: on rails 3.2.9
[16:44:34] leostera: universaL: anyway, replaced the values with the proper groupname_value and I got them working
[16:44:41] leostera: universaL: not that I like it, but sill
[16:45:01] leostera: universaL: thanks for the insight
[16:54:27] Sylario|2: i have a parameter problem with a block link_to : https://gist.github.com/4206126
[16:54:42] Sylario|2: i want to add :format=>:pdf
[16:55:03] Sylario|2: but i do not know if it's an option or an html_option
[16:56:11] workmad3: Sylario|2: link_to doesn't differentiate options and html options
[16:56:27] workmad3: Sylario|2: however, it will object to the way you're trying to pass in the path
[16:56:45] workmad3: Sylario|2: and you might also get into trouble with the explicit hash syntax
[16:57:11] workmad3: Sylario|2: what you have right now though is a syntax error :P
[16:57:46] workmad3: Sylario|2: take a look
[16:58:00] workmad3: Sylario|2: if you can't figure out why you have a syntax error, you need to break open the ruby books
[16:59:53] Sylario|2: workmad3: i mix a "function call" with the => thingie?
[17:00:09] helpa: Sylario|2: If you can't figure out a syntax error, go and re-read the pickax http://pragprog.com/book/ruby/programming-ruby
[17:00:09] workmad3: Sylario|2: !syntax
[17:01:14] workmad3: (and seriously, the fact you quoted 'function call' and then refered to the hash rocket as the '=> thingie' shows you need to really sort out your understanding of ruby syntax)
[17:02:36] Sylario|2: i quoted it because i am still bothered by the generated functions for path
[17:07:00] Sylario|2: ok, hashes at the end
[17:07:12] Sylario|2: and rails do not care about format pdf :/
[17:07:24] jamuraa: I can't seem to use a view partial with a cache() directive in an actionmailer template. What do I need to do in order to make this work without duplicating this template without caching just for the HTML email report.
[17:13:13] elaptics: jamuraa: put the cache outside of the partial?
[17:17:52] okay: I'm trying to figure out how to check if theres a notice, i put <% if notice? %> in my layout but it gave undefined method, any ideas?
[17:18:40] jamuraa: elaptics: duplicate my cache directive in 10 places instead of the 1 place I have it now? can I just ignore it somehow when I'm in an actionmailer, or better yet actually use the cache in actionmailers like I did before?
[17:22:22] stephenorr: ok everyone, i'm off home to play skyrim :)
[17:23:02] elaptics: jamuraa: ah, thought you just had it in one place. I haven't done that myself so don't know
[17:23:46] elaptics: okay: what notice? A flash message?
[17:24:13] okay: elaptics, is there a difference? I'm new to this and I've just been using it like this, <%= notice %>
[17:25:49] elaptics: okay: can you gist your code?
[17:26:32] okay: https://gist.github.com/952b96ab4b6d1b49ef64
[17:28:05] okay: elaptics, I think I've figured it out, after googling the right things
[17:28:13] okay: turns out notice was more than just a notice
[17:29:54] elaptics: okay: yes, you must have a method with a name 'notice', probably a helper method. For your code to work as written you'd also need a method called notice? that responded with a true/false appropriately
[17:29:58] spyroboy: I actually created my models using pluralized names
[17:30:06] spyroboy: PageBackgrounds
[17:30:08] spyroboy: is this bad?
[17:30:17] elaptics: spyroboy: yes :)
[17:30:28] spyroboy: what's the best way to fix this?
[17:30:38] elaptics: unpluralize them
[17:30:50] spyroboy: yes, I mean, is there a command to do that?
[17:31:12] elaptics: not in rails, just have to find/replace
[17:31:23] spyroboy: what about my migration files
[17:31:27] spyroboy: do I need to changes those too?
[17:31:28] elaptics: rails unfuck model Pages :)
[17:31:51] elaptics: spyroboy: the tables themselves should be plural
[17:54:12] mosez: i've got a date object. and i need two arrays. one array with the past 13 beginnings of the months, and another array with the last 5 quartals... knows somebody a handy way?
[17:54:48] mosez: d.downto(d.months_ago(12)) gives me all days of the last 12 months :(
[17:55:27] Ziioynx: What are people using for CI servers these days, I am looking into Jenkins but obviously something more ruby-esque would be preferable any suggestions?
[17:56:16] mosez: ziioynx: travis?
[17:57:46] Ziioynx: mosez, It looked really cool but they state on their home page that it isn't the best for a closed source app. and unfortunately that is what i am looking for
[17:58:59] mosez: ziioynx: it's all open source. you can run travis on you own nodes if you dont want to use their service
[17:59:47] Sylario|2: how do i generate the rdoc for a specific gem? (prawn)
[17:59:58] Ziioynx: mosez, Hmmm okay well then i might take a closer look at it, do you have any experience running with it?
[18:01:03] Ziioynx: mosez, Thanks
[18:03:36] ddd: mosez: however it should be noted that there is no support when doing so. They are just starting to do paid stuff, but they won't do support for privately run nodes in-channel
[18:03:45] certainty: http://firstinresults.wordpress.com/2012/08/15/ruby-1-9-and-rails-3-2-9-is-amazing/ wtf?
[18:03:59] ddd: Sylario|2: gem install blah —-ri —-rdoc
[18:05:00] ddd: We will have the Word Press of today using Ruby on Rails. This will dominate the future of Online marketing. WTF??
[18:05:12] ddd: gotta be a troll-joke
[18:05:25] mosez: ddd: i told him he can run it if he dont want to use their service...
[18:05:47] ddd: right, but that says nothing about support, as in being able to go to their channel for setup help.
[18:06:26] mosez: ddd: never said anything about support. he asked for alternatives to jenkins only.
[18:06:28] ddd: they can run a service and still offer one-off support. just, they don't and are adamant about not doing so (rightfully)
[18:06:28] elaptics: mosez: if d is your date, how about: memo = [d.beginning_of_month]; (1..13).inject([]) {|i| memo << memo.last - 1.month }
[18:06:58] ddd: mosez: dude, i'm not blasting you for it, I'm making sure both know there's no support from them for private nodes is all
[18:07:06] mosez: elaptics: got to play a little bit with it. thx
[18:07:18] mosez: ddd: yeah, its ok :)
[18:07:20] ddd: many try (almost daily) to install private nodes and walk their channel for assistance. thats all
[18:08:22] ofcan: hi! how to change the attribute of the model when user logs out (I am using Devise)?
[18:09:29] ddd: write your own sign_out method, make your changes, and then call super or vis versa (ordering) within the method
[18:10:30] ddd: super will kick it back up to devise's sign_out (or logout, whichever it is) so if you define your own and call it, make your changes and call 'super' to return control to devise
[18:11:11] ddd: def sign_out ; @current_user.some_attr = false ; super ; end
[18:12:07] ddd: or if its an attr that devise mods itself: def sign_out ; super ; @current_user.that_attr = your_change ; end
[18:13:56] jwg2s: Do you guys use anything for formatting HTML in source code with your rails projects?
[18:14:04] jwg2s: A gem perhaps?
[18:14:23] ddd: err? explain
[18:15:32] ofcan: ddd: thank you (i was missing this 'super' part, and don't quite understand what it does, so I'll look into it further). Can you please explain where to write my own sign_out method wich overwrites the default Devise one?
[18:17:59] ddd: ofcan: err? Think you might want to read https://github.com/plataformatec/devise#readme under Configuring Controllers
[18:18:45] ddd: (i would actually entreat you to read the whole thing, but if you feel you want to peice meal i'd start there and then dig)
[18:22:36] ofcan: ddd: thank you
[18:26:33] dbeest: Hi, I just created a fresh debian6 system then upgraded it to debian7(wheezy), installed ruby1.9.1(which installs 1.9.3p194), then rubygem1.8.23 and rails 3.2.9; rails new blog01 is failing, first it failed on a coffeescript gem that I installed with "gem install sqlite3 -v '1.3.6'", now it wants sqlite3 ( i thought this should be done automatically)
[18:28:20] mosez: hum.... funtimes gem does not work :(
[18:28:22] mosez: https://github.com/Barrison/fun-times/blob/master/lib/funtimes/date_range.rb
[18:29:09] bmcgee: hi guys, I'm using nginx + unicorn, serving static assets through nginx. When I change any of my assets and update my install that particular assets fails to load with a not found. When i expired all assets by bumping their version i'm now getting no assets loading. Been reading through stack etc and can't seem to figure out where i'm going wrong. Snippet here: https://gist.github.com/4207217
[18:34:49] dbeest: Hi, can someone tell me why this is happening? http://pastebin.com/iYs418gu
[18:35:10] dbeest: Always wondered why people didn't like it :P
[18:36:21] bmcgee: on that note anyone wanna take a stab at my gisted problem above…? :D
[18:36:31] jrabolli: anybody have any experience or know of good info on adding video chat to a rails app? would need the ability to record the video chat. would love it to be html5 based instead of flash - but that might be 'pie in the sky' right now
[18:37:40] dbeest: Hi, can someone tell me why this is happening? http://pastie.org/private/7ibaamwg5qhib33jpxsng (pastie version)
[18:38:03] rushed: dbeest: http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/
[18:38:13] davidcelis: dbeest: dude read the error
[18:38:15] davidcelis: it tells you
[18:38:23] davidcelis: you dont have sqlite3 installed
[18:38:37] bmcgee: dbeest: it tells you here http://pastie.org/5480129
[18:38:51] dbeest: rushed: I have sqlite3 installed
[18:39:10] bmcgee: not with the development headers i'm guessing
[18:39:15] bmcgee: had the same issue a while back
[18:39:31] bmcgee: again it's in the error
[18:40:06] dbeest: bmcgee: searching sqlite3 doesn't show an sqlite3-devel, I'm not sure what to do
[18:40:10] rushed: dbeest: you read what I said about as well as you read that error message~
[18:40:21] bmcgee: dbeest: what os?
[18:40:27] dbeest: bmcgee: debian 7
[18:40:32] dbeest: rushed: suure :P
[18:40:37] bmcgee: dbeest: ah can't help you there then
[18:40:51] ddd: you need the binary and the lib (since the bin needs the lib to run anyways), and the headers. The headers are usually in a sqlite3-dev(el) or libsqlite3-dev(el) pacakge
[18:40:52] dbeest: bmcgee: is fine, am reading the linked blog entry
[18:41:00] ddd: are you running RVM?
[18:41:20] dbeest: ddd: no because I usually run into problems with it eventually
[18:41:33] ddd: are you using RVM? if so, then run: rvm requirements and it will tell you what packages to install
[18:41:39] ddd: dbeest: problems like what?
[18:41:46] ddd: you're having issues without it
[18:42:14] dbeest: ddd: cant remember well since it was a while ago, think system version of ruby eventually starts trying to be default even though rvm; dunno will try again
[18:42:44] ddd: err? no, that would mean that your 'default' alias got screwed or removed
[18:43:21] ddd: or that you weren't launching a login shell or terminal that acted as a login shell meaning RVM wasn't being properly sourced and the alias picked uo
[18:43:38] ddd: such as happens with Terminal.app and GnomeTerminal
[18:45:07] cuci: hello! Sorry for repeating the same question as the day before but I still got stuck:
[18:45:45] cuci: I'm trying to make a modal dialog with bootstrap like so:https://gist.github.com/4198427 and the dialog appears and the object gets created, but hte dialog does not dissapear
[18:46:48] cuci: I've tried in js console .modal('hide') like in API but it has no method named modal. I've tried .hide() and it hides but the backdrop remains black
[18:46:59] cuci: any ideas on what I'm doing wrong?
[18:47:08] rushed: cuci: what are you doing to close the dialog?
[18:47:20] bricker: cuci: Try adding a hook like, $("form#pacient").on submit: (e) -> $(".modal-body").hide() or whatever the function is to hide a modal with bootstrap
[18:47:31] jrabolli: i am guessing the RayDash Gem is still the best solution for video conferencing in a rails app right?
[18:47:47] bricker: google hangouts
[18:47:58] cuci: rushed: I'm refereing to the submit button the close button from the header works fine
[18:48:36] jrabolli: google hangouts integrated in a rails app? interesting. has it been done? can you record?
[18:48:49] rushed: cuci: what are you doing to close the dialog after the submit button has been clicked/touched?
[18:49:10] bricker: jrabolli: no I was being a dick
[18:49:30] jrabolli: lol ok - mission accomplished :)
[18:51:22] jrabolli: mostly i am just trying to find out if there is an html5 solution within rails for videochat
[18:51:24] cuci: rushed: I've tried several ideas based upon:https://gist.github.com/4207392 but I got Object [object Object] has no method 'modal'
[18:51:33] jrabolli: just to avoid the iphone/flash issues later
[18:51:53] jrabolli: but not sure u can record with html even if there was
[18:51:58] jrabolli: which is a req for me
[18:54:20] bricker: jrabolli: don't think HTML would have access to your webcam, as that would obviously be a very big security risk
[18:56:49] dukedave: jrabolli: bricker: http://www.tokbox.com/ ?
[18:58:20] rushed: cuci: you might try breaking it into steps, i.e. first get an alert('hi') to fire after your form in the modal successfully posts, then figure out what console command will dismiss the modal, then put that code where the alert is :)
[18:59:20] bricker: dukedave: is it HTML video? I don't see anywhere that indicates that
[19:00:32] dnyy: I have has_many through, the join model has an extra attribute on it. I can get it to save in the controller, but I have no idea how to access it. If I do case.contacts, how can I get the attribute from the join model (case_contacts)?
[19:01:05] cuci: rushed: Ok. Thank you for the tip. I suspect a typo from my part it seems my most frequent mistake and the most hard to fix
[19:01:30] bricker: dnyy: reference the join model association name, or delegate
[19:01:51] bricker: dnyy: if it's has_many :contacts, through: :case_contacts, you can do case.case_contacts.position or whatever
[19:02:40] dnyy: hm, right, it's an array but i guess there'll never be more than one. so i guess @case.contacts.last.case_contacts[0].role is safe to do.
[19:03:09] bricker: dnyy: gist your models and I'll explain it
[19:04:05] dnyy: bricker: https://gist.github.com/092bc470daa383381c07
[19:04:17] dnyy: CaseContact has a `role` field/attribute
[19:07:15] bricker: dnyy: see my comment on your gisat
[19:07:57] bricker: dnyy: actually that first example won't work since it's a many-to-many, use the second one
[19:08:15] dnyy: bricker: aah, okay, so i have to go through case_contacts and not contacts
[19:11:36] dnyy: bricker: alright, thanks
[19:13:16] bmcgee: Has anyone ever had problems with rails serving a static asset path which doesn't match the path specified in the precompiled manifest.yml file? Seems that's where my issue is coming from
[19:13:52] Sylario|2: ddd> thx for the rdoc
[19:25:31] mercwithamouth: having a weird little hickup here when trying to update a model
[19:25:31] mercwithamouth: http://pastie.org/5480353
[19:25:36] lectrick: When you run a Rails test, what is the piece of code that makes the database connection based on what is in config/environments/test ?
[19:25:55] mercwithamouth: i get the proper flash that the attributes are being changed
[19:26:07] mercwithamouth: update_attributes! ?
[19:27:35] omarquina: Hi, Anybody may guide me, about how relate an ActiveRecord model, to a polymorphic ActiveResource ?
[19:28:03] bricker: omarquina: Ask something specific
[19:29:21] omarquina: hi bricker, I have to resource OficinaA pointing to a Remote Service, and OficinaB pointning to a other service
[19:29:36] al3xnull: Has anyone ever had issues migrating non Mongoid data into a format Mongoid understands? I'm able to save new mongoid documents and update them, but I'm unable to update migrated data at all. It raises a `NoMethodError: undefined method `each' for "":String`
[19:29:58] esouza: hello guys
[19:30:20] al3xnull: esouza: hello
[19:30:21] bricker: omarquina: and you want to combine those into a single ActiveRecord model?
[19:30:33] omarquina: yeah bricker
[19:31:12] bricker: omarquina: so it will just be a matter of, within the ActiveResource model, adding a method which will create an instance of the ActiveRecord model based on what the API returned
[19:31:48] bricker: omarquina: hopefully both resources are returning similar data, if not then you'll have to do some mapping
[19:33:48] dankest: I have a simple method that finds an object, and redirects_to :back. How can I prevent this action from looking for a tempalte?
[19:34:15] bricker: dankest: render nothing: true
[19:34:30] bricker: dankest: I *think* that still works although it might be deprecated, double-check the rendering guide
[19:35:10] dankest: bricker: awesome, thanks.
[19:35:35] esouza: I have a question, I have a admin area of my app, that it is working with devise and everything. But when I try to add my admin files inside my admins folder the basic crud does not work. So to make sure I was not going crazy I created a scaffold of my accounts and made sure that the basic crud was working. But now when I try to move the scaffolded files into the admin folder on my controller, view and model
[19:35:35] esouza: it complains about the routes. I did change my controller to be class Admins::accounts. So what I just did was I created another scaffold but this time I set the namespace adims/accounts, that creates all the files inside the admins but it requires me to change my accounts table to be admins_account. So my question is how should I do that? I would like to keep accounts not admins_accounts. THank You
[19:36:22] bricker: esouza: if you have namespaced controllers like that you need to reflect it in the routes.rb file with the `namespace` directive
[19:36:33] rafi5: is there a limit on the length of a filename that ActionDispatch::Static will serve?
[19:36:45] rafi5: fonts.com gave me fonts with GUID names (e.g. "07fe0fec-b63f-4963-8ee1-535528b67fdb.eot") and rails is 404'ing them, unless I cut down the filename..
[19:37:06] esouza: namespace :admins do
[19:37:06] esouza: resources :dashboards
[19:37:06] esouza: resources :accounts
[19:37:09] esouza: bricker: I did
[19:37:15] mercwithamouth: ok yeah...weird. my update_attributes isn't saving http://pastie.org/5480353
[19:38:17] mercwithamouth: no error...get the proper notice, etc
[19:39:20] bricker: mercwithamouth: what happens if you try it with a bang, update_attributes!
[19:39:27] esouza: bricker: so my question is does anyone have suggestions in how should I proceed in order to create my admins sections? And should my tables be name as admins_accounts?? Is that the proper way?
[19:39:46] bricker: esouza: your tables don't need to be namespaced like that
[19:39:57] mercwithamouth: bricker: same thing
[19:40:00] BrokenCog: hello. i'm having a problem with routes on a controller. I created the following rails generate controller Home index rubrics rules admin results
[19:40:28] BrokenCog: and then wanted to add a method, results, which I did: http://pastebin.com/8rSXfqSP
[19:40:31] nobitanobi: Hi. I have a query that looks like this… where({:role => 'Teen', :notifications => — How can I put an OR in the :role?
[19:40:42] omarquina: bricker: sorry, attending other issues
[19:41:36] mercwithamouth: i edited the pastie to include the model http://pastie.org/5480422
[19:41:45] mercwithamouth: it's fairly barebones...i was just beginning to play with jruby
[19:41:57] rhizmoe: when structuring capybara tests, is it important at all to start with stuff like "visit /", as if the test is always starting at the very beginning?
[19:42:00] omarquina: bricker: In my case My Activerrecord model has an polymorphic association called :extremo, an :extremo could be a OficinaA:ActiverResoruce or an OficinaB:acrtiveResource
[19:42:11] BrokenCog: however, if i use the method as paths, say in link_to, only one or two are resolved - the others complain that the route doesn't exist. i added the routes via: resource :home do collection do get ... any ideas what else needs to change?
[19:43:23] BrokenCog: this is the routing: http://pastebin.com/3dZBrJiy even with the :as set, the results_path is not known.
[19:44:32] BrokenCog: ... if anyone can reach pastebin, and has a suggestion as to why it's wrong please let me know.
[19:44:49] BrokenCog: or if it is too slow, I can repost to pastie.
[19:45:18] rhizmoe: hah, pastebin copied okcupid's color scheme
[19:45:41] mercwithamouth: also bricker when i attempt the very same function in the console it works
[19:45:47] rhizmoe: BrokenCog: not sure what your question is, but you don't really need index in there
[19:45:56] mercwithamouth: it must be my view code
[19:46:49] esouza: bricker: Sorry i just read this. But if I don't it gives me https://gist.github.com/0bbb5bc6f80642c1e4ea
[19:47:28] BrokenCog: rhizmoe: i was trying to figure out what's wrong and added all the methods. link_to 'someplace', 'rubrics_path' is the only path which works ... all the others including index complain: unknown var
[19:48:04] rhizmoe: unknown "var?"
[19:48:09] omarquina: rhizmoe: i try to use that aproach
[19:48:45] BrokenCog: rhizmoe: undefined local variable or method `results_path'
[19:48:57] rhizmoe: BrokenCog: rake routes
[19:48:59] omarquina: but not all time, because once you have navigation wel defined, you cold access per resource url directly
[19:49:42] BrokenCog: rhizmoe: http://pastie.org/5480458
[19:49:45] omarquina: could access per resource url
[19:50:20] BrokenCog: rhizmoe: I'm still trying to learn how to read that, but it seems they all have routes.
[19:52:00] mattaf123: how would you get only the headers of a csv file (headers meaning like column titles) without looping through all rows or doing anything to expensive (i'm using files with thousands and thousands of rows, potentially more). i just need to ensure that certain columns exist.
[19:55:18] bricker: mattaf123: possibly `CSV.load("your_file.csv").headers` http://ruby-doc.org/stdlib-1.9.2/libdoc/csv/rdoc/CSV.html
[19:55:37] bricker: just a guess though, didn't try it
[19:55:42] rhizmoe: BrokenCog: home_index_home_index is bad! :)
[19:55:55] bricker: rhizmoe: why? it looks okay looks okay to me
[19:58:09] BrokenCog: rhizmoe: okay. I removed the resource :... block and used individual match statements for each method. That worked. I thought I could do it 'en masse' but guess not.
[19:58:15] rhizmoe: BrokenCog: you're going to want to de-quote the block stuff and just do get :rules ,etc and remove index and probably the results one (since you call that out separately)
[19:58:32] rhizmoe: what, no, keep resources...do
[19:59:51] BrokenCog: rhizmoe: I got rid of it because the controller doesn't have a create/delete/edit, etc method which I think the resource block was wanting to create.
[20:00:00] BrokenCog: I can put it back... let me see if it works.
[20:00:04] rhizmoe: BrokenCog: more like this: http://pastebin.com/0vGgnqm5
[20:00:09] Wizywig: ahoy there fellers... a question on capybara -- i am executing "page.find("#x").click" and it sometimes executes it twice (2nd time timing out) sometimes normally. Any ideas how to debug?
[20:00:41] BrokenCog: rhizmoe: what did you mean about "to de-quote the block" de-quote what??
[20:00:49] rhizmoe: BrokenCog: see what i just pasties
[20:02:44] BrokenCog: rhizmoe: okay, why can't :result be added to the resources block?
[20:04:29] rhizmoe: because you account for it separately with the match below
[20:04:38] mercwithamouth: any explanations why the exact code used in an update method works in the console but doesn't from the actual web page even you though get a notice that everything worked accordingly?
[20:05:05] rhizmoe: mercwithamouth: too vague
[20:05:15] mercwithamouth: rhizmoe: can't be...i've posted my code 3x now
[20:05:21] mercwithamouth: http://pastie.org/5480422
[20:07:47] BrokenCog: rhizmoe: thanks for the help.
[20:09:57] Wizywig: I just made the code do "page.should have_css("#x"); page.find("#x").click" the 2nd statement times out as content not found. makes no sense... any thoughts on how to even approach this problem?
[20:10:28] mercwithamouth: rhizmoe: looks fine right?
[20:15:08] mercwithamouth: yeah i'm slow =(
[20:15:59] mercwithamouth: typos and getting angry before seeing the mistake make me want to hide my face -_-
[20:16:14] ofcan: can I increase the size of Twitter Bootstrap glyphicons?
[20:16:28] mercwithamouth: ofcan: i believe so
[20:17:18] ofcan: mercwithamouth: I cant find anywhere how
[20:17:38] mercwithamouth: ofcan: i thought you just add the class 'large'
[20:17:49] mercwithamouth: checking now...i do remember doing it last summer though. one sec
[20:17:56] lunks: What is the easiest way to include methods in ApplicationController from an engine?
[20:18:22] lunks: https://gist.github.com/4208252
[20:18:25] lunks: this doesn't seem to work :/
[20:18:28] ofcan: mercwithamouth: thanks
[20:19:12] klj613: is it possible for compass to compile a single file.. without having the absolute path? (only relative)
[20:19:18] esouza: Ok, I have a question, can I use scaffold as my starting point? Or this is a big nono?
[20:19:56] ofcan: mercwithamouth: thx, but that is so minor of an enlargement :) anything more?
[20:20:11] mercwithamouth: lol not that i can see =(
[20:21:20] scriabin: does anybody know of a good tutorial for raising and catching custom exceptions in rails apps?
[20:22:04] scriabin: I'm raising the exceptions correctly, but they're blowing up my log and I'
[20:22:24] scriabin: m hoping if I catch them appropriately (somewhere) the code will execute more cleanly
[20:23:54] rafi5: is there a limit on the length of a filename that ActionDispatch::Static will serve? fonts.com gave me fonts with GUID names (e.member:g. "07fe0fec-b63f-4963-8ee1-535528b67fdb.eot") and rails is 404'ing them, unless I cut down the filename..
[20:23:57] mercwithamouth: hmm which gem is least likely to make you want to kick puppies these days? carrierwave or paperclip
[20:24:12] mercwithamouth: I do remember paperclip being annoying a while back
[20:26:40] certainty: scriabin: show some code
[20:27:08] rhizmoe: mercwithamouth: people ask questions about using both, so neither is perfect
[20:29:04] mercwithamouth: rhizmoe: hrmm good enough. i'll go with carrierwave first...
[20:29:09] pothibo: Is there a reason why .count() method wraps in parenthesis * in the following example? https://gist.github.com/714b28816180a954558e
[20:30:28] rafi5: pothibo: because that's an SQL function and they require paren args
[20:33:11] scriabin: certainty: https://gist.github.com/4208385
[20:33:53] pothibo: rafi5: you are right, stupid question.
[20:33:56] scriabin: the CheckDeploymentWorker throws a UnixFailedExitException if it fails to perform it's task
[20:34:09] rafi5: pothibo: no such thing
[20:34:46] pothibo: If you use has_many… :order => "created_at DESC", :finder_sql => …. it seems rails drop the order by.. any way to do this?
[20:35:18] pothibo: 2 stupid questions in a row
[20:35:43] LordDoskias: when using capybara in my integration tests i want to check whether a table is present in my view and also whether it has a particular row like so: :rows => ['test', 'test', 'test', 'test', '1985'] but i get error that :rows is unrecognised
[20:36:04] LordDoskias: assert page.has_table? 'sortabletable', :rows => ['test', 'test', 'test', 'test', '1985'] <= that is my line
[20:39:16] dan_: if i want to add keywords to a product model at what point does it make sense to create an entire has_many relationship?
[20:40:22] skyjumper: dan_: i'd assume only if the keywords are used/manipulated individually
[20:41:19] dan_: skyjumper, yea, the only thing is i'd want it to behave like a has_many in the UI
[20:41:38] skyjumper: dan_: could store it as a serialized array
[20:42:03] dan_: skyjumper, yea ok i'll do some research on that thanks!
[20:44:10] rabbite: if i wanted to see users.created_at in my console, what command do i give?
[20:44:38] ajacom: What is a good database modeler tool for linux?
[20:45:16] skyjumper: ajacom: you mean for a visual display of the table relations?
[20:45:25] rhizmoe: ACTION needs bug tracking
[20:45:35] shaolynn: I'm having an issue with the rails static asset server - I'm unable to name a file anything longer than 32 characters
[20:45:44] shaolynn: Is there a way to up the filename length limit?
[20:45:57] rhizmoe: shaolynn: likely OS dependent
[20:46:19] shaolynn: weird, I'm on a mac and I can see the file in the finder
[20:48:00] rhizmoe: then maybe it has to do with whatever you're using for "static asset server"
[20:49:07] rafi5: rhizmoe: it's the rails ActionDispatch::Static
[20:49:21] rafi5: rhizmoe: and the actual limit seems to be 34 chars..?
[20:51:59] dbeest: Can someone tell me why rvm 1.17.2 is installing when I run the install script?
[20:55:32] timhansen: has anyone successfully upgraded a rails 3.0 app to current rails?
[20:56:35] scriabin: rabbite did you get an answer?
[20:56:47] rushed: dbeest: how does that differ from your expectations?
[21:04:01] ajacom: skyjumper, yes
[21:04:49] skyjumper: ajacom: i've used mysql workbench, but it does suck
[21:05:15] rabbite: scriabin: no, i didn't
[21:05:29] skyjumper: ajacom: if you find a good web-based one, please let me know...
[21:05:34] rabbite: im a rails/console newb
[21:06:52] ajacom: skyjumper, ok, thanks
[21:08:21] slash_nick: testing thread pools is fun
[21:08:24] bricker: oh my gosh... I will NEVER get used to having to put () to call functions w/o args when writing coffeescript
[21:08:34] bricker: I have wasted way too much time because of that
[21:10:23] rabbite: bricker: isn't that the same in js?
[21:10:36] rabbite: function name() { stuff }
[21:10:54] rabbite: oh, but then when you call it, its just name
[21:11:10] davidcelis: you have to use parens
[21:11:26] davidcelis: otherwise it just returns the function itself rather than calling it
[21:11:34] bricker: rabbite: yes, but my point is that going between ruby and coffeescript, which are otherwise very similar in syntax, makes me forget the parens all the time
[21:13:04] bricker: There's no such thing as a "reference to a method" in ruby, as far as I know, like there is in Javascript. In JS you can call console.log(SomeObject.method) and it will just print out the function as it's written, without running it
[21:13:55] ajacom: I'm getting ActiveRecord::StatementInvalid in UsersController#index Could not find table 'users' while following Michael Hartl's tutorial, after scaffoling a user model
[21:14:06] universaL: aJacom: rake db:migrate
[21:14:24] ajacom: universaL, bundle exec rake db:migrate
[21:14:26] ajacom: that's what i was doing
[21:15:05] ajacom: ah.. rake aborted!
[21:15:23] slash_nick: ajacom...cool, why?
[21:16:29] ajacom: i don't know.. it just says... rake aborted! undefined method `STRING' for #<ActiveRecord::ConnectionAdapters::TableDefinition:0x000000028d01b0>
[21:16:52] ajacom: maybe because i used STRING instead of 'string' in rails generate scaffold User name:string email:string
[21:17:20] ajacom: should i do the rails generate command again on top of the other ?
[21:17:29] bricker: ajacom: just edit the migration file
[21:17:42] ajacom: bricker, ok, where is it'
[21:17:49] bricker: ajacom: db/migration
[21:17:52] slash_nick: vim db/migrate, shift+G, Up, Enter ;)
[21:18:26] slash_nick: oops: vim db/migrate, Enter, shift+G, Up, Enter ;)
[21:18:49] slash_nick: short term muscle memory loss
[21:19:37] ajacom: cool, it worked
[21:19:52] slash_nick: ew, that series of keystrokes assumes there's a swap file
[21:19:55] dukedave: While we're on vim and migrations, shameless bump for my own SO answer, but I think it's little known: http://stackoverflow.com/a/10855498/21115
[21:20:37] slash_nick: cool dukedave
[21:20:44] Wizywig: any of u guys had issues with capybara where you ask it to click something, and it would instead timeout (even though the element is there and visible)
[21:20:51] Wizywig: *with firefox drivers
[21:21:35] slash_nick: not exactly... i've used "wait_until" to wait for a link to be present before clicking
[21:22:08] Wizywig: slash_nick: naw, its basically finding the link, clicking, then timing out
[21:22:24] Wizywig: Or it decides to not actually click even though it finds it
[21:24:29] slash_nick: weird... are you tagging it with @javascript so you can watch it do it's thing?
[21:27:56] bricker: doesn't bootstrap have some sort of boxshadow mixin
[21:28:35] bricker: ah yes there it is
[21:37:22] dankest: I have a form_tag that contains two radio selects. How do I make them exclusive? As in, if I select one, I want the other to deselect.
[21:38:27] slash_nick: http://stackoverflow.com/questions/3790873/i-need-an-event-trigger-for-a-radio-button-for-when-it-is-unchecked-because-anot/10826504#10826504 dankest
[21:38:36] dankest: slash_nick: God among men. Thanks dude.
[21:38:51] slash_nick: Check out rthbound... that's me :)
[21:43:12] Wizywig: slash_nick: no, not js, it's just the regular selenium "click"
[21:44:37] krazyj: i am le noob. could someone explain what this is doing? https://gist.github.com/e95737456dc4f6569713
[21:45:26] ofcan: how to make textarea increase in height as user types more and more txt?
[21:45:55] slash_nick: krazyj: if the request format is json, it'll look for app/views/accounts/foo_form.erb.json and render it
[21:46:13] krazyj: slash_nick: ah! thanks
[21:46:42] mlangenberg: Ugh, Sidekiq is tiring me. Somehow it behaves unpredictable in production. :/
[21:47:41] rabbite: if i do something dumb like @users = User.find(:all) in console
[21:47:52] rabbite: and it gets stuck because I have 1020402340230 users
[21:48:00] rabbite: is there a command to stop the process?
[21:48:14] FLeiXiuS: ctrl-z doesnt stop
[21:48:16] slash_nick: I always try ctrl+C, then Z
[21:48:34] rabbite: neither one of those work
[21:48:37] slash_nick: ps aux|grep rails c...then kill -9 the bugger
[21:48:56] rabbite: meh, i can just close the terminal window as fast
[21:48:58] FLeiXiuS: rabbite, Why would you be doing a find all on that many records ;-)
[21:49:20] rabbite: because I'm dumb, i prefaced my question with that :p
[21:49:32] rhizmoe: that's a lot of users
[21:50:15] davidcelis: rabbite: http://www.creativeuncut.com/gallery-17/art/com-rabite-concept.jpg
[21:50:39] joonas: davidcelis: what the hell is that
[21:50:45] davidcelis: a fucking Rabite
[21:50:50] rabbite: oh shit, i was in college and young and needed the money
[21:50:56] rabbite: don't judge me
[21:50:58] slash_nick: That's too many users... did you call User.all in production?
[21:54:09] rabbite: nah, i just wanted to test user.created_at.to_s(:text)
[21:54:18] rabbite: to see what format it was outputting
[21:55:31] FLeiXiuS: User.last ftw
[21:56:30] slash_nick: User.last(30).sample if you don't wanna show much favoritism for the new guy
[21:57:06] slash_nick: ACTION wishes mongoid new about #last(args)
[21:58:48] ofcan: how to make textarea increase in height as user types more and more txt?
[21:59:00] slash_nick: with javascript
[22:00:34] ryanf: http://www.jacklmoore.com/autosize
[22:01:05] mlangenberg: Does anyone know if Sidekiq has a specific redis version requirement? Can't find it in the wiki.
[22:01:18] slash_nick: mlangenberg: yes it does, last i used it was like 3 months ago
[22:01:18] parndt: I think so yes mlangenberg
[22:01:27] parndt: he mentioned that when he presented at RubyConf
[22:01:40] parndt: http://confreaks.com/videos/1290-rubyconf2012-asynchronous-processing-for-fun-and-profit
[22:01:57] mlangenberg: I'm tracking down some very strange behavior, I'm inserting 10 jobs, but only a few get processed.
[22:02:09] mlangenberg: Does not happen when I run in production on my machine.
[22:02:24] parndt: oh *version* requirement
[22:03:02] harushimo: question, when you are looking at the gemfile: what does gem 'sqlite3', '1.3.5' mean?
[22:03:18] parndt: it means use sqlite3 version 1.3.5
[22:04:08] mlangenberg: I defined a noon Sidekiq worker. When I do: 10.times { Worker.perform_async }, the Web UI job counter increases with ~3-8, error counter stays the same.
[22:04:15] harushimo: that is what I thought
[22:04:20] harushimo: I need to change that
[22:04:40] harushimo: i'm rails on my mac but how I check sqllite3 version/
[22:04:46] harushimo: I mean version?
[22:05:34] parndt: harushimo: sqlite3 --version
[22:05:48] parndt: but that's not the ruby compatibility gem version
[22:05:54] parndt: which is specified in your Gemfile as 1.3.5
[22:06:04] parndt: two different things http://rubygems.org/gems/sqlite3
[22:08:35] harushimo: 1.3.15 is default version when I type in the rails new app_name
[22:08:52] parndt: what's the problem with the version of sqlite3?
[22:10:25] slash_nick: harushimo: to change it... rm Gemfile.lock, edit Gemfile, `gem uninstall sqlite`, run `bundle`
[22:10:46] slash_nick: harushimo: sorry, apparently I was stuck about 100 pages up
[22:11:03] harushimo: I don't think I need to change anything because I did my other test app
[22:11:05] harushimo: and it worked
[22:12:59] Radar: GOOD MORNING MY PEOPLE.
[22:13:46] slash_nick: Someone had a good birthday :)
[22:14:36] slash_nick: Same thing that's in the vertical direction toward the ground... matter of perspective really
[22:16:08] havenn: Skydivers, good till the last drop...
[22:16:43] skyjumper: ACTION makes a face
[22:17:11] lectrick: Anyone have any experience working with named connection pools in ActiveRecord? And swapping between them?
[22:18:53] suppp: anybody here uses CoffeeScript ? I'm trying to get started with it, and do not understand how can i access a function which i've declared in a coffeescript file ( /app/assets/javascript/mycontrollername.coffee.js ) and call that function from inside my application.html.erb. have a simple function called coffeeOnline that creates an alert() , but when calling coffeeOnline(); from application.html.erb it says that i
[22:18:54] suppp: cannont find that function
[22:19:21] helpa: suppp: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[22:19:21] davidcelis: suppp: !gist
[22:19:40] suppp: didn't think gist was needed but sure, one second
[22:20:19] slash_nick: we just wanna see who you are on github
[22:23:27] suppp: davidcelis : https://gist.github.com/4209504
[22:23:29] suppp: here it is
[22:24:10] davidcelis: is testcontroller.coffee.js included in your manifest
[22:24:23] davidcelis: also .coffee.js isn't the right file extension; you want .js.coffee
[22:26:18] suppp: davidcelis : it is .js.coffee , my bad, i didn't change anything manually there it's whatever it was generated by the generator . i have used rails generate controller testcontroller for this
[22:26:40] davidcelis: suppp: look in web inspector and make sure your javascript is actually being loaded
[22:26:53] davidcelis: suppp: if your application.js manifest doesn't include testcontroller.js.coffee, then it's not going to load
[22:28:34] suppp: davidcelis : the firebug shows that javascript file being loaded when i load the page. I did not add anything to the application.js as i assumed that it automatically loads everything in the directory . will read up on that now , thanks
[22:28:51] cantonic: hey everybody. i need a recommendation please. following scenario: customer hires you for doing something, you agree on a specific amount per hours and a time estimation of 10 hours. after 4 hours of work you send the customer a mockup of your work, customer doesn't totally like it, writes you the next day, that he has no interest anymore. do you still charge the customer for the work you have done even if it is not finished?
[22:30:05] slash_nick: cantonic: i'd try... do you have a contract?
[22:30:50] cantonic: slash_nick: normally i do. but this time i don't
[22:32:13] suppp: davidcelis : i have added //= require_testcontroller to the application.js but still not getting access to that function. however, as i said, firebug does show this file being loaded by the browser when i load the rails page
[22:32:32] gabebug: does this seem like a bug to anyone else?
[22:32:33] gabebug: [4] pry(main)> User.where('id not in (?)', []).all => User Load (0.3ms) SELECT `users`.* FROM `users` WHERE (id not in (NULL))
[22:32:45] slash_nick: cantonic: then you may have to rely on his good grace... I'd ask around for better advice =)
[22:32:46] davidcelis: suppp: you added `//= require_testcontroller` ? exactly liket hat?
[22:32:48] gabebug: casting [] into null?
[22:33:20] cantonic: slash_nick: but is it unfair to charge the customer for the hours i have worked?
[22:34:01] slash_nick: certainly not... you may not have a legal claim to that money without a contract, but it's fair to get paid for what you've done...
[22:34:08] slash_nick: err... for the time you've spent
[22:34:31] suppp: davidcelis : there is also a //= require_tree . in there which from what i'm reading, should include all the files within that directory, which would explain why i actually see the file loaded in firebug
[22:34:39] waseem_: Is there a way to see full file context when viewing diff in a pull request on Github?
[22:34:49] suppp: davidcelis : https://gist.github.com/4209641 copy paste of my application.js . the "testcontroller" is actually the calendar
[22:35:17] gabebug: davidcelis: can you think of a simpler work around than addition a conditional in a scope? e.g.: scope :exclude_ids, ->(ids) { ids.empty? ? scoped : where('id not in (?)', ids) }
[22:35:23] suppp: and the file name: calendar.js.coffee and controller name: calendar
[22:37:07] harushimo: I'm editing my gemfile
[22:37:18] harushimo: I'm trying to add rspec into gem file
[22:37:22] harushimo: how would I do that?
[22:37:36] slash_nick: suppp: normally controller names are pluralized...
[22:37:44] suppp: calendars ? but the controller name is calendar
[22:37:54] slash_nick: suppp: just checking...
[22:38:59] suppp: slash_nick : tx, but yea , the controller name is not pluralized . and as i said the js file is shown as loaded by firebug : https://gist.github.com/4209504
[22:40:24] jarr0dsz: hey everyone ive played with bluecloth and markup engines before im my blog but what would be the most flexible best way to handle html formatting in text strings that are stored in db?
[22:40:42] jarr0dsz: im building a sortoff small cms, and want to have a clean method to save and apply styles in the browser for some non techies
[22:41:08] jarr0dsz: also if anyone has good recommendation for a jquery based in browser editor wysiwyg? that works nice with rails would love to hear
[22:41:13] suppp: so any thoughts anybody about why this js function isn't being found ?
[22:41:30] Radar: jarr0dsz: Mercury editor.
[22:42:13] jarr0dsz: Radar: ah cool.. looks really good beter than tinymce thx for the tip
[22:42:28] suppp: update : I have added alert "Coffee Online form the source" directly in the calendar.js.coffee file, and it gets called ... so in fact i am now sure that this file is included and loaded with my page, however the function i wrote, is not available from within the page :(
[22:43:52] jarr0dsz: radar thank you for the reallly good tip! it even supports inline editing wow!
[22:46:07] Radar: jarr0dsz: my paypal is radarlistener@gmail.com
[22:46:40] bricker_: how do I tell helpa to donate money to you on my behalf
[22:46:45] Radar: Also FYI: it was my birthday yesterday
[22:50:02] suppp: anybody here use CoffeeScript with rails ? I'm having a hard time accessing methods i've declared within a .js.coffee file, from within application.html.erb : https://gist.github.com/4209776 . The alert that's not in a function gets shown, but the coffeeScript function that i've declared isn't found
[22:51:03] blazes816: suppp: all coffee scripts are wrapped up into their own scope. check out the compiled js for your cs
[22:51:21] blazes816: suppp: if you need access to stuff cross-file in cs, you need to attach it to window
[22:51:42] blazes816: window.coffeeOnline = ....
[22:52:01] dankest: Radar.years_to_death -= 1
[22:52:11] suppp: blazes816 : thanks now it's starting to make sense . so there's no way to access that scope otherwise ?
[22:52:25] blazes816: (kind of a bummer)
[22:52:43] kurko_: Guys, I wrote some ideas about an Acceptance testing framework in JS. Opinions? https://gist.github.com/4209648
[22:52:49] Radar: dankest: Pretty much.
[22:53:27] suppp: blazes816 : ok makes perfect sense now, and it works. thank you very much
[22:54:56] slash_nick: dankest: did the javascript snippet work like magic?
[23:10:38] injekt: why would `rails dbconsole` work but `rake db:setup` fail to connect to the postgres server?
[23:12:31] epochwolf: injekt: dbconsole launches the command line client
[23:12:51] epochwolf: it's a different applicaiton
[23:14:09] injekt: epochwolf: that's understandable, then my question is why would postgres fail via the bundled gem?
[23:14:30] epochwolf: injekt: what's the exact error?
[23:14:57] injekt: epochwolf: it can't connect to the server "could not connect to server: No such file or directory" tried to uninstall the old gem and reinstall but no go
[23:15:34] injekt: hmm I think rvm is keeping it elsewhere
[23:15:37] epochwolf: That's an error for a missing file...
[23:15:46] epochwolf: not a database connection
[23:16:01] injekt: epochwolf: right, because there's no socket :P
[23:18:51] jarr0dsz: Radar: I make it good , it was my birthday yesterday also hehe co incidence ;p
[23:19:47] Radar: jarr0dsz: :O
[23:23:11] slash_nick: ACTION wonders if there's a better way to run umpteen servers while developing... guard, sidekiq, yard, etc... all in one process
[23:23:27] slash_nick: ick, process is the wrong word
[23:25:16] waseem_: slash_nick: Services.
[23:26:03] slash_nick: ACTION nods... thank ya sir
[23:51:55] ssvss__: Hi, I am using google_xoauth2 to access gmail via IMAP. I get the following expires_at=1354668348 when I get a response from google. any idea how I can fins after how long it expires.
[23:52:20] Scient: thats a timestamp
[23:52:24] Scient: so convert it into a datetime
[23:54:09] ssvss__: thanks, that helped.
[23:55:28] cableray: I was thinking it would be nice to have a helper for rspec that would run the block on each item in a collection. would there be a better way than just having the helper pass the block to #it?
[23:57:43] slash_nick: like before(:each) ?