« Back to channel list

#RubyOnRails - 24 September 2013

« Back 1 day Forward 1 day »
[00:24:39] leo_33: in your opinion why would a headhunter continue sending you info about a job after a job interview?
[00:26:58] Radar: leo_33: when two cousins love each other very much
[00:28:54] leo_33: yes radar?
[00:29:03] Radar: leo_33: Well, it leads to genetic… problems, such as mental incapacitation.
[00:29:03] Sc0rp10n: how do I set environment for whenever? It always defaults to production
[00:29:29] Radar: Those people can lead somewhat normal lives and get jobs as headhunters and whatnot… but sometimes their reduced mental function causes them to act in unpredictable and illogical ways.
[00:29:30] Radar: Just saying.
[00:30:06] Sc0rp10n: I want to set environment to 'development' using whenever --set 'environment=development' but it doesn't work
[00:30:57] lscott3: Sc0rp10n: I am seeing this on SO: set :environment, 'staging', or you could do per job it says runner 'My.runner', :environment => 'staging'
[00:31:57] Sc0rp10n: is there a way to set environment for whenever using capistrano?
[00:32:24] Radar: Sc0rp10n: yes probably.
[00:32:33] jcromartie: I've got a view "data_sources/index.html.erb", and a partial, "data_sources/_data_source.html.erb". When I use "<%= render @data_sources %>" in the index view, the partial works fine.
[00:32:42] lscott3: hmm in the same SO page I see this: set(:whenever_command) { "RAILS_ENV=#{rails_env} bundle exec whenever" }
[00:32:47] lscott3: let me put the link in here
[00:32:50] jcromartie: The partial is like "<%= data_source.name %>"
[00:32:54] lscott3: http://stackoverflow.com/questions/1070231/rails-cron-with-whenever-setting-the-environment
[00:33:01] jcromartie: if I use any other method to try to render the data source, it fails
[00:33:59] jcromartie: like: render "data_source", collection: @data_sources; (in a loop) render "data_source", object: data_source; render "data_source", locals: {data_source: data_source};
[00:34:27] Sc0rp10n: thanks lscott3
[00:34:34] Sc0rp10n: one more question
[00:34:55] Sc0rp10n: is there is way to set the environment dynamically inside schedule.rb
[00:35:04] Sc0rp10n: when I try to call Rails.env inside
[00:35:09] Sc0rp10n: it doesn't work
[00:35:17] jcromartie: why don't any of those approaches work? the partial IS being rendered, but it throws a NameError on the local data_source in all of those cases
[00:36:02] lscott3: Sc0rp10n: hmm thats a good one. So you want to deploy then have the script set the env once it deploys
[00:36:07] lscott3: dynamically
[00:36:29] Sc0rp10n: cause I have 3 environments
[00:36:42] lscott3: Sc0rp10n: as you should
[00:36:42] Sc0rp10n: and I want to run the job on all environments
[00:36:43] jcromartie: it's because I didn't specify partial: foo
[00:37:09] Sc0rp10n: it's actually only for testing purposes
[00:37:57] lscott3: Sc0rp10n: is rails even loaded at the point it runs the schedule.rb?
[00:38:12] lscott3: you know what I am saying?
[00:38:25] Sc0rp10n: that's why I'm having that problem
[00:38:57] lscott3: http://stackoverflow.com/questions/7084500/how-to-detect-rails-environment-inside-whenever this is something I'm looking at now
[00:38:59] Sc0rp10n: whenever doesn't let me change environment using capistrano
[00:39:07] lscott3: I'm curios now
[00:39:32] lscott3: I've just used it very lightly, never really in depth.
[00:40:25] lscott3: Sc0rp10n: look at the one with 13 up votes what do you think about that?
[00:40:48] Sc0rp10n: it won't work but the one below probably would
[00:40:54] Sc0rp10n: I'm gonna try both and let you know
[00:41:55] lscott3: So I've been tasked with an older app that runs hobo. Gotta say I'm not really enjoying it so far… Feels foreign
[00:42:14] lscott3: I'm struggling with just adding an edit button...
[00:44:35] eph3meral: coffee talk: store CMS content in DB columns or write out metacode-ing-style to templates and choose template to render dynamically based on a value stored in a db column
[00:45:24] eph3meral: is the former worth it performance wise for something that should scale to approx 500-1000 concurrent requests?
[00:47:50] Sc0rp10n: lscott3, sadly both didn't work for me
[00:48:25] lscott3: Sc0rp10n: boo that sucks
[00:48:27] eph3meral: I guess in some ways that second part is an irrelevant question what with on demand cloud scalability
[00:48:57] eph3meral: but still - I would look at writing out to actual files largely related to desires for increasing performance (we've already got site load time issues)
[00:49:16] eph3meral: and I know knuth sayeth premature optimization is 97% of the root of all evil
[00:49:24] Sc0rp10n: lscott3, haha I know
[00:49:35] Sc0rp10n: anyways I'll figure out a way to do it
[00:49:42] lscott3: You've seen this one? https://github.com/javan/whenever/wiki/Setting-variables-on-the-fly
[00:49:52] lscott3: I mean its an extension of that SO page
[00:49:56] lscott3: a link i should say
[00:49:59] lscott3: from the SO page
[01:08:52] greenL: anyone?How can I use Eventmachine in an unicorn web server without block in main thread?
[01:10:52] danhunter: could someone possibly explain how I can use concerns to extend a gem's class to add a belongs_to association?
[01:11:06] tigris_: anyone who has used ldap auth with devise before, any pros/cons on devise_ldap_authenticatable vs omniauth-ldap?
[01:13:28] sumeetjain: Question about database transactions: I have a rake task which does a *lot* of work on the database. It's run in a cron job each night - takes several minutes. I don't have any significant performance adjustments in place. I'm wondering if it's a good idea to wrap the entire task into a single transaction (`transaction do` … `end`). Is that considered a good practice? Or does it have bad consequences?
[01:14:04] eph3meral: sumeetjain, probably a question better suited for #yourdatabase
[01:14:35] n_blownapart: I mistakenly ran 'rake db:migrate log' and got no error, no output...just back to the prompt. what have I done...anything?
[01:15:39] sumeetjain: eph3meral: Is there no conventional wisdom for doing bulk tasks within a single transaction?
[01:17:04] eph3meral: sumeetjain, transactions are generally meant to address a problem of data integrity - if you need data integrity for everything your rake task does then I'd say it might be worth it to wrap it all in a transaction - if you find you're taking a severe performance hit, there's always the cloud
[01:17:35] eph3meral: sumeetjain, you could fire up a separate cron server dedicated to just processing intense batch jobs like that for the few minutes it takes to do the job, and then shut it down
[01:17:43] eph3meral: or even if it's a couple hours to do the job
[01:18:37] greenL: eph3meral: how can i use eventmachine inside unicorn,it seems em is not work properly compare to thin
[01:18:52] sumeetjain: Okay, thanks - that's helpful. You've confirmed some of what I've read, which is that transactions aren't meant as a performance booster. Appreciate the insight.
[01:19:14] optobear: danhunter: you don't absolutely have to use a concern to do that. what you're doing is sometimes called monkey patching. do you understand how to do that as such?
[01:20:06] danhunter: optobear: i know the concept, though haven't done it within rails
[01:21:10] danhunter: optobear: as i understand it, a concern is better than extending from lib as it's loaded at runtime - doesn't require a server restart to be initialized?
[01:23:17] optobear: danhunter: why are you particularly concerned about whether the server needs a restart?
[01:23:37] danhunter: optobear: just ease of development!
[01:24:29] eph3meral: greenL, dunno, I use puma X
[01:24:36] eph3meral: er, s/X/XD/
[01:27:54] optobear: danhunter: sure. i think in any case you're changing class-level properties, so I wouldn't be sure you wouldn't need a restart, but I'm just not sure either way
[01:29:25] danhunter: optobear: assuming i'd like to try a concern, could you shed any light on how I'd add an association to a class in a gem?
[01:31:58] optobear: danhunter: you want to include concern into the original class in an initializer: e.g. in config/initializers/gem_class.rb GemClass.send :include, MyConcern
[01:32:45] danhunter: i totally missed the necessity for the .send :include
[01:33:05] danhunter: optobear: thanks
[01:33:29] optobear: danhunter: np :)
[01:38:29] dllama: how would you map to get results as "5.55, 6.66, 7.77" versus ["5.55", "6.66", "7.77"] ? trying to pass in values into a data attribute in html to use with flotcharts
[01:39:27] optobear: dllama: ["5.55", "6.66", "7.77"].join ','
[01:39:34] dllama: ahhh, thank you!
[01:39:40] dllama: forgot bout join
[01:40:16] dllama: i feel like a dolt, that was 45 minutes of my life i'll never get back lol
[01:42:21] optobear: dllama: oh? well, i'm a programmer who's never, ever wasted 45 minutes of my life on something obvious in retrospect. not once ;)
[01:42:45] uhsf: What's the simplest way to configure multiple Rails apps on a single domain? I was thinking of domain.tld/some_other_app_name. How to configure this?
[01:45:43] lscott3: uhsf: using apache/nginx with passenger
[01:46:00] lscott3: i wouldn't necessarily call it the simplest but there are plenty of docs surrounding it
[01:47:20] cwin: I'm hoping someone can help me. I can't seem to figure out why I'm getting the TypeError "can't convert Array into Hash" with the following code: http://pastie.org/8350473
[01:47:51] lscott3: uhsf: here is a tutorial on one of my fav platforms :) https://www.digitalocean.com/community/articles/how-to-install-rails-and-nginx-with-passenger-on-ubuntu
[01:48:25] uhsf: lscott3: I wasn't able to configure nginx with passenger, so I'm using thin right now. Is it possible to add other apps using only routes?
[01:49:05] lscott3: so you are saying something like mydomain.org/app1 mydomain.org/app2
[01:49:17] lscott3: running thin instances under each app?
[01:50:09] uhsf: yes, that's what I was thinking
[01:52:25] lscott3: That may be getting a little out of my scope of expertise there but can I ask why nginx or apache didint work?
[01:53:53] uhsf: I guess I will have to retry nginx and passenger, but I had all sorts of problems. I tried for a few days then gave up and used thin. I'm using Arch Linux.
[01:55:08] lscott3: Would you happen to know which part you got stuck on?
[01:55:12] RustyShackleford: I'm generally a big fan of IDE's
[01:55:35] RustyShackleford: is there a good (free) IDE for rails?
[01:55:36] lscott3: For the most part it should be smooth sailing just install passenger and configure nginx to point to the app
[01:55:45] lscott3: RustyShackleford: vim
[01:56:06] sevenseacat: rubymine is the 'main' ruby IDE (given the bast majority dont use one)
[01:56:48] lscott3: RustyShackleford: you can try sublime out for free, ruby mine sometimes has some killer deals for 20 bucks or so
[01:57:19] RustyShackleford: I'm using sublime at the moment
[01:57:25] lscott3: you don't like it?
[01:57:41] RustyShackleford: i do, but I wouldn't call it an ide
[01:57:56] uhsf: lscott3: following Arch wiki it was the command passenger-install-nginx-module that always failed. I couldn't get nginx to serve the rails/passenger.
[01:58:09] lscott3: yeah, i like apps like sublime because they are so lightweight
[01:58:15] optobear: RustyShackleford: +1 rubymine, if you can afford it, and your machine has enough memory to run a big 'ol java app. i swear by it myself
[01:59:04] lscott3: uhsf: I've ran into some problems with Centos running the module - I'll have to look and see what I did
[01:59:27] uhsf: it says to run passenger-install-nginx-module as root but all my gems are installed as normal user
[01:59:31] lscott3: uhsf: it was because a package wouldn't compoile
[01:59:41] lscott3: I had to manually download it and make it myself
[02:00:07] RustyShackleford: 99 bucks for a personal license :(
[02:00:17] uhsf: also, it's never clear what user should have permissions to what directories with nginx
[02:00:49] lscott3: uhsf: are you opposed to apache? depending on what you are trying to do it, it should be just fine
[02:01:01] lscott3: or are you running into the same problem with apache
[02:01:19] uhsf: http user, nobody user, normal user, root?
[02:01:33] uhsf: lscott3: I had the same problem with apache
[02:02:29] lscott3: I've only had problems with CentOS, every other time its been pretty easy
[02:02:33] lscott3: just install and go
[02:04:37] uhsf: I will retry passenger/nginx when I have more time, thanks.
[02:05:38] chrstphrhrt: New to Rails, having a little trouble understanding where logic goes between app templates and generators
[02:05:43] n_blownapart: hi why are some migrations generated by default; and some need to be written as with uniqueness arguments? thanks: http://pastie.org/8350512
[02:06:04] lscott3: uhsf: sorry i wasn't more of a help :/ I hope it works out for you
[02:07:31] n_blownapart: or partially* written ^^
[02:07:45] sevenseacat: none 'need to be written as with uniqueness arguments'
[02:08:53] n_blownapart: hey. well, I had to add line 3 of the first entry .. I guess uniqueness is just one element of the definition sevenseacat thanks
[02:09:53] sevenseacat: yes, because rails generators will not automatically generate migrations for indexes
[02:11:21] n_blownapart: thanks sevenseacat , trudging on..
[02:19:34] vim_shim: dllama: "5.55, 6.66, 7.77".split(" ") vs ["5.55", "6.66", "7.77"].join(" ") ?
[02:19:53] dllama: vim_shim, sorry?
[02:20:01] dllama: join',' worked for me
[02:20:24] dllama: i was getting the values via map
[02:20:35] dllama: and it gave me ["5.55", "6.66"] etc
[02:20:48] vim_shim: can this channel run ruby?
[02:20:54] dllama: and to use it with flot, i needed to convert it to "5.55, 6.66, 7.77"
[02:21:01] jrobeson: konnichiwa sevenseacat
[02:21:13] vim_shim: #clojure runs a minimal clojure interpreter bot
[02:21:37] vim_shim: ACTION checks #ruby
[02:22:23] sevenseacat: jrobeson: ohayo
[02:22:40] jrobeson: vim_shim, this channel can't, but #ruby can
[02:24:23] sevenseacat: hooray, i appear to have stuffed up something on my system by trying to remove ruby 2.0.0-p195
[02:24:57] jrobeson: so you could use only via rvm/rbenv ?
[02:25:17] Flashmasterson: i tried installing the latest version of rails using this command 'sudo gem install rails' but have received this message "WARNING: Improper use of the sudo command could lead to data loss
[02:25:18] Flashmasterson: or the deletion of important system files. Please double-check your
[02:25:18] Flashmasterson: typing when using sudo. Type "man sudo" for more information.
[02:25:18] Flashmasterson: To proceed, enter your password, or type Ctrl-C to abort.
[02:25:18] Flashmasterson: Password:" i'm also not able to type a password
[02:25:34] jrobeson: passwords don't show
[02:25:51] jrobeson: so people can't look over your shoulder to see how many characdters you used
[02:26:04] jrobeson: and the warning is true
[02:26:09] Flashmasterson: jrobeson: oh so just type it blindly and enter?
[02:26:10] sevenseacat: well you shouldnt be using sudo to install gems
[02:26:12] jrobeson: but.. you should be ok
[02:26:15] jrobeson: also that..
[02:26:21] jrobeson: unless you want it system level
[02:26:26] Flashmasterson: ok i have xcode, will that help?
[02:26:28] jrobeson: there are valid reasons for that.. like on a vm..
[02:26:49] jrobeson: that only runs that app
[02:26:53] Flashmasterson: someone said installing xcode is a safer way to do this
[02:27:03] jrobeson: most people just gem install
[02:27:06] jrobeson: on their own computers
[02:27:32] Flashmasterson: well i did that already, i'm at 'gem install rails v 3.2.7
[02:27:55] jrobeson: why are you installing that one?
[02:28:04] jrobeson: vs the stable 4.0 ?
[02:28:12] sevenseacat: or at least 3.2.14
[02:28:22] sevenseacat: ACTION is reinstalling 4.0
[02:28:25] jrobeson: just gem install rails
[02:28:30] jrobeson: it'll get you 4
[02:28:41] Flashmasterson: jrobeson: ok so the command prompt will be?:
[02:28:44] jrobeson: gem install rails
[02:29:27] Flashmasterson: 'gem install rails 4'?
[02:30:10] jrobeson: sevenseacat, so what broke?
[02:30:24] sevenseacat: jrobeson: dunno, but i deleted a lot of shit and i fixed it :P
[02:30:25] jrobeson: i don't use :/ enough :(
[02:31:13] jrobeson: hmm.. strangely this is the first time i've ever seen an all underscore nick before
[02:31:26] Flashmasterson: jrobeson: i entered 'gem install rails' and nothing happened
[02:31:27] sevenseacat: i deleted the ruby version, but bundle was pointing to a bin in the deleted folder for some reason
[02:32:02] Flashmasterson: jrobeson: nevermind it just took a while to present any text
[02:32:22] jrobeson: if something just sits there and doesnt return a prompt.. it is in fact doing something
[02:32:36] jrobeson: usually you wait a good 5 minutes for any such thing before giving up
[02:32:46] jrobeson: until you get a feel for what should take a long time and what shouldn't
[02:32:52] Flashmasterson: jrobeson: ok good to know
[02:32:55] jrobeson: it sounds like you're pretty new to command line stuff
[02:33:01] dllama: guys, i'm having some trouble with time zones and .where() .. I'm eastern time zone, i've set that in my config. but create() uses UTC time. however, when i do Order.where("created_at >= ?", Time.zone.now.beginning_of_day) it queries it only for my existing time zone (which i suppose is correct), but its already the 24th in UTC and its not showing me that.
[02:33:10] Flashmasterson: jrobeson: man, i'm not even out of the womb yet
[02:33:21] iliketurtles: I'm trying to use guard-livereload, and everything works as expected so long as the file is in /app/assets, but files in /vendor/assets are seemingly not being watched. my guardfile is the standard default: https://gist.github.com/Lordnibbler/bb7aab82b80fd698e8ea
[02:33:45] jrobeson: perhaps you might want to install a linux virtual machine so you can break everything you want and not kill your actual computer
[02:34:56] jrobeson: Flashmasterson, i've never used a mac so i can't be all that helpful when it comes to where stuff should go and how you should set stuff up on there
[02:35:10] jrobeson: i'm a linux nerd only
[02:35:53] jrobeson: sevenseacat, did you ever use a mac as one of your main computers before? or have you always been a linux nerd?
[02:36:14] Flashmasterson: jrobeson: oh ok, but as far as "killing" my computer, are there things-not-to-do that translate through all OS's ? when using the terminal i mean
[02:36:25] sevenseacat: jrobeson: when i started at my current company they gave me a mac, and i used it for a year
[02:36:42] jrobeson: Flashmasterson, well it's easy to accidentally do something like rm -rf / .. and if you used sudo.. good bye computer
[02:37:01] jrobeson: did you give it a real chance? :)
[02:37:17] sevenseacat: i gave it a year of 9-5 use
[02:37:43] Flashmasterson: jrobeson: shit i may have entered a sudo command but how would i know if i killed it?
[02:37:53] jrobeson: yeah.. you have a lot to read..
[02:38:27] jrobeson: sudo itself just means run as administrator.. and rm -rf means delete everythin in target
[02:38:30] jrobeson: forcefully..
[02:38:49] Flashmasterson: jrobeson: oh ok i haven't used rm -rf
[02:39:04] jrobeson: well it's likely you'll do so in the future.. i know i do..
[02:39:40] jrobeson: sevenseacat, i guess i meant did you try to get a hang of the mac way of doing things? there are some cool tools there for sure
[02:40:00] sevenseacat: well yeah, you kinda have to
[02:40:09] jrobeson: i think i've maybe spent 30 actual minutes on one.. usually helping people setup their wifi at my coffee shop
[02:40:11] sevenseacat: its the mac way or the highway
[02:41:02] Flashmasterson: bricker`LA: hey i'm having some trouble updating rails to 4 and i'm looking through the ror tutorial but still with errors from terminal
[02:41:27] jrobeson: Flashmasterson, on mac's most people tend to use something like homebrew to manage all their non mac software. like various libraries needed for ruby gems and such
[02:42:50] Flashmasterson: jrobeson: cool i'll look into it
[02:43:45] Flashmasterson: jrobeson: strange that the ror tutorial didn't mention that
[02:44:42] jrobeson: well the ror tutorial is just for rails itself.. not all the other million things you can do with it
[02:45:06] sevenseacat: the tutorial assumes you already know your way around your own computer
[02:46:39] jrobeson: i wonder how one can test somebody whether they have the requisite linux knowlege to manage rails .. and only that
[02:47:49] s2013: i set up my first rails app on a vps. it was a fun learning experience
[02:49:13] jrobeson: s2013, be careful.. you might get a wrinkle in your brain
[02:49:21] jrobeson: all this learning crap
[02:49:36] ner0x: Hey yall.
[02:50:16] s2013: its a virtual private server Flashmasterson
[02:50:23] s2013: my brain is all a moosh anyways
[02:51:11] Flashmasterson: s2013: it runs on mac too?
[02:51:31] jrobeson: it's a computer in some remote location..
[02:51:45] jrobeson: that is acdtually a fake computer that runs on a real one.. thus virtual
[02:51:45] s2013: Flashmasterson: its a remote server
[02:51:59] s2013: its as if you had your own dedicated server but its not
[02:52:07] s2013: there are many vps setup in one server
[02:53:15] shams: I have a app hosted on heroku. My cousin made the site responsive and emailed it back a zip. Tried commiting and merging but getting a git error. Can someone help?
[02:53:44] s2013: whats the error shams
[02:53:50] sevenseacat: 'emailed it back a zip'? :/
[02:53:57] shams: yea.. its a big mess
[02:53:58] jrobeson: that would suck to deal with
[02:53:59] s2013: probably a merging error
[02:54:08] jrobeson: have them commit it and merge it for you..
[02:54:11] jrobeson: and then pull it from them
[02:54:13] jrobeson: that'd be best
[02:54:18] jrobeson: and rever what you just did
[02:54:21] shams: its giving me a really dirty error where it say's heroku cedar doesn't detect it as an app
[02:54:31] s2013: is it an app?
[02:54:37] s2013: does it run locally?
[02:55:08] shams: couldn't get the zip he emailed to run locally
[02:55:14] shams: but my app current app runs locally fine
[02:55:21] s2013: so how can you expect it to run on heroku
[02:55:27] s2013: are you pushing your current app
[02:55:30] s2013: so i decided that digital ocean is so much better than heroku
[02:55:33] sevenseacat: well if you cant run it... what s2013 said
[02:55:38] gwillen: shams: I hope you didn't pay him anything
[02:55:49] shams: lol! no, i didnt pay anything to make my app
[02:56:01] shams: private message me if you want to see my work
[02:56:03] s2013: shams figure out how to get it running locally with the responsive changes
[02:56:06] s2013: then you can try to push it to heroku
[02:56:18] shams: i heard of digital ocean, i'll look into it
[02:56:27] sevenseacat: digital ocean is irrelevant to your proble
[02:57:24] jrobeson: s2013, digital ocean isn't always better than heroku..
[02:57:33] jrobeson: linode beats digital ocean in reliability.. that's for sure
[02:57:33] shams: im going to try and get it running locally, if anyone can help me via teamviewer?
[02:57:47] sevenseacat: shams: if you have problems, we can help you here.
[02:58:06] jrobeson: land both linode and digital ocean assume you want to be a sysadmin
[02:58:15] jrobeson: while heroku doesn't
[02:58:20] jrobeson: and that's what people pay for heroku for..
[02:58:59] s2013: i had linode
[02:59:02] jrobeson: not that heroku is the only such one
[02:59:09] sevenseacat: ACTION weeps with joy at the speed of ruby 2
[02:59:12] s2013: i mean i have my own dedicated servers
[02:59:16] jrobeson: sevenseacat, ! :)
[02:59:44] s2013: but do is not bad
[03:00:04] jrobeson: perahps R adar is lost in the land of gta 5.. (don't actually wanna ping him)
[03:02:03] jrobeson: s2013.. well i'm sure it's great for what you're doing.. you probably don't mind if you're down for 5 minutse here and there and such
[03:02:30] s2013: jrobeson: its not for any serious applications
[03:02:39] s2013: basically heroku is a bitch to get a lot of things running on imo
[03:02:41] jrobeson: yeah.. so it's much more reasonable for what you want out of it
[03:02:48] shams: shit is expensive
[03:02:50] s2013: like i said, i have my own dedicated servers for actual stuff
[03:02:53] jrobeson: it looks easy enough to me.. but it is expensive
[03:02:58] shams: they want me to pay $9 a month for postgrese
[03:03:08] s2013: pg is free on heroku
[03:03:14] sevenseacat: postgres is the default and free on heroku
[03:03:16] jrobeson: only for a certain number of rows
[03:03:22] sevenseacat: for a certain size yeah
[03:03:24] shams: yea, theres a limit
[03:03:28] sevenseacat: ~5MB i believe
[03:03:35] Flashmasterson: ok i installed homebrew and, of course, am seeing a handful of disconcerting messages. who is great with a mac?
[03:03:36] sevenseacat: which for most toy apps is plenty
[03:03:36] jrobeson: i thought it was 10
[03:03:56] sevenseacat: Flashmasterson: we cant help you if you dont tell us the errors
[03:03:59] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[03:04:08] jrobeson: Flashmasterson, you need to spend time learning stuff about how to use the command line on mac
[03:04:14] jrobeson: before worrying about rails
[03:04:18] s2013: Flashmasterson: what are you trying to install?
[03:04:42] jrobeson: google has a new site for showing all the worlds consitutions
[03:04:52] s2013: i interviewed with an australian company today
[03:05:18] s2013: i went into the office and they had paintings of australia all over and i was like wow cool.. then turns out the ceo is aussie and it was an australian company but they are relocating to the us
[03:05:48] shams: i'm here in the US
[03:05:54] shams: working in AOL
[03:05:59] s2013: cool. in nyc?
[03:06:07] s2013: in the tw building?
[03:06:11] shams: Patch and alto mail
[03:06:11] s2013: that woudl be a sick office
[03:06:19] s2013: actually no. is it by the amex building
[03:06:30] s2013: ive been to an aol office.
[03:06:31] shams: 675 6th ave, in flatiron
[03:06:35] s2013: yeah that one
[03:06:38] shams: 770 broadway?
[03:06:41] shams: theres two
[03:06:51] s2013: i think 675 6th ave. that address sounds familiar
[03:06:59] Flashmasterson: s2013 rails 4 haha
[03:07:04] shams: we use scala, but i'm not a fan
[03:07:26] s2013: no sorry 770 broadway
[03:07:33] s2013: thats the one with the coworking space too right?
[03:07:36] s2013: 770 Broadway, Floor 6
[03:07:50] s2013: Flashmasterson: whats the error? just use railsinstaller
[03:07:50] dllama: Can anyone please tell me how to do the following with proper rails4 convention, @order = Order.group(:created_at).count — where it'll timezones into account?
[03:08:07] dllama: the code works, but it spits everything out in UTC
[03:08:33] s2013: i had an interview with Moodys , they liked me but wanted me to work with PHP
[03:08:36] sevenseacat: why railsinstaller? -_-
[03:08:46] s2013: cauuse its quick. and it works for me on windows. i assume it would work the same on mac
[03:08:52] s2013: in fact it worked for me on mac
[03:08:56] sevenseacat: its pointless on mac
[03:09:06] s2013: it took me 5 mins to set it up.
[03:09:24] sevenseacat: it takes less than that to type 'gem install rails'
[03:09:27] jrobeson: i always get annoyed when people use mamp for thier php apps on mac and i have to fix them there
[03:09:27] s2013: actually they dont have rails 4 on mac
[03:09:33] Flashmasterson: s2013: remind me of the command prompt to do that, i just need v3.2.7.because that's what the ror tutorial is using
[03:09:46] s2013: just install rails installer Flashmasterson
[03:09:59] sevenseacat: things like railsinstaller are a great way to have no idea what you're doing
[03:10:00] s2013: i had trouble isntaling rails on mac. there were issues and errors
[03:10:07] jrobeson: your tutorial is too old Flashmasterson
[03:10:21] shams: are we allowed to offer people money to get something done here?
[03:10:28] gwillen: sevenseacat: that's the kind of argument that leads people to install Gentoo hoping they'll learn something
[03:10:28] s2013: or people want to get to coding and not bother owrrying about setting things up sevenseacat
[03:10:31] Radar: shams: yes please
[03:10:40] jrobeson: gwillen, i learned something from installing gentoo
[03:10:40] Radar: shams: how much and for what?
[03:10:44] gwillen: sevenseacat: I know because I was once one of those people
[03:10:52] Flashmasterson: jrobeson: you're probably right but he's saying to follow that version because other versions will vary too much for my beginner level to handle
[03:10:52] jrobeson: gwillen, i used gentoo for years.. and i learend a WHOLE bunch
[03:11:02] scyllinice: Did wycats ever get his Tokaido thing done?
[03:11:07] jrobeson: Flashmasterson, that means pick a different tutorial
[03:11:23] s2013: is it hartl?
[03:11:25] sevenseacat: installing and building an OS is irrelevant to learning rails, but i would think installing and configuring rails is important to learning rails
[03:11:34] jrobeson: no.. becuase hartl has a rails 4 tutorial
[03:11:36] sevenseacat: but hey, what do i know
[03:11:53] sevenseacat: (obviously not much because i have never installed gentoo :P)
[03:11:56] jrobeson: i feel the same way when it comes to setting up apache and php
[03:12:05] scyllinice: sevenseacat: You should try it at least once
[03:12:07] jrobeson: on windows.. i can see the need
[03:12:15] jrobeson: but not on mac or linux
[03:12:31] sevenseacat: i once installed arch for fun, does that count?
[03:12:52] jrobeson: sorta.. even though arch's package manager is not very good (imo)
[03:13:06] scyllinice: sevenseacat: Unless you installed everything via AUR, it's not the same
[03:13:19] sevenseacat: ACTION hands in geek card
[03:13:40] scyllinice: I think I last installed Gentoo back in 2007 or so
[03:13:52] scyllinice: Built everything from source.. took forever
[03:13:54] scyllinice: Then I didn't use it
[03:15:39] Flashmasterson: jrobeson: can i send you a git?
[03:15:48] Flashmasterson: jrobeson: *gist
[03:15:49] scyllinice: Does he work hard?
[03:16:00] s2013: just paste it here Flashmasterson
[03:16:14] scyllinice: Paste the gist link, not the code
[03:17:01] s2013: so reduce and inject essentially does the same thing?
[03:17:17] Flashmasterson: ok https://gist.github.com/Flashmasterson/6679953
[03:17:22] scyllinice: I believe they are aliases if I remember correctly
[03:17:42] s2013: well one takes block the other one takes a symbol i think
[03:18:09] s2013: Flashmasterson: did you try typing sudo gem install rails
[03:18:18] sevenseacat: a) stop using sudo and b) you're missing the mac development stuff
[03:18:23] sevenseacat: s2013: did you read the gist?
[03:18:42] vim_shim: s2013: http://underscorejs.org/#reduce
[03:18:54] s2013: i was going step by step
[03:19:06] scyllinice: s2013: reduce can take a block as well
[03:19:26] s2013: thanks vim_shim and scyllinice
[03:19:30] helpa: sevenseacat: Okay.
[03:19:38] sevenseacat: so need a better command for that one.
[03:19:50] s2013: Flashmasterson: do you have xcode installed and updated?
[03:20:03] scyllinice: sevenseacat: If you're using sudo, you're sudoing it wrong?
[03:20:14] s2013: Flashmasterson: just go to railsinstaller.org and use that man
[03:20:18] scyllinice: ACTION rimshots
[03:20:37] Flashmasterson: s2013: i tried and it just makes me angry
[03:20:42] sevenseacat: sudo -> 'Reformatting your computer and installing windows. Posting your Facebook password on IRC. Sending your secret stash of porn to your grandma. Setting a small kitten on fire.'
[03:20:53] Flashmasterson: s2013: i'm completely new to this
[03:21:05] s2013: Flashmasterson: do you have ruby installed?
[03:21:08] s2013: type in ruby -v
[03:21:09] scyllinice: Flashmasterson: You have RVM. You don't need sudo
[03:21:13] scyllinice: For anything
[03:21:27] sevenseacat: s2013: please tell me how he could run gem install ANYTHING without ruby installed
[03:21:29] helpa: brownies: Okay.
[03:21:29] brownies: !sudo make me a sandwich
[03:21:34] brownies: hm, that was disappointing.
[03:21:45] s2013: he obviously has ruby installed. i meant the latest version
[03:21:48] s2013: ruby comes with macs
[03:21:57] sevenseacat: s2013: so why are you asking stupid questions
[03:22:03] scyllinice: The gist states he has rvm installed
[03:22:06] s2013: you can ignore me
[03:22:08] scyllinice: 1.9.3-p448 in fact
[03:22:10] Flashmasterson: i do but i need rails
[03:22:15] sevenseacat: s2013: gladly.
[03:22:17] Flashmasterson: that's what i'm after
[03:22:18] s2013: but if it makes your life better then feel free :)
[03:22:41] scyllinice: Flashmasterson: You have to install development tools first. <--- in your log
[03:22:49] scyllinice: Flashmasterson: That means go install Xcode from the app store
[03:23:04] s2013: i already asked him about that scyllinice
[03:23:22] scyllinice: s2013: Well, somewhere that got lost in translation
[03:23:28] scyllinice: So we're going over it again
[03:23:28] Flashmasterson: scyllinice: we can start from opening xcode, because i installed it
[03:23:30] vim_shim: Flashmasterson: Basically, Apple ships a crippled unix, and you have to make sure you have a bunch of development libraries that are easier to install on Linux and come by default.
[03:23:43] scyllinice: Flashmasterson: Great. Go to XCode preferences
[03:24:16] Flashmasterson: scyllinice: done
[03:24:16] s2013: also make sure its the latest xcode too. sometimes you have to reinstall it. thats what happened tome on my mac
[03:24:25] scyllinice: Flashmasterson: Click the downloads tab in there
[03:24:35] scyllinice: Install "Command line tools"
[03:24:47] s2013: yeah do what scyllinice said
[03:25:18] vim_shim: Flashmasterson: You could also use vagrant and virtualbox to emulate a linux system and just develop inside of that.
[03:25:45] vim_shim: Flashmasterson: but s2013 +1
[03:26:11] Flashmasterson: ok i just need to authorize from system prefs first - i just upgraded to mountain lion
[03:26:52] scyllinice: Xcode 5 makes you sign into their developer program thing before letting you download the tools. It's annoying, but doesn't cost you anything
[03:27:27] Flashmasterson: ok good. installing 3 updates now...
[03:27:39] Flashmasterson: on command line tools
[03:28:04] s2013: i work on windows for themost part and it works great
[03:28:25] Flashmasterson: shit, i mean documentation - i get this message when i try to install from the 'components' section: Failed to install "iOS 5.0 Simulator"
[03:28:49] Flashmasterson: An unknown error occurred. Please try again.
[03:29:12] sevenseacat: did you do what it said?
[03:30:12] Flashmasterson: sevenseacat: from the 'downloads' tab, yeah
[03:32:26] scyllinice: Flashmasterson: Is the command line tools bit installing?
[03:33:12] Flashmasterson: scyllinice: no i got that message when i clicked on the download icon next to it
[03:33:30] Flashmasterson: scyllinice: Failed to install "iOS 5.0 Simulator"
[03:33:30] Flashmasterson: An unknown error occurred. Please try again.
[03:33:57] Flashmasterson: scyllinice: same message on ccommand line tools
[03:34:18] scyllinice: Flashmasterson: Ok. I'm not sure what to tell you for that
[03:35:37] Flashmasterson: scyllinice: well shit
[03:36:09] scyllinice: Flashmasterson: You can try opening up the Console utility and watch the log file when you try to download the command line tools
[03:36:19] scyllinice: Flashmasterson: That might help me point you in the right direction
[03:37:05] Flashmasterson: scyllinice: ok i'll try
[03:37:36] Flashmasterson: scyllinice: where is the console utility?
[03:39:02] scyllinice: Under the utilities directory in Applications
[03:40:56] Flashmasterson: scyllinice: wow, it suddenly decided to accept my request by asking me for my password
[03:41:07] Flashmasterson: scyllinice: weird
[03:41:32] Flashmasterson: scyllinice: this seems like it should take a while, yes no?
[03:42:07] scyllinice: Depends on your internet speed
[03:42:39] scyllinice: Once that's done, I would uninstall rvm (rvm implode) and reinstall it. Just to have a clean slate
[03:42:55] scyllinice: Reinstall the ruby you had (1.9.3-p448)
[03:43:02] scyllinice: and then don't use sudo
[03:43:12] scyllinice: You don't need to with RVM
[03:43:35] scyllinice: If you don't have homebrew by now, you should also get that
[03:45:09] Flashmasterson: scyllinice: i i just got homebrew but received errors afterward, can i gist it to you?
[03:46:07] Flashmasterson: scyllinice: https://gist.github.com/Flashmasterson/6680139
[03:47:56] scyllinice: I wouldn't worry about the dylibs and static lib warnings
[03:48:05] scyllinice: The macports/fink warning you should take car of
[03:48:56] Flashmasterson: scyllinice: ok so homebrew fill function for me how? at this stage, which is hartle's tutorial
[03:49:26] scyllinice: Flashmasterson: RVM will want to install a bunch of libraries for compiling rubies
[03:49:39] scyllinice: Flashmasterson: Plus it makes installing postgresql or mysql easy
[03:50:49] Flashmasterson: scyllinice: ok i don't know what postgresql or mysql is but i think you're telling me that it will function as the way to install libraries and compiling other softare/what-not
[03:51:03] scyllinice: Flashmasterson: Yes
[03:51:34] Radar: PostgreSQL and MySQL are both database management systems
[03:51:36] scyllinice: Flashmasterson: That statement tells me you're new to web development at the least.
[03:51:49] sevenseacat: he's new to computers, it seems
[03:51:51] Radar: PostgreSQL is like a house built with bricks, and MySQL is like a house designed by MC Escher, built out of Lego.
[03:52:21] Flashmasterson: yes damnit, very new
[03:52:23] scyllinice: Radar: and with extra bits of lego strewn about waiting for you to destroy your feet on them
[03:52:24] sevenseacat: why does devise not use flash messages like any normal freaking app
[03:52:38] sevenseacat: signup error -> no flash message set
[03:52:51] dllama: sevenseacat, are you sure about that? right on their github page it says that devise requires flash messages
[03:53:10] sevenseacat: it uses them for some things, not consistently
[03:53:27] scyllinice: Flashmasterson: It's fine to be new. That wasn't a jab. It just tells me I shouldn't assume you know what I mean 100% of the time. I can adjust accordingly
[03:53:45] dllama: sevenseacat, ahh ok. i just remember reading that they require it
[03:54:38] Flashmasterson: scyllinice: oh i didn't mean to imply that it was a jab, the "damnit" was just out of being very sure of how green i am
[03:54:51] scyllinice: sevenseacat: I wonder if it's setting a flash key that your layout isn't displaying
[03:54:59] sevenseacat: scyllinice: its not setting any flash ketys.
[03:55:38] Flashmasterson: scyllinice: the download bar for command line tools hasn't filled at all - what do you think?
[03:56:10] scyllinice: Flashmasterson: It's a few hundred meg. Might take a while
[03:57:37] sevenseacat: so many solutions to 'fix' devise not setting flash messages http://stackoverflow.com/questions/4101641/rails-devise-handling-devise-error-messages
[03:58:51] Zesty: I'm deploying with capistrano to a server. I have RSA key login via ssh, but without a password. I'm wondering how I get this to work? I see a lot of stuff about ssh forward agent, but I think that's after it connects to the server in the first place
[03:59:07] Zesty: my problem is when i do cap:deploy, it asks for a password, but I'm using a key located locally in ~/.ssh/whatever
[03:59:21] scyllinice: sevenseacat: Jose does live in #elixir-lang when he's online, so you could ask him next time he's around
[03:59:55] scyllinice: Zesty: Can you shell into the server normally without it asking for a password?
[04:00:07] scyllinice: From your shell
[04:00:17] Zesty: scyllinice: yes, I need to do ssh -i ~/.ssh/key deploy@ip
[04:00:26] Zesty: and it just connects
[04:00:41] sevenseacat: yeah im reading through the literally hundreds of issues on github relating to flash messages in devise, 90% of them closed by jose going 'no'
[04:00:44] scyllinice: Zesty: Ok. Then yeah, you'll need key forwarding
[04:00:55] Zesty: I have that in my deployrb but it still asks for a password
[04:02:31] scyllinice: Zesty: Can you gist your capistrano config?
[04:03:14] Zesty: scyllinice: sure
[04:04:10] Zesty: scyllinice: http://pastie.org/private/ajqkdknvgmcxvmg6vqvybg
[04:06:25] scyllinice: Zesty: if you add this, does it help? default_run_options[:pty] = true
[04:07:04] Zesty: still asks for password
[04:08:44] Zesty: does it matter than I'm not using ssh-agent or whatever to manage my keys? I just have a random RSA key in my ~/.ssh folder, I'm not sure how it knows what file to use
[04:09:58] scyllinice: Zesty: It looks like you can specify the key you want
[04:10:39] scyllinice: Zesty: set :ssh_options, {:forward_agent => true, keys = ["Path/to/key"] }
[04:11:25] scyllinice: well.. :keys =>
[04:11:30] scyllinice: You know what I meant :)
[04:12:33] Zesty: still asks for password
[04:13:05] scyllinice: So you can get into the first server with ssh -i ~/.ssh/key cap@ec2....
[04:16:01] scyllinice: Got nothing else then. Maybe remove the forward_agent key?
[04:20:12] Zesty: ssh_options[:auth_methods] = ["publickey"]
[04:20:14] Zesty: I needed this
[04:22:19] sevenseacat: wish i knew why guard just locks up sometimes
[04:23:34] jrobeson: hmm.. i think i have the same problem also.. i'm using guard-puma.. and it'll just stop reloading puma
[04:23:53] sevenseacat: im only using guard and guard-rspec
[04:24:08] sevenseacat: and i have guard 2.0.0.pre3 because it supposedly fixed the problem
[04:33:14] sevenseacat: gaaaaah rubyconf au next year is in sydney :(
[04:33:18] sevenseacat: was hoping melbourne again
[04:38:49] |PiP|: anyone know of some sort of metaprogramming framework that allows an apps user to define application logic? like, "if user logs in and does X, do Y" and have a bunch of options for X and Y available for the user to utilize
[04:41:12] jrobeson: i'd usually some some sort of event listener/notifier for that personally..
[04:41:44] |PiP|: like callbacks?
[04:41:48] Radar: *cough* ActiveSupport::Notifications
[04:42:52] Radar: |PiP|: You could probably do it with AS::Notifications
[04:43:53] jrobeson: sup Radar ?
[04:44:11] Radar: jrobeson: Working through adjustments stuff for Spree still.
[04:44:21] Radar: Today I learned that adjustments for promos were not being calculated before tax adjustments
[04:44:32] Radar: Which means that if you get $10 off a $50 item, you're still paying $5 tax instead of $4.
[04:44:56] Radar: This means a) the customer pays more tax and b) the store collects more tax which means c) the government takes more tax money from the store.
[04:45:05] sevenseacat: those bastards.
[04:45:06] Radar: Can't have the government taking more money soooo
[04:45:32] s2013: Radar: you ever interviewed anyone for spree or any other company
[04:45:38] Radar: s2013: nope
[04:46:11] bratsche: Anyone used plv8?
[04:46:25] helpa: bratsche: Don't ask "does anyone use <thing>?". It's better to just state your problem and if anyone has used <thing> they will most likely answer.
[04:46:25] Radar: bratsche: !used
[04:47:23] bratsche: Sorry.. does anyone know if plv8 gives you normal JS objects and methods (e.g., Date), or only the normal Postgres stuff?
[04:47:36] Radar: bratsche: Why are you asking that here and not in the postgresql channel?
[04:53:37] sevenseacat: this sounds fun
[04:54:09] iliketurtles: i've attempted to set up guard-livereload. everything works with files in /app/assets, but files in /vendor/assets are not being watched. my guardfile is the standard default generated by `guard init livereload`: https://gist.github.com/Lordnibbler/bb7aab82b80fd698e8ea any idea what might be going on here?
[05:03:22] rhizome: i would check google
[05:08:05] jrobeson: iliketurtles, hmm.. seens fine to me
[05:08:16] jrobeson: i haven't used guard-livereload yet myself though
[05:14:25] jrobeson: iliketurtles, i'm having enough trouble with guard locking up my puma :(
[05:14:38] Radar: big cat thing
[05:14:59] Radar: Looks like this http://www.lpzoo.org/sites/default/files/imagesfacts/puma.jpg?1331838804
[05:15:58] jrobeson: that's a good picture of a puma face
[05:16:58] iliketurtles: Radar: while i've got you here, should I do anything to bring attention to that routes bug I'm having with 4.0? never tried to help with rails core before
[05:17:10] Radar: patience is a virtue
[05:17:16] Radar: and all that other zen bullshit
[05:17:26] iliketurtles: its got me pretty stuck, can't do much with the app till i get it resolved
[05:31:28] sevenseacat: mm routes bugs. tasty.
[05:35:34] boytoy: ACTION hands sevenseacat some salt and pepper
[05:36:35] iliketurtles: jrobeson: found the issue, if only I could devise a way to override this fucking line: https://github.com/guard/listen/blob/27bae3a1c8b318954c9e798c3c16dafae4297e5a/lib/listen/directory_record.rb#L15
[05:37:19] sevenseacat: that makes sense to me
[05:37:26] sevenseacat: why are you modifying things in vendor?
[05:37:35] sevenseacat: adding to it, yes
[05:38:52] iliketurtles: sevenseacat: good point, I have some bootstrap CSS overrides in there, but I suppose it would make more sense to have them in app/assets
[05:40:52] iliketurtles: sevenseacat: on it
[05:42:09] speakingcode: I am doing find_or_create_by on a field that is set as a unique index. I am getting an error "ConstraintException: column is not unique (ActiveRecord::RecordNotUnique)... why would find_or_create_by be trying to create a record that already exists?
[05:42:56] sevenseacat: speakingcode: the full line of code?
[05:43:06] speakingcode: sure, one sec
[05:44:44] rvanlieshout: speakingcode: it's set as a uniqe index by who?
[05:44:48] rvanlieshout: in the database or in rails?
[05:44:58] speakingcode: AR migration, in the database
[05:45:01] speakingcode: one sec, making a gist
[05:46:18] speakingcode: https://gist.github.com/speakingcode/6680808 sevenseacat rvanlieshout
[05:46:59] Radar: What is create_with?
[05:47:03] rvanlieshout: speakingcode: aren't you just adding a field that is not unique?
[05:47:17] speakingcode: rvanlieshout: what do you mean?
[05:47:21] Radar: Oh it's a Rails method. TIL.
[05:47:45] sevenseacat: yeah thats news to me too
[05:48:06] rvanlieshout: speakingcode: that your database engine is complaining you're inserting a record conflicts with your constraint
[05:48:22] speakingcode: Radar: create_with(...).find_or_create_by(...) will create a record with the fields in create_with if it doesn't exist (matched by fields in find_or_create_by)
[05:48:41] Radar: speakingcode: yes. That must be new to Rails.
[05:48:46] speakingcode: rvanlieshout: yah, but it shouldn't be trying to create it if it already exists
[05:49:08] rvanlieshout: speakingcode: maybe it's case insensitive in it's query but sensitive on it's insert
[05:49:10] speakingcode: yeah, http://guides.rubyonrails.org/active_record_querying.html#find-or-build-a-new-object
[05:51:15] speakingcode: rvanlieshout: you are correct sir, but backwards
[05:51:16] rvanlieshout: speakingcode: have you checked the db to find if such a record already exists?
[05:51:50] speakingcode: it's case insensitive on the insert (because the model has self.email = email.downcase on before_save) but the query is case senstiive
[05:52:16] speakingcode: so the query was not matching an upper-cased email and then it would try to create it
[05:53:08] speakingcode: that fixed it, and nope i didn't check the db b/c the error only showed ? for the values, and i didn't think to puts em out before you solced it :-)
[05:53:12] rvanlieshout: speakingcode: dunno if sqlite supports it, but you could try to change your table settings for that
[05:53:41] speakingcode: yeah, i'm only using sqlite for development, will be postgres in prod, but it's fine
[05:54:05] rvanlieshout: speakingcode: ouch... that's wrong.. you should use the same as in production
[05:54:16] speakingcode: rvanlieshout: why?
[05:54:43] rvanlieshout: speakingcode: because you should know it works before you push it to development
[05:54:49] speakingcode: AR abstracts the db
[05:54:55] speakingcode: oh, i will. this is brand new development
[05:55:00] rvanlieshout: so then why did this error pop up?
[05:55:26] speakingcode: b/c i'm populating it with test data that had uppercases in it, and i haven't put anything in place to handle that yet
[05:55:37] sevenseacat: so the error is correct?
[05:55:46] rvanlieshout: if this is not an issue in production you shouldn't have to worry about it in dev
[05:55:51] sevenseacat: so why are we having this discussion?
[05:55:52] rvanlieshout: that's why you should use the same db engine
[05:56:17] speakingcode: sevenseacat: i dunno, i already explained that the issue was indeed case-sensitivity and why that was so
[05:56:44] sevenseacat: ACTION shrugs and goes back to shiny new code
[05:56:57] speakingcode: rvanlieshout: AR abstracts the database away. there's no production yet, heh
[05:57:16] rvanlieshout: speakingcode: it does, but only if you never use anything fancy postgres supports
[05:57:40] speakingcode: obviously i will indeed test against postgres before i push it out to production with pg, but i'm not doing anything fancy just basic queries at this point
[05:59:49] maoko: Did someone try to use wickedpdf here?
[06:00:10] helpa: maoko: Don't ask "does anyone use <thing>?". It's better to just state your problem and if anyone has used <thing> they will most likely answer.
[06:00:10] Radar: maoko: !used
[06:00:13] speakingcode: anyway, thanks rvanlieshout. you helped me find the problem
[06:00:19] Radar: speakingcode: what was the problem?
[06:00:36] Radar: Case sensitivity?
[06:00:59] speakingcode: 00:48 < speakingcode> it's case insensitive on the insert (because the model has self.email = email.downcase on before_save) but the query is case senstiive
[06:01:07] speakingcode: 00:49 < speakingcode> so the query was not matching an upper-cased email and then it would try to create it
[06:03:58] maoko: radar, thanks god. Whenever I try to use a partial within header I can't use js offset for the content in the main part. So basically it looks like this http://tinypic.com/view.php?pic=2j483ll&s=5
[06:04:15] maoko: wicked pdf 0.11 on os x
[06:04:51] Radar: maoko: I never said *I* used it,.
[06:05:10] ajustrun: hey guys, im getting an error -- No route matches {:action=>"show", :controller=>"users"} when i link_to paypal_path. here's my bake routes: http://cl.ly/image/21221p41191H
[06:05:15] maoko: radar, sorry, got it wrong. heh
[06:05:18] ajustrun: am i missing something?
[06:05:29] ajustrun: i have a paypal action in my controller
[06:05:47] Radar: ajustrun: show us config/routes.rb
[06:06:53] ajustrun: Radar: https://github.com/ArunGupta25/sartorialis/blob/development/config/routes.rb
[06:07:22] Radar: ajustrun: You're getting this error when you just link?
[06:07:30] ajustrun: yeah link_to paypal_path
[06:07:42] ajustrun: well link_to "string" paypal_path
[06:08:16] Radar: I don't know how that happens
[06:08:56] ajustrun: well at least its not something silly, i was just thinking i was getting how routing works
[06:10:45] icharlie: /msg nickserv help
[06:11:01] ajustrun: Radar: weird, i moved the action to a new controller and im still getting the same error
[06:11:16] Radar: ajustrun: it's not the controller that is causing that
[06:11:27] Radar: ajustrun: Try restarting your server
[06:11:35] ajustrun: Radar: tried that =/
[06:12:34] Radar: then I am out of ideas sorry
[06:13:11] ajustrun: thats ok, any suggestions on where i should dig for the answer?
[06:14:28] maoko: Well, I have opened an issue for wicked pdf, if there is someone who can help me with it, it would really nice. Here is the link https://github.com/mileszs/wicked_pdf/issues/256
[06:15:50] Radar: ajustrun: Typically it would be obvious in your routes.rb, but it's not.
[06:15:59] Radar: ajustrun: If I knew where to dig for the answer, I would've asked you to look there too
[06:16:16] ajustrun: Radar: cool cool no worries, ill prob figure it out. thanks for your help!
[06:21:39] mackgile: i defined column type as integer and i am using for check_box, in check box i am using for each loop can i store id of that for each loop model
[06:43:01] dsrx: can't find any docs on it -- is the difference between create_association and create_association! the same as create and create! ?
[06:43:35] dsrx: namely that the latter raises an exception if the validation fails?
[06:43:47] sevenseacat: easy way to find out
[06:45:43] mackgile: can we store row id in collection_check_boxes
[06:48:42] krz: whats the naming convention for user uploaded content? underscores, dashes, other?
[06:55:27] mackgile: f.collection_check_boxes is not stored in model here is gist https://gist.github.com/anonymous/6681193
[07:00:25] freedrull: can an engine add routes to another engine ?
[07:14:06] tagrudev: state_machine is still developed ?
[07:29:18] railsgo: hello anybody solve my issue
[07:29:59] sevenseacat: you had an issue?
[07:30:34] railsgo: i have sticked with check boxes
[07:30:48] sevenseacat: oh you're that guy
[07:34:07] railsgo: here is my gist https://gist.github.com/anonymous/6681193
[07:49:38] railsgo: hi can you clearify about multiple check boxes
[08:00:39] Kaylors: How do I make my server call a third-party API after a fixed interval of time?
[08:01:39] Kaylors: As in, the Open Exchange Rates API lets me pull the current currency exchange rates. I want the API to be called every hour, on the hour and the rates stored in a local database. How do I do that?
[08:02:14] sheeny: Does anyone know what this error is all about? https://gist.github.com/craigsheen/6681695
[08:02:34] sheeny: Was working perfectly fine a couple of days ago
[08:04:54] Scient: Kaylors: cron obviously
[08:05:35] Kaylors: Scient: Ruby gem?
[08:05:45] sheeny: Ah nvm, its on OSX issue with files, maybe I changed something the other day
[08:05:48] Scient: you know, crontab
[08:06:06] Scient: if you are going to tell me you have no idea what cron is, i wont go any further :P
[08:06:09] Scient: and will let you google
[08:06:32] railsgo: does any one know about neseted form using check box https://gist.github.com/anonymous/6681193
[08:07:18] Kaylors: Sceint: -googling-
[08:10:32] Kaylors: Scient: Alright, Cron takes care of the automation. How do I call a third-party API from within a a controller? As in, I can use AJAX calls from jQuery, but I want to do it completely on the server-side.
[08:10:57] Scient: as in you wont call a controller from cron
[08:11:09] Kaylors: Sceint: No, no, forget cron.
[08:11:27] Scient: make a http call then?
[08:11:32] Scient: or which part is the problem
[08:11:33] Kaylors: Sceint: How do I call a third-party API from a controller?
[08:11:42] Scient: its likely theres also a gem existing for the api integration
[08:11:46] Scient: if its a more popular API
[08:11:55] Scient: if not, then just make the HTTP calls yourself
[08:12:23] Kaylors: Scient: Syntax? I'm sorry, I've only been at it for a few weeks.
[08:12:43] Scient: https://github.com/jnunemaker/httparty
[08:13:09] Kaylors: Scient: -checking out-
[08:13:44] optobear: Kaylors: https://www.ruby-toolbox.com/categories/http_clients, https://www.ruby-toolbox.com/categories/api_clients
[08:14:36] greengriminal: Morning people!
[08:16:02] greengriminal: I am trying to do a matcher on my nested attributes to check if it has been included. So I used the `include` rspec matcher and this did not work. Any ideas: https://gist.github.com/anonymous/ffe044cf0a728eafb7f9#file-example-rb-L27
[08:17:32] sevenseacat: how can an ID, which is an integer, include anything?
[08:19:03] greengriminal: sevenseacat: You can see what I am trying to do right?
[08:19:18] railsgo: can any one https://gist.github.com/anonymous/6681193
[08:20:50] greengriminal: sevenseacat: Well on line 9 I include my filters_attributes which is another table. I am trying to create the rspec test so that it should include the filter inside a rule when it is created
[08:21:08] sevenseacat: greengriminal: so why are you checking the rule ID?
[08:22:00] elaptics: railsgo: can anyone what?
[08:23:56] elaptics: greengriminal: what is the purpose of that spec?
[08:24:37] elaptics: what is Filter.first? It's not very obvious what that has to do with a controller spec?
[08:24:46] greengriminal: elaptics: Essentially I am trying to test this show action in my controller https://gist.github.com/anonymous/4bd46a90ff8b4272217d
[08:26:15] yatish27: I have an array of active records, Now how can I do a find by id on the array
[08:26:47] elaptics: greengriminal: so I'm guessing rule has_many :filters? And when you create a rule it's creating at least one associated filter and you want to check that it's all returned?
[08:27:52] greengriminal: elaptics: In saying that I have also got ` accepts_nested_attributes_for :filters` in my "rule" model also
[08:27:55] railsgo: <elaptics> i am using nested forms project and member, member is nested, here i am using checkboxes data is not stored in model have a look https://gist.github.com/anonymous/6681193
[08:28:42] elaptics: greengriminal: so I would set something specific as an attribute for the associated filter in your valid_attributes let call and then just check for that output in the spec (your line 27)
[08:30:20] greengriminal: elaptics: Will give that a shot
[08:37:01] DaniG2k_: guys whats a good way to include bootstrap's class="active" when someone is on that specific page?
[08:39:11] sevenseacat: DaniG2k_: http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-current_page-3F
[08:52:35] Macaveli: Anyone have a nice CSS for Pre Code Highlighting for Rails?
[09:07:37] elaptics: Macaveli: coderay and pigments are typical solutions for syntax highlighting for code
[09:10:55] irctc809: Hi Guys, I'm wondering how not to display root key for the JSON result using Jbuider
[09:11:21] irctc809: any one has a quick answer?
[09:12:08] irctc809: /msg nickserv help
[09:12:10] ljarvis: irctc809: use json.array!
[09:12:25] ljarvis: or add the keys yourself manually
[09:12:29] irctc809: huh? thanks ljarvis
[09:12:35] irctc809: will give it a try
[09:13:31] irctc809: ljarvis: I know how to add keys manully or how to loop through an array
[09:14:06] irctc809: but it seems to me that the grammar is JSON.somekey
[09:14:35] ljarvis: irctc809: show us the jbuilder view and the output
[09:14:39] irctc809: so if I dont want the somekey when my result is an array...that's the background of this question.
[09:15:09] irctc809: ljarvis: your JSON.array! works
[09:15:13] ljarvis: so you want json.array!
[09:15:26] irctc809: thanks a lot, I'm quite new to Rails and didnt realize this method
[09:25:15] ARMIGER1: I've just started working on customizing a Spree instance, and I'm wondering why the Spree logo isn't getting replaced. Is it supposed to go in 'app/assets/images/admin/bg/spree_50.png'?
[09:25:29] jrobeson: also #spree might be better channel
[09:25:36] Macaveli: elaptics I just need the css I'm using daux.io to write my documentation and the syntax highlighting is not so good
[09:27:53] ARMIGER1: jrobeson: Thank you! I'll try over in #spree.
[09:28:30] dangerousdave: just mapped the following for devise to get rid of the /users in the url https://gist.github.com/deathwishdave/21238fc8e33354cefc89. Works, but problem is new_user_session_path still links to the /users path.
[09:46:06] DaniG2k_: anyone have any experience with world flag sprites and rails?
[09:46:15] DaniG2k_: i saw there are a few gems but
[09:46:41] DaniG2k_: it looks a bit complicated for just having to add a little icon :|
[09:54:12] Macaveli: When i log in via Popup in IE/Chrome everything is nice filled in in my dropdowns but in FF he does not fill in anything in the dropdowns any ideas?
[09:59:41] cheeti: hi in my application after user sign up "You need to sign in or sign up before continuing." message is showing rather than confirmation why?
[10:00:06] cheeti: hi in my application after user sign up "You need to sign in or sign up before continuing." message is showing rather than confirmation message why?
[10:07:42] DaniG2k_: cheeti: you'd have to show us your code for us to know what the problem is
[10:08:51] denym_: is there any tool which can illustrate the db schema bases on schema.rb or out of a postgres db?
[10:09:05] elaptics: cheeti: sounds like you've got a before filter on the controller action
[10:09:27] elaptics: cheeti: I guess you should take that off the action that's dealing with the confirmation step
[10:09:59] elaptics: denym_: illustrate how? is \d in a database console not enough?
[10:11:36] denym_: just out of curiosity... like in rubymine where o
[10:12:36] universa1: denym_: railroads iirc
[10:12:48] cheeti: <elaptics> this is my sign in page code <div class="login con-box"> <div class="row-fluid"> <% if notice %> <div class="alert-enprobe pagination-centered"> <button type="button" class="close" data-dismiss="alert">&times;</button><%= notice %> </div> <% end %> <% if alert %> <div class="alert-enprobe pagination-centered"> <button type="button" class="close" data-dismiss="alert">&times;</button><%= a
[10:13:06] helpa: cheeti: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[10:13:06] universa1: cheeti: !gist
[10:13:37] denym_: like this http://hemju.com/wp-content/uploads/2010/10/rubymine-diagram1.png
[10:13:37] denym_: sometimes when it gets more complex i want such a thing to break my mind about it
[10:13:57] universa1: denym_: http://rubyforge.org/projects/railroad
[10:14:21] universa1: denym_: https://github.com/preston/railroady
[10:14:58] cheeti: <DaniG2k_> this is may code in devise session
[10:15:14] cheeti: <DaniG2k_> <div class="login con-box"> <div class="row-fluid"> <% if notice %> <div class="alert-enprobe pagination-centered"> <button type="button" class="close" data-dismiss="alert">&times;</button><%= notice %> </div> <% end %> <% if alert %> <div class="alert-enprobe pagination-centered"> <button type="button" class="close" data-dismiss="alert">&times;</button><%= alert %> </div> <% end %
[10:15:39] denym_: universal: thank you
[10:15:39] universa1: cheeti: put your code in a gist / paste and give us the link to it.
[10:17:58] cheeti: <universa1> https://gist.github.com/mamatharao/6682828
[10:18:51] universa1: cheeti: sign in? sign up? what happens in the log?
[10:21:14] cheeti: <universa1> after sign up it will redirect to signin page with devise.en.yml message "You need to sign in or sign up before continuing." but i want show devise.en.yml "A message with a confirmation link has been sent to your email address. Please open the link to activate your account." message
[10:22:46] universa1: cheeti: gtg to lunch, but have you configured your model to require confirmable?
[10:23:34] cheeti: <universa1> yes i did that. confirmation mail also sending
[10:24:25] denym_: universal: ok they are not that pretty, but doing their work :)
[10:29:46] tobago: when I do include *.js.coffee. Where is it rendered in the html? I can't find it in the javascript tags.
[10:31:08] ljarvis: tobago: if you're using a manifest it wont be rendered in the html
[10:32:04] tobago: ljarvis, o.k. but a simple alert in the coffee script works anyway. how?
[10:32:33] ljarvis: tobago: check the source of your application.js, that manifest loads them all
[10:33:24] tobago: ljarvis, so when I do firebug the html, the test alert js should be in application.js?
[10:33:45] ljarvis: tobago: correct
[10:35:51] Cork: could anyone explain what references adds that joins doesn't do?
[10:36:16] Cork: (active record rails 4)
[10:36:27] ljarvis: Cork: what?
[10:37:07] Cork: ljarvis: i get a deprication warning when i use a joins(:table).where()
[10:37:24] Cork: ljarvis: it tells me to do joins(:table).where().references(:table(
[10:40:46] cheeti: after sign up it will redirect to signin page with devise.en.yml message "You need to sign in or sign up before continuing." but i want show devise.en.yml "A message with a confirmation link has been sent to your email address. Please open the link to activate your account." message. i was configured confirmable in user model.
[10:43:10] tobago: ljarvis, mmh. I checked the js of application.js but didn't find any alert, though it alerts.
[10:51:15] cheeti: hi after sign up it will redirect to signin page with devise.en.yml message "You need to sign in or sign up before continuing." but i want show devise.en.yml "A message with a confirmation link has been sent to your email address. Please open the link to activate your account." message. i was configured confirmable in user model.
[10:54:22] dangerousdave: just mapped the following for devise to get rid of the /users in the url https://gist.github.com/deathwishdave/21238fc8e33354cefc89. Works, but problem is new_user_session_path still links to the /users path.
[10:58:21] cheeti: after sign up it will redirect to signin page with devise.en.yml message "You need to sign in or sign up before continuing." but i want show devise.en.yml "A message with a confirmation link has been sent to your email address. Please open the link to activate your account." message. i was configured confirmable in user model.
[11:04:24] msimkins: cheeti: I assume you have actually configured the confirmable module in your devise.yml, repeating your question multiple times will not necessarily get you a faster answer
[11:04:54] msimkins: cheeti !gist your devise initialiser
[11:04:59] linusoleander: Does anyone know how to access type_id on line 13?
[11:04:59] linusoleander: https://gist.github.com/oleander/76536c2fdea799eaa429
[11:07:14] cheeti: <msimkins> i activated confirmable in user model. it's sending confirmation message also.
[11:07:21] greengriminal: The include matcher for rspec states: to specify that a collection includes one or more expected objects. In saying this. I have created a two test example one that creates an object without a Filter and one with a filter: https://gist.github.com/anonymous/6683236#file-rules_controller_spec-rb-L31
[11:08:09] greengriminal: So in saying that can someone confirm if that set up looks correct. The purpose of this test is to just check if the filter object that I create from my "valid_filter_attributes" is included.
[11:08:34] msimkins: cheeti: so it sends the confirmation email - just does not give you the right flash message ?
[11:08:47] cheeti: yes right
[11:09:02] cheeti: <msimkins> yes right
[11:09:11] msimkins: cheeti: can you gist your initializer
[11:12:06] cheeti: <msimkins> https://gist.github.com/mamatharao/6683276
[11:18:44] msimkins: cheeti: Hmm, that looks OK, (although I have not used Devise in a while), my only thought is you are using cancan or something to Authorise, or you have a before_filter :authenticate_user!, and therefore when it tries to redirect with the initial flash, that gets in the way, and your flash is being overwritten with the fact that you must sign in
[11:18:50] cheeti: <msimkins> is there any configurations in divise initializer
[11:19:35] apeiros: I need a bind variable in an order clause
[11:20:03] apeiros: sadly, AR doesn't seem to provide bind-vars there. what's the proper way to do it instead?
[11:20:05] msimkins: cheeti: Configuration for what ?
[11:20:50] apeiros: connection.quote? e.g. .order("COALESCE(col, #{connection.quote(val)}) DESC") ?
[11:21:30] cheeti: <msimkins> to dosplay confirmation message. https://gist.github.com/mamatharao/6683276
[11:22:47] tobago: ljarvis, I found my failure. javascript_include_tag('admin/base') put the js into the body tag somewhere. how to make rails put it into head tag?
[11:23:13] msimkins: cheeti: Don not believe there is, it should be part of the Gem Code
[11:23:39] tobago: best would be to put the coffeescript into application.js
[11:24:02] tobago: but I don't know how to make rails work like this.
[11:24:45] DaniG2k_: anyone here know how I can localize Devise's views?
[11:25:00] DaniG2k_: so that i can have translations for Sign up/Login/Logout in other languages
[11:25:29] nettoweb: guys, I created a scaffold for "Visits" so the users can suggest date for visits and so on. But now I need an another method (as admin) to change the Visit to set to "Scheduled" or "rescheduled". I'm a bit confused if I use the same controller to do this
[11:25:39] msimkins: DaniG2k_: Copy them to the app code (think its rails g devise:views), then customeize as needed
[11:26:11] DaniG2k_: msimkins: i have the views already
[11:26:22] DaniG2k_: msimkins: i need to know how to localize the page/action names
[11:27:11] msimkins: DaniG2k_: Not sure you can change the routes, but changing the names should be as any I18N effort
[11:27:30] dangerousdave: just mapped the following for devise to get rid of the /users in the url https://gist.github.com/deathwishdave/21238fc8e33354cefc89. Works, but problem is new_user_session_path still links to the /users path.
[11:28:14] maoko: How can i do uppercase text transform in prawn?)
[11:28:43] msimkins: DaniG2k_: If you are Using Devise V2 or Higher, look at devise-i18n-views gem
[11:29:13] dangerousdave: nettoweb: use edit action on same controller
[11:29:17] tobago: how to add "javascripts/admin/base.js.coffee" to application.js in the view "admin/reasons/index.html.erb"?
[11:29:22] greengriminal: Any ideas why this test is not working: https://gist.github.com/anonymous/6683426#file-spec-rb-L31. In my first test I check if a "rule" is created with a filter. That passes. Then the second test on line31 i want to create a rule with a filter. However I tried to use the include matcher. Any ideas?
[11:30:06] tobago: where Admin/ReasonsController is derived from Admin/BaseController
[11:33:39] mikecmpbll: tobago: assets don't work like that. if application.js was dynamic then it would never be cached.
[11:33:53] nettoweb: dangerousdave: good, I'm doing this but as admin. but now I tried to chech if any attr was changes in this update method so I use resource.attr_name? but with no success
[11:33:56] mikecmpbll: tobago: you just need to put javascript_include_tag on the page you want that JS.
[11:34:02] nettoweb: dangerousdave: it must be in the model, right?
[11:35:08] dangerousdave: nettoweb: no success?
[11:35:36] tobago: mikecmpbll, so maybe somehting like yielding javascripts to head from that specific view would be the way to go?
[11:36:01] mikecmpbll: use content_for :head
[11:37:17] mikecmpbll: and you can create a layout for the admin controller too, which includes the javascript include declaration.
[11:37:22] nettoweb: dangerousdave: retorn false for me
[11:38:00] nettoweb: dangerousdave: always return false for me
[11:38:10] nettoweb: even if changed the value
[11:39:20] nettoweb: dangerousdave: https://gist.github.com/osnysantos/f683ef87466d67e4f273
[11:39:28] dangerousdave: nettoweb: odd, I have to go pick my son up from school now sorry. Would suggest debugging it, sounds like your doing right thing.
[11:39:44] msimkins: Kx8dcDml5129
[11:39:47] mikecmpbll: nettoweb: show the visit_params, too.
[11:39:50] nettoweb: dangerousdave: ok, hank you
[11:40:21] nettoweb: mikecmpbll: https://gist.github.com/osnysantos/f683ef87466d67e4f273
[11:40:35] DaniG2k_: does anyone know how i can add bootstrap styling to devise's devise_error_messages! method?
[11:40:45] tobago: mikecmpbll, thanks. the good old way still works.
[11:41:14] mikecmpbll: nettoweb: then I assume your parameters aren't correct, post the contents of params first thing in your create action
[11:41:21] mikecmpbll: update, i mean.
[11:42:03] mikecmpbll: DaniG2k_: google.
[11:42:57] nettoweb: mikecmpbll: visit_params = {"data"=>"qqw", "observacao"=>"qwqw", "data_agendada"=>"sss"}
[11:43:19] nettoweb: mikecmpbll: I'm using puts to debug this, is there a better way to do this?
[11:43:37] mikecmpbll: nettoweb: that's fine. you can use raise if you want to halt operation.
[11:43:46] mikecmpbll: causes an exception.
[11:44:14] mikecmpbll: are you sure the data_agendada value isn't already "sss" for @visit?
[11:47:34] nettoweb: mikecmpbll: I'll take a look more closely at this problem
[11:47:41] mikecmpbll: good idea :).
[11:48:24] artmann: Hi, Iäm building an interfarce for another application and it's account table has a field named "type" but it seems to be reserved in rails , any workarounds?
[11:48:56] nettoweb: mikecmpbll: take a look at outpup please: https://gist.github.com/osnysantos/f683ef87466d67e4f273
[11:49:58] nettoweb: I'm using rails 4
[11:51:43] nettoweb: mikecmpbll: but htanks, i have to go now...
[11:54:54] mikecmpbll: he's probably using protected_attributes and strong_paramters like that guy yesterday. /shrugs
[11:56:11] cheeti: after sign up it will redirect to signin page with devise.en.yml message "You need to sign in or sign up before continuing." but i want show devise.en.yml "A message with a confirmation link has been sent to your email address. Please open the link to activate your account." message. i was configured confirmable in user model.
[12:05:26] Cork: could anyone explain what references adds that joins doesn't do?
[12:05:30] Cork: (active record rails 4)
[12:05:32] msimkins: artmann: Yes type is reserved for STI, You need to rename it to account_type (or something)
[12:06:11] artmann: msimkins: I can't rename the database as it's created and used by another application. Can I somehow change it in the model?
[12:10:47] artmann: msimkins: https://github.com/rails/rails/pull/7417#issuecomment-7931244 seems to solve it
[12:10:58] msimkins: artmann: Yes you can, you need to create (IIRC) getter/setter methods that effectively alias out the field
[12:11:44] DefV: I have a problem with before_destroy & nested_attributes: https://gist.github.com/DefV/6683824
[12:13:00] msimkins: artmann: like: def account_type<cr>self[:type]<cr>end, and def_account_type=(s)<cr> self[:type] = s<cr>end
[12:13:22] msimkins: artmann: <in the model> (I cant get to gist for some reason right now)
[12:14:25] artmann: msimkins: https://gist.github.com/Artmann/844b1ac746358b53209d Works for me
[12:15:25] mikecmpbll: Cork: in a migration?
[12:15:30] msimkins: Yay - Gist back :)
[12:15:43] Cork: mikecmpbll: no in a normal selector
[12:15:46] msimkins: artmann: Yes, that will work as long as you never want to access the type column
[12:15:52] Cork: .join(:table).where()
[12:16:05] Cork: what they want is .join(:table).where().references(:table)
[12:16:09] Cork: and i don't really see why...
[12:16:24] Cork: it warns in the log if you don't
[12:16:36] mikecmpbll: oh. i'm not familiar with it. /dives out
[12:17:20] mikecmpbll: Cork: http://blog.remarkablelabs.com/2012/12/what-s-new-in-active-record-rails-4-countdown-to-2013 some notes about it there
[12:21:50] Cork: mikecmpbll: thx, doesn't answers my question though...
[12:22:18] mikecmpbll: Cork: yeah, it's not particularly clear is it
[12:22:48] mikecmpbll: are you getting the deprecation warning when not using .includes() ? :/
[12:23:00] Cork: mikecmpbll: i'm not using include
[12:23:22] Cork: cause as far as i remember includes was if you wanted the data in the record, not if you wanted it for the select
[12:23:26] Cork: then you used joins
[12:23:36] Cork: now i don't really see the difference between joins and includes...
[12:23:51] mikecmpbll: includes will do a LEFT OUTER JOIN whereas joins will do an INNER JOIN
[12:24:09] mikecmpbll: i.e. User.joins(:posts) will only bring back users with at least 1 post
[12:24:20] mikecmpbll: User.incudes(:posts) will bring back all users, regardless.
[12:25:06] malusalexandru: hi. I've got an issue with my datePicker, please check out this link: https://gist.github.com/maimutza/6683983
[12:25:10] Cork: heh wonder when that changed >_>
[12:25:13] mikecmpbll: However, includes won't always do a left outer join, in my example above it will run two queries.
[12:25:23] mikecmpbll: Cork: joins and includes have always behaved that way.
[12:25:25] Cork: been fiddling with rails selectors for too long :)
[12:26:04] Cork: mikecmpbll: there was joins and (i think includes) back in rails 2.1 that didn't do outer
[12:26:23] mikecmpbll: joins won't ever do outer.
[12:26:25] Cork: and one made it possible to use the table in where and the other didn't
[12:26:55] Cork: (it became separate select queries)
[12:26:55] mikecmpbll: ah okay, that may have changed, not sure. nowadays if you use includes table in where, it will do an outer join
[12:27:08] mikecmpbll: if you don't use it in the condition, it will do two separate queries.
[12:27:12] Cork: ok, that clears up a few things for me
[12:27:17] mikecmpbll: references forces it to do it as an outer join
[12:27:28] Cork: ok, that makes sense
[12:27:30] mikecmpbll: i don't really understand what the point of that is, i guess it makes it more explicit.
[12:27:33] Cork: thx for clearing it up
[12:27:57] Cork: mikecmpbll: from the warning it is so rails don't have to parse the string to find what tables was used in the select
[12:28:46] Cork: mikecmpbll: http://pastebin.com/BcTTS82f
[12:28:47] mikecmpbll: ah, i guess there were some bugs with it in rails 3? never noticed.
[12:29:51] Cork: though my legacy knowledge of joins made me confused about that message :)
[12:30:18] mikecmpbll: i still don't get why it was showing for you using .joins() ..
[12:30:50] Cork: well i guess it still parses the string if references isn't used
[12:31:00] mikecmpbll: what for? it's always joining the table.
[12:31:05] Cork: ya... donno
[12:31:11] greengriminal: I am doing the following: render json: @rule, include: :filters and I want to add another association. Can I just do: render json: @rule, include: {:filters, :criterium}
[12:31:13] mikecmpbll: unless they changed the implementation of joins in rails 4
[12:31:32] greengriminal: I know this won't work but what is the correct to do this
[12:32:01] Cork: greengriminal: i THINK [:filters, criterium] should work
[12:32:09] Cork: but don't quote me on that ;)
[12:32:22] mikecmpbll: yeah, you wouldn't use a hash because that's not a valid hash syntax.
[12:35:03] Macaveli: I have something strange! I have a popup that asks for the users login and password when the user logs in correctly the popup is gone and the users personal info is shown! But my selectboxes are empty. And the HTML code is correct and it works in on IE/Chrome but not in Firefox any ideas?
[12:35:55] malusalexandru: hi. I've got an issue with my datePicker, please check out this link: https://gist.github.com/maimutza/6683983
[12:36:19] malusalexandru: should output a text field, when clicked a calendar would popup
[12:36:25] malusalexandru: yet nothing happens when clicked
[12:37:45] universa1: malusalexandru: errors in the browser console?
[12:38:01] universa1: does the text field actually have the approriate class in the generated html?
[12:38:50] malusalexandru: <input id="birth_date" class="datepicker" type="text" value="" name="birth_date"></input>
[12:39:19] universa1: malusalexandru: so open up the browser console and see what $(".datepicker") returns
[12:40:05] universa1: malusalexandru: and also if: $(".datepicker" ).datepicker({dateFormat: "yy/mm/dd"}); raises an error
[12:41:06] malusalexandru: sorry universal, how do I see that? a bit new to inspecting elements in ubuntu firefox
[12:44:23] Cork: another interesting question
[12:44:56] Cork: how do you make rails handle optional text fields
[12:45:11] Cork: as rails now uses strict mode for the database, and text fields can't have default values
[12:45:23] Cork: it becomes kinda impossible to have optional text fields
[12:45:55] universa1: malusalexandru: no clue about firefox, i use chrome, because the built in dev tools are quite good
[12:46:07] malusalexandru: switching as we speak
[12:46:52] msimkins: Cork: Why cant text fields have default values ?
[12:49:19] geolin: i am using rails4,i have stucked with nested attributes
[12:50:32] Cork: msimkins: mysql strict doens't allow it
[12:51:25] msimkins: Cork: Ahh, that would explain it, I gave up on MySQL a long time ago for a proper database :)
[12:53:28] greengriminal: Trying to write a simple destroy spec test to respond_to json: https://gist.github.com/anonymous/6684262 I think i've gone wrong somewhere
[12:53:30] mikecmpbll: Cork: not sure I know what you mean regards defaults
[12:53:55] liquid-silence: can anyone recommend a postgres tool for mac?
[12:54:08] Cork: mikecmpbll: i get funny errors when i run create! :)
[12:54:25] mikecmpbll: Cork: default where?
[12:55:01] Cork: mikecmpbll: in the schema
[12:55:04] greengriminal: Seem to be getting a: ActionController::UnknownFormat ActionController::UnknownFormat when I have specified the format ;/
[12:56:25] pskrz: any good resources for self-referential, many-to-many relationships with a CRUD interface?
[12:56:30] mikecmpbll: Cork: what error? :/
[12:56:52] Cork: mikecmpbll: sql errors
[12:57:16] Cork: mikecmpbll: Mysql2::Error: Field 'notes' doesn't have a default value
[12:57:31] Cork: "ya, i know, cause i can't add one"
[12:57:45] msimkins: liquid-silence: for what ?
[12:57:45] mikecmpbll: Cork: i think it'll do that if you have a not null constraint without a default?
[12:57:51] cwin: I'm struggling with a TypeError, and wondering if anyone could help me with this: http://stackoverflow.com/questions/18972023/typeerror-cant-convert-array-into-hash
[12:57:57] mikecmpbll: Cork: and you don't pass a value
[12:57:57] liquid-silence: msimkins running queries I presume/.
[12:58:02] Cork: mikecmpbll: yes, and like i said, it can't have a default
[12:58:11] mikecmpbll: Cork: why can't it?
[12:58:15] geolin: how to make the nested attributes work??
[12:58:15] msimkins: liquid-silence: pgAdmin3
[12:58:36] Cork: mikecmpbll: cause it is a text field
[12:58:51] msimkins: liquid-silence: I use psql to actually run queries), but thats command line
[12:59:02] liquid-silence: msimkins currently using that too
[12:59:15] mikecmpbll: Cork: don't mind me, i'm learning all sorts about rails 4 today ;D
[12:59:35] Cork: mikecmpbll: this is mysql not rails technically
[12:59:55] mikecmpbll: yeah but i think the strict change is rails 4, no?
[13:00:01] Cork: mikecmpbll: yes
[13:00:12] liquid-silence: msimkins mind om?
[13:00:16] liquid-silence: mind a pm evebn
[13:00:17] Cork: (though that's a good thing)
[13:00:20] geolin: in nested attributes data is not saved
[13:00:23] mikecmpbll: Cork: guess you'll have to populate the "default" value in a before_filter
[13:00:32] msimkins: liquid-silence: Feel free
[13:00:43] Cork: mikecmpbll: ya, after_initialize looks like how we will have to do it
[13:00:51] Cork: mikecmpbll: we moved away from that in 2.3 though :)
[13:00:58] Cork: feels kinda broken to have to add it again XD
[13:01:18] Cork: cause before 2.3 rails didn't use the default value from the schema
[13:01:27] Cork: so you had to use initialize
[13:01:52] Niels__: can somebody confirm to me, that this is in fact built in rails? http://da-dk.sennheiser.com/
[13:02:03] Cork: 3 remove initialize and added after_initalize
[13:03:12] greengriminal: In actual fact I am trying to create a spec test that deletes all associated records when a particular rule is deleted would anyone agree that I am heading in the right direction: https://gist.github.com/anonymous/6684405
[13:03:16] rvanlieshout: Niels__: the server responds with a loaded module passenger and it kinda looks like rails
[13:03:50] jarr0dsz: hi guys i have setup a custom git server but how to use those inside the Gemfile ?
[13:04:01] Niels__: rvanlieshout: + the js has gmaps4rails which i guess is a gem
[13:04:14] jarr0dsz: normally you do :github => "..." is there some special param for custom hosted gems?
[13:04:33] rvanlieshout: Niels__: but you would only know for sure if you ask them
[13:04:52] rabbi1: hi, new to ROR, need a little help on devlse gem….
[13:06:15] rvanlieshout: rabbi1: just ask your question in here
[13:07:16] amortimer: @greengriminal Use http://builtwith.com to check.
[13:07:52] greengriminal: amortimer: What is this. I don't need this ;/
[13:08:08] rabbi1: devise has generated all new files like, new user etc etc…. i have login form and sign up form on the home page
[13:08:35] amortimer: @greengriminal sorry wrong user.
[13:08:45] rabbi1: how can i transfer it to home page, will partials help me ? if i do so i need to change the file name else where ?
[13:08:57] amortimer: @Niels__ Use http://builtwith.com to check
[13:09:53] malusalexandru: hey universa1 sorry it took so long
[13:10:09] malusalexandru: when the chromium got installed, it installed without an address bar, don't know why
[13:10:22] malusalexandru: so reinstalled and now works fine
[13:10:37] rabbi1: malusalexandru: better to use google chrome
[13:10:40] malusalexandru: indeed I have 26 errors and 6 warning on my console
[13:11:36] malusalexandru: a lot of Cannot call sendrequest and onrequest on undefined
[13:11:43] geolin: i have the problem with nested attributes
[13:12:54] Niels__: amortimer: nice site, thanks.
[13:13:18] amortimer: @Niels__ You're welcome.
[13:14:59] rabbi1: amortimer: how can i customize devise to display signup and login for in the home page ?
[13:15:11] Macaveli: Anyone have experience with select boxes not showing as selected after Popup http://stackoverflow.com/questions/18982191/firefox-not-showing-select-box-correctly-after-js-popup
[13:15:21] malusalexandru: to see the value only for that variable
[13:15:25] malusalexandru: where should i go?
[13:15:35] rabbi1: amortimer: how can i customize devise to display signup and login form in the home page ? using devise
[13:17:27] amortimer: @rabbi1 I'm not specifically sure, but you should probably get devise worked into your site before you start writing views for it.
[13:20:48] rabbi1: amortimer: yeap, devise is working and doing great
[13:21:03] rabbi1: https://github.com/plataformatec/devise/wiki/How-To:-Change-the-default-sign_in-and-sign_out-routes
[13:21:20] rabbi1: where can i add those change route methods ?
[13:22:33] sevenseacat: exactly where the page tells you to
[13:22:56] sevenseacat: did you read the link you gave us?
[13:23:19] rabbi1: amortimer: got it …. wow
[13:24:00] amortimer: @rabbi1 I'd head over to the devise repo on github and find out what it recommends you do. Also checkout RailsApps/rails3-bootstrap-devise-cancan repo. Those should have what you're looking for.
[13:24:08] rabbi1: sevenseacat: yeah, i was just checking on what he meant change on route… expecting a separate route file ;)
[13:24:50] rabbi1: amortimer: yeap, it's done i guess, as of now its getting routed to login… will have to check to put both on home page… brb
[13:24:58] rabbi1: thanks for the time
[13:28:00] rabbi1: devise_for :users, :path => '', :path_names => {:sign_in => '', :sign_out => '', :sign_up => ''} this will route those two forms in home page…. but it's actually routing only the 'sing_in' not the others ….. what am i missing here ?
[13:28:11] malusalexandru: hi. I've got an issue with my datePicker, please check out this link: https://gist.github.com/maimutza/6683983
[13:28:22] malusalexandru: should output a text field, when clicked a calendar would popup, yet nothing happens
[13:28:35] malusalexandru: the command $(".datepicker") in debug returns null
[13:29:45] rvanlieshout: malusalexandru: i guess you got a good starting point over there
[13:29:54] rvanlieshout: have you verified there actually is an element with class datepicker?
[13:30:50] rabbi1: malusalexandru: it's either jquery not loaded or your text filed doesn't have class 'datepicker' can't think of anything else….
[13:31:35] malusalexandru: as a mention, in the Error section
[13:31:41] malusalexandru: it gives me 26 errors and 6 warning
[13:31:53] malusalexandru: "Cannot call method sendRequest"
[13:31:56] scyllinice: You should fix those
[13:32:04] malusalexandru: "Cannot read property Onrequest"
[13:32:08] scyllinice: JS errors stop other JS from running
[13:33:08] malusalexandru: error sources are in {VM] binding
[13:33:22] malusalexandru: variable binding?
[13:33:28] malusalexandru: or something similar?
[13:35:57] rvanlieshout: malusalexandru: i would start by looking for the actual problem
[13:42:52] AntelopeSalad: if i overwrite to_param so i output an id-slug do i need to index the slug field?
[13:42:59] malusalexandru: rvanlieshout: kept trying to do that for some hours ^_^
[13:43:14] rvanlieshout: malusalexandru: you verified there is an element with that class?
[13:43:24] rvanlieshout: cause you just told us $(".datepicker") returns nothing
[13:44:08] malusalexandru: should be this one declared in the view
[13:44:08] malusalexandru: <%= text_field_tag :birth_date, '', :class => "datepicker" %>
[13:44:23] rvanlieshout: malusalexandru: you cannot use 'should' when debugging
[13:44:27] rvanlieshout: verify that the html source contains that
[13:45:56] malusalexandru: if i double click on the text field, choose inspect element
[13:46:00] malusalexandru: i get this: <input class="datepicker" id="birth_date" name="birth_date" type="text" value="">
[13:46:57] rvanlieshout: ok.. then it's kinda strange why a $('.datepicker') returns nothing
[13:47:08] rvanlieshout: what other kind of js errors are shown?
[13:52:57] malusalexandru: Uncaught TypeError: Cannot read property 'onRequest' of undefined include.postload.js:473 Uncaught TypeError: Cannot call method 'sendRequest' of undefined
[13:53:56] rvanlieshout: strange. $(".datepicker") returns an empty array or something else?
[13:54:52] rvanlieshout: ah.. then that's wrong to start with
[13:55:05] rvanlieshout: then i guess you should fix the two errors
[13:55:08] rvanlieshout: starting with the first
[13:55:27] rvanlieshout: it's expecting a onRequest property on something, but that something is not given
[13:55:30] rvanlieshout: what is something there?
[13:56:08] rvanlieshout: hmm.. gotta go.. hope you find something there
[13:56:27] malusalexandru: see ya, thanks for trying
[13:56:43] rvanlieshout: back tomorrow
[13:57:27] clocKwize: anyone here good with RabbitMQ/Bunny? I'm trying to stop my consumer gobbling all the jobs, I've got my consumer with ack: true, and after I process a job I call chnanel.acknowledge but if I just put a raise "BAM!" in the on_delivery, all the jobs still disappear from the queue
[14:07:15] Flashmasterson: i downloaded command line tools, what do i do next to properly install rails?
[14:07:21] Flashmasterson: i have a mac btw
[14:07:46] zeel: Flashmasterson: you are on about command line tools for xcode ?
[14:08:45] Flashmasterson: zeel: yeah but the goal is to use it to make installing rails safer/easier
[14:09:05] zeel: install rbenv && ruby-build
[14:09:11] zeel: then gem install rails
[14:10:35] Flashmasterson: ok so enter the command 'install rbenv' into terminal first?
[14:11:01] zeel: install homebrew first
[14:11:34] zeel: Flashmasterson, enter this into your terminal:
[14:11:35] zeel: ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
[14:11:50] zeel: then do `brew install rbenv`
[14:12:12] ichilton: Is there a way of seeing memory usage of a rails process? - and can it be broken down into what's causing that? (gem's presumably)
[14:15:33] Flashmasterson: hmm if that gist is what is supposed to happen afer 'ruby -e "$(curl -fsSL' then uh oh
[14:17:10] Flashmasterson: zeel: the terminal just doesn't seem to be doing anything
[14:17:19] vasanth: **And others with old
[14:17:59] zeel: Flashmasterson: you need to install homebrew:- http://brew.sh/
[14:19:11] Flashmasterson: zeel: i just did yesterday
[14:19:30] zeel: then run `brew update`
[14:19:44] zeel: then `brew install rbenv` then `brew install ruby-build`
[14:20:44] zeel: Flashmasterson: https://github.com/sstephenson/rbenv#homebrew-on-mac-os-x
[14:21:26] Flashmasterson: zeel: the terminal isn't responding
[14:21:59] zeel: it probably takes a couple of minutes to install
[14:22:17] HashNuke: hey people ~!
[14:22:43] momomomomo: My turn to ask a question for once :) I'm having some issues getting nginx to recognize my upstream socket in a Unicorn/Nginx config. Gist of the sites-available file here along with the error: https://gist.github.com/momer/6685272
[14:23:05] momomomomo: The .sock file exists, and matches the unicorn.rb sock file string
[14:23:05] Flashmasterson: zeel: ok, is it bad for the computer to Ctrl+C?
[14:23:34] zeel: you can always rerun the command
[14:23:42] zeel: depends on what errors you are getting
[14:23:54] HashNuke: I have a few PDF generating actions. And sometimes the link changes and anyone who's bookmarked an old link ends up getting a "Template missing" error. It looks for an application.pdf layout to render a 404. Is there a way to handle this with a html 404 response?
[14:24:16] ner0x: Say I have a model called "Gender" where that gender can be Male, or Female. And each Male/Female can either be Young or Old... how would I structure this? I was thinking STI seems the best fit but OldMale OldFemale YoungMale YoungFemale just seems like more than I need? Any suggestions are welcome. :)
[14:24:55] interactionjaxsn: ner0x: what are the other associations on this?
[14:25:41] ner0x: interactionjaxsn: Male/Female have different associations, young/old have limits such as "amount of pushups" etc.
[14:27:18] interactionjaxsn: ner0x: I'm thinking a person has a gender flag and an age. i don't understand the need to get that granular but i don't have a total understanding of what you are trying to accomplish
[14:27:37] momomomomo: oh man, I'm a victim of a typo
[14:28:31] foucist: ner0x: STI would be OldGender, YoungGender
[14:28:53] QaDeS: hiyas. devise is ending up in an infinite loop between my site's callback and the facebook login window, and i can't figure out, why. the browser gets redirected to facebook although i'm redirecting to a completely different URL inside my website. can anybody help me debug this issue?
[14:29:06] foucist: ner0x: just add a field for age, throw young or old in that.. operate on that
[14:29:31] Flashmasterson: zeel: ok it finally just said "command not found"
[14:29:38] ReBa_: I have a problem testing: https://gist.github.com/RemiSpot/6685615; I thought doing def "add_product_price_to_line_item" would give me the line_item.product_price not to be nil, but it still is... Can someone help me with this?
[14:29:48] zeel: Flashmasterson: for which command?
[14:29:57] helpa: QaDeS: 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.
[14:29:57] universa1: QaDeS: !code
[14:30:02] Flashmasterson: zeel: update brew
[14:30:19] zeel: no you need to do `brew update`
[14:30:32] Flashmasterson: zeel: crap sorry
[14:30:38] ner0x: interactionjaxsn: foucist: It's really a test of limits based on what type of account a person has. Account, we'll say "Free" and "Pay" for this one. They dictate file upload limits. And there are three diferent types of accounts.
[14:30:49] universa1: ReBa_: no failing code, no code showing where you use it.
[14:31:05] universa1: ReBa_: you probably want a save somewhere in there.
[14:31:18] interactionjaxsn: ner0x: it's just that the term old is so ambiguous.
[14:31:33] et-nid: Does any one know of a good free text mining framework
[14:31:36] ner0x: interactionjaxsn: Well it wouldn't be "old" I was just using that as an example.
[14:31:57] ReBa_: universa1: Sorry, I've updated the code to show where the error is made
[14:34:14] ReBa_: Now it is perfectly updated: I should have the 'product_price' attribute to be a price, but it is nil...
[14:36:35] crunch-choco: i'm on heroku now, and I see "mailgun" addon to send emails. Can't we rely on the net/smtp gem to send emails?
[14:43:57] svector: Hello! how do I tell devise to save the username field on the user model? I have changed the view to add a text field but it's not saved.
[14:44:17] svector: i'm guessing the `devise_parameter_sanitizer.sanitize(:sign_up)` is filtering it out... if so, how do I add the field back?
[14:45:40] AntelopeSalad: does anyone know why ActionController::UnknownFormat gets thrown when trying to return json? i'm trying to return json for 1 specific action -- code example: http://pastie.org/8351865
[14:47:54] olivier_bK: i dont no sorry
[14:48:56] dangerousdave: can i get some help please? http://stackoverflow.com/questions/18983402/removing-user-from-a-devise-url
[14:49:34] dangerousdave: svector: this shows you how http://railscasts.com/episodes/209-devise-revised
[14:55:42] denym_: How to use hstore on the example of a shopping list? column :article {article1 : Pepper, article2 : Salt, ...} and column :price {article1 : 1, article2 : 2,5, .... } ?
[15:01:27] timhansen: morning, all
[15:04:20] [flip]: h, how to deactive caching for an ActiveRecord model when using the static all method? i'm playing with rails 4' live streaming and need to get the current data from the database...
[15:06:08] [flip]: ah.. clear_query_cache()
[15:06:16] timhansen: still struggling with an issue where i can't save a record as it's rejecting the has_one association. https://gist.github.com/willc0de4food/395851d07045c9614043
[15:07:49] timhansen: i've tried modifying the code to this: https://gist.github.com/willc0de4food/2c5ad1624790e3b68227 in which the params still get rejected, as it says priority & status are not permitted
[15:08:02] timhansen: which baffles me, because priority & status are in the params.permit
[15:08:15] davidcelis: timhansen: you're not accepting any sort of nested attributes
[15:08:29] davidcelis: pretty much any params from forms come through as strings
[15:08:50] davidcelis: read up on nested attributes; that should help
[15:11:22] ner0x: https://gist.github.com/fswitalski/6686239 I'm trying to figure out how to structure my application. Any suggestions welcome.
[15:11:27] timhansen: davidcelis: but i'm not creating a priority or status through the ticket, i simply want to associate a pre-created priority / status with a ticket
[15:11:31] timhansen: davidcelis: does that matter?
[15:12:51] timhansen: which makes me think i may be doing the relationship wrong
[15:14:25] davidcelis: priority_id ?
[15:14:55] davidcelis: you're going to get params[:ticket][:priority] so you're assigning ticket.priority
[15:15:00] davidcelis: you want to set ticket.priority_id
[15:18:00] timhansen: yea, i need to change my relationships
[15:18:09] timhansen: and re-do my db tables
[15:18:46] ner0x: I didn't want to use state-machine for something as small as pay vs free accounts.
[15:19:32] davidcelis: timhansen: dude what?
[15:19:38] davidcelis: no you don't, are you even listening to me?
[15:20:10] ner0x: I think including a module that has all the limits is a better way to do it rather than the STI. include MyApp::Limits so that it reads a "type" column and returns the values. :)
[15:23:52] dllama: how do u console in production mode?
[15:24:08] timhansen: ticket.priority_id gets an "undefined method error"
[15:24:16] timhansen: davidcelis: ^
[15:24:18] pskrz: dllama: bundle exec rails console production
[15:24:33] bratsche: or export RAILS_ENV=production
[15:24:43] dllama: RAILS_ENV=rpdocution failed, said bundler couldn't find the command
[15:25:02] dllama: pskrz, that worked thanks!
[15:25:05] pontiki: ACTION would not to the export -- unless you are *sure* to remember it's set in that shell
[15:25:09] bratsche: RAILS_ENV=production bundle exec rails c
[15:25:48] pontiki: dllama: if bundle couldn't find the command, it had nothing to do with setting RAILS_ENV in front of it
[15:25:48] dllama: bratsche, yea that did the trick too, i had it backwards calling bundle exec first
[15:25:50] dllama: thanks guys!`
[15:26:17] davidcelis: timhansen: actually why do you have a whole model for Priority anyway
[15:26:17] dllama: pontiki, both methods mentioned here have worked, i just had the command backwards.
[15:26:28] davidcelis: timhansen: shouldnt that just be a single field for a priority level
[15:26:37] pontiki: shell commands are always: [env] cmd [options and arguments]
[15:27:01] timhansen: davidcelis: i want the user to be able to define their own priority levels
[15:27:10] dllama: thanks pontiki, i'll write that down :)
[15:27:12] timhansen: and have them available across the system
[15:32:25] DonovanYoung: hmm... am I the only Rails dev that prefers minitest over rspec? I feel very much in the minority out there.
[15:32:42] pontiki: yup, you *are* the only one
[15:32:49] DonovanYoung: even those other minitest lovers, seem to prefer the spec tests over unit tests.
[15:32:51] svector: dangerousdave, thanks! the solution was actually on devise's README file
[15:33:00] DonovanYoung: pontiki: I feel as such
[15:33:06] pontiki: spec tests *are* unit tests, what are you talking about?
[15:33:26] DonovanYoung: sure, but they're syntatical sugar
[15:33:36] pontiki: what does that have to do with it?
[15:34:16] DonovanYoung: you miss the point. spec tests attempt to match rspec syntax. So why not just use rspec?
[15:34:27] pontiki: oh maybe i do...
[15:34:44] pontiki: i always call rspec tests spec tests
[15:35:15] mikecmpbll: DonovanYoung: nah, i use minitest too.
[15:35:22] DonovanYoung: I like minitest for the simple rubyish of it, not some extra DSL I have to remember.
[15:35:39] pontiki: unit tests have nothing to do with what syntax or framework you use, though
[15:35:58] pontiki: they're just a type of test
[15:36:18] clusterfoo: I like minitet for gems / command line tools... for rails I need rspec or my tests get fugly beyond control
[15:36:18] krz: anyone used something similar to http://square.github.io/cube/ ? any alternative recommendations for time series event colection databases?
[15:36:20] pontiki: DonovanYoung: you sound particularly picky
[15:36:54] DonovanYoung: pontiki: I mean Minitest::Unit vs. Minitest::Spec
[15:37:18] pontiki: remembrance comes from repeated use
[15:37:31] DonovanYoung: clusterfoo: that's currently what I'm trying to wrap my mind around, why do you think that is?
[15:37:55] DonovanYoung: pontiki: oh, is that how that works? :/
[15:38:03] pontiki: just like everything else
[15:38:51] DonovanYoung: why do the (seemingly) preponderance of rails devs prefer rpsec?
[15:39:27] DonovanYoung: the new minitest is pretty nice, but is it simply a matter of "what we're used to" now?
[15:39:44] DonovanYoung: because the old TestUnit wasn't as full-featured?
[15:39:58] DonovanYoung: I'm honestly curious
[15:40:26] DonovanYoung: I'm on the fence about it
[15:40:39] pontiki: i actually have no idea if rspec is in higher usage than minitest, considering rails still defaults to minitest
[15:40:59] pontiki: perhaps more rails bloggers talk about it
[15:41:08] DonovanYoung: clusterfoo: and yes, that's where I come from too... Minitest for gems and pure ruby. So, my question is, why use rspec for rails? Why not stick with minitest?
[15:41:42] fryguy: i use minitest for rails, works great for me
[15:42:13] pontiki: rspec is what is driving TDD and BDD
[15:42:20] DonovanYoung: pontiki: well, a quick google search for 'rails testing' will show you that nearly every guide (outside of guides.rubyonrails.org itself) refers to rspec
[15:42:28] clusterfoo: DonovanYoung: I think it might be because a rails app usually entails lots of integration with many different components and dsl's (capybara, requests, ar), that all the rspec syntactic sugar helps. When dealing with simple, vanilla ruby, all that stuff is overkill and even gets in the way.
[15:42:57] pontiki: that exactly jibes with my statement above about rails bloggers
[15:43:03] DonovanYoung: clusterfoo: hmm... that's a good point, actually
[15:43:21] pontiki: i do not find it gets in the way at all, actually
[15:43:53] pontiki: again, with doing TDD/BDD even on gems and cli proggies, i find it aids in my thinking about how to implement
[15:43:56] DonovanYoung: which? rpsec?
[15:44:02] pontiki: yes, rspec
[15:44:17] DonovanYoung: pontiki: do you use rpsec for gems and pure ruby projects, or are you more-or-less a 'rails person'?
[15:44:29] pontiki: i write more gems/cli than rails apps
[15:44:44] DonovanYoung: and you use rspec. Interesting.
[15:45:09] DonovanYoung: (honestly, I'm not being sarcastic)
[15:45:37] pontiki: way back in the day, i used to write tests (perl, mainly) that follow very much the minitest formulary
[15:45:37] DonovanYoung: I just prefer minitest for pure ruby, so I'm wondering why I'm using rspec for rails.
[15:45:52] pontiki: i find thinking in rspec TDD terms much more amenable
[15:45:53] DonovanYoung: granted, I'm still new to rails
[15:46:03] pontiki: there is no need to use rspec
[15:46:20] pontiki: or even Minitest::Spec for that matter
[15:46:49] bratsche: I like rspec's options for grouping tests.
[15:46:52] rehat: on forms what is the difference between collection: and collections:
[15:47:26] DonovanYoung: pontiki: well, that's what I'm getting at... there's no *need* to use rpsec, yet the majority (so it seems) does.
[15:47:41] DonovanYoung: I'm curious why
[15:47:41] pontiki: still not sure why that's seems to be an issue
[15:47:47] pontiki: i think i said why
[15:47:49] DonovanYoung: not an issue, merely curious
[15:48:02] DonovanYoung: you did, I'm wondering what others think
[15:48:16] pontiki: good point. merely my opinion.
[15:48:20] pontiki: i don't actually *know* why
[15:48:37] pontiki: still don't even know if it's a majority
[15:48:50] pontiki: most of the rails devs i have encountered don't write tests at all :(
[15:48:54] bratsche: Like I said, I like the ways of grouping tests with describe/context.
[15:48:54] DonovanYoung: maybe not, it could simply be the vocal majority (as you pointed out)
[15:49:02] pontiki: i mean, as have worked with
[15:49:04] DonovanYoung: thanks bratsche
[15:49:23] AntelopeSalad: would it be a bad move to overwrite the .exists? method to really return true/false or should i just make a new method that uses .exists? and specifically return true/false based on the results?
[15:49:39] pontiki: for which class, AntelopeSalad ?
[15:49:45] AntelopeSalad: i'm using the jquery validator plugin and it only works if you return exactly true or false
[15:49:57] AntelopeSalad: pontiki: for a typical rails model class
[15:50:05] terrellt: DonovanYoung: It's definitely the majority. I think part of it is many tutorials who came out were written by people who prefer rspec - and thus include how to install it and use that. I like rspec and use it, but I certainly have nothing against Test::Unit or MiniTest.
[15:50:49] pontiki: i would generally say mucking with standard ActiveRecord::Base methods like that could be problematic -- hard to know exactly what else is calling it.
[15:51:04] terrellt: ACTION shrugs.
[15:51:16] bratsche: pontiki: I think people don't write tests when they're getting started because they're still learning the platform. I didn't write tests in the beginning for that reason. And recently I've been investigating Play Framework to possibly switch to, and so far I'm not writing tests there either. But I always write tests in my Rails stuff now, and I expect I'll do so in my Scala/Play stuff as I get further.
[15:51:25] terrellt: It's a public method. If something always exists or doesn't I think it's valid to override.
[15:51:31] DonovanYoung: terrellt: yeah, that's my thought as well. In fact, that's what led to my question. I'm comfortable with MiniTest for ruby, but am trying to get better at writing Rails tests... looking for guides on MiniTest best practices is (thus far) fruitless. Most guides out there assume rpspec.
[15:51:50] pontiki: bratsche: sadly, most of these people were experienced devs, already knew rails, typically startup mentality
[15:52:19] bratsche: pontiki: Bummer. :(
[15:52:23] AntelopeSalad: pontiki: ok, i'll just make a new method then on the model
[15:52:50] AntelopeSalad: i may have found a work around though by using !! before the method call to convert it to true/false, but i'm not sure if this'll work yet
[15:52:53] terrellt: pontiki: I'm not sure where you've been - but every professional shop I've interacted with are of the opinion that tests are life.
[15:53:19] pontiki: here in minneapolis, also in silicon valley
[15:53:37] DonovanYoung: oh, I think testing is "a good thing", to be sure.
[15:53:39] pontiki: i can't say it's a majority, since it's such a small number. merely my experience.
[15:53:44] terrellt: I wouldn't work in a shop that doesn't test. That's just asking for maintenence problems.
[15:53:54] terrellt: Late nights, "the hell is going on"
[15:54:10] pontiki: in my work, i'm usually brought in to establish a quality practice
[15:54:15] pontiki: so that colours things as well
[15:54:31] DonovanYoung: yeah, that's why I'm trying to get better at it. I just don't really like the idea of learning the rspec DSL when I already know unittest/minitest
[15:54:43] bratsche: Often I feel like I need to over-test to compensate for the lack of a compiler.
[15:54:47] pontiki: oh, see, DonovanYoung -- i think that's just wrong
[15:54:51] pontiki: learn everything you can
[15:55:08] AntelopeSalad: pontiki: it seems !! does work, do you think that's better than making a new method?
[15:55:16] DonovanYoung: don't get me wrong, I'm a voracious learner... sometimes to my detriment (oh, new shiney tool... must learn it!)
[15:55:24] DonovanYoung: but there comes a point where I have to stop and ask 'why?'
[15:55:25] pontiki: if you get into a place where they do nothing but rspec, you will be on a learning curve if you get the job
[15:55:37] blowmage: DonovanYoung: minitest's spec dsl only generates test-style objects and methods. its a veneer.
[15:55:42] terrellt: DonovanYoung: Learning the RSpec DSL takes a couple hours, maybe. Considering its popularity I think it's pretty important.
[15:55:52] pontiki: i don't say you have to make it a practice, per se, but an extra tool in the tool box? good thing, i think
[15:56:05] DonovanYoung: sure, valid point.
[15:56:07] terrellt: DonovanYoung: But you certainly don't have to. As for best quality minitests, I haven't seen anything related to that.
[15:56:24] DonovanYoung: terrellt: yeah, nor I.
[15:56:32] DonovanYoung: maybe I'll write one (as a way to learn it)
[15:56:36] bratsche: DonovanYoung: Yeah, I started out with test/unit and then started using rspec. I feel like rspec made me a better tester, and that knowledge transfers back to test/unit or minitest if I want to use them.
[15:56:57] DonovanYoung: bratsche: AH, that's the kind of thing I was looking for.
[15:56:59] pontiki: AntelopeSalad: double bang is a very accepted way of doing that, but it's less readable for some, and someone coming up after you looking at your code might not get why you did it that way. leave a comment.
[15:57:11] dobry-den: Why use RSpec when Ruby already has comparison semantics and you can just do `assert { 4 == fn(2) }`?
[15:57:15] terrellt: Bratsche makes a good point. Testing best practices are pretty platform independent - the only things that aren't are little things, like use let/subject in rspec tests.
[15:57:25] dobry-den: Check out https://github.com/sconover/wrong
[15:57:48] bratsche: DonovanYoung: Only because rspec gives you some higher-level patterns than test/unit did. testunit was basically just a bunch of plain Ruby functions, and you can of course do anything in there. But using rspec you see certain patterns pop up (describe, context, before(:all), before(:each), etc).
[15:57:51] AntelopeSalad: pontiki: yep i did drop in a 1 line comment, i'm still new to ruby so trying to figure out the idioms
[15:57:52] dobry-den: There's nothing prude about being ambivalent towards Yet Another DSL.
[15:58:26] bratsche: DonovanYoung: You can do all that stuff in whatever framework you want, or no framework at all. It's just a nice higher-level pattern to frame your mind a little bit. Or at least, that's how it was for me.
[15:59:34] DonovanYoung: AntelopeSalad: you might try a ternary operator as well. <statement> ? 'true' : 'false'
[15:59:47] DonovanYoung: AntelopeSalad: if you're concerned about readability, that is
[16:00:09] AntelopeSalad: right now it's: format.json { render json: !!Category.exists?(params[:category_id]) }
[16:00:22] ivanskie: my gist: https://gist.github.com/i5okie/6643896 , someone suggested row[1] = Vendor.find(:name => row[1]).id, which doesn't work
[16:00:28] ivanskie: says unknown key: name
[16:00:31] DonovanYoung: bratsche: thank you, that's a great view on it.
[16:00:47] AntelopeSalad: i'd say readability wise it makes almost no sense without a comment heh
[16:01:06] DonovanYoung: for me, I think that's the appeal of minitest. It's just a bunch of ruby methods... nothing to get in the way.
[16:01:08] pontiki: i would say wrong looks pretty right
[16:01:18] ivanskie: basically while importing a csv file, i need to replace a name from a diff model with it's id, then import the data into this model
[16:01:38] davidcelis: AntelopeSalad: that isn't valid json
[16:01:59] AntelopeSalad: davidboy: for some reason this is the only possible way to make the jquery validation plugin's remote call work
[16:02:24] davidcelis: ??? what were you doing before that didn't work?
[16:02:33] davidcelis: i've never seen jQery work by parsing invalid json
[16:02:42] AntelopeSalad: i had it wrapped in a "result" object
[16:02:52] ivanskie: i've just added a small sample from my csv file https://gist.github.com/i5okie/6643896
[16:03:24] bratsche: DonovanYoung: There's something very appealing about the indentation you get from nested describe/context in rspec. It's hard to say why, but it's very satisfying. Very readable. That alone makes me prefer spec-style to function-style.
[16:03:55] bratsche: DonovanYoung: I have a pretty old app that I've been maintaining for a few years that's got a large test/unit suite and I wish I could convert it to rspec now. :)
[16:04:28] pwz2000: I am working on this form and it's not saving data to database. It should be posting to the letsgo table but it's not saving information from the form. Can someone take a look at my create action to make sure what I have is right? https://gist.github.com/pwz2k/6687045 . When I process form it redirects to the homepage (as it should) but it reads flash error message 'date was not posted'.
[16:05:07] AntelopeSalad: davidcelis: i didn't look at the source but it seems like they expect the remote function to return nothing but true or false
[16:05:29] AntelopeSalad: so i guess if you wrapped it properly in json it would always return true?
[16:06:36] ajph: what's the best way of dealing with multiple css & js assets, preferable one per action? do i need to use a layout per action?
[16:06:49] pontiki: pwz2000: could we see the homepage view as well?
[16:07:07] scriabin: if I get the admins to double my server's ram to 8 gigs, does anybody know what I need to do to tell ruby/passenger of the change?
[16:07:10] pontiki: pwz2000: most especially where you're processing flashes?
[16:07:23] ajph: for example, i don't want my item.js file included in my view for home. it's causing too many conflicts
[16:07:26] ivanskie: updated the gist again https://gist.github.com/i5okie/6643896
[16:07:28] linusoleander: How would I access the type_id on line 13?
[16:07:28] linusoleander: https://gist.github.com/oleander/76536c2fdea799eaa429/29687af84876c64a568a80ef9cb819fb863a9ef9
[16:07:33] ivanskie: been at it for a few days now
[16:07:39] pontiki: nothing to ruby, scriabin. i doubt you'd need to tell passenger
[16:07:59] DonovanYoung: bratsche: interesting
[16:08:06] krz: anyone here used riak?
[16:08:18] bratsche: I have not.
[16:08:52] pontiki: i've only heard a couple friends raving about it :)
[16:09:02] pontiki: and collecting stickers n stuff
[16:09:16] blowmage: pwz2000: do you have any validations on the model? if so, put the error messages in the flash: `flash[:error] = "Date was not posted! #{@letsgo.errors.full_messages.join(', ')}"`
[16:10:00] bratsche: I'm not really sure what riak's claim to fame is even supposed to be.
[16:10:02] pwz2000: pontiki: updated https://gist.github.com/pwz2k/6687045
[16:10:05] momomomomo: pontiki: riak stickers?
[16:10:06] AntelopeSalad: btw, do you guys know why a route concern would work for a resource but not for a manually assigned get request?
[16:10:10] ivanskie: https://gist.github.com/i5okie/6643896
[16:10:32] pontiki: momomomomo: they pick them up at various cons and RSes
[16:10:58] momomomomo: haha :'D need to go to a conference at some point
[16:11:04] momomomomo: I only make it out to local MN events
[16:11:23] ivanskie: I have a CSV file I want to import to Item model. id,name,vendor_id….. the CSV file lists vendors as name… how do I replace the vendor name on each row with vendor_id during import?
[16:11:42] ivanskie: row[1] = Vendor.find(:name => row[1]).id does not work in this case
[16:11:57] ivanskie: gist https://gist.github.com/i5okie/6643896
[16:13:22] ajph: does everyone allow application.* to include every single one of their js & css assets or is there a better way?
[16:13:42] pontiki: ivanskie: look at line 5 of that gist
[16:14:12] ivanskie: right, I'm trying to figure out why that's wrong now
[16:14:28] pontiki: you're Vendor model does not have a :name field
[16:14:55] ivanskie: .find_by_name ?
[16:15:03] ivanskie: well it does
[16:15:10] pontiki: no sorry, find doesn't use keyed parms
[16:15:27] pontiki: perhaps find_by_name, or use where with those parms
[16:15:41] ivanskie: create_table "vendors", force: true do |t|
[16:15:42] ivanskie: t.string "name"
[16:15:47] ivanskie: i'll try find by name
[16:16:07] AntelopeSalad: here's a snippet of the described problem: http://pastie.org/8352107
[16:16:23] ajph: is my question difficult to understand? do i need to explain further?
[16:16:50] tomoyuki28jp: When we add an i18n translation, using the global scope might be messy. How do you guys use a scope? One way I can think of is using an app scope.
[16:17:49] ivanskie: hm looks like it likes find_by_name better..
[16:17:57] ivanskie: now I'm getting something bezare
[16:18:49] ivanskie: updated gist https://gist.github.com/i5okie/6643896
[16:19:06] ajph: this is what i dislike about rails. there's "The Rails Way"… and anything else you're f*cked.
[16:19:22] ivanskie: when i do this: *Item.attribute_names()
[16:19:31] ivanskie: does it expect to have the params in order?
[16:20:08] ivanskie: should I specify which column is which? I thought this should splice it according to header..
[16:20:32] ivanskie: but it's trying to do something wrong here, or rather do what the wrong code is telling it to do somewhere
[16:21:54] ivanskie: i can't wrap my head around that error. so messssyy
[16:22:26] pontiki: ajph: nothing stops you from not putting a specific asset outside of the app/assets folder and serving it up directly
[16:22:50] pontiki: also, you can turn off the asset pipeline and serve up the assets individually as you call them
[16:23:16] ivanskie: … i just edited the CSV file to get rid of the double quotes… i wonder if that's what messing me up
[16:23:17] ajph: pontiki: which would mean i'd need a layout for each controller action, right?
[16:23:39] ivanskie: or perhaps I need to implicitly specify that the comma is what separates the values?
[16:23:51] pontiki: or a partial that is called
[16:24:01] ivanskie: somehow it's trying to breakup the vendor_name
[16:24:15] ajph: pontiki: why would you ever want your users.js included in the same page as your items.js for example
[16:24:22] pontiki: why indeed
[16:24:34] ajph: pontiki: but that is default rails behaviour
[16:25:27] pontiki: eventually, all those pages would likely be called by a user. having them all down load once puts them in the browsers cache; the concept is that first page load takes teh hit, the rest of the pages go much faster
[16:25:40] ajph: pontiki: i can't serve up css in a partial because my application.html.erb layout has started a <body> tag
[16:25:44] pontiki: it's one opinion
[16:25:45] ivanskie: oh i need an adult.. (aka an experience rails programmer) heeeeellllppppppp
[16:26:33] ajph: pontiki: is my statement above correct? is there another way other than having a layout for each view?
[16:26:41] pontiki: ajph, serving them all together is taking the longer view of the user visitng your site often, and using many of the pages
[16:27:35] breakingthings: so for one, "the rails way" in the case of when and how to load css is correct please don't load a new css file for every page that's nuts
[16:27:41] pontiki: ajph, it may take more splitting up of your layout
[16:27:58] breakingthings: for two even if you're going to be that nuts, there are still ways to configure and mangle the asset pipeline or remove it altogether to do such crazy things.
[16:28:05] pontiki: breakingthings: it would end up about the same, eventually
[16:28:30] pontiki: since the individual files would each end up cached in the browser
[16:28:40] ajph: pontiki, breakingthings: what if i have multiple $(document).ready() actions that are specific to each page. do i just force the users browser to execute these regardless of what page they're on?!
[16:28:44] breakingthings: yeah, and each one is an extra request. that's nuts.
[16:29:00] mikecmpbll: ajph, you don't have to have //= require_tree in your application.js
[16:29:02] pontiki: only the first time, breakingthings
[16:29:12] breakingthings: ajph: JS can be included anywhere though.
[16:29:19] mikecmpbll: just include the files that you want to include on the pages you want them included.
[16:29:21] breakingthings: do whatever the hell you want with the JS.
[16:29:51] mikecmpbll: do whatever the hell you want with the css too?
[16:30:08] breakingthings: pontiki: of course, that doesn't mean that you're not making at least one extra request for every page.
[16:30:11] breakingthings: it's just silly.
[16:30:15] ajph: mikecmpbll: you can't include the css in a view because your application layout has started the <body> tag at that point
[16:30:24] breakingthings: do whatever the hell you want with css if you're shameless*
[16:30:24] mikecmpbll: ajph: content_for :head
[16:30:32] pontiki: breakingthings: that's only one way to look at it
[16:31:08] pontiki: granted, setting up and tearing down a request generally takes more time than the actual transfer, if the css/js is minified
[16:31:17] breakingthings: it's dumb. just use the one.
[16:31:18] pontiki: executing the js actually takes longer, in many cases
[16:31:30] scriabin: hookah! Had an ActiveRecord query taking 83000ms - added an index, now takes 80ms
[16:31:33] breakingthings: JS is it's own beast do whatever you like with it
[16:31:35] pontiki: but again: long view vs. short view
[16:31:52] scriabin: who's the mysql genii? This guy with the two thumbs is!!!
[16:31:59] scyllinice: add classes to your body tag so you can scope your css as needed
[16:32:01] scyllinice: That's what I do
[16:32:16] breakingthings: unless your CSS is a behemoth it'll be worth it to load a single, combined CSS.
[16:32:32] ajph: scyllinice: that's a good idea
[16:32:53] breakingthings: rarely is the CSS large enough that you won't be spending more time making requests every load than you would have to just use proper class names and send one file
[16:33:01] Hauleth: Have anyone some experience in TypeScript + Rails + Heroku?
[16:33:10] breakingthings: as soon as they visit a second page you've recouped the extra download time :l
[16:33:16] ajph: breakingthings: who care's how fast if it loads if it's an organisational mess and difficult to maintain. that's the point.
[16:33:20] Hauleth: Is there custom buildpack needed?
[16:33:53] ajph: who gives a crap if the user has to wait an extra 10ms per page because you like to split your css
[16:34:01] breakingthings: what does the practice of loading a single css file have anything to do with your organization and maintenance
[16:34:14] breakingthings: you have a preprocessing pipeline for gods sake
[16:34:19] breakingthings: split them up all you want
[16:34:32] scyllinice: Hauleth: I don't have any specific experience, but I believe you will need one
[16:34:35] breakingthings: then the one mashed up css file can be sent down the wire and you're none the wiser
[16:34:48] breakingthings: ACTION shrugs
[16:34:48] breakingthings: Yall need pipelines.
[16:35:46] ajph: breakingthings: is that default rails behavious? because mines just including each file for each page
[16:35:52] Hauleth: scyllinice: :/
[16:35:52] ajph: behaviour*
[16:36:03] scyllinice: The asset pipeline is really annoying when you don't load everything into a digest file
[16:36:54] Hauleth: scyllinice: I hoped that it isn't needed like for CoffeeScript (sic!) which now is also pure JS thing.
[16:39:27] scyllinice: Hauleth: Have you tried just deploying? Maybe the typescript gem you have included takes care of it
[16:39:37] ivanskie: oh right aaand i need to convert the msrp column to msrp_cents for the import.. so that the money gem works
[16:39:54] mva3212: What is the preferred queue solution for RoR?
[16:40:06] scyllinice: Hauleth: It depends on if Heroku has the typescript compiler available or if the gem includes one. Not sure :)
[16:40:26] scyllinice: mva3212: People like Resque and Sidekiq.
[16:40:35] scyllinice: mva3212: Sidekiq is newer
[16:40:45] scyllinice: mva3212: But Resque has been getting some love lately
[16:40:48] tubbo: means ZOMG MESSAGE QUEUE
[16:40:59] machuga: ajph if you're in development mode it does not concat your files for you
[16:41:09] pipework: I don't get why people like resque.
[16:41:19] tubbo: one of them uses more memory, the other more CPU
[16:41:29] pipework: Unless you're using redis for other things too, it's a lot of architecture for a background job system.
[16:42:37] breakingthings: Maybe that's exactly why they like it.
[16:42:46] tubbo: pipework: we've done some (non-scientific) tests and found sidekiq is not as good for CPU-intensive tasks.
[16:43:02] pipework: tubbo: Ever give straight up ruby a go?
[16:43:16] tubbo: and by "we" i mean "people that worked at my company who no longer work here" :)
[16:43:34] tubbo: pipework: well, for this particular app we also use redis to cache.
[16:43:51] tubbo: but i believe we actually do have a self-written job scheduler on the rails 2 app
[16:44:05] tubbo: just uses ruby and a DB i believe. predates delayed_job :0
[16:44:34] mva3212: well basically all I'm doing is taking post requests from remote hardware and then going on and calling a third party api for each one
[16:44:51] tubbo: i really like the idea of keeping a database of tasks in case the main process shits out or something, but i think it should be written to after the fact. so when actions are completed, the DB gets updated to keep a "record" of what happened.
[16:45:02] mva3212: sounds like sidekiq is the way to go since i'm running on a single linode with not a lot of memory
[16:45:14] tubbo: the DB shouldn't be used as the information source, just the backup for when the app starts up and needs to know what tasks are pending.
[16:45:22] tubbo: but i'm not sure how i'd implement that :(
[16:45:50] scyllinice: query on startup, sync occasionally to the db?
[17:05:45] mva3212: With Sidekiq do I need to have only one perform method per worker class
[17:05:56] mva3212: or can i do performX performY performZ
[17:05:59] mva3212: all in the same class
[17:06:18] breakingthings: as far as I know, just one perform method.
[17:06:35] pipework: tubbo: Remember that background job system I described before? Use ZMQ as the job queue in that!
[17:06:47] breakingthings: You'll either want another class or an argument system to choose which action to perform.
[17:06:56] breakingthings: (which, of course, could get hacky.)
[17:07:09] mva3212: so each task gets a new class
[17:07:35] tubbo: pipework: hehe yeah i guess :)
[17:15:16] duke_nukem: has anyone had experience with Carrierwave generating different version of an image properly, but the url being returned for those versions is incorrect? I have images I'm uploading and I'm generating thumbnails from them. The image URL locations work fine, but for some reason the thumbnail version URLs aren't. For instance, the original filename "/9d/ab/d5/fa/9dabd5fa7ccb5d1f7a9a470b97264ab9.png", the thumbnail filename: ...
[17:15:16] duke_nukem: ... "thumbnail_16/98/07/b4/169807b4a401295caa66d405276cc854.png", but when linking to the thumbnail using photo.image.url(:thumb) or .thumb, the url is something like this: "thumbnail_9d/ab/d5/fa/9dabd5fa7ccb5d1f7a9a470b97264ab9.png"
[17:18:33] denym_: How to use hstore on the example of a shopping list? column :article {article1 : Pepper, article2 : Salt, ...} and column :price {article1 : 1, article2 : 2,5, .... } ?
[17:18:48] duke_nukem: my code: https://gist.github.com/dhoss/6688100
[17:23:13] asahi: hello, if I run a rake command, is there a way I can save the output to a file?
[17:23:37] pontiki: asahi: what OS?
[17:23:51] pipework: asahi: with a shell redirecy
[17:24:14] pskrz: rake whatevs > filename.txt
[17:24:40] asahi: ah i see. thank you
[17:38:04] ggherdov: Hello. I am looking for a toy RoR application with which I can practice building debian packages of RoR websites. What such an hello-world looks like? what basic components are involved? Where do I find one?
[17:38:31] pipework: ggherdov: Rails applications can be simple in architecture and depenencies, and they can be horridly complex with them.
[17:38:58] ggherdov: pipework: I can imagine, and my goal was to start simple
[17:39:03] pipework: A simple blog application that uses flat files or sqlite3 for the database is an easy start.
[17:39:11] pipework: Then you only need to depend on ruby and sqlite3, I thnik.
[17:39:16] pipework: think* ssl too.
[17:39:57] ggherdov: pipework: ok. Any name of similar app comes to mind?
[17:40:06] ggherdov: ACTION googling @ruby on rails blog@
[17:40:11] pipework: ggherdov: The gettingstarted blog app is neat.
[17:40:21] ggherdov: pipework: thanks a lot
[17:42:11] ggherdov: pipework: http://guides.rubyonrails.org/getting_started.html#creating-the-blog-application is that it ?
[17:43:02] matheusca: why observer removed from rails 4?
[17:43:15] pipework: ggherdov: YEah.
[17:43:19] pipework: matheusca: Googleable
[17:43:23] ggherdov: pipework: ok
[17:44:00] mklappstuhl: where would I put something like this in rails: http://stackoverflow.com/questions/14376902/zipping-2-arrays-in-ruby-in-random-locations
[17:44:12] pipework: In the right place.
[17:45:14] mklappstuhl: pipework: mind telling me where that is? I want to use it in a controller...
[17:45:26] elaptics: ggherdov: when you've mastered a simple rails app then you could package up discourse if you want a complex app with complex dependencies
[17:45:45] pipework: mklappstuhl: Depends on how you want to use it.
[17:46:00] pipework: mklappstuhl: I would probably use it in a model, but call it from a controller.
[17:46:12] pipework: If you want to use it in more than one place, I'd put it in a module in lib/
[17:46:14] ggherdov: elaptics: looks like... you're reading my mind :-) my final goal is, indeed, discourse.
[17:46:33] elaptics: ggherdov: hehe
[17:46:38] ggherdov: elaptics: do you know of somebody who did it already? that would save me some work!
[17:47:06] mklappstuhl: pipework: not really for now
[17:47:08] elaptics: ggherdov: not that I know of yet - perhaps because it's still under very active development no-one has wanted to try?
[17:47:29] ggherdov: elaptics: I will be The One :)
[17:47:49] elaptics: ggherdov: you would likely be very popular if you manage it :)
[17:48:01] ggherdov: ACTION dreams of glory
[17:53:16] momomomomo: Ah, me gusta when complex parts come together in production
[17:53:34] momomomomo: but no me gusta fragile web scraping
[17:56:17] dangerousdave: why does this line work for me? why is it necessary to have the path_names specified? devise_for :users, :path => '', :path_names => {:sign_in => 'sign_in', :sign_out => 'sign_out'}
[18:02:23] Malkav: Hey guys!
[18:04:03] mattvv: yo guys, anyone had experience with feature flipper gems? I'm currently looking into some at the moment, Arturo seems to be the winner so far
[18:05:59] Malkav: Is there a way to shorten this up?
[18:06:00] Malkav: https://gist.github.com/Almaron/6688865
[18:06:51] slash_nick: Malkav: try goo.gl
[18:07:20] slash_nick: see, shorter: http://goo.gl/LVgG6Z
[18:08:03] Malkav: slash_nick: very funny. I mean is there a way to refactor that bit of code to make it simpler
[18:08:13] Malkav: not to shorten the gist url
[18:16:27] danhunter: something like send("parse_from_" << hash[:origin], hash)
[18:16:42] danhunter: Malkav: above ^
[18:17:15] danhunter: though its questionable that its a nicer solution
[18:18:46] Malkav: that's much nicer, 'cause I really have about a dozen cases like those
[18:19:06] Malkav: so It'll get me from 15 lines to 4
[18:19:36] ner0x: Does rails4 not make array columns automatically be able to be pushed into?
[18:22:32] mwlang: Has anyone worked with storing and manipulating timestamps in UTC? I usually only work with local times, but I'm working on an app that will collect data across many timezones, so I thought it would be smartest to store all timestamps in UTC.
[18:22:53] mwlang: However, I just did Date.today.to_time.utc => 2013-09-24 04:00:00 UTC
[18:23:48] mwlang: and that made me wonder about time boundaries of a day (which if I used the above + 24.hours leads to => [2013-09-24 04:00:00 UTC, 2013-09-25 03:59:59 UTC])
[18:24:27] DylanJ: dates, timezones
[18:24:31] mattvv: Or does anyone know any good tools for gradually releasing to different customers
[18:24:41] DylanJ: mwlang: I use datetime.current.things
[18:24:50] DylanJ: DateTime.current.end_of_day
[18:25:00] mwlang: If I were living in the UK events occurring in the Eastern Timezone would certainly be starting at 4AM UTC….
[18:25:02] DylanJ: those days will be *should be* stored as utc
[18:27:26] mwlang: ah, I see a minor difference now…beginning_of_day and end_of_day return +0000 as the timezone.
[18:27:38] mwlang: Tue, 24 Sep 2013 00:00:00 +0000
[18:30:15] mwlang: anyway, here's my real question…if I'm living in a specific timezone (UTC's timezone for example) and I want to look at data that occurred "yesterday" in another timezone (Eastern US), does it make more sense to the end-user to scope the query from midnight to midnight or 4AM to 4AM if I'm a UTC person looking at Eastern's activity?
[18:30:48] superscott[8]: i don't see the options for pool/timeout in the mysql version of the adapter? does that mean they're not supported, or handled by another class? https://github.com/rails/docrails/blob/master/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
[18:31:57] DylanJ: mwlang: i'd like to see things in my timezone
[18:32:02] DylanJ: yesterday "to me"
[18:32:25] DylanJ: not yesterday in utc when i live -8 hours from utc.
[18:33:48] mwlang: DylanJ: Sounds right for me, too.
[18:33:57] EminenceHC: Is there a way to set a form field value with a variable created in the controller? For instance Users ID?
[18:34:35] makerop: you could just add a tag and the current_user etc
[18:35:10] EminenceHC: makerop: how would I implement that to always post when the form is posted?
[18:35:20] DylanJ: EminenceHC: use a hidden_field :foo, @val
[18:35:25] makerop: hidden_field
[18:35:39] makerop: hidden_field :user_id current_user.id
[18:35:54] maoko: Can someone suggest me how to make a beautiful page break within a table in wickedpdf?)
[18:35:56] DylanJ: or if it's a form_for @obj. you can modify the @object in the controller.
[18:37:09] EminenceHC: DylanJ: How would I set the value to the @object in the controller?
[18:37:33] makerop: explicitly
[18:37:35] thecarlhall: are there best practices when marshaling active record objects?
[18:37:50] thecarlhall: I can't seem to reload the data but I'm sure it's my own ignorance
[18:37:58] makerop: thcarlhall what does marshaling mean?
[18:38:37] MasterAsia: Is there a good pattern for having a user signup with a firstname/lastname on devise? Or do I just inject more form fields to the signup form :P
[18:39:01] thecarlhall: makerop: I'm using Dalli (memcache client) which does Marshal.dump
[18:39:40] makerop: thecarlhall, ah, cool, I wasnt sure if that was a "term" i didnt nkow
[18:39:53] cesarstafe: hi people.. I am struggling with a bug related to i18n.. in logs says "I18n::InvalidLocaleData (can not load translations from config/locales/en.yml, expected it to return a hash, but does not)
[18:39:54] mwlang: maoko: short answer, you can't, if you're rendering HTML and then from that, PDF
[18:40:07] cesarstafe: somebody has an idea of what could be the problem?
[18:40:11] rhizome: mwlang: you can interpolate the time to an arbitrary zone and get beginning/end from there
[18:40:19] DylanJ: EminenceHC: say you have user = User.find(params[:user_id]) and you wanted to change the name to "john smith" before the page is loaded ( set it in the controller) you'd call user.name = "john smith"; render foo
[18:40:26] rhizome: transpose? still early
[18:40:27] cesarstafe: the en.yml is in place and it is valid
[18:40:29] DylanJ: @user = User...
[18:40:57] cesarstafe: I am using rails 3.2.13 and i18n 0.6.1
[18:40:57] rhizome: assigning for render seems suboptimal
[18:40:59] mwlang: maoko: reason being is that the browser is treating the entire page as a one big canvas and when rendered from there to PDF, the canvas is sliced up.
[18:41:04] bradherman: Running an Rails 4 app on heroku with mysql2, ruby 2.0… When I try to enter a unicode character in one of my text fields, I get a 500 every time (☆, for example)… I've tried about 30 fixes I've found online yet to no avail
[18:41:18] maoko: mwlang, yes, that's what I'm doing.
[18:41:19] mwlang: you can come close with good metrics and calculations on all font/text heights and margins.
[18:41:38] bradherman: error example: ActiveRecord::StatementInvalid: Mysql2::Error: Incorrect string value: '\xEF\x83\x98\x09Fl...'
[18:42:19] mwlang: maoko: I actually have been down this road -- ended up abandoning the rendering with HTML => PDF approach and simply built the PDF with prawn directly.
[18:42:52] DylanJ: bradherman: http://matthew.mceachen.us/blog/howto-configure-an-amazon-rds-instance-to-use-utf-8-925.html
[18:42:53] maoko: mwlang, I know that and the one and only idea I had in stock is to write some kinky script to prepend table headers after each page break, but for now I will try to convert my table into a set of divs. Maybe this will work out better.
[18:43:06] DylanJ: i think that will help. a coworker ran into the same problem with rds
[18:43:17] DylanJ: our db was latin1 for whatever reason
[18:43:22] DylanJ: when it needed to be utf8
[18:43:32] bradherman: oh if this fixes it, i will love you forever dylanj
[18:43:35] EminenceHC: DylanJ: What if I have @form = DrugAssessment.create(drug_assessment_params) How would I set a :student_id parameter?
[18:43:38] DylanJ: i didnt fix it i just know that was the issue
[18:43:50] DylanJ: EminenceHC: I'd do it in the view with a hidden field.
[18:44:08] rhizome: maoko: http://stackoverflow.com/questions/5679118/how-to-set-table-headers-in-prawn
[18:44:29] mwlang: maoko: I think the divs approach does at least work a lot better.
[18:44:31] cesarstafe: I have removed all comments and checked that any tab is present in en.yml file
[18:45:01] cesarstafe: * checked that there is not tabs
[18:45:05] maoko: mwlang, so you have ended with prawn too.. That's a pain to hear. But I'm afraid that prawn learning curve is very rough and I won't manage re-creating the whole layout in it.
[18:45:16] mwlang: and speaking of repeating headers, that was the kicker for us that pushed us over the edge to go with Prawn.
[18:45:22] AntelopeSalad: i ran into an n+1 query problem, is there a way to fix this at the model level rather than put .includes(:foo) into every query chain?
[18:45:41] rhizome: AntelopeSalad: what do you mean?
[18:46:03] tubbo: AntelopeSalad: you could make a method that does includes(:foo)
[18:46:05] AntelopeSalad: i was googling around and it seemed like maybe you could eagerly load the associated data with something in the model, but i couldn't get it to work
[18:46:23] AntelopeSalad: in the association belongs_to call or whatever relation you're using
[18:46:35] EminenceHC: DylanJ: I have @id = 1 in my controller but <%= s.hidden_field :student_id, :value => "@id" %> does not seem to work.
[18:46:38] AntelopeSalad: i tried a whole bunch of combinations and nothing worked so i thought maybe i was doing it wrong
[18:47:23] tubbo: AntelopeSalad: have you tried reimplementing the reader method?
[18:47:37] DylanJ: EminenceHC: haha yep. that wont work
[18:47:41] makerop: EminenceHC, if you are using form_for and and object, you cant use @id
[18:47:44] tubbo: AntelopeSalad: has_many, for example, simply defines `def foos; Foo.where(bar_id: id); end`.
[18:47:57] DylanJ: "@id" is not what you want.
[18:47:59] makerop: you need to assign it to the object itself
[18:48:03] tubbo: AntelopeSalad: you could redefine it as `def foos; Foo.includes(:bar).where(bar_id: id); end`
[18:48:05] tubbo: for example
[18:48:05] AntelopeSalad: i have a belongs_to :category and has_many :posts relationship going on
[18:48:16] makerop: form_for @user, @user.id
[18:48:35] tubbo: AntelopeSalad: the has_many posts will be easy
[18:48:36] mwlang: rhizome: that's actually a very good idea.
[18:48:55] tubbo: belongs_to has a bit more under the hood, but should be just as easy since the getter is the same
[18:48:58] tubbo: s/getter/reader
[18:49:06] rhizome: which one? i have so many! timezone?
[18:49:12] AntelopeSalad: i'm not really sure what you mean tubbo
[18:49:45] tubbo: AntelopeSalad: well has_many and belongs_to are called "macros". they're actually just class methods but are called macros because they basically write code for you.
[18:49:51] AntelopeSalad: googling resulted in someone saying you could do something like: has_many :posts,:include=>:comments (different example)
[18:50:03] tubbo: AntelopeSalad: belongs_to :foo, for example, creates a method called foo() as well as foo=() which do read/write_attribute, respectively.
[18:50:10] tubbo: AntelopeSalad: but it requires that you have foo_id in your DB
[18:50:22] AntelopeSalad: i do have category_id as a field in my posts table
[18:50:54] tubbo: AntelopeSalad: has_many, OTOH, doesn't require you to have any kind of DB schema. you just pass it the symbol of an object in your app and it will attempt to find all of the records that relate to the current class
[18:51:21] tubbo: AntelopeSalad: but since all those macros are doing are defining methods on your class, surely you could just do the same thing manually? :)
[18:51:24] AntelopeSalad: tubbo: this was what i was looking at btw http://stackoverflow.com/a/9294861
[18:51:31] AntelopeSalad: i just couldn't figure out how to apply it to my case tho
[18:51:49] tubbo: AntelopeSalad: what do you mean? are you trying to do the :include on a belongs_to?
[18:52:01] AntelopeSalad: well, he made it seem like there's 2 choices to fix the problem
[18:52:15] AntelopeSalad: 1. do .includes(:category) , which works and i could do this but i'd rather not if i can avoid it
[18:52:25] rhizome: i'm googling conflicting information on whether :include on an association still works
[18:52:36] AntelopeSalad: 2. add that include call to the has_many, but i couldn't get this to work
[18:53:48] EminenceHC: makerop: Thanks that worked!
[18:53:53] EminenceHC: DylanJ: Thank you!
[18:54:06] kaldrenon: Inside a form_for do |f| block, when I make f.submit, how do I pass additional CSS classes to it? I had = f.submit, class: 'btn" in my HAML but that didn't work
[18:54:21] rhizome: AntelopeSalad: what's the issue, you want to eager load an association by default for a particular model? in every query?
[18:54:35] tubbo: AntelopeSalad: what didn't work about it?
[18:55:02] AntelopeSalad: rhizome: i have 2 views that get a list of posts , one that has a scope applied for only published posts (public page) and one without any scopes (admin end to manage the posts)
[18:55:27] AntelopeSalad: it felt wrong to have to make a scope and then use that on both
[18:55:32] AntelopeSalad: but maybe that is the correct way?
[18:55:58] AntelopeSalad: tubbo: it said it couldn't find "category" and that maybe i didn't spell it correctly
[18:56:07] rhizome: AntelopeSalad: i would make scopes that correspond to the user roles
[18:56:20] AntelopeSalad: there's no roles in this case, it's just posts and categories
[18:56:40] workmad3: AntelopeSalad: is the association called :categories by any chance?
[18:56:43] AntelopeSalad: that stackoverflow link was just an example of someone putting the include call on the association
[18:57:02] workmad3: oh wait, never mind
[18:57:06] rhizome: AntelopeSalad: generally you can use default_scope for this, but i would use methods
[18:57:10] AntelopeSalad: workmad3: nope, i tried that tho just for the heck of it
[18:57:35] workmad3: I'm with rhizome... you can add this to the default scope, but I wouldn't recommend it
[18:57:47] AntelopeSalad: what about a custom scope vs a method?
[18:57:58] rhizome: scopes are DEAD
[18:58:03] bratsche: No they're not.
[18:58:14] rhizome: no, they're not, but i think it's better to think of them that way
[18:58:26] workmad3: AntelopeSalad: a 'custom scope' is really just a wrapper around a class method nowadays
[18:58:58] AntelopeSalad: from a maintenance POV are scopes just bad?
[18:59:03] bratsche: A scope is a nice syntax with some semantic meaning and it guarantees chainability.
[18:59:08] AntelopeSalad: because as a newbie it seemed pretty easy
[18:59:22] bratsche: AntelopeSalad: There is no additional maintenance burden from using scopes.
[18:59:31] bratsche: Use them or don't, it's just a matter of preference.
[18:59:32] AntelopeSalad: and you can have your "scopes area" of your model where you know these are chained queries
[18:59:45] rhizome: right, that's the semantic value
[18:59:49] workmad3: bratsche: it isn't the scope that guarantees the chainability... it's that what you give it is inherently chainable (an ActiveRelation object, or a lambda that returns one of those)
[19:00:29] lexi87: Hey guys a quick question I have. When users submit this form, it sends the contents of the form but the 'category' value remains 0 in the database when it should read the option the user selected. Is this incorrect? <%= f.select :category, options_for_select( [["Select One", ""], "Cell", "Work", "Office", "Home", "Other"]) %>
[19:00:31] workmad3: bratsche: unless you're still on rails 2 anyway :)
[19:00:50] bratsche: workmad3: No, if you return nil from your lambda it will still chain. That's not true of a method.
[19:01:00] jstrong: lexi87: sounds like your category column is an integer and not a string
[19:01:00] AntelopeSalad: what would you even name such a scope/method btw?
[19:01:03] AntelopeSalad: is there a convention>?
[19:01:06] rhizome: lexi87: there is a :selected option you should be using
[19:01:16] AntelopeSalad: eager_category seems weird but it explains it well i guess
[19:01:26] rhizome: with_categories
[19:01:47] AntelopeSalad: thanks, i like that one
[19:01:48] rhizome: bratsche: interesting
[19:01:50] lexi87: jstrong: I switched it to varchar, as before it was reading NULL
[19:02:06] jstrong: lexi87: switched with a migration?
[19:02:10] jstrong: lexi87: or manually?
[19:04:12] lexi87: jstrong: thank you for pointing that out.
[19:05:42] jstrong: lexi87: yeah you need to do it through a proper migration
[19:07:02] bratsche: Run like an AntelopeSalad!
[19:08:04] louism2wash: Hey guys, I am trying to configure Rack to allow the browser to cache my css/js files and to not use the 'if-modified-since' header so that a request isn't sent to the server just to check if a file has been modified or not. Is that something I should be doing with Rack or should I be configuring my web server? Thanks.
[19:09:30] maoko: A very stupid question indeed.. How can I check current rails env in console?
[19:09:36] rhizome: louism2wash: something like an expires header? http://7fff.com/2011/03/25/setting-expires-headers-via-rack/
[19:09:40] rhizome: maoko: Rails.env
[19:10:05] maoko: rhizome, thankx
[19:10:23] workmad3: louism2wash: ideally, you won't be serving css and js files using rack
[19:10:41] workmad3: louism2wash: that's a job more suited to a server like nginx, or a CDN
[19:18:17] louism2wash: rhizome: thanks, I'll take a look
[19:20:34] rhizome: but yeah, best that it doesn't hit rack at all
[19:20:50] louism2wash: workmad3: I would tend to agree, I am just wondering the presence of that 'if-modified-since' header is forcing the check on the server? If that is the case, I think Rack is what is setting that header on the initial request for the file. I'm really not sure though.
[19:21:24] workmad3: louism2wash: if your web server is serving css/js, the request never reaches rack
[19:21:35] workmad3: louism2wash: not even for an initial request
[19:23:27] louism2wash: workmad3: I see what you're saying. How do I check if the web server is serving the assets? Is that the default config?
[19:23:50] workmad3: louism2wash: depends on your app server
[19:24:03] workmad3: louism2wash: with most app servers, no it isn't the default config
[19:24:33] louism2wash: workmad3: I'm using Phusion Passenger. Sounds like I need to dig into that documentation a bit more.
[19:25:13] workmad3: louism2wash: ah, that's the only one, afaik, that doesn't need extra config :) (unless you're running it in standalone mode and proxying to it through an nginx instance, rather than using the module)
[19:26:59] lessless_: hey folks! does anyone understands bitcoin protocol?
[19:28:46] tubbo: lessless_: these guys probably do https://en.bitcoin.it/wiki/API_reference_(JSON-RPC)
[19:29:22] louism2wash: workmad3: OK, so it sounds like Phusion Passenger is forcing the web server to store those files. In that case, it sounds like I need to make sure that Rack isn't setting that 'if-modified-since' header.
[19:30:35] helpa: lessless_: Don't ask "does anyone use <thing>?". It's better to just state your problem and if anyone has used <thing> they will most likely answer.
[19:30:35] tubbo: lessless_: !used btw if you want a more specific rails-centric answer
[19:31:13] dangerousdave: With Devise I have https://gist.github.com/deathwishdave/da687569449bfcb49ca5 which allows my to get to my sign in page with http://myapp.com/sign_in, problem is new_user_session still points at http://myapp.com/users/sign_in
[19:31:22] soahccc: Is ruby right with start_with? or why does any other language troll me with start>s<_with?
[19:31:59] tubbo: soahccc: what?
[19:32:25] lessless_: I want to implement a bitcoin payments in my app, what gem should I use and is it necessary to store whole information about transactions locally, which I suppose takes about ~15Gb?
[19:33:48] tubbo: lessless_: lol how did you come up with that number?
[19:35:25] tubbo: lessless_: first of all, pretty much every answer i've given you has come from the bitcoin wiki. why don't you try reading that? seems to have a shitload more knowledge on BTC than everyone here combined
[19:35:35] tubbo: lessless_: second of all, here are merchant services that use BTC: https://en.bitcoin.it/wiki/How_to_accept_Bitcoin,_for_small_businesses#Merchant_Services
[19:35:35] ivanskie: im getting a strange error when trying to show the index view for items...
[19:35:37] ivanskie: https://gist.github.com/i5okie/6690089
[19:35:51] lessless_: tubbo, Iused local bitcoin client and it's cache was growing like 1Gb in month
[19:35:55] tubbo: lessless_: you probably don't want to set up your own merchant service, due to the legal liabilities.
[19:36:00] ivanskie: it worked earlier just fine.. but now it doesn't want to show up.. I'm thinking it doesn't like that there is nothing there...
[19:36:11] ivanskie: but i don't understand why did not have any issues earlier..
[19:36:16] makerop: ya, use a 3rd party to facilitate btc transactions
[19:36:25] burmjohn: Anyone notice when in development mode if you change something in your code it takes 30 or so seconds for the webrick (or puma) to reload those changes? (Rails 4)
[19:36:47] lessless_: tubbo, it's just for kidding around
[19:38:38] ivanskie: oh interesting,
[19:39:26] ivanskie: i tried to import items.. and looks like it has indeed imported them, however my code to swap "name" with "id" by doing find_by_name did not actually do that.
[19:40:28] tubbo: lessless_: i guess you could use the API then...never bothered figuring out how to accomplish that since there's so much bullshit you have to wade through
[19:42:07] San1ty: anyone experience with discourse?
[19:43:01] ivanskie: okay so uhm
[19:43:04] tubbo: burmjohn: nope.
[19:43:24] tubbo: burmjohn: instantaneous for me, on a macbook air running OS X 10.8 with 4GB of RAM
[19:43:26] tubbo: and an SSD
[19:43:35] soahccc: tubbo: Well like all languages or frameworks I know use starts or ends_with but ruby implemented start_with and end_with. Same goes for exist? and exists? although ruby supports both here
[19:43:44] ivanskie: could someone please help me with this https://gist.github.com/i5okie/6643896?
[19:43:52] tubbo: burmjohn: that *probably* has to do with your I/O being fucked up. is your disk too full? not enough RAM?
[19:44:50] tubbo: soahccc: there's no "right" or "wrong"...it's just whatever the original dev thought was the easiest to remember
[19:45:08] burmjohn: tubbo: nope plenty of ram, it is a networked drive though. Could it be a timestamp thing?
[19:45:19] tubbo: soahccc: remember, ruby was initially developed by japanese people. so don't expect all of the method names to be grammatically correct...though they do seem to echo past language syntaxes.
[19:45:27] tubbo: burmjohn: it's a networked drive thing.
[19:45:33] tubbo: burmjohn: that's why you're seeing it move so slow.
[19:46:06] tubbo: happens to me every so often even though the server is in the same room and i'm connected directly into the Level3 internet backbone
[19:46:29] burmjohn: tubbo: ah, never had this issue in the past. Is there a way to force reload on every request rather then just tracked files?
[19:47:07] tubbo: burmjohn: restart the server? do work locally? remember, rails' development env was designed for local work, so it probably isn't going to be as good in a networked set up.
[19:50:15] soahccc: tubbo: Okay thanks I think I thought to serious about it ;)
[20:01:56] San1ty: Guys, I try: Gem install bluepill (have RVM installed) and when I execute it says bluepill not found;
[20:01:58] San1ty: what the?
[20:08:12] iamjarvo: so i am trying to use action_controller.relative_url_root = "/subdirectory" link_to example_url doesnt respect it
[20:10:45] Flashmasterson: i just installed homebrew and it's three commands (brew update
[20:10:46] Flashmasterson: $ brew install rbenv
[20:10:46] Flashmasterson: $ brew install ruby-build) for rails - what is the next step for getting rails 4 installed?
[20:12:31] thecarlhall: When Marshal.dump yields, "singleton can't be dumped", is there a nice/easy way to find out what is causing the offense?
[20:12:52] thecarlhall: this is when dealing with an array of AR objects
[20:14:51] tubbo: Flashmasterson: it's actually just one: `brew install rbenv ruby-build` :D
[20:15:00] tubbo: Flashmasterson: and the next step for getting rails installed is `gem install rails`.
[20:15:34] bratsche: thecarlhall: This doesn't answer your question, but beware of dumping like that if you're trying to store it somewhere like a db, because there's no guarantee to be compatible between even the most minor of Ruby versions.
[20:16:07] thecarlhall: bratsche: thanks for the tip. I'm storing this in memcache.
[20:16:33] tubbo: iamjarvo: did you try example_path?
[20:16:51] tubbo: or do you need to be doing _url to get the full path?
[20:18:29] ivanskie: so i've been dealing with importing a CSV file for like a week now, and have made a lot of progress thanks to lots of help..
[20:19:13] ivanskie: well now, after some progress.. i've cleaned up the CSV file in question in Excel, and matched each column according to Attributes from the Items model.. to hopefully help it along..
[20:19:22] ivanskie: well now i'm getting an error https://gist.github.com/i5okie/6690605
[20:20:00] ivanskie: on the part of the code that worked perfectly for importing data from CSV into a different model. (just without the part of the code that replaces Names with IDs)
[20:22:29] Flashmasterson: tubbo: alright something happened, can i send you the gist?
[20:22:49] ivanskie: removed * from there.. seems to be doing something
[20:22:56] tubbo: Flashmasterson: sure, why do you need to PM me though?
[20:23:09] ivanskie: its a 24mb file, with 290+ lines of CSV data
[20:23:31] tubbo: ivanskie: this is what's broken `item.attributes = row.to_hash.slice(*Item.attribute_names())`
[20:23:48] tubbo: ivanskie: i think you need to be more explicit in defining how your hash is supposed to look
[20:24:04] ivanskie: right, that makes sense.. I'm not too sure how that would look like
[20:24:39] Flashmasterson: https://gist.github.com/Flashmasterson/6690665
[20:24:57] Xeago: the * is called the splat operator
[20:25:05] tubbo: Flashmasterson: read line 30
[20:25:08] Xeago: it derefences an array
[20:25:10] tubbo: Flashmasterson: and install xcode developer tools
[20:25:21] Xeago: so it wsould be multiple arguments
[20:25:35] Flashmasterson: tubbo: ahhh ok, i just downloaded those tools
[20:25:45] tubbo: Flashmasterson: did you install them?
[20:26:13] tubbo: hmm, run `brew doctor`.
[20:26:29] tubbo: take care of all the warnings it throws you if there are any
[20:26:49] ggherdov: hi. does `gem install rails` requires gcc installed? I am getting "Failed to build gem native extension" ---> http://bpaste.net/show/1syOBW1YXP3z8vv95ieZ/
[20:26:50] tubbo: the issue is this: "/Users/toreystriffolino/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
[20:26:52] tubbo: You have to install development tools first.
[20:27:25] ivanskie: mI'm not sure what */splat is, i removed it.. and I'm still waiting for it to either error out. or finish the import..
[20:27:33] ivanskie: right now, it is actually importing
[20:27:39] tubbo: ggherdov: you probably don't want `sudo gem`...typically that's a system ruby that's typically a 1.8.7 variant.
[20:27:40] Flashmasterson: tubbo: ok keep in mind that i'm very new to this. i get this messaged after running brew doctor: https://gist.github.com/Flashmasterson/6690719
[20:28:17] ivanskie: I'm still only at ~40,000
[20:28:20] tubbo: Flashmasterson: okay so take care of them, you should be OK with the dylame stuff but the first one you need to take care of
[20:28:30] tubbo: Flashmasterson: however, it looks like homebrew can still sense your installation of GCC
[20:28:30] ivanskie: wow.. well i'll get back to you guys in.. half hour lol
[20:28:32] tubbo: so that's not the issue
[20:29:11] tubbo: Flashmasterson: try doing `brew install apple-gcc42`.
[20:29:39] ggherdov: tubbo: `gem install rails` wants to write in /var/lib, that's why the sudo. About, your remark, I don't get it; I have ruby 1.9.3
[20:29:44] momomomomo: I feel bad for Flashmasterson - he's been trying to do this for the last 2 or 3 days. Just. Install. Rails.
[20:29:55] tubbo: ggherdov: ah okay
[20:30:01] momomomomo: RVM is a bummer, maybe I should have thwarted you away from the rails tutorial and towards chruby
[20:30:02] ggherdov: tubbo: "system ruby" <--- what is this?
[20:30:13] momomomomo: ggherdov: That's the ruby that comes with your system - do not touch
[20:30:17] tubbo: ggherdov: well on OS X you get 1.8.7 installed out of the box, which is your "system" ruby.
[20:30:30] tubbo: ggherdov: on most other OSes ruby isn't bundled, so that's totally meaningless to you :)
[20:30:35] ivanskie: i just snooped into my pg database data..
[20:30:42] Flashmasterson: tubbo: ok got this https://gist.github.com/Flashmasterson/6690766
[20:30:54] tubbo: ggherdov: it's a typical newbie mistake to use `sudo gem`. you *shouldn't* need to do that...i'm not sure why rails "wants to" write to /var/lib
[20:31:03] ivanskie: its creating new id's and only populating the created at and msrp_currency fields
[20:31:39] ggherdov: tubbo: momomomomo: ok. I have a different setub, ubuntu server with *very* minimal packages. Ok got it, I will avoid "sudo gem" when possible thanks.
[20:31:50] tubbo: Flashmasterson: try a `brew update`. this is what I get: https://gist.github.com/tubbo/099dcbd61cdfbcfc9028
[20:31:58] momomomomo: ggherdov: Are you using rbenv, chruby, or rvm ?
[20:32:04] tubbo: Flashmasterson: protip...you need to brew update to get the latest versions.
[20:32:06] ivanskie: yeah so that did not work..
[20:32:16] tubbo: ggherdov: ahh you installed ruby with APT didn't you
[20:32:20] tubbo: s/ruby/rails
[20:32:22] ivanskie: how do I implicitly show what each column is when importing?
[20:32:24] helpa: ggherdov: Ubuntu Ruby, Rails and RVM setup guide: http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/ - Guaranteed to work 100% of the time or your money back!
[20:32:24] tubbo: ggherdov: !ubuntu
[20:32:25] ggherdov: momomomomo: you're naming implementations, right? how do I find out?
[20:32:38] ggherdov: tubbo: thanks a lot
[20:32:38] tubbo: ggherdov: follow that guide.
[20:32:41] ivanskie: because this process has worked on a different model, where i did not have to replace a column's data with another
[20:32:42] momomomomo: ggherdov: Not implementations, just ruby management stuffs
[20:32:52] tubbo: ggherdov: don't ever install anything ruby with any package manager other than rubygems
[20:32:54] tubbo: or homebrew
[20:32:59] momomomomo: ggherdov: https://github.com/postmodern/chruby
[20:33:18] ggherdov: tubbo: momomomomo: on thanks. Yes, apt.
[20:33:50] DylanJ: bradherman: any luck?
[20:33:52] tubbo: ggherdov: yeah don't do that. dpkg maintainers aren't fast enough with new ruby releases to be trusted. you're only setting yourself up for major failure if you install ruby via APT.
[20:33:52] ivanskie: and apparently Item.destgroy_all does not remove it's knowledge of previously existing IDs.. so when adding new items, it still starts from the 164, for example.. or the last id..
[20:34:34] tubbo: ggherdov: unfortunately (or fortunately? not sure which!), the Ruby community moves much faster than APT package maintainers can keep up. plus they ensure it works on all versions of the OS, Ruby doesn't do that at all.
[20:36:54] maZtah: how to install the 'pre' version of alchemy_cms?
[20:37:02] Flashmasterson: tubbo: ok i got this :https://gist.github.com/Flashmasterson/6690859
[20:43:00] jstrong: Is it possible to pass a block to a partial?
[20:49:04] tubbo: Flashmasterson: you're not gonna "break it". just keep trying to do what you're doing :)
[20:49:14] dummby: rubyonrails , is this a SCADA language?
[20:49:34] tubbo: Flashmasterson: oh wait you might need to `brew tap homebrew/versions`.
[20:49:42] tubbo: Flashmasterson: sorry you didn't have the right repo :D
[20:49:50] Flashmasterson: tubbo: ok it says "Already up-to-date" for homebrew
[20:50:06] dummby: rubyonrails , is this a SCADA language?
[20:51:42] tubbo: Flashmasterson: cool, did you try installing rails?
[20:51:47] tubbo: dummby: what's a SCADA language?
[20:51:50] scriabin: anybody know why I'm getting an error: No such file or directory - /.../tmp/cache/assets/sprockets%2F22ad3b255d8c7b87bf0ec5e6fc52f03720130924-13139-nfbh1v.lock after I switched this server from production to development?
[20:52:01] tubbo: dummby: and ruby on rals is NOT a language. ruby is a language. rails is a *framework*.
[20:52:03] dummby: INDUSTRIAL MACHINES
[20:52:11] tubbo: dummby: are you trolling
[20:52:47] Flashmasterson: tubbo: 'just did with 'gem install rails' and i got this gist: https://gist.github.com/Flashmasterson/6691048
[20:53:03] dummby: I want to learn about programming language related to SCADA
[20:53:10] tubbo: Flashmasterson: are you even looking @ the output or just pasting it directly to gist?
[20:53:17] tubbo: dummby: then why don't you go shove a big black dick in your ass
[20:53:45] tubbo: dummby: you rimjobbing north korean dictator cunt waffle
[20:54:06] gwillen: tubbo: you okay there?
[20:54:17] ivanskie: omg omg omg omg i fixed it
[20:54:34] tubbo: gwillen: i always like to go out with a bang. one big insult before i /ignore someone.
[20:54:41] dummby: so rubyonrails is mildly related to SCADA etc?
[20:54:44] tubbo: being profane is fun
[20:55:14] Flashmasterson: tubbo: just pasting, but now that you mention it - i see these two things as the most dosconcerting: "Could not create Makefile due to some reason, probably lack of
[20:55:14] Flashmasterson: necessary libraries and/or header" and "You have to install development tools first". the ladder because i already installed development tools
[20:55:17] dummby: fuckin fagits
[20:55:39] dummby: I WILL FUCK UR MOM WITH GEMS FULL OF CUM IN HER ANAL
[20:55:44] tubbo: Flashmasterson: please make an attempt to actually learn something before asking for more of my help. i'm not a REPL. i have a job and my time is valuable. please don't waste it.
[20:55:51] dummby: WITH GEM LUBE AND A TRAIN RACK UP HER CUNT. FUCKIN TROLLS
[20:56:06] dummby: RUBYONRAILS FAGITS
[20:56:12] tubbo: first rule of programming: look at the output for what you wrote...lol
[20:56:16] dummby: BITCH NIGGER MOTHERFUCKERS
[20:56:29] dummby: TUBBO U PIECE OF SHIT
[20:56:36] ivanskie: wtf. this i did not see coming..
[20:56:39] EminenceHC: Dummby's mom must have not made him his special meatloaf today...
[20:56:39] dummby: I WILL CUM ON UR MOTHERS ASS AND MOUTH, FO FREE
[20:56:40] Flashmasterson: tubbo: understood but realize that i know next to nothing about this process, i play upright bass and am trying to create a really advanced website
[20:56:59] fryguy: going to love when sometime in the future your real name gets associated with this alias, and this shows up in the search results for your name
[20:57:00] dummby: I AM PLAYING WITH UR MOMS ASS, TUBBO BITCH
[20:57:05] ivanskie: i thought vendor part numbers must be unique.. apparently they are boot.. tech data is selling same manufacturer product number 3 times for 3 different prices..
[20:57:07] dummby: AND SHE IS PLAYING WITH MY BALLS
[20:57:09] ivanskie: how the f does that work
[20:57:20] tubbo: Flashmasterson: yeah, i feel ya. i'm a musician also. it's hard to make a really advanced site, that's why it's "advanced". but you'll get there. code is a lot like composing music.
[20:57:26] ivanskie: solution, delete from CSV
[20:57:31] dummby: BITCHFAGS RUBYONFAILS
[20:57:47] dummby: I AM ASSFISTING UR MOMS
[20:57:47] scriabin: Flashmasterson:you're installing on a mac?
[20:57:49] tubbo: Flashmasterson: you have to actually make an attempt to learn, though...and sometimes it helps to meet up with others who code in rails and actually just shadow them to see how they work.
[20:57:50] dummby: GAY MOFOS
[20:58:03] ivanskie: unless i can index from non unique column
[20:58:14] dummby: FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK V
[20:58:19] dummby: FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK
[20:58:22] dummby: FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK
[20:58:25] dummby: FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK
[20:58:28] dummby: FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK
[20:58:29] ivanskie: can someone do a ban already?
[20:58:30] dummby: FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK
[20:58:33] dummby: FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK
[20:58:36] dummby: FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK
[20:58:39] dummby: FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK
[20:58:43] fryguy: dummby: you mad bro>
[20:58:45] tubbo: Flashmasterson: this is not the last time you'll be doing this
[20:59:32] ivanskie: what was that showcase of maturity?
[20:59:36] Flashmasterson: tubbo: i see. i live in ny where the few coding friends i have are super busy, but i'll keep trying to ask for their help. can you at least give me a hint for what the next step is?
[20:59:42] tubbo: everyone please /ignore dummby
[20:59:48] bratsche: Flashmasterson: If it makes you feel any better, I just play viola. :)
[20:59:48] scriabin: Flashmasterson:you're installing on a mac?
[20:59:53] breakingthings: he's already b& tubbo
[21:00:06] tubbo: i have him on ignore so i dunno
[21:00:11] ajph: is there a good way of returning html for a query request but returning nothing for a normal browser request? can't think of a way to differentiate
[21:00:26] Flashmasterson: scriabin: hahahha great name, yeah i am
[21:00:29] fryguy: ajph: what do you mean a "query" request?
[21:00:33] tubbo: ajph: render text: '' would render nothing.
[21:00:50] ajph: fryguy: JQuery (javascript)
[21:00:51] ivanskie: if i edit my schema.rb file and do rake db:migrate … thaaat won't to buzz all will it
[21:01:07] tubbo: Flashmasterson: it's always a pain installing ruby the first time...getting all the dev tools together on a mac.
[21:01:09] scriabin: ok have you tried this? http://www.rackspace.com/blog/installing-rails-on-a-mac/
[21:01:19] tubbo: wtf Flashmasterson
[21:01:20] ajph: tubbo: yeah or render :nothing => true - but how do i do that for a browser request vs. return some actual data for a javascript ajax request
[21:01:20] bratsche: scriabin: Are you a pianist?
[21:01:21] fryguy: ajph: so like you want to return json for an ajax request or something?
[21:01:22] helpa: Flashmasterson: http://ryanbigg.com/2011/06/mac-os-x-ruby-rvm-rails-and-you/
[21:01:22] tubbo: Flashmasterson: !osx
[21:01:25] tubbo: the guide!
[21:01:41] ajph: fryguy: yeah but actual html so i don't have to parse the json
[21:02:01] scriabin: piano, guitar, anything I can get my hands on - I'm a composed actually
[21:02:02] tubbo: ajph: yeah you could `render text: nil unless request.xhr?`
[21:02:11] tubbo: render text: nil and return unless request.xhr?
[21:02:16] bratsche: scriabin: Cool. :)
[21:02:26] fryguy: ajph: 1. ajax partials should probably be done a different way (see turbolinks, or real javascript frameworks), otherwise, just request a different resource, potentially by extension (/blah.ajax versus just /blah)
[21:02:38] fryguy: or use the .xhr? method to check
[21:03:06] fryguy: http://www.learningjquery.com/2010/03/detecting-ajax-events-on-the-server
[21:03:54] ajph: fryguy, tubbo: what i'm actually doing is rendering a view based on /items/viewall, then using ajax to request /items/view/:page to append to a view when the user scrolls to the bottom of the page
[21:04:27] ivanskie: so hum i have add_index :items, :vpn, :unique => true...
[21:04:37] ivanskie: how do i change it to unique => false?
[21:04:40] ivanskie: in migration?
[21:04:45] ajph: at the moment /items/view/:page just renders some basic html that gets put on the end of the div on my main page
[21:04:51] ivanskie: i tried remove_index :items, :vpn, :unique => false
[21:04:58] ivanskie: and then add_index :items, :vpn, :unique => false
[21:05:02] boytoy: Is there nothing like good ol' auto_link in Rails 4? (https://github.com/tenderlove/rails_autolink)
[21:05:17] ivanskie: err tried remove_index :items, :vpn, :unique => true
[21:05:17] tubbo: ajph: i also use this trick when working with ember.js.. https://gist.github.com/tubbo/1e25e297287c82b95b3b
[21:05:20] ivanskie: and then add 
[21:05:24] ivanskie: but it doesn't like it
[21:06:46] ivanskie: how do i remove index?
[21:06:50] smathy: Ahh, "doesn't like it" - I'm so glad my computer spits out specific error messages, I don't know how I'd cope if it just expressed its feelings like so many others seem to.
[21:07:28] smathy: Helping by not helping since 1989.
[21:07:35] scriabin: oh how much do I hate svn? This much <------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------>
[21:07:49] ajph: tubbo: is returning a bunch of html and appending it to a div good/reasonable practise?
[21:07:57] ivanskie: i don't like how dirty migrations are
[21:08:14] ivanskie: with each version number in beginning, i can't consolidate them into one or two files..
[21:08:19] ivanskie: don't like it
[21:10:02] ivanskie: I'm learning to be a better programmer, but why should the process be taken out on the application I'm working on.. lol
[21:10:15] ivanskie: …just blabbering, don't mind me
[21:11:35] ivanskie: gotta wait another minute or so to import the rest of the file..
[21:11:35] s2013: ivanskie: you can just load your schema
[21:11:39] s2013: after you run the migration initially
[21:11:48] s2013: thats what i do atleast
[21:11:53] ivanskie: that makes more sense
[21:12:15] s2013: i prefer rake db:reset if i want to just reload everything
[21:12:27] ivanskie: at 0.5ms to import an item… out of 293000 rows in CSV file… hmm
[21:12:31] ivanskie: what 2.5 minutes?
[21:13:42] ivanskie: would probably be quicker with nginx and unicorn without spitting out log into my terminal eh
[21:14:13] slash_nick: ivanskie: are you using postgres?
[21:14:25] slash_nick: then why not use COPY to import csv files?
[21:14:46] tubbo: ajph: not really.
[21:14:51] slash_nick: it's allllmost instantenous, especially for a measly 290k rows
[21:14:56] tubbo: ajph: but neither is a URL named 'GET /items/viewall'
[21:15:10] slash_nick: ivanskie: http://www.postgresql.org/docs/9.2/static/sql-copy.html
[21:15:15] ivanskie: but what about created_at and updated_at fields..
[21:15:27] ivanskie: wouldn't rails explode if they were blank?
[21:15:46] ivanskie: otherwise i would have just imported using PGadmin...
[21:15:47] ajph: tubbo: what's the convention to do something like that?
[21:16:13] ivanskie: but its not a very clean process..
[21:16:15] ajph: tubbo: return json and parse it all?
[21:16:22] ivanskie: not for rails anyway
[21:16:27] tubbo: ajph: yeah, use a client-side templating library
[21:17:42] slash_nick: ivanskie: you could add ,, to the end of every line... or ,<timestamp>,<timestamp>
[21:18:09] ivanskie: its alright, i'll wait it out this time
[21:18:32] slash_nick: yeah... i think there might be other nuances.. something tells me you'd want to kick the pkey sequence after importing via psql copy, as well
[21:19:15] ivanskie: okay i think i miscalculated how long it'll take
[21:19:22] ivanskie: cause I'm still at 48k
[21:19:37] ivanskie: it keeps jumping from .5 to .8ms
[21:19:55] ivanskie: i wish i had sad in this thing
[21:20:38] ivanskie: well, while its importing, i gotta figure out how to paginate all this maddness
[21:20:48] Trudko: Guys out of couriosity how do you back your code? most people seems to use github and some localhistory, I was thinking of getting usb key where I would create copy of my projects. That way I dont have to worry that much about loosing one day work(if i would commit to repository at least once a day)
[21:21:20] ivanskie: github still seems like a good way
[21:21:21] fryguy: Trudko: use version control, and commit much more often than once a day
[21:21:24] ivanskie: or git at least
[21:21:41] Trudko: can that be automatized/
[21:21:52] duggiefresh: agreed. use git and push to branches.
[21:21:59] tubbo: i guess but why would you want it to be automated
[21:22:11] ivanskie: that would complicate things further
[21:22:14] Trudko: cause i am lazy ? why not
[21:22:22] ivanskie: especially if you are in the middle of working on a file
[21:22:26] ivanskie: and save it mid-stream
[21:22:34] ivanskie: or save it, then add a few more codes
[21:22:38] Trudko: yeah thats why I would buy USB key where I would have backup not version contorl
[21:22:40] ivanskie: and it commits and pushes.. ur screwde for that commit
[21:22:59] ivanskie: normally you write a bit of code make sure it works, then commit and push
[21:23:07] ivanskie: then add some more, then commit and push
[21:23:11] fryguy: Trudko: you make commits whenever you finish an atomic piece of work
[21:23:20] ivanskie: what he said
[21:23:30] fryguy: you are correct in that you need a backup along with version control, but something like github takes care of that for you
[21:23:51] ivanskie: if you worry about not having internet connection, you can clone it to your usb key, daily
[21:24:08] ivanskie: or however often you prefer
[21:24:19] AntelopeSalad: does anyone know what would cause ?resource[field]=foo to be appended to a url rather than just foo?
[21:24:23] ivanskie: and that part can be automated
[21:24:27] Trudko: internet connection wouldnt be the problem I just worry that I willget lazy and I wont commit for day or two and lost some work there.
[21:24:37] ivanskie: thats a different problem
[21:24:39] tubbo: Trudko: git/version control is about code communication, not code storage. it's to show a history of your changes. if all of your commit messages are "changed files", for example, how is a VCS at all useful?
[21:24:40] Trudko: it shouldnt happen but usb key is cheapy as hell
[21:25:05] ivanskie: git combines both however..
[21:25:07] tubbo: Trudko: instead of shimming your apparent laziness, why not just nip the problem in the bud and commit more frequently?
[21:25:13] ivanskie: version history, and code backup
[21:25:18] ivanskie: remote backup of your code
[21:25:20] tubbo: yes, but you get code backup as a side effect
[21:25:26] tubbo: and only if you use remotes
[21:25:30] tubbo: which isn't required with git
[21:25:38] Trudko: tubbo: i dont trust my self :) and as I said I would use git i just want to add usb key just to be sure.
[21:25:41] tubbo: the purpose of a VCS is to show changes
[21:25:55] ivanskie: right so, i guess he could use git for version control, then backup the folder to his usb key as he wishes
[21:25:56] tubbo: Trudko: you might as well just work off the USB at that point
[21:26:04] ivanskie: the copy process can be automated for sure
[21:26:18] toretore: GIT IS THE CORRECT ANSWER
[21:26:26] ivanskie: there you go, tubbo just suggested a great solution for you
[21:26:39] Trudko: tubbo: i could i guess but i like git hub.
[21:26:40] fryguy: Trudko: your thought process is entirely wrong, and any developers you work with in the future are going to hate you
[21:26:41] tubbo: Trudko: make sure you copy the whole dir, including the .git/ folder, to preserve history
[21:26:57] tubbo: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @ fryguy
[21:27:06] Trudko: fryguy: how is being extra safe wrong? i will use version control PLUS i will have copy on usb key
[21:27:21] fryguy: Trudko: because you aren't going to be committing enough
[21:27:22] ivanskie: Trudko, thats not extra safe
[21:27:32] fryguy: there's nothign wrong with using a usb key whatever, go ahead and do that, OR JUST USE GITHUB
[21:27:42] tubbo: but not BOTH. :)
[21:27:44] Trudko: fryguy: which magic ball told yout that?
[21:27:58] ivanskie: your head, ball
[21:28:09] Trudko: ivanskie: still safer then just using gihub only.
[21:28:12] fryguy: Trudko: if you want to be naive and ignore the advice from people, whatever
[21:28:29] tubbo: Trudko: no it's not, it's an extra level of complexity that doesn't offer you that much more win.
[21:28:41] tubbo: and doesn't make you any more "safe", in fact i'd argue it keeps you less safe
[21:28:59] Trudko: tubbo: is it though? i will just plug it in and saving would be automatic.
[21:29:04] Trudko: tubbo: why do you think so?
[21:29:20] tubbo: Trudko: suppose you and i are hacking on rails/rails, and you're working on a patch. you do a bunch of work and save the files but don't commit.
[21:29:25] ivanskie: @fryguy is trying to tell you that you should keep your code sanely, by using version control responsively.. it's either you use version control and commit as you should, or don't use it at all, because it won't help you. (at least i think thats it)
[21:29:30] tubbo: Trudko: meanwhile, i edit the same files and DO commit, and push to rails/rails
[21:29:46] tubbo: Trudko: you've backed up the code on your USB stick, now you come to pull down and "oh no!" you lost your work
[21:30:04] tubbo: Trudko: your automated program copies the bad merge to your USB stick. your code is gone.
[21:30:25] tubbo: Trudko: had you committed, you would have avoided this whole scenario. because git knew you did X at Y time, and you can always go back to that point in `git reflog`.
[21:30:35] Trudko: tubbo: and if I wont have usb key it can't happen?
[21:30:45] Trudko: tubbo: and I am not saying I wont commit
[21:30:47] ivanskie: forget your usb
[21:30:54] tubbo: Trudko: it can, but only if you don't commit anything. the USB is a red herring.
[21:31:01] Stalkr_: Hey, I am trying to deploy an app on Heroku for New Relic, but I receive 'OpenSSL::SSL::SSLError: SSL_connect SYSCALL returned=5 errno=0 state=SSLv2/v3 read server hello A'
[21:31:04] Stalkr_: What is the problem?
[21:31:05] tubbo: Trudko: let's revisit this one...why do you need a USB stick?
[21:31:13] tubbo: wasn't it to protect against you NOT COMMITTING?
[21:31:29] tubbo: Trudko: so right there, you're saying you won't be committing.
[21:31:45] Trudko: tubbo: well i thought that it could be safe if i forget to commit lets say one day of work.
[21:31:49] tubbo: Trudko: i commit so frequently that i only stand to lose about 15 mins of work, max, if my computer actually exploded right now.
[21:32:06] Trudko: tubbo: really you commit that often? hmm
[21:32:09] tubbo: Trudko: if you actually have the ability to commit an entire day's work in one go, you aren't committing frequently enough
[21:32:09] ivanskie: ^ right, and a little bit excessive kind of committing
[21:32:15] tubbo: not excessive
[21:32:20] fryguy: Trudko: that's what we've been telling you. commit more often
[21:32:22] tubbo: very much in-cessive.
[21:32:32] tubbo: haha Trudko didn't realize how often we meant! :D
[21:32:33] ivanskie: however, if you commit once in a while, then forget to commit.. and you have some code on usb, and some code locally.. and some on github maybe..
[21:32:34] msimkins: Trudko: I probably commit once an hour
[21:32:38] ivanskie: how do you know what was your good code?
[21:32:57] tubbo: Trudko: can i pm you real quick?
[21:33:20] Trudko: fryguy: and I agreed what I am saying is that i could forget to commit and something might just happen there if I have usb key i have one backup . if I dont have usb key I don't.
[21:33:21] msimkins: ivanskie: Different branch
[21:33:24] Trudko: tubbo: yeah sure!
[21:33:29] foucist: tubbo: pm me instead! i'm cooler
[21:33:35] foucist: ACTION wants the pm love
[21:33:43] Trudko: i am not planning to commit less just because I have usb key
[21:34:23] msimkins: ivanskie: Working code is in master, what I hack on is in a feature branch
[21:34:38] ivanskie: Trudko: if you are too lazy to type all the commands to commit each time… you can make an Allias or custom command like icon or whatever, that executes git add -A and then git push -u origin master or whatever
[21:34:44] smathy: What has IRC become? People ask whether they can PM others now? Are you Canadian or something tubbo?
[21:34:44] fryguy: Trudko: so fine, use the usb key
[21:34:50] ivanskie: ur right msimkins
[21:35:19] ivanskie: i broke my code once, by not branching and then trying to branch and merging some bad code..
[21:35:21] tubbo: smathy: setting an example
[21:35:22] ivanskie: into the master.. lol
[21:35:24] ivanskie: that was fun
[21:35:45] tubbo: ivanskie: `git reset --hard <the-sha-before-you-did-that>` :)
[21:35:52] fryguy: Trudko: using a usb key in addition to correctly using version control == doing it right. using it as a replacement for version control or as a way to let you be shitty with version control == doing it wrong
[21:35:57] ivanskie: may way past that now
[21:35:58] Trudko: ivanskie: yeah for sure i would like to use simple commands but still as I said usb key wont hurt.
[21:36:17] Trudko: fryguy: I agree! i want to use as addition not as replacement.
[21:36:20] ivanskie: well its up to you :)
[21:36:32] tubbo: Trudko: FWIW, i also keep a second copy of my code on my own personal git server
[21:36:38] tubbo: because you just never know when github is going to change their ToS... :)
[21:36:53] omarqureshi: surely you have the copy of your source code locally, right? :<
[21:36:55] toretore: Trudko: a usb key is much, much worse protection than proper git usage
[21:37:05] toretore: (with a remote)
[21:37:06] tubbo: omarqureshi: my personal git server is on a 1U machine in my house, so that's kinda local right? :)
[21:37:09] ivanskie: I'm glad.. tubbo does that.. so rails is not doomed when that does happen lol
[21:37:14] Trudko: toretore: yeah for sure , i dont want to use usb key as replacement.
[21:37:16] omarqureshi: yeah, i guess
[21:37:22] tubbo: i don't contribute to rails or anything lol
[21:37:27] omarqureshi: pushing to multiple remotes seems meh-like.
[21:37:30] toretore: Trudko: this is to say you should focus on using git properly first
[21:37:33] ivanskie: then we're doomed
[21:37:39] toretore: this usb thing is mostly a waste of time
[21:37:40] omarqureshi: unless needed
[21:37:52] Trudko: toretore: yeah fore sure.
[21:38:01] Trudko: toretore: well at worst i will waste few bucks
[21:38:01] pontiki: usb keys make wonderful floppy replacements
[21:38:13] toretore: Trudko: and a lot of time
[21:38:13] pontiki: so i can cart around big files
[21:38:16] ivanskie: man I'm still only at 95k :(
[21:38:22] Trudko: toretore: why do you think so?
[21:38:29] ivanskie: i think i miscalculated 2.4333 to be hours and not minutes
[21:38:41] toretore: Trudko: if you want *backup*, use a proper backup solution instead
[21:38:59] msimkins: omarqureshi: Just have a cron job somewhere that pulls the current code then
[21:39:22] pontiki: or send a 12.4G movie to a friend who has slow network
[21:39:23] toretore: omarqureshi still uses svn
[21:39:26] toretore: don't listen to him
[21:39:29] omarqureshi: msimkins: then you have to have private keys on the server
[21:39:32] foucist: toretore: you lie!
[21:39:38] omarqureshi: i still use CVS
[21:39:40] foucist: omarqureshi was using git before linus made it
[21:40:04] pontiki: who has private keys??
[21:40:07] toretore: i use mv file.rb file.rb.bak22
[21:40:07] ivanskie: man. i love when this happens.. someone comes in with a question.. and everyone starts replying, and suggesting ideas :)
[21:40:16] ivanskie: real sense of community here :)
[21:40:17] pontiki: github does not have my private keys
[21:40:24] foucist: ivanskie: you're just lucky with time of day or something ;)
[21:40:32] omarqureshi: pontiki: im not talking about github.
[21:40:41] omarqureshi: please read the conversation fully
[21:40:42] ivanskie: no i've done that myself before.. asked some question, and everyone started to argue about one or the other
[21:40:53] omarqureshi: FUCKING USE POSTGRES!
[21:40:54] Trudko: ivanskie: true this channel saved my as* many times.
[21:41:18] pontiki: no server i use has my private keys
[21:41:20] ivanskie: without these guys here i probably wouldn't get to where I'm at right now with my app.
[21:41:29] msimkins: omarqureshi: Well it's my server I'm backing ip to, so it will have a key on it anyway
[21:41:35] omarqureshi: pontiki: you're drunk, go home
[21:41:37] toretore: pontiki: you don't understand what omarqureshi was saying
[21:41:56] ivanskie: there we go, its starting to fall apart
[21:41:57] msimkins: omarqureshi: It's own private key
[21:42:07] Trudko: toretore: btw what would you use as proper backup solution for solo developer/
[21:42:10] bratsche: The sky is falling!
[21:42:31] omarqureshi: shipped off to iron mountain
[21:42:35] toretore: Trudko: a usb stick
[21:42:36] omarqureshi: on a daily basis
[21:42:50] Trudko: toretore: i think you are sarcastic :D
[21:43:10] toretore: Trudko: there are lots of choices, depends on your os etc
[21:43:12] bratsche: Trudko: If you use Mac then Time Machine isn't bad.
[21:43:31] ivanskie: time machine isn't that good of backup..
[21:43:42] pontiki: the only thing i can see about needing private keys on a server is in response to this: [20130924|1638.59] < msimkins> omarqureshi: Just have a cron job somewhere that pulls the current code then
[21:43:47] ivanskie: not for code anyway
[21:43:52] omarqureshi: right pontiki
[21:43:53] Trudko: i guess you will loose respect for me if I had any respect :D ...but i use windows ....(dont judge me)
[21:43:53] toretore: tbh there are no really good backup solutions that i know od
[21:44:04] pontiki: you do not need private keys on the server to do that
[21:44:07] ivanskie: how do you do any rails programming on windows?
[21:44:10] toretore: WWWWIIIIINNNNDDDDDOOOOOWWWSSSS EVERYONE!!!!!
[21:44:21] toretore: he uses windows!!!!
[21:44:35] omarqureshi: how does the remote server using cron pull code in from a private repo then pontiki ?
[21:44:37] ivanskie: rails is cross platform
[21:44:39] omarqureshi: please elaborate.
[21:44:53] ivanskie: ssh tunnel
[21:44:57] pontiki: same way it can from github
[21:45:01] Trudko: ivanskie: well I dont do rails for long time i had only one smaller app and I didnt have problem. I have linux in VM for testing(production is also at linux)
[21:45:03] pontiki: https interface
[21:45:11] omarqureshi: pontiki: and authentication?
[21:45:23] ivanskie: i tried to get into rails on Windows..
[21:45:25] ivanskie: multiple times
[21:45:35] omarqureshi: thats just as stupid as a private key, surely
[21:45:36] ivanskie: can't figure it out for the life of me..
[21:45:43] ivanskie: or rather i give up within first 2 minutes
[21:46:02] Trudko: ivanskie: i have used rail installer without any problem
[21:46:14] ivanskie: i have a macbook at home.. so every time i get an amazing idea of using my windows machine with the bigger screen… and try to install rails..
[21:46:15] Trudko: afaik some gems could have problems with windows?
[21:46:20] ivanskie: i end up going back to my macbook within seconds
[21:46:21] slash_nick: Me too... first time I experienced rails was ~2007. I worked with it on a windows machine for one week - by the end of the week I had installed ubuntu over windows AND bought a macbook.
[21:46:45] ivanskie: meh rails installer meeeehhhh
[21:46:52] ivanskie: its allllrrriiiggghhtt i guess..
[21:47:16] ivanskie: for me personally i just can't get over using Command Line / prompt,, in windows to do this stuff..
[21:47:20] EminenceHC: does rails installer install ruby 2.0? last time I checked they only supported 1.9
[21:47:30] bratsche: If I were developing on Windows the first thing I'd do is install a Linux VM.
[21:47:31] ivanskie: and i don't have the same commands i've grown accustom to.. like ls or ll
[21:47:43] ivanskie: I'm like buddy buddy with centos..
[21:47:48] ivanskie: and pretty much same with macosx
[21:47:49] Trudko: ivanskie: yeah I actually understand that because comamnd line is reason why I am flirting with linux after years. i get tired of using mouse
[21:48:01] San1ty: installing discourse is a fucking pain in the ass
[21:48:06] San1ty: sorry just had to vent
[21:48:09] ivanskie: so trying windows i give up so easy… yeah i could use that linux runtimes and stuff but meh
[21:48:15] Trudko: ivanskie: so i am slowly figuring out some cool things which you cant do in winodws.
[21:48:43] ivanskie: i think windows, despite being all mouse control, and yada yada.. actually slows me down when it comes to this stuff
[21:49:18] ivanskie: the only guy i really use, is for text editing and quick file manipulation without having to type out long commands
[21:49:36] fryguy: ivanskie: you should check out ranger for file manip
[21:49:40] ivanskie: which is easy with linux.. just minimal vm..
[21:49:50] ivanskie: and connect with winscp and do all that with graphical stuff
[21:49:58] ivanskie: but still use linux backend
[21:50:31] tobobo: ivanskie: that's what i do on my mac. works pretty well.
[21:51:01] tobobo: ivanskie: and if you screw something up you can keep backups of the vm
[21:51:36] ivanskie: i think i would switch to doing that as well if i had mission critical app to work on. or close to it..
[21:51:41] ivanskie: right now I'm all local on my mac..
[21:51:58] fryguy: blah, find it so much easier to just do linux for everything
[21:52:02] ivanskie: later i'll either up it to my EC2 instance, or try heroku..
[21:52:14] ivanskie: although for the app I'm working on, the production will be sitting in a linux VM
[21:53:04] ivanskie: so right now I'm trying to do all i can to make sure that gem file lock and what not are up to snuff to be able to transition over to another platform seamlessly
[21:53:22] ivanskie: one thing i should have done was create a gemset
[21:53:25] ivanskie: haven't done that yet
[21:53:32] fryguy: don't use gemsets anymore
[21:54:08] fryguy: that's what bundler is for now
[21:54:20] smathy: It's what bundler was always for.
[21:54:30] ivanskie: but now gemfile.lock is there..
[21:54:34] ivanskie: from getgo..
[21:54:42] ivanskie: i guess that replaced the gemset?
[21:54:51] ivanskie: right makes sense
[21:54:57] ivanskie: btw.. I'm still importing
[21:55:08] ivanskie: at 130k stil
[21:55:15] ivanskie: yah. 2.3 was the hours not minutes
[21:56:23] ivanskie: i did 0.5ms x 1000 then 297000..
[21:56:27] ivanskie: hm don't remember now
[21:57:42] ivanskie: (0.5x297000)x(1000/60)
[21:57:50] ivanskie: i think should give me minutes it will take
[21:58:39] ivanskie: ok my math is getting worse by the minute
[21:59:12] fryguy: what are you importing anyway
[21:59:29] ivanskie: a price list from a supplier
[21:59:33] superscott[8]: if the connections in my rails3 active record pool are going stale, can anybody point me in a good direction for dealing with that?
[21:59:51] ivanskie: which carries over 290k of items apparently
[22:00:04] fryguy: 0.5ms to import a single item is terrrrrrrrrrribad
[22:00:25] smathy: ivanskie, 1000/60 probably isn't doing what you think it is.
[22:00:49] ivanskie: yah, thaïs cause each line is accessing vendor model, and doing a swapparoo of "vendor name" for vendor_id
[22:01:00] ivanskie: over 160 vendors
[22:01:16] ivanskie: didn't feel like manually doing the swap in notepad.. lol
[22:01:27] scriabin: looking for advice from a more experienced rails developer - I have an object which has_many :servers. I need to deal with these servers in batches determined by :oos_percentage. So I was thinking of creating a method number_of_oos_blocks and then for each block work with servers in that block
[22:01:33] scriabin: then I realized this is a lot like pagination
[22:01:43] scriabin: so should I just use pagination?
[22:01:55] scriabin: in other words will_paginate is already in my project
[22:02:24] ivanskie: smathy: yah it definitely is not.
[22:02:56] ivanskie: and multiplying 0.5 by a 1000 isn't helping either
[22:03:09] ivanskie: 500th of a second.
[22:03:17] ivanskie: so to turn that into second.. hmm
[22:03:34] ivanskie: 0.005 x 297000
[22:04:01] ivanskie: 24.75 minutes
[22:04:03] smathy: I have no idea what your problem is, just that integer division is a common gotcha.
[22:04:17] ivanskie: I'm trying to figure out how long this import is going to take
[22:04:38] ivanskie: at average of 0.5ms per row, ~297000 rows
[22:05:12] ivanskie: its been way over 24minutes
[22:05:37] ivanskie: oh brilliant
[22:05:44] ivanskie: rails is on a different time zone
[22:05:58] ivanskie: it says first item was created at 8pm tomorrow
[22:06:06] ivanskie: its 3:06 right now
[22:06:27] ivanskie: how does that happen?
[22:06:46] ivanskie: utc+ 0 it says in the console right now
[22:06:52] ivanskie: is its time zone
[22:07:04] ivanskie: I'm assuming its PG that's in diff timezone
[22:07:07] ivanskie: and not rails
[22:07:32] ivanskie: i know i can check.. but I'm gonna leave it alone to do import for now
[22:07:39] ivanskie: i really want those items in there already
[22:08:19] ivanskie: ok so yah its been 2 hours now and its still only at 151k
[22:08:29] smathy: Should have been just 2.5 minutes
[22:08:40] ivanskie: yah thats what i thought
[22:09:16] ivanskie: i think i missed the part where it declares how long it took it to switch vendor_name for vendor_id
[22:09:19] ner0x: In the past I've used factory_girl to create complex fixture data, any alternative methods? (Starting a new project and figured I'd ask)
[22:09:21] smathy: Computations often fail to proceed at a linear rate.
[22:09:56] ivanskie: so there's also .2ms on average at play per row..
[22:10:10] ivanskie: so i guess overall the average jumps to .7 to .8ms per row
[22:10:31] ivanskie: but thats still in minutes we're talking about so yah.
[22:11:47] frem: Question: I have a model that `belongs_to Message` and has `attr_accessible :message_id`. When I try to create an instance of the model `MyModel.create({message_id: foo})`, the model says it doesn't have the attribute `message_id`. But it does have `messaged_id`. Wat?
[22:12:54] ivanskie: heh you know what i've also noticed..
[22:13:12] ivanskie: it says all the times it took the sql to insert into… and rails to lookup vendor_id by name...
[22:13:23] ivanskie: but every couple of seconds.. it pauses for a second or two
[22:13:36] ivanskie: im assuming thats the hard drive catching up
[22:14:41] ivanskie: (261.4ms) COMMIT
[22:15:26] toretore: ivanskie: are you doing an import?
[22:15:46] smathy: Probably rebuilding indexes.
[22:15:54] matiasevqz: is considered bad practice to put classes that not inherit from ActiveRecord::Base in the directory app/model/ ?
[22:15:56] toretore: using activerecord?
[22:16:03] toretore: matiasevqz: no
[22:16:12] toretore: if they're models that is
[22:16:26] matiasevqz: for instance i have a class that do some pure business logic, but this class does not correspond to a table in the database. I only use an object of this class to make a json response like this: render json: Calculate.new(params)
[22:16:45] ivanskie: i don't have index on item model
[22:16:57] toretore: matiasevqz: if it's not obviously a model, it should probably go in lib
[22:18:06] ivanskie: wow man my macbook is getting warm...
[22:18:39] ivanskie: dont care anyway
[22:19:07] toretore: ivanskie: are you doing something like bigFile.rows.each{|row| Item.create(row.atts) } ?
[22:19:28] ivanskie: but what i do care about is it is taking longer and longer as the import is commencing
[22:19:52] ivanskie: first_or_create
[22:20:11] toretore: is that yes or no?
[22:20:28] toretore: yeah, that's going to take a loooong time
[22:21:00] toretore: you're better off using mass insert or importing csv directly
[22:22:21] ivanskie: well I'm already at 161000… still have 130k rows to go
[22:26:54] Radar: Good morning all
[22:27:50] toretore: radar signal received; bouncing back to emitter.
[22:28:52] ivanskie: toretore ur doing it wrong..
[22:29:30] toretore: radar shield is not up yet
[22:29:41] frem: never mind. i had a typo in my migration... -_-
[22:30:53] ivanskie_: had to login on windows machine... taking 2 minutes to type something up
[22:31:01] ivanskie_: so toretore ur doing it wrong
[22:31:57] ivanskie_: oh this is painful.. i have to leave work with my macbook open
[22:32:02] ivanskie_: so it continues the import
[22:32:07] digitalcake: when making a basic site with rails whats the best way to set up key / value site specific settings. Example I have a small section in my footer that I want to be able to make dynamic but I dont want a whole model for.
[22:32:31] ivanskie_: and driving will make the hard drive park a few times probably.. so that will prolong the process even more..
[22:32:35] ivanskie_: noooooooooooooOooooo
[22:32:47] Radar: ivanskie_: noob
[22:32:52] Radar: should've gone with a CSV import
[22:33:04] ivanskie_: im doing CSV import
[22:33:13] toretore: shoulda used mongo
[22:33:30] Radar: ivanskie_: CSV import by loading the data with Ruby and then inserting it using AR?
[22:33:44] Radar: Not what I meant. I meant something like LOAD DATA INFILE for MySQL or COPY from PostgreSQL
[22:33:47] Radar: so much faster
[22:34:00] toretore: or mass insert
[22:34:00] ivanskie_: someone already suggested that
[22:34:11] ivanskie_: but what about created_at and updated_at
[22:34:19] ivanskie_: what am i gonna do with that?
[22:34:22] toretore: add them yousrself
[22:34:32] ivanskie_: for every row in 297000 rows?
[22:35:07] ivanskie_: see if im writing code here i might as well write it to do it from the rails app.. otherwise i could just import directly into pg from pgadmin or something
[22:35:32] wm3|away: ivanskie_: just write an SQL update statement that sets the created_at and updated_at to the current time
[22:36:09] ivanskie_: alright i'll cancel the import
[22:36:40] ivanskie_: reason for not doing direct import => i need to swap "vendor name here" for vendor_id
[22:36:45] ivanskie_: while importing each row into items
[22:37:04] Radar: ok man, whatever you want
[22:37:42] wm3|away: ivanskie_: fair enough
[22:37:45] toretore: connection.execute("INSERT INTO items (foo, bar) VALUES #{rows.map{|r| "(#{r.to_sql})" }.join }")
[22:37:47] wm3|away: ivanskie_: it'll take a fair bit of time though
[22:38:02] superscott[8]: if the connections in my rails3 active record pool are going stale, can anybody point me in a good direction for dealing with that?
[22:38:08] toretore: use ur imagination m8
[22:38:37] ivanskie_: radar, i don't know a better way to do it.
[22:39:10] denym_: How to use hstore on the example of a shopping list? column :article {article1 : Pepper, article2 : Salt, ...} and column :price {article1 : 1, article2 : 2,5, .... } ?
[22:40:13] ivanskie_: but i have 160 vendors listed by name throughout the 297000 rows of items.csv
[22:40:25] ivanskie_: since my item model has vendor_id
[22:40:35] ivanskie_: i extracted all unique vendor names and imported them into vendor model
[22:41:06] obiwanchinobi: I am trying to implement a simple mail interceptor but it isn't working. So i tried to debug it and it's not even firing. I've initialised and i have followed a few examples including asciicasts.Any suggestions of how i can further debug this? https://gist.github.com/obiwanchinobi/ce39361654e38face121
[22:41:14] wm3|away: ivanskie_: honestly? I'd write a plain rake task that transforms the CSV file from one with vendor names into one with vendor ids
[22:41:16] ivanskie_: now i need to import all the items.. so I swap the vendor_name for vendor_id before each create
[22:41:29] ivanskie_: im not sure how to do that either
[22:41:42] wm3|away: ivanskie_: and then I'd import the new CSV file with a connection.execute into the table
[22:42:10] ivanskie_: looks like my import process has frozen
[22:42:36] foucist: ivanskie_: i did something like def set_vendor=(name); v = Vendor.find_or_create_by_name(name); Item.vendor_id = v.id; end; and then Item.create(set_vendor="<name>")
[22:42:52] foucist: ivanskie_: with the rest of the hash from the csv. . are you using roo?
[22:43:02] ivanskie_: just csv class
[22:43:39] ivanskie_: dont have this error anymore (removed the index)... but here's basically what im doing: https://gist.github.com/i5okie/6690605
[22:43:56] ivanskie_: err diff code
[22:44:50] foucist: well basically i have a constant for the "keys" that the column gets assigned to.. like keys = [:id, :set_vendor, :whatever, :whatever2] and do Hash[*keys.zip(cur.row(row)).flatten] to get {:id => 2, :set_vendor => "vendor name", etc.. }
[22:44:55] foucist: and then pass that to Item.create
[22:45:36] darrik: obiwanchinobi: what version of rails? i do the same thing but register mine as Mail.register_interceptor(...)
[22:45:54] darrik: obiwanchinobi: mine is 3.2.3
[22:46:02] obiwanchinobi: let me try that
[22:46:29] darrik: obiwanchinobi: i however didn't do mine in an initializer but rather in environments/development.rb
[22:46:34] foucist: ivanskie_: hm? what's on line 24
[22:46:34] wm3|away: darrik: err... please use a more updated version of rails than that
[22:46:48] foucist: ivanskie_: you only pasted 25-30
[22:46:52] wm3|away: darrik: that version was before some really critical security updates
[22:47:09] wm3|away: same @ obiwanchinobi
[22:47:30] darrik: wm3|away: want to donate some time to upgrade?
[22:47:36] obiwanchinobi: darrik: Mail didn't work. I'll try and put it into development.rb
[22:47:36] ivanskie_: https://gist.github.com/i5okie/6690605
[22:47:42] ivanskie_: i dont have that error anymore..
[22:47:49] wm3|away: darrik: you can't even update to 3.2.14?
[22:47:52] ivanskie_: just showing the gist for the item.rb model where i have the import code..
[22:47:56] obiwanchinobi: wm3|away: did you do it similar to how i did or you were agreeing that you have the problem i have?
[22:48:09] wm3|away: obiwanchinobi: no, I was saying don't use 3.2.3
[22:48:11] ivanskie_: i've been sitting over 2 hours now waiting for it to import the 297k of rows
[22:48:11] darrik: wm3|away: i'm just saying, nothing is free, except advice ;)
[22:48:12] toretore: ivanskie_: don't use Item.where
[22:48:27] obiwanchinobi: wm3|away: ahhh
[22:48:31] ivanskie_: is it quireing the database each time?
[22:48:36] ivanskie_: or whatever the spelling,, geez
[22:48:36] wm3|away: darrik: sure... you've just got to ask yourself what arbitrary remote code execution priveleges on your server is actually worth ;)
[22:48:39] obiwanchinobi: sorry, we're using v3.2.13
[22:48:54] ivanskie_: i think the import just froze.. so
[22:49:02] ivanskie_: a while ago it froze actually
[22:49:04] darrik: wm3|away: not my server. i know what it's worth. however, 3.2.3 was current when the app was contracted. when the client wants to pay to upgrade, they can make that evaluation
[22:49:05] ivanskie_: yah that make sense
[22:49:06] wm3|away: darrik: as I said... some *really* critical security updates
[22:49:17] wm3|away: darrik: ah, fair enough :)
[22:49:46] wm3|away: darrik: I just wouldn't mention the url for them in chan anytime soon btw... if security through obscurity is all they have, don't ruin it too easily :)
[22:49:50] obiwanchinobi: darrik: i inform my clients it is highly recommended to upgrade so i get more work from them
[22:49:58] ivanskie_: im gonna get going home now..
[22:50:01] obiwanchinobi: they have never said "no" to security updates
[22:50:09] ivanskie_: i'll reconnect in a few mins
[22:50:23] darrik: obiwanchinobi: we have different clients, apparently
[22:50:45] darrik: wm3|away: hell, i'll give away the url. perhaps that will make a more convincing argument than i have thus far ;)
[22:50:45] obiwanchinobi: darrik: haha, fair call
[22:51:12] dcope: is it possible to set a limt on number of logs in shared/log when they're rotating?
[22:51:27] peter_lee: Hi I'm having trouble calling a method from a view in Rails 4
[22:51:36] darrik: dcope: with logrotate?
[22:51:49] peter_lee: I have a customer method in my controller, do I need to create a route?
[22:51:56] peter_lee: sorry custom**
[22:52:00] dcope: darrik: yeah, i can use logrotate
[22:52:07] obiwanchinobi: darrik: no luck :(
[22:52:09] darrik: dcope: there's an option with logrotate for that. rotate 14
[22:52:15] dcope: darrik: ah, perfect.
[22:52:23] obiwanchinobi: darrik: did you get the interceptors working with a background queueing process e.g. delayed jobs?
[22:53:14] darrik: obiwanchinobi: honestly, i don't remember. i can tell you this: my register_interceptor is outside my config block in my env file, although i don't remember why. wouldn't have been my first choice place to put it, so i may have been forced
[22:54:00] obiwanchinobi: darrik: thanks for your help :)
[22:54:06] darrik: obiwanchinobi: for what it's worth ;)
[22:55:34] Stalkr^: Hey all, is there some way to see a log when running Rails locally?
[22:55:55] Stalkr^: I am trying to deploying my app to New Relic, need to see if there is a connection
[22:56:18] darrik: Stalkr^: rails should create logs when running locally. tail -f logs/development.log ?
[22:56:32] dcope: darrik: rotate 14 keeps logs for 14 days?
[22:56:46] darrik: dcope: it's dependent on whether you use 'weekly', 'daily', etc
[22:56:51] darrik: dcope: it should keep 14 rotations
[22:56:54] Stalkr^: darrik: Sweet, I see a New Relic log, that's something
[22:57:00] darrik: dcope: which should equate to 14 files
[22:57:13] darrik: dcope: fwiw, i use weekly and rotate 26
[22:57:16] darrik: keeps 1/2 year of logs
[22:57:31] darrik: dcope: obviously adjust for different log volumes
[22:59:11] darrik: dcope: you can set that option globally in logrotate.conf or per block inside logrotate.d/*
[22:59:43] dcope: darrik: yep, put it in a block within lograte.d
[22:59:51] dcope: and logrotate picks this up automatically ?
[23:00:10] darrik: dcope: yeah, because it's not a daemon. it's run by cron. each run reads the conf
[23:00:20] dcope: very cool :-)
[23:00:48] ner0x: So I just finally grasped the concept of STI and... I must say... awesome job.
[23:00:51] darrik: dcope: you can force it to run with -f or test run with -d
[23:01:08] ner0x: I mean, I had the concept but never from a rails perspective. Awesome.
[23:01:41] gestahlt: Im currently looking at the google search results at page 7!!!!
[23:01:58] gestahlt: I cant get JS running on my mountable engine
[23:02:21] gestahlt: I dont use an application layout.. so i cant include js there
[23:02:33] gestahlt: But i need JS for the stupid delete links
[23:03:27] gestahlt: so im stuck, do you guys have any idea how to properly include JS in an engine?
[23:03:39] toretore: what does your engine do?
[23:09:18] MrPunkin: What is the proper way to handle separating html and json format needs in a controller method nowadays? Say you don't need to setup some variables for the JSON response, only the HTML one? Is it still just respond_to with a block and nest the stuff in there?
[23:14:54] bricker`work: MrPunkin: request.format.html?
[23:15:04] bricker`work: That's how I do it anyways
[23:19:12] Stalkr^: Does anyone use New Relic here?
[23:19:21] Stalkr^: I have some trouble with my Rails app
[23:19:32] bastilian: Stalkr^: talk.
[23:19:55] Stalkr^: I am trying to deploy my app, but doesn't seem to talk with New Relic
[23:20:06] Stalkr^: Last log line is: Doing deferred dependency-detection before Rack startup
[23:25:10] passbe: i need to take the log files from multiple ruby + ror apps and search through them in a unified view? any recommendations
[23:26:57] Gaelan: In Rails 4, how can I set a condition on the join table in a has_many through?
[23:27:59] Gaelan: I tried using :conditions, but I got told to use a scope lambda instead. I can't figure out how to tell Rails which table to use for the scope lambda.
[23:28:39] nettoweb: guys, I set up my app to use 'pt-BR' locale, but when I use <%= visit.data.strftime("%B / %Y") %> it cant translate to portuguese the month names… its already confirured in my yml file. I get only this: March / 2014
[23:28:50] nettoweb: must I do anything else?
[23:28:53] optobear: Gaelan: has_many :things, ->{ where(stuff) }
[23:29:50] Gaelan: optobear: Will that condition be checked against the join table in a :through?
[23:30:26] optobear: Gaelan: sorry, not sure. give it a tru?
[23:31:35] Leighton: nettoweb: did you see this? http://stackoverflow.com/a/4592304
[23:32:37] optobear: Gaelan: i'd expect something like has_many :things, ->{ where('joined_things.property = ?', value) }, through: :joined_things
[23:32:56] spyzer: hey guys I am trying to check how much data was gzipped from nginx, In chrome I get the header gzip in my response(I use api endpoints only in my RoR) and chrome shows something like 1.8Kb and then below it 8.0Kb
[23:32:58] Gaelan: optobear: Thanks! Will try.
[23:33:19] optobear: Gaelan: np. let me know
[23:34:21] spyzer: does that mean that 8.0kb was the content size and 1.8 kb was trxferred
[23:35:11] spyzer: seems like that was it :)
[23:38:41] nettoweb: Leighton: tank you, it translated but not with the format that I want.. is there a way to get "January / 2013" format? must I change this in my YML?
[23:42:17] ner0x: When does namespacing models become a good idea? Any criteria?
[23:43:36] Leighton: nettoweb: hmm, this doesn't give the proper format? I18n.localize(visit.data, :format => '%B / %Y') What did you end up getting?
[23:44:05] nettoweb: Leighton: thank you
[23:45:56] Radar: ner0x: This is another "it depends" question
[23:46:00] Radar: ner0x: Why are you looking into namespacing a model now?
[23:48:09] ner0x: Radar: Different types of "accounts" with different logic but all using the same "account" table. I figured if I put things under Type1/Project etc it'll keep it clean while providing some nice options later on.
[23:48:30] Radar: what kind of different logic?
[23:51:49] ner0x: Radar: Type1 would send out publications on projects they won/lost where as type2 and type3 wouldn't.
[23:52:04] Radar: Why would they all use the same table?
[23:52:17] Radar: These sound like different things.
[23:55:00] ner0x: Radar: They all work on construction projects, which typically have the same data, they just do different things to them.
[23:55:28] Radar: I think I'm going to need a lot more context to understand this problem.
[23:55:33] Radar: This is not something that can be solved in 15mins