« Back to channel list

#RubyOnRails - 21 October 2015

« Back 1 day Forward 1 day »
[00:02:30] FailBit: chanserv didn't send you a message about your nick, unless it was the entrymsg for this channel
[00:02:35] FailBit: in which case sure
[00:04:14] IFrank00: has joined #RubyOnRails
[00:05:05] drupald: has joined #RubyOnRails
[00:05:10] blackhuey: has joined #RubyOnRails
[00:05:13] dmarr: If I have some local schema.db changes, and I go to merge some upstream changes which also modify schema.rb, what is the best way to resolve the conflicts in schema version?
[00:05:16] trosborn: has joined #RubyOnRails
[00:05:58] annlewis: has joined #RubyOnRails
[00:06:12] matthewd: The wording does make it sound like you're not registered / can't talk... but I assume it's deliberately terse to increase the chances people will actually read it
[00:06:39] dmarr: seems if i take the later timestamp, i may risk losing my local schema changes when I push back upstream?
[00:06:53] matthewd: dmarr: You should be able to revert to your previous local version, run migrations, and done
[00:07:46] dmarr: so should i abort this merge where the conflicts are found?
[00:08:04] matthewd: No.. you can also just resolve the conflict manually
[00:08:28] matthewd: Just make sure you end up with both sets of changes present (as you would for any other merge), and the higher timestamp
[00:08:32] dmarr: yeah, I think I want to do that.
[00:09:18] joshkovach: has joined #RubyOnRails
[00:13:12] yunior: has joined #RubyOnRails
[00:18:37] shmilan: has joined #RubyOnRails
[00:19:06] yunior: i need some help with rbenv
[00:19:14] yunior: anyone can help me
[00:20:14] yunior: i'm starting with this so sorry for my begginner questions
[00:21:10] yunior: i have install rbenv with this guide https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-with-rbenv-on-ubuntu-14-04
[00:21:26] Lightsword: has joined #RubyOnRails
[00:21:36] yunior: but when i close the command line
[00:21:54] yunior: and open it again i can't execute the rbenv command
[00:22:03] yunior: what can i do?
[00:22:16] sunya7a: has joined #RubyOnRails
[00:22:34] havenwood: yunior: does it work after you run?: source ~/.bash_profile
[00:23:04] yunior: first when i installed and run that command it worked
[00:23:14] yunior: but then it didn't
[00:23:23] havenwood: yunior: i mean now
[00:23:34] yunior: i should say that i'm installing it in aws
[00:24:29] havenwood: yunior: I'm assuming your ~/.bash_profile file isn't getting sourced. See: https://github.com/sstephenson/rbenv/wiki/Unix-shell-initialization
[00:25:33] workmad3: has joined #RubyOnRails
[00:25:54] yunior: i read something that said when you are not in gnome you should do something different
[00:26:22] yunior: should i install rbenv as root or as another normal user?
[00:26:58] stardiviner: has joined #RubyOnRails
[00:28:25] smathy: yunior, https://github.com/sstephenson/rbenv#installation
[00:28:44] yunior: thanks smathy
[00:28:56] smathy: yunior, you're welcome.
[00:28:56] nettoweb: has joined #RubyOnRails
[00:33:44] dopie: has joined #RubyOnRails
[00:35:22] herbst: has joined #RubyOnRails
[00:36:15] oflannabhra: has joined #RubyOnRails
[00:36:20] drupald: has joined #RubyOnRails
[00:37:16] renegadeandy: has joined #RubyOnRails
[00:45:34] jessemcgilallen: has joined #RubyOnRails
[00:48:56] oflannabhra: has joined #RubyOnRails
[00:50:26] bonhoeffer: has joined #RubyOnRails
[00:51:26] hephaestus_rg: has joined #RubyOnRails
[00:52:17] bobbobbins: has joined #RubyOnRails
[00:53:14] bonhoeffer: has joined #RubyOnRails
[00:56:41] GriffinHeart: has joined #RubyOnRails
[00:58:30] pydave6367: has joined #RubyOnRails
[01:00:46] MrPunkin: has joined #RubyOnRails
[01:00:46] trosborn: has joined #RubyOnRails
[01:01:37] comm64x: has joined #RubyOnRails
[01:04:11] hephaestus_rg: has joined #RubyOnRails
[01:05:04] trosborn: has joined #RubyOnRails
[01:05:56] IrishGringo: has joined #RubyOnRails
[01:06:28] riotjones: has joined #RubyOnRails
[01:07:14] annlewis: has joined #RubyOnRails
[01:07:55] SteenJobs: has joined #RubyOnRails
[01:08:23] bonhoeffer: has joined #RubyOnRails
[01:09:47] trosborn: has joined #RubyOnRails
[01:10:23] comm64x: has left #RubyOnRails: ()
[01:10:42] comm64x: has joined #RubyOnRails
[01:10:56] comm64x: Got a question...lol don't I always, but this honestly is quite specific and particular to the point that GIYF, SO, and RTFM is not helping or I'm just not seeing it one i dont know...anyway say I want to set a number of constants. These constants are directory paths and I need to be able to require File.expand_path(CONSTANT_REPR_PATH_DIR_HERE, "somefile"). My initial idea was to create an initializer
[01:10:57] NBarnes: has joined #RubyOnRails
[01:11:02] comm64x: that would set the path directories as constants and have in the initializer CONSTANT = File.expand_path(...etc. but I'm not sure how I would do that or if that would even be a best way to do this...any ideas?
[01:11:46] d34th4ck3r: has joined #RubyOnRails
[01:13:07] tds5016: is there anyone using twitter_bootstrap_form_for that could help me figure out how to manually set the path the form sends to?
[01:13:24] unreal: has joined #RubyOnRails
[01:13:32] tds5016: currently I have a problem where the smart path is being returned incorrectly, and I'm pretty sure it's because I'm using cequel
[01:15:01] dikaio: has joined #RubyOnRails
[01:15:21] kara_sweets: has joined #RubyOnRails
[01:16:40] ellisTAA: has joined #RubyOnRails
[01:16:40] simkessy: hi, just wondering if this would work in a service class `def initialize user=:current_user end`
[01:17:13] sevenseacat: sure. i don't think it will do what you expect it to do, though.
[01:19:25] simkessy: I just want to set @user = user (being the current user by default)
[01:20:12] sevenseacat: yeah that code doesn't do that.
[01:20:44] simkessy: is there a way to pass in current user by default or do I need to send in the user as an arguement
[01:21:01] sevenseacat: you would pass it in as an argument.
[01:21:26] tds5016: anyone know how I'd override a model's path?
[01:21:38] sevenseacat: tds5016: models don't have paths.
[01:21:54] FailBit: comm64x: what?
[01:22:36] GriffinHeart: has joined #RubyOnRails
[01:23:06] comm64x: FailBit: I need to assign directory paths to some constants and I need to be able to use those constants throughout my app when requireing a file
[01:23:13] tds5016: there's a way that I'm able to create a link by just passing a model.
[01:23:24] tds5016: how would I make it so that the link that gets created points somewhere else.
[01:23:29] FailBit: comm64x: then sure use an initializer
[01:25:06] chills42: has joined #RubyOnRails
[01:25:42] hfp: has joined #RubyOnRails
[01:26:15] hfp_work: has joined #RubyOnRails
[01:26:33] bonhoeffer_: has joined #RubyOnRails
[01:26:40] comm64x: FailBit: Okay good so how would I do that in an initializer? I thought maybe Rails.application.config.initializer_name.constant = CONSTANTNAME = File.dirname(....something but that seems a bit long
[01:27:14] FailBit: make an initializet
[01:27:18] FailBit: *initializer
[01:27:28] FailBit: in the initializer, assign the constant
[01:28:00] comm64x: FailBit: but an initializer is for sure the way to go right
[01:28:19] FailBit: it's not the only way but it's probably the best
[01:28:39] FailBit: my pillow needs me
[01:28:41] comm64x: FailBit: thats what I'm looking for ty
[01:28:42] FailBit: ACTION awaaay
[01:29:06] brook: has joined #RubyOnRails
[01:29:39] matthewd: tds5016: It calls the modelname_path route helper, so arrange to correctly name your intended route, and things should Just Work, I think
[01:30:01] chills42: has joined #RubyOnRails
[01:30:13] simkessy: sevenseacat: thought so, awesome thx
[01:30:53] tjbiddle: has joined #RubyOnRails
[01:30:54] tds5016: can I override and make model_path "my custom path"
[01:31:38] tds5016: I basically have the id being a uuid... that I need to get the .to_s version of before returning the the model_path
[01:31:42] MrPunkin: has left #RubyOnRails: ()
[01:31:43] hfp: has joined #RubyOnRails
[01:31:56] matthewd: So not pointing to an application route at all? It's possible, but you're more likely to end up in edge case territory
[01:32:15] matthewd: Oh, that's a different question
[01:32:19] matthewd: And the answer is to_param
[01:32:23] sevenseacat: tds5016: so you want to overwrite to_param in the model...?
[01:32:46] hfp_work: has joined #RubyOnRails
[01:33:13] trosborn: has joined #RubyOnRails
[01:33:19] tds5016: I want to make this thing give me the path '/path/to/"value.to_s"/new'
[01:36:37] EminenceHC: has joined #RubyOnRails
[01:37:26] tds5016: does that make any sense?
[01:40:12] sevenseacat: yep, and we already answered.
[01:41:15] tds5016: what's the answer then?
[01:41:25] tds5016: I can't just do to_s
[01:41:36] sevenseacat: [09:32:19] matthewd: And the answer is to_param
[01:41:37] sevenseacat: [09:32:23] sevenseacat: tds5016: so you want to overwrite to_param in the model...?
[01:41:51] sevenseacat: nine minutes ago
[01:41:54] tds5016: if that's what generates the path?
[01:42:00] sevenseacat: have you even looked?
[01:42:46] bphogan: has joined #RubyOnRails
[01:42:48] GnuYawk: has joined #RubyOnRails
[01:42:49] sevenseacat: we're not here to spoonfeed answers. we're here to help solve problems.
[01:42:51] tds5016: nope... lol. You win. I'll quit being an ass hole and go do so now.
[01:42:58] sevenseacat: it requires some effort on your part too.
[01:43:37] chouhoulis: has joined #RubyOnRails
[01:44:21] dopamean_: has joined #RubyOnRails
[01:45:35] GriffinHeart: has joined #RubyOnRails
[01:46:52] tds5016: this is a dumb question, I'm sure; but why did it get named to_param?
[01:47:16] oflannabhra: has joined #RubyOnRails
[01:49:27] allcentury: has joined #RubyOnRails
[01:50:01] matthewd: Because it converts the object to a form suitable for use as a [URL] parameter?
[01:51:07] IFrank00: has joined #RubyOnRails
[01:52:55] tds5016: thank you so much for your help by the way.
[01:53:48] tds5016: I would think it should be something like to_path_param though.
[01:54:01] tds5016: to_param sounds like you'd possibly return a hash of your object.
[01:54:01] bonhoeffer: has joined #RubyOnRails
[01:54:11] tds5016: but that's me and my stupidity.
[01:54:17] tds5016: anyhow, have a good night guys. Thanks again!
[01:55:56] trosborn: has joined #RubyOnRails
[01:56:01] helpa: We're not all guys here - while you probably don't meant to be exclusive, not everybody feels that way. Maybe consider using "folks", "y'all" or "everyone" instead?
[01:57:14] [1]brook: has joined #RubyOnRails
[01:58:15] thecyclone: has joined #RubyOnRails
[01:58:34] oflannabhra: has joined #RubyOnRails
[02:06:32] thecyclone: Hi. I would like to create a debian package to make ruby on rails installation much easier. Is this project viable?
[02:07:19] riotjones: has joined #RubyOnRails
[02:07:57] Aeyrix: If you have to ask that question, honestly no.
[02:08:00] annlewis: has joined #RubyOnRails
[02:08:10] sevenseacat: thecyclone: there already is one, that we recommend people don't use.
[02:08:14] Aeyrix: I mean the answer is also "realistically no", to be honest.
[02:08:20] Aeyrix: Rails shouldn't be packaged by apt.
[02:08:35] lzx: has joined #RubyOnRails
[02:09:30] wethu: has joined #RubyOnRails
[02:09:42] thecyclone: I have recently started working on rails. I find it really logical and easy to use. However, I had to spend nearly 3 days worth of my freetime to get it up and running. The similar story goes for all my peers. I think packaging it in apt will make the process a lot easier
[02:10:46] Aeyrix: It takes you three days to install ruby-install, chruby, and then run `gem install rails`?
[02:11:09] sevenseacat: Aeyrix: to be fair, some research would be required before deciding on that.
[02:11:17] thecyclone: its not that easy
[02:11:21] sevenseacat: though that research could simply consist of 'ask someone'
[02:11:24] sevenseacat: thecyclone: it really is.
[02:11:34] Aeyrix: sevenseacat: True, I guess.
[02:11:49] thecyclone: Aeyrix: I am really sorry if I am not as intellectually gifted as you are but it really took me 3 days
[02:11:58] Aeyrix: thecyclone: Packaging rails in apt is a terrible idea.
[02:12:02] nemo_: has joined #RubyOnRails
[02:12:03] sevenseacat: thecyclone: what did you get stuck on?
[02:12:11] Aeyrix: Two days were the weekend.
[02:12:36] n1lo: has joined #RubyOnRails
[02:12:54] drupald: has joined #RubyOnRails
[02:13:43] workmad3: has joined #RubyOnRails
[02:14:10] nemo_: has joined #RubyOnRails
[02:15:28] thecyclone: sevenseacat: just some broken packages. I guess guys like me could do with all the command being listed on the rails official website and explained. That way, There is no need to always google your problems
[02:15:58] sevenseacat: well yes, if you were using packages, thats part of the problem
[02:16:02] sevenseacat: thats why we're telling you not to use packages
[02:16:39] tjbiddle: has joined #RubyOnRails
[02:17:27] thecyclone: i tried using rvm as well
[02:17:35] thecyclone: didn't work out that well
[02:18:05] thecyclone: you can simply google "why ruby on rails is so hard to install", you will see that I am not alone
[02:18:07] comm64x: oh great ones! :) might I request from you a confirmation on syntax? I need to set a constant in an initializer to a directory path, this is what I have so far ABSPATH = File.expand_path(File.dirname(__FILE__), File.join('/')) but the root directory of the application is 2 levels up from where the initializer file resides soooo .....I'm thinking something needs to be changed just not sure how
[02:18:34] sevenseacat: thecyclone: it can be hard, yes. but there are also a *lot* of guides out there to help.
[02:18:44] sevenseacat: and we can also help, because any problem you have, we've probably seen before.
[02:18:50] sevenseacat: we've also written some of those guides.
[02:18:53] comm64x: thecyclone: are you using windows or what?
[02:18:58] Aeyrix: >click first link
[02:19:00] thecyclone: sevenseacat: "a lot" of guides mess up the whole thing
[02:19:05] Aeyrix: >OP claims it's one click to install and use a lamp stack
[02:19:08] Aeyrix: uhhhhhhhhh
[02:19:10] sevenseacat: thecyclone: heaven forbid we have more than one way to do things.
[02:19:38] matthewd: If you're on a sufficiently recent debian, `apt-get install ruby; gem install rails` should work fine
[02:19:53] matthewd: (though long term, using system ruby has potential downsides)
[02:19:55] thecyclone: please give me a link to some guide that lists the proper way to install "Ruby on Rails", to save it for future
[02:20:05] Aeyrix: Gimme like
[02:20:06] Aeyrix: 30 minutes
[02:20:07] nemo_: has joined #RubyOnRails
[02:20:11] Aeyrix: I'm writing a thing.
[02:20:23] helpa: Ubuntu, Ruby, ruby-install, chruby, Rails setup guide: http://ryanbigg.com/2014/10/ubuntu-ruby-ruby-install-chruby-and-you/ - Gauranteed to work 100% of the time or your money back!
[02:20:33] sevenseacat: works just as well for debian.
[02:21:08] thecyclone: Aeyrix: waiting. Thanks
[02:21:27] sevenseacat: !osx if you're on OSX.
[02:21:27] helpa: http://ryanbigg.com/2011/06/mac-os-x-ruby-rvm-rails-and-you/
[02:21:37] sevenseacat: mostly the same deal.
[02:22:24] thecyclone: sevenseacat: I use Ubuntu LTS 14.04. Thanks
[02:23:46] trosborn: has joined #RubyOnRails
[02:23:55] oflannabhra: has joined #RubyOnRails
[02:24:58] thecyclone: anyway if we compare it to Django, i feel they have handled the installation part pretty well
[02:25:19] Aeyrix: thecyclone: Garbage, tbh.
[02:25:26] Aeyrix: Django's installation process is absolute bollocks in comparison.
[02:25:33] nemo_: has joined #RubyOnRails
[02:25:34] Aeyrix: I actually just asked someone else that exact question.
[02:25:43] Aeyrix: 1:15 PM <floby> kek yea the team we work with was having trouble installing django
[02:25:49] Aeyrix: Except "the team" is now using NodeJS
[02:25:53] Aeyrix: so maybe they just have no idea at all.
[02:26:03] Aeyrix: sevenseacat: I'm writing mkrb now.
[02:26:08] Aeyrix: So we can just give people that. :D
[02:26:19] thecyclone: I installed Django about a year ago with no prior knowledge, it took me 5 min
[02:26:37] sevenseacat: then you had prior knowledge
[02:26:37] Aeyrix: Fairly sure it's now one single command to install Rails on Homebrew.
[02:26:47] sevenseacat: probably, but I wouldnt recommend that either.
[02:26:50] Aeyrix: thecyclone: What OS are you using
[02:26:54] Aeyrix: I'll write this for your OS first
[02:27:03] Aeyrix: If it's Windows, the script will simply format your hard-drive
[02:27:07] thecyclone: Ubuntu 14.04 LTS
[02:27:47] Aeyrix: Can you run `uname` in the terminal, please?
[02:27:52] Aeyrix: I only have access to OSX and FreeBSD right now.
[02:27:56] Aeyrix: Does it just return 'Linux'?
[02:28:18] thecyclone: yes, it returns linux
[02:29:28] nemo_: has joined #RubyOnRails
[02:29:45] nogic: has joined #RubyOnRails
[02:30:54] chouhoulis: has joined #RubyOnRails
[02:31:10] danman: has joined #RubyOnRails
[02:32:49] hmsimha: has joined #RubyOnRails
[02:34:09] nemo_: has joined #RubyOnRails
[02:36:01] helpa: http://i.imgur.com/tyViD.gif
[02:36:35] Radar: thecyclone: Due to the different versions of Ruby and Rails I would say that such a project is not viable.
[02:36:45] Radar: You could have a package for every version of Ruby, and every version of Rails.
[02:36:50] Radar: It would be a lot of effort for little gain.
[02:36:59] Radar: The community copes just fine with chruby+ruby-install these days.
[02:37:14] thecyclone: or a simple gui that lists all the currently available packages?
[02:37:25] thecyclone: one click. problem solved
[02:37:56] Radar: ruby-install ruby 2.2.3
[02:37:58] Radar: problem solved
[02:38:24] markelite: has joined #RubyOnRails
[02:39:38] sevenseacat: thecyclone: you're welcome to make such a tool, but there are valid reasons it doesnt exist already
[02:39:52] yogeshrt: has joined #RubyOnRails
[02:40:05] siddart: has joined #RubyOnRails
[02:40:11] thecyclone: sevenseacat: it would be great if you can elaborate
[02:40:30] sevenseacat: isnt that what we've been doing for like half an hour...
[02:40:50] moeabdol: has joined #RubyOnRails
[02:41:30] Maletor: has joined #RubyOnRails
[02:43:20] atomical: has joined #RubyOnRails
[02:43:21] nemo_: has joined #RubyOnRails
[02:45:36] gambl0re: has joined #RubyOnRails
[02:47:04] willharrison: has joined #RubyOnRails
[02:47:39] thecyclone: so, you mean that with separate apt's, it would be difficult to manage and install several versions of ruby. Right?
[02:47:55] sevenseacat: not difficult, impossible
[02:48:22] nemo_: has joined #RubyOnRails
[02:48:38] shmilan: has joined #RubyOnRails
[02:49:47] thecyclone: Also, can you please tell some cool resources that I can use to learn it
[02:50:34] kara_sweets: has joined #RubyOnRails
[02:50:58] thecyclone: ruby on rails
[02:51:13] thecyclone: just finished installing it like 4 hours ago
[02:51:32] Radar: thecyclone: !r4ia
[02:51:32] helpa: thecyclone: Rails 4 in Action - http://manning.com/bigg2 - An excellent book combining Rails and TDD/BDD development. Written by Rebecca Skinner, Steve Klabnik, Ryan Bigg, Yehuda Katz
[02:51:40] Radar: thecyclone: That's the book that sevenseacat and I wrote.
[02:51:48] mois3x: has joined #RubyOnRails
[02:52:27] nemo_: has joined #RubyOnRails
[02:52:31] tjbiddle: has joined #RubyOnRails
[02:52:45] thecyclone: someone suggested me this : Ruby on Rails Tutorial Learn Web Development with Rails (3rd Edition)
[02:53:26] Radar: Let me just say that when you buy something that's free you get what you pay for ;)
[02:53:40] sevenseacat: Radar: unfortunately, lots of people buy that tutorial.
[02:53:45] Radar: sevenseacat: indeed.
[02:53:54] trosborn: has joined #RubyOnRails
[02:54:07] thecyclone: its very popular amonst my peers
[02:54:59] Aeyrix: Okay, so I've written a script that follows what is currently considered best practice by, well, everyone in here at least.
[02:55:06] Aeyrix: I'm just running a test now, I spun up a Debian box to ensure that it works.
[02:55:09] GriffinHeart: has joined #RubyOnRails
[02:55:22] Aeyrix: There's a couple of caveats with it right now mostly coming down to flexibility, but this is something I'm willing to continue to develop and support.
[02:55:25] sevenseacat: so is it going to be 'pipe this script to sudo bash' like everyone rages at? :D
[02:55:33] Aeyrix: It'll be "manually download it, and run it".
[02:55:47] Radar: curl Aeyrix.co/ruby | sh
[02:55:50] Radar: what could possibly go wrong
[02:55:51] Aeyrix: gl with that
[02:55:53] Aeyrix: I block curl
[02:56:06] Aeyrix: I block that too.
[02:56:09] Aeyrix: (seriously)
[02:56:11] Radar: Net::HTTP
[02:56:21] Aeyrix: I block anything without a user agent header.
[02:56:32] Aeyrix: If you want to go to the effort to put one in, you probably know what you're doing anyway.
[02:56:35] Radar: curl -H 'User-Agent: <fake>" ... you get the idea.
[02:56:49] Aeyrix: ... why is this apt-get broken
[02:57:02] Aeyrix: in australia
[02:57:10] Radar: Aeyrix: !enternotspace
[02:57:10] helpa: Aeyrix: The enter key should not be used as a space bar. Lines on IRC can be up to 400 characters long.
[02:57:58] Aeyrix: 80 long max, you know the drill
[02:57:58] Cache_Money: has joined #RubyOnRails
[02:59:20] baweaver: has joined #RubyOnRails
[02:59:41] Aeyrix: Oh man Vultr absolutely butchers /etc/apt/sources.list.
[02:59:51] theblang: has joined #RubyOnRails
[03:00:23] towski_: has joined #RubyOnRails
[03:01:50] mrtomme: has joined #RubyOnRails
[03:03:21] Aeyrix: Wow the only thing wrong with this entire script was the fact that the sources.list was broken by Vultr.
[03:03:29] Aeyrix: ... Nothing I write ever works first time.
[03:04:05] Aeyrix: Does anyone know if there's a unit-testing library for Bash?
[03:04:58] djbkd: has joined #RubyOnRails
[03:05:51] djbkd: has joined #RubyOnRails
[03:06:09] matthewd: Aeyrix: I really don't understand how layering another script on top of the existing "one line to get set up" scripts is going to make things easier :/
[03:06:12] rdavila: has joined #RubyOnRails
[03:06:25] Aeyrix: matthewd: Because some people clearly have issues with the current set of steps.
[03:06:39] Aeyrix: I mean if that isn't obvious from the above conversation I don't really know what to tell you dawg.
[03:07:22] tuelz: has joined #RubyOnRails
[03:07:27] bruno-: has joined #RubyOnRails
[03:08:35] pawnbox: has joined #RubyOnRails
[03:08:45] annlewis: has joined #RubyOnRails
[03:09:00] matthewd: I'm not questioning whether some people have issues... I'm unclear on how this *solves* same
[03:09:14] matthewd: But https://github.com/sstephenson/bats may suit your needs?
[03:09:30] braincrash: has joined #RubyOnRails
[03:10:00] trosborn: has joined #RubyOnRails
[03:10:06] arthurnn: has joined #RubyOnRails
[03:11:46] gambl0re: has joined #RubyOnRails
[03:12:38] cswelin: has joined #RubyOnRails
[03:18:15] rakm: has joined #RubyOnRails
[03:18:40] corioliss: has joined #RubyOnRails
[03:21:11] cobragoat: has joined #RubyOnRails
[03:21:49] PhaseCode: has joined #RubyOnRails
[03:24:10] chopin: has joined #RubyOnRails
[03:24:11] quazimodo: I have a model called Service. I want to do a query using active record that uses an alias kind of like (pseudocode sql): SELECT * FROM services WHERE ( complex conditions on services ) INNER JOIN services AS roots WHERE roots.parent_id = nil AND ( other conditions on roots) GROUP BY roots.id
[03:24:15] quazimodo: does this even make sense?
[03:24:28] dnewkerk: has joined #RubyOnRails
[03:24:46] quazimodo: because services is actually a nested tree structure
[03:24:53] duderonomy: has joined #RubyOnRails
[03:26:32] rubyonrailed: has joined #RubyOnRails
[03:26:40] VeryBewitching: quazimodo: This might help http://www.sitepoint.com/nested-comments-rails/
[03:27:50] chopin: has joined #RubyOnRails
[03:28:12] quazimodo: i'll take a look
[03:28:22] quazimodo: I may have to dive into some AREL
[03:35:09] gambl0re: has joined #RubyOnRails
[03:36:00] dnewkerk: has joined #RubyOnRails
[03:36:07] Motoservo: has joined #RubyOnRails
[03:37:54] dnewkerk: has joined #RubyOnRails
[03:38:37] dnewkerk: has joined #RubyOnRails
[03:38:47] thecyclone: Aeyrix: waiting bruh!
[03:39:29] spijet: has joined #RubyOnRails
[03:39:41] Aeyrix: thecyclone: Just testing some stuff.
[03:39:43] Aeyrix: I don't want it to like
[03:40:02] shmilan: has joined #RubyOnRails
[03:40:10] trosborn: has joined #RubyOnRails
[03:41:12] iateadonut: has joined #RubyOnRails
[03:42:04] spijet: Hello guys! I'm kinda new to RoR (only have one small web-app ready and working). At the moment I'm working on a webapp that talks to PgSQL database and sends the result of the query to user. However, the DB in my case is extremely slow (a query can take almost 3 hours to complete!), so I wonder how do I make a Rails worker which would wait for requested data and then send it via SMTP?
[03:42:24] dnewkerk: has joined #RubyOnRails
[03:43:12] dnewkerk: has joined #RubyOnRails
[03:43:16] spijet: I've already figured out how to implement PgSQL connection and SMTP output, but I'm afraid that if I put the query code right into the controller, it'd get killed by timeout :D
[03:43:32] matthewd: spijet: Look at activejob
[03:44:11] rhizome: spijet: you're looking for a workflow
[03:44:19] nya: has joined #RubyOnRails
[03:44:58] spijet: matthewd: can it really work for 3 hours without getting killed? My original thought was to run an external serverside script but that'd be extra-dirty
[03:45:46] speakingcode: has joined #RubyOnRails
[03:46:21] matthewd: Yes, it should be fine in a background worker, as long as you don't specifically impose some other timeout
[03:47:19] Radar: Aeyrix: Ship it :)
[03:47:20] matthewd: (though 3 hours sounds like a very long time... I'd start by checking the efficiency of the query)
[03:47:35] spijet: matthewd: oh, ok, I'll try it, thanks
[03:48:08] Aeyrix: Radar: Filthy
[03:48:12] brook: has joined #RubyOnRails
[03:48:17] spijet: matthewd: well, it's a NAT event log database, and it's huge (300K records per second)
[03:48:21] arthurnn: has joined #RubyOnRails
[03:49:09] spijet: matthewd: so it's kinda expected that getting data from this db is slow :)
[03:51:54] Aeyrix: Radar: https://gist.github.com/Aeyrix/444d7672447ce17efe8c
[03:52:06] Aeyrix: clean script tbh, still a lot of stuff to do but I verified it works on Debian and Ubuntu.
[03:52:26] GriffinHeart: has joined #RubyOnRails
[03:53:32] pawnbox: has joined #RubyOnRails
[03:53:45] pawnbox: has joined #RubyOnRails
[03:55:23] Radar: I would use that for newbies :)
[03:55:59] Aeyrix: thecyclone:
[03:56:08] spijet: Aeyrix: that's a nice script :)
[03:56:12] Aeyrix: Thanks yo.
[03:56:16] thecyclone: woah! mind == blown
[03:56:35] Aeyrix: Don't run this as root.
[03:56:45] Aeyrix: Make a new user, make sure they have sudo access, and run it as them.
[03:56:56] nertzy: has joined #RubyOnRails
[03:57:23] matthewd: Aeyrix: Unlikely to be a problem for a newbie, but https://gist.github.com/Aeyrix/444d7672447ce17efe8c#file-mkrb-sh-L91 seems a bit over-eager
[03:57:36] spijet: Aeyrix: do a root check :) [[ $(who) == "root" ]] && echo "Hey stop that!!"
[03:57:43] matthewd: (also, the things it's trying to delete aren't necessarily inside ~/, AFAICS)
[03:57:44] zpe: has joined #RubyOnRails
[03:57:51] Aeyrix: matthewd: They are.
[03:57:58] Aeyrix: chruby is inside ruby-install
[03:58:00] Aeyrix: which is inside ~
[03:58:41] matthewd: I don't see where
[03:58:43] webdestroya: has joined #RubyOnRails
[03:59:06] matthewd: ruby-install seems to be $PWD
[03:59:40] Aeyrix: Yeah I was playing with env -i
[03:59:51] Aeyrix: when I was trying to find a way to reload environment variables
[04:00:09] Aeyrix: Unfortunately, that's not doable without launching another interactive bash prompt from within the script.
[04:00:20] Aeyrix: Not worth it, so I just resorted to adding that warning on the end.
[04:00:45] matthewd: Err, s/be/be inside/
[04:00:56] thecyclone: Thanks mate! you really wasted a lot of your precious time in helping me :')
[04:01:19] juanca_: has joined #RubyOnRails
[04:01:25] thecyclone: Also, it would be great if you can suggest some resources that i can use to learn RoR
[04:01:29] rubyonra_: has joined #RubyOnRails
[04:01:44] matthewd: And now you mention it, rming the current directory is best avoided, too
[04:01:54] workmad3: has joined #RubyOnRails
[04:02:50] Aeyrix: That is literally a nonissue.
[04:03:10] sevenseacat: I have mixed opinions about this script
[04:03:21] sevenseacat: yes making things easy for newbies is good. but knowing your tools is also good.
[04:03:49] sevenseacat: 'how do i upgrade ruby? how do i install a gem?' 'how did you do it before?' 'uh... i ran some script'
[04:04:00] Aeyrix: That's why I listed things along the way.
[04:04:16] Aeyrix: >learn about x here
[04:04:21] sevenseacat: yeah but if you think newbies are going to look at that, follow the links, etc. you're dreaming
[04:04:27] jenrzzz: has joined #RubyOnRails
[04:04:28] Aeyrix: It's not like they do anyway
[04:04:43] Aeyrix: % of people that just copy and paste the stuff from Radar's blog:
[04:04:48] Aeyrix: Even I just do it, but I know what they all do.
[04:05:10] matthewd: I guess my real concern is that, unlike the other example of a "just do all the things" script, this is one way -- there's no `rvm implode`
[04:05:15] sevenseacat: i mean at the end of your script, they have an environment, which is good, but they havent learnt anything
[04:05:32] matthewd: (and it's no fluke that's literally the only rvm command I know)
[04:05:40] Aeyrix: matthewd: Yeah I didn't manage to get that implemented in the twenty minutes I had to spend building it.
[04:05:54] Aeyrix: I think it's about third or fourth on my priority list. I managed two.
[04:07:01] matthewd: Aeyrix: Yeah, that's fair enough... I guess I'm more projecting, with an awareness of how difficult that cleanup can be... especially as you don't really "own" the places you're putting these things
[04:07:27] Aeyrix: matthewd: The advantage of these tools is that cleanup is "rm -rf ~/.rubies"
[04:07:30] Aeyrix: that's it.
[04:08:05] riotjones: has joined #RubyOnRails
[04:08:13] bruno-: has joined #RubyOnRails
[04:08:20] matthewd: And /usr/local/share/chruby, and the bashrc modifications
[04:08:38] Aeyrix: Why would you want to remove those?
[04:08:52] Aeyrix: They have a net zero impact on your system if you remove the rubies folder.
[04:09:33] annlewis: has joined #RubyOnRails
[04:10:58] matthewd: 'how do i upgrade ruby? how do i install a gem?' 'how did you do it before?' 'uh... i ran some script... but now it's not doing what i expect'
[04:11:13] bendangelo: has joined #RubyOnRails
[04:11:13] Aeyrix: >how do i install a gem
[04:11:33] matthewd: (to riff on sevenseacat's story)
[04:12:04] Aeyrix: If someone's run that script I know exactly where they're up to on their system.
[04:12:14] matthewd: Personally, my strategy in such a situation is always going to be "throw it all away and start again"
[04:12:34] Aeyrix: Course it is.
[04:12:36] thecyclone: sevenseacat: people who are interested will take the pains to go through the script
[04:12:37] matthewd: Aeyrix: You're not [necessarily] the one who has to support them in 2 years time
[04:13:02] sevenseacat: thecyclone: people who are interested don't need such a script.
[04:13:23] Aeyrix: matthewd: tbh I'm too busy to continue this conversation without getting really irritated with you.
[04:13:46] thecyclone: Using your analogy, people who like to play games should install each framework step by step reading guides and all.
[04:14:04] Aeyrix: People interested in the mechanics of game design would do that.
[04:14:16] SteenJobs: has joined #RubyOnRails
[04:14:17] sevenseacat: no, but people who are going to need to use those frameworks directly should.
[04:14:22] Aeyrix: Which would be analogous to people interested in the script's internals.
[04:14:35] Radar: !popcorn34
[04:14:37] Radar: !popcorn3
[04:14:37] helpa: http://i.imgur.com/SsZ8pbG.gif
[04:15:01] thecyclone: sevenseacat: does your book contain chapters dedicated to installation?
[04:15:12] Radar: thecyclone: it sure does
[04:15:15] Aeyrix: thecyclone: Yes.
[04:15:16] sevenseacat: thecyclone: yes, appendix A is about installation for linux, windows and OSX.
[04:15:20] Aeyrix: And they're far better than the script I wrote.
[04:15:39] Aeyrix: When I get to the parts of the todo I'm going to make it mandatory to read into the components, tbh.
[04:15:44] sevenseacat: they'll nearly identical to the links I gave you hours ago, which is where the inspiration was drawn from.
[04:15:55] Aeyrix: If you can't answer the question it asks it won't continue the script. :^)
[04:15:56] thecyclone: good, I purchased one called "beginning rails : Jeffrey Allan Hardy" and its outdated
[04:16:08] Aeyrix: It'll also report you to the internet police to get your computer driving license revokes.
[04:16:10] Aeyrix: revoked even
[04:16:18] Radar: thecyclone: do you have a link to that one?
[04:16:39] Aeyrix: www.amazon.com/Beginning-Rails-From-Novice-Professional/dp/1430210869
[04:16:42] simkessy: Hey, I have a Service class and I'm trying to access the instance variable after initialization. I tried this: https://gist.github.com/simkessy/cc77bbc814f87e3f1c8f but didn't work
[04:16:42] thecyclone: I have a physical copy, dont know any link
[04:16:46] Radar: http://www.amazon.com/Beginning-Rails-Novice-Professional-Experts/dp/1590596862
[04:16:51] thecyclone: should I send you screenshots?
[04:16:54] Radar: I guess it's that one? August 2nd 2007 is yeah, a bit old :)
[04:16:56] sevenseacat: rails 2 ....?
[04:17:11] Aeyrix: Radar: That's Rails 1
[04:17:14] Aeyrix: Rails 2 was my link
[04:17:34] ishikawa91: has joined #RubyOnRails
[04:17:35] sevenseacat: either way, meep
[04:17:55] thecyclone: Aeyrix: yes your link
[04:18:16] pydave6367: has joined #RubyOnRails
[04:18:25] thecyclone: Radar: the link Aeyrix sent is the one
[04:18:42] sevenseacat: yes, very out of date. very. extremely.
[04:19:00] Radar: thecyclone: did you buy that?
[04:19:02] thecyclone: the packages and links it has stated no longer exist
[04:19:07] Radar: like, with money?
[04:19:14] thecyclone: Radar: yes, I bought tha :(
[04:19:17] Radar: what sevenseacat said
[04:19:34] sevenseacat: no wonder you struggled for three days
[04:19:38] matthewd: Yeah.. did someone *sell* it to you? :|
[04:19:44] zpe: has joined #RubyOnRails
[04:19:55] thecyclone: Purchased from a book store
[04:19:58] thecyclone: like a week ago
[04:21:03] _djbkd: has joined #RubyOnRails
[04:22:50] thecyclone: right now I guess I will use Ruby on Rails Tutorial Learn Web Development with Rails (3rd Edition)
[04:23:12] thecyclone: coz I dont have 50$ to spend on radar's book :(
[04:24:09] ishikawa91: Take a look at Michael Hartl's book, it's free if you read it on his website
[04:24:11] matthewd: Yeah, that's pretty up to date, and will do you much better than something written for Rails 2
[04:24:29] Radar: ishikawa91: That's the one thecyclone is referencing.
[04:24:40] Radar: I think it's a stunted tutorial.
[04:24:41] ishikawa91: Ah ok, joined in late :)
[04:25:07] ishikawa91: It's definitely not thorough, but a decent way to get your feet wet
[04:25:15] Radar: It really only covers the same content that Rails 4 in Action covers in its first 6, maybe 7 chapters.
[04:25:21] Radar: Rails 4 in Action has another 8 chapters after that.
[04:25:22] sevenseacat: and you dont even need a local environment set up! >_>
[04:25:31] Radar: Would've we put them in if we didn't think it worthwhile learning those things?
[04:25:57] sevenseacat: and *we* only scratched the surface of stuff I wanted to include
[04:26:03] trosborn: has joined #RubyOnRails
[04:27:12] Aeyrix: Updated with more links to R4IA.
[04:28:34] thecyclone: Radar: what do you think of rails for zombies?
[04:28:43] matthewd: I guess I'm supposed to be pushing AWDwR, but it's a bit long in the tooth at the moment
[04:29:14] `based_pdev`: has joined #RubyOnRails
[04:29:32] Aeyrix: thecyclone: As far as current state goes, Rails 4 in Action is the definitive starter field guide.
[04:29:45] thecyclone: to anyone who wants to know the "So called comprehensive guides" to learn ruby .. SMH https://www.quora.com/What-are-the-best-resources-for-learning-Ruby-on-Rails
[04:30:01] sevenseacat: we know them already.
[04:30:48] sunya7a: has joined #RubyOnRails
[04:32:43] yfeldblum: has joined #RubyOnRails
[04:34:51] orolo: has joined #RubyOnRails
[04:35:04] shivil: has joined #RubyOnRails
[04:35:42] pawnbox: has joined #RubyOnRails
[04:36:57] jenrzzz: has joined #RubyOnRails
[04:37:20] pawnbox: has joined #RubyOnRails
[04:43:13] pydave6367: has joined #RubyOnRails
[04:44:31] thecyclone: Anyway, thanks everyone! sorry if I offended you. gtg. god bless!
[04:47:06] hephaestus_rg: has joined #RubyOnRails
[04:47:12] Radar: thecyclone: no offence :)
[04:47:43] nemo_: has joined #RubyOnRails
[04:48:07] gotts: has joined #RubyOnRails
[04:48:42] GriffinHeart: has joined #RubyOnRails
[04:54:00] arup_r: has joined #RubyOnRails
[04:56:52] sevenseacat: time to butcher some react code. wish me luck.
[04:57:05] Aeyrix: Ouch. Have fun. :\
[04:57:06] Radar: sevenseacat: I think you'll enjoy React more than other JS frameworks
[04:57:22] Aeyrix: I think you'll enjoy plain HTML more than other JS frameworks.
[04:58:49] sevenseacat: i only have a very loose idea how it works, but am going to modify a component and add some new functionality. this will either be really easy, or will end in tears
[05:03:07] moeabdol: has joined #RubyOnRails
[05:03:40] GriffinHeart: has joined #RubyOnRails
[05:03:42] toy: has joined #RubyOnRails
[05:05:23] comm64x: has left #RubyOnRails: ()
[05:05:55] nemo_: has joined #RubyOnRails
[05:08:04] tuelz: has joined #RubyOnRails
[05:08:21] Radar: It's the least worst of all the JS frameworks :)
[05:08:28] Radar: Easiest learning curve I reckon
[05:09:14] bruno-: has joined #RubyOnRails
[05:10:17] annlewis: has joined #RubyOnRails
[05:11:24] pawnbox: has joined #RubyOnRails
[05:11:50] shivil: has joined #RubyOnRails
[05:12:08] pawnbox: has joined #RubyOnRails
[05:13:36] baweaver: Radar: It seems to get a lot of good reactions
[05:14:10] Or1on: baweaver, :D
[05:16:01] spijet: has left #RubyOnRails: ("WeeChat 1.3")
[05:16:39] Radar: hello again arathald :)
[05:17:13] arathald: I'm halfway through ch4. I realized last night why so many rails sites look so similar
[05:18:41] d34th4ck3r: has joined #RubyOnRails
[05:18:46] arathald: (not a bad look when done properly, but it *is* extremely prominent)
[05:19:39] sevenseacat: because rails devs arent designers so we all just put bootstrap in?
[05:19:50] arathald: pretty much
[05:20:25] VeryBewitching: Bootstrap is common enough I would think by now that it's a good starting point to use for prototyping anything.
[05:20:25] dhjondoh: has joined #RubyOnRails
[05:20:38] zpe: has joined #RubyOnRails
[05:20:47] arathald: it's a solid base to add well-crafted design onto
[05:21:07] sevenseacat: its easy to drop in and have a site that doesnt immediately look like ass
[05:21:11] arathald: but you *do* see a ton of websites that just use it
[05:21:12] chrissonar: has joined #RubyOnRails
[05:21:18] arathald: without many tweaks
[05:21:28] VeryBewitching: I dial back the padding
[05:21:34] arathald: it looks good, but it screams "I built this on rails!!"
[05:21:42] sevenseacat: its not used only for rails apps.
[05:21:49] sevenseacat: its used for a *lot* of apps.
[05:21:54] arathald: it is the hallmark of them though
[05:21:59] sevenseacat: i wouldnt say so.
[05:22:17] VeryBewitching: Lots of WordPress templates are Bootstrapped, I would imagine Drupal and Joomla! too
[05:22:33] arathald: the bitcoin community especially has tons of rails web apps (I do know that they're actually rails) that are mostly just vanilla bootstrap
[05:22:44] dekhaus_: has joined #RubyOnRails
[05:22:59] arathald: yeah, but the obvious wordpressness usually hits me first ;)
[05:23:01] sevenseacat: lots of all kinds of templates are based on bootstrap
[05:23:12] VeryBewitching: Well building an interface that doesn't look like Windows 95 or Motif is a *good* idea coming out of the gate.
[05:23:16] sevenseacat: as well as any custom themes integrated into frameworks
[05:23:23] sevenseacat: nothing specific to rails there
[05:23:43] duncannz: has joined #RubyOnRails
[05:24:15] zpe_: has joined #RubyOnRails
[05:24:43] VeryBewitching: I have to admit though, Sass + Bootstrap is an easy combination to work with, if you have no design skills.
[05:24:56] duncannz: has joined #RubyOnRails
[05:24:59] sevenseacat: also nothing specific to rails.
[05:25:01] chouhoulis: has joined #RubyOnRails
[05:25:02] VeryBewitching: (Even if you do.)
[05:25:09] sevenseacat: i first learnt sass while building php apps.
[05:25:16] VeryBewitching: sevenseacat: Yup, nothing to do with Rails.
[05:26:21] VeryBewitching: I remember designers handing me images cut up from Image Ready in 1999 so we could layout designs using tables.
[05:26:34] Aeyrix: oh man tables
[05:26:50] VeryBewitching: I'm glad we've emerged from those insane dark ages.
[05:27:19] VeryBewitching: Smoke break, and.. *poof*
[05:27:55] GriffinHeart: has joined #RubyOnRails
[05:28:18] arathald: emails still use tables. it's disheartening
[05:28:41] sevenseacat: unfortunately so.
[05:28:47] sevenseacat: many layers of nested tables
[05:29:03] dekhaus_: has left #RubyOnRails: ()
[05:29:37] arathald: I try not to deal too much with emails anymore if I can help it
[05:29:53] sevenseacat: i spent years building them. and not much has changed since then.
[05:30:02] sevenseacat: except its probably now outlook 2010 instead of outlook 2007 that sucks.
[05:30:14] arathald: I'm my team's email expert, so I can usually get away with handing a task to someone else and just serving as a consultant for it
[05:30:27] arathald: outlook 2010 and outlook 2013
[05:30:32] dekhaus: has joined #RubyOnRails
[05:30:59] mytrile: has joined #RubyOnRails
[05:31:00] arathald: the behavior is significantly different between 2007 and 2010, actually
[05:31:07] arathald: I mean, still broken in the ways that matter
[05:31:14] arathald: but just different enough to give you a headache
[05:32:11] arathald: I'm trying to figure out how to throw together a quick design for the website that I actually need to put up
[05:32:34] arathald: bootstrap is probably not a good look for it :/
[05:33:05] arathald: it's a band website.
[05:33:09] riotjones: has joined #RubyOnRails
[05:33:17] arathald: bootstrap would be really hard to pull off there
[05:33:31] arathald: at least without some heavy modifications
[05:33:39] Gustavo: has joined #RubyOnRails
[05:33:51] sevenseacat: time to start designing then.
[05:33:55] arathald: then again, there's less of the type of stuff bootstrap deals with and more general layout and design work on that kind of website
[05:34:00] dekhaus_: has joined #RubyOnRails
[05:34:41] arathald: I don't need lots of forms and data views and all that
[05:35:10] arathald: I mean, hell, I don't even really need rails or any other app framework. wordpress or even a static site would do, but :shrug:
[05:35:14] arathald: it's a great excuse
[05:35:30] duderonomy: has joined #RubyOnRails
[05:35:31] arathald: plus having built-in content management will be nice
[05:35:33] Radar: https://raw.githubusercontent.com/radar/twist/master/doc/preview.png
[05:35:36] Radar: Bootstrap-less design
[05:35:42] Radar: It is possible :P
[05:36:17] Aeyrix: I don't use Bootstrap tbh
[05:36:34] trautwein: has joined #RubyOnRails
[05:36:35] Radar: A more modern version of the same design http://i.imgur.com/DVI9x1V.png
[05:37:05] aganov: has joined #RubyOnRails
[05:37:30] arathald: are there other libraries like bootstrap that have different feels to them (I looked at bootstrap themes/variations, and they all look pretty similar to my eye except for the complete overhauls that look like sliced pngs)
[05:37:33] dekhaus: has joined #RubyOnRails
[05:38:18] arathald: Radar: that's a nice design. clean, simple
[05:38:27] sevenseacat: 'i want everything as awesome as bootstrap but not bootstrap'
[05:38:33] arathald: easy on the eyes. great layout for documentation
[05:39:03] sevenseacat: ACTION goes back to poking react with a stick
[05:39:44] arathald: sevenseacat: it doesn't have to be as awesome as bootstrap. it really just has to give me a different base to start designing up from
[05:40:06] MartinElvar: has joined #RubyOnRails
[05:40:06] Radar: arathald: look at normalize.css
[05:40:16] Radar: There's your base :)
[05:41:02] arathald: sevenseacat: because it's not the look I'm going for. I could heavily modify the bootstrap look, but if I can find a base that's more in line with what I want for this site, that'll be easier to build on
[05:42:52] arathald: plus I'm curious. if there's other tools that might be worth working with, I want to know about them
[05:42:54] VeryBewitching: arathald: I dunno, Bootstrap is really simple.
[05:43:09] sevenseacat: there are heaps of other css frameworks out there. take your pick.
[05:43:18] sevenseacat: we don't know what you want, so start researching.
[05:43:29] ruurd: has joined #RubyOnRails
[05:43:47] VeryBewitching: arathald: http://modernweb.com/2014/02/17/8-bootstrap-alternatives/
[05:43:57] VeryBewitching: Good place to begin.
[05:44:27] Radar: dekhaus: it works
[05:44:30] dekhaus: Hi All. Within the 'success' callback of a jquery.post call - I'm trying to reload the current page. I've tried 'location.reload(true)' alone as well as with "window.location.href = '/?' + Date.parse(new Date)" (note - its coffeescript) and nothing seems to work. My 'post' call works and now I'd like to refresh the page. Please help. (I realize that refreshing the page is not ideal - but its a very 'light' page
[05:44:31] dekhaus: :-) ). Thx Dave
[05:44:31] Radar: you have passed the first test
[05:44:54] Radar: dekhaus: !gist full code plz
[05:44:54] helpa: dekhaus: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[05:45:59] dekhaus: http://pastie.org/10496733
[05:46:03] rdavila: has joined #RubyOnRails
[05:46:24] rhizome: dekhaus: why reload the page when you're using ajax?
[05:46:26] lxsameer: has joined #RubyOnRails
[05:46:26] lxsameer: has joined #RubyOnRails
[05:47:39] dekhaus: because I'm being lazy and now I want to know is why the 'reload' won't work
[05:47:45] tagrudev: has joined #RubyOnRails
[05:47:59] rhizome: yak shaving
[05:48:19] Radar: dekhaus: window.location.reload?
[05:48:28] Radar: line 9 doesn't do anything
[05:49:07] Radar: dekhaus: why do you have just location.reload?
[05:49:24] Radar: Oh, it should work still I guess.
[05:50:00] Radar: ACTION shrugs
[05:50:02] workmad3: has joined #RubyOnRails
[05:50:04] Radar: hard to know without seeing it for myself
[05:50:10] dekhaus: based on several google searches - that seems to be the accepted way of reloading the page. passing 'true' means call server
[05:51:22] krz: has joined #RubyOnRails
[05:51:29] dekhaus: i realize that I reloading the page is not ideal - but I'm curious why the reload isn't working
[05:51:52] VeryBewitching: I've used window.location.reload() in Coffee and it works just fine.
[05:51:54] Aeyrix: dekhaus: Are you using turbolinks?
[05:51:56] arathald: I'm liking kickstart, actually
[05:52:06] arathald: i mean, just what I'm reading and seeing
[05:52:08] dekhaus: turned turbolinks off
[05:52:37] arathald: though... their "store" that's supposed to be a vibrant community hub for components and designs has 8 things in it, all developed by the same person
[05:55:32] pydave6367: has joined #RubyOnRails
[05:57:14] GriffinHeart: has joined #RubyOnRails
[05:57:49] moeabdol: has joined #RubyOnRails
[05:58:12] nya: has joined #RubyOnRails
[05:59:41] Aeyrix: mkrb is now 100% modular
[05:59:51] Aeyrix: will work on darwin and implosion stuff tomorrow
[06:00:05] michael_mbp: has joined #RubyOnRails
[06:00:52] workmad3: has joined #RubyOnRails
[06:03:40] Radar: Aeyrix: You're XKCD 927'ing really hard :P
[06:04:22] Aeyrix: Radar: This is mostly for my own benefit.
[06:04:26] Aeyrix: I need this for laziness purposes.
[06:04:39] Aeyrix: I spin up new boxes constantly. I did three today on two different architectures and two different OSs.
[06:04:39] Radar: I tease, I teaste
[06:04:48] Aeyrix: BSD ARM, Linux x86_64.
[06:04:53] Aeyrix: Shit needs automating.
[06:05:44] imp4t: has joined #RubyOnRails
[06:06:10] spkprav: has joined #RubyOnRails
[06:07:47] sevenseacat: ACTION goes to firefox to see what XKCD 927 is, types in half the URL.... ah hah
[06:08:18] yardenbar: has joined #RubyOnRails
[06:08:21] arathald: I got lost looking at beautiful websites
[06:08:26] krz: has joined #RubyOnRails
[06:08:51] sevenseacat: if anyone wants some discounts on some manning books - http://archive.constantcontact.com/fs172/1101335703814/archive/1122625931066.html
[06:10:20] bruno-: has joined #RubyOnRails
[06:11:05] annlewis: has joined #RubyOnRails
[06:13:05] AntiSpamMeta: has joined #RubyOnRails
[06:13:43] sunya7a: has joined #RubyOnRails
[06:13:50] jessemcgilallen: has joined #RubyOnRails
[06:15:21] nemo__: has joined #RubyOnRails
[06:19:03] herbst: has joined #RubyOnRails
[06:19:29] arathald: ok, time to watch tv
[06:23:44] jacksparrow007: has joined #RubyOnRails
[06:25:37] jacksparrow007: has joined #RubyOnRails
[06:28:22] nemo_: has joined #RubyOnRails
[06:29:20] artmann: has joined #RubyOnRails
[06:29:30] arup_r: Suggest me some good refs for Elasticsearch.... ( I am on http://www.elasticsearchtutorial.com/elasticsearch-in-5-minutes.html )
[06:29:49] norc: has joined #RubyOnRails
[06:30:56] srinidhi: has joined #RubyOnRails
[06:31:15] papercode: has joined #RubyOnRails
[06:32:06] kp666: has joined #RubyOnRails
[06:32:09] comrad: has joined #RubyOnRails
[06:33:03] zpe: has joined #RubyOnRails
[06:33:04] kp666: has joined #RubyOnRails
[06:34:36] Shoutsid: has joined #RubyOnRails
[06:34:43] ellisTAA: has joined #RubyOnRails
[06:35:55] GriffinHeart: has joined #RubyOnRails
[06:36:27] dopie: has joined #RubyOnRails
[06:37:29] n008f4g_: has joined #RubyOnRails
[06:45:03] linus4: has joined #RubyOnRails
[06:49:59] yfeldblum: has joined #RubyOnRails
[06:51:08] nfk|laptop: has joined #RubyOnRails
[06:52:11] bmalum: has joined #RubyOnRails
[06:53:54] krz: has joined #RubyOnRails
[06:56:06] ruurd: has joined #RubyOnRails
[06:56:09] dnewkerk: arup_r: https://gorails.com/episodes/elasticsearch-with-searckick
[06:56:58] jacksparrow007: has joined #RubyOnRails
[06:57:09] papercode: has left #RubyOnRails: ("WeeChat 0.4.3")
[06:58:26] arup_r: dnewkerk: Thanks
[07:04:00] futilegames: has joined #RubyOnRails
[07:04:44] solars: has joined #RubyOnRails
[07:08:30] ruurd: has joined #RubyOnRails
[07:08:52] tuelz: has joined #RubyOnRails
[07:08:56] jas02: has joined #RubyOnRails
[07:10:04] vishnu: has joined #RubyOnRails
[07:10:55] alienaut: has joined #RubyOnRails
[07:11:02] MartinElvar: has joined #RubyOnRails
[07:11:52] annlewis: has joined #RubyOnRails
[07:12:47] eGGsha: has joined #RubyOnRails
[07:17:33] bruno-: has joined #RubyOnRails
[07:18:01] adac: has joined #RubyOnRails
[07:19:09] mloy: has joined #RubyOnRails
[07:19:56] lea: has joined #RubyOnRails
[07:24:37] p8m: has joined #RubyOnRails
[07:25:28] yardenbar: has joined #RubyOnRails
[07:30:29] Gustavo: has joined #RubyOnRails
[07:32:35] sadaf2606: has joined #RubyOnRails
[07:33:17] Shoutsid: has joined #RubyOnRails
[07:35:16] xcesariox: has joined #RubyOnRails
[07:37:59] draken: has joined #RubyOnRails
[07:38:08] lea: has joined #RubyOnRails
[07:38:24] jxs_: has joined #RubyOnRails
[07:38:44] Cervajz: has joined #RubyOnRails
[07:41:48] nurbson: has joined #RubyOnRails
[07:43:58] artto: has joined #RubyOnRails
[07:44:36] marr: has joined #RubyOnRails
[07:44:50] nurbson: whats the capybara equivalent for rspecs 'render' with let(:variable) {@variable} ? I tried visit '/articles/edit' and get a RecordNotFoundError since @variable in my view doesn't get set
[07:47:57] sevenseacat: nurbson: why isnt your controller setting it?
[07:48:10] doublemalt_: has joined #RubyOnRails
[07:48:20] webdestroya: has joined #RubyOnRails
[07:48:45] nurbson: the controller needs an ID for find the object, with rspec I set it with let(:article) { FactoryGirl.create(:article) }
[07:48:47] pawnbox: has joined #RubyOnRails
[07:49:10] krz: has joined #RubyOnRails
[07:49:22] zpe: has joined #RubyOnRails
[07:49:26] pawnbox: has joined #RubyOnRails
[07:50:14] sevenseacat: thats not quite how it works
[07:50:30] sevenseacat: if you're writing a feature test or equivalent with capybara, it acts like a normal request you would make in your browser
[07:50:47] sevenseacat: you wouldnt go to /articles/edit in your browser, you'd go to /articles/2/edit or something
[07:50:56] nurbson: oh I see :)
[07:51:34] VeryBewitching: So long, farewell, auf wiedersehen, good night
[07:53:25] zpe_: has joined #RubyOnRails
[07:53:48] yogeshrt: has joined #RubyOnRails
[07:54:41] trosborn: I have @toppings = Toppings.all. Each topping has a name. Is there an easy way to grab the name from each one and concatenate the results? Something like ???@toppings.map_the_names.join????
[07:55:08] claeseman: has joined #RubyOnRails
[07:55:22] sevenseacat: the easiest way would be to pluck(:name) to select an array of names from the db
[07:55:34] sevenseacat: however I feel we're only getting half the story
[07:56:15] adac: has joined #RubyOnRails
[07:57:06] trosborn: no??? that worked perfectly. Thank you so much :) would probably never have found that method
[07:59:21] NBarnes: has joined #RubyOnRails
[08:00:08] kalusn: has joined #RubyOnRails
[08:00:33] kalusn: has joined #RubyOnRails
[08:01:01] curses: has joined #RubyOnRails
[08:01:38] trosborn: for the record, I was just making a view helper method to add commas to a list of names. def add_commas_to_product(products); products.pluck(:name).join ', ???; is what I have now.
[08:01:57] mikecmpbll: has joined #RubyOnRails
[08:02:33] jsrn_: has joined #RubyOnRails
[08:03:07] bennysan: has joined #RubyOnRails
[08:03:12] pawnbox: has joined #RubyOnRails
[08:03:30] cstyles: has joined #RubyOnRails
[08:03:35] workmad3: has joined #RubyOnRails
[08:03:48] cheeti: has joined #RubyOnRails
[08:04:58] arBmind: has joined #RubyOnRails
[08:05:35] cheeti: hi,we can get the banwidth of a website using rails code?
[08:05:48] yogeshrt: has joined #RubyOnRails
[08:06:04] Axilla: has joined #RubyOnRails
[08:06:59] norc: Im using Oracle, which has no notion of integers (they are stored as floating point numbers). Is something like def price; self[:price].to_i; end in my model ok or is there a better way?
[08:07:53] contradictioned: has joined #RubyOnRails
[08:08:38] LudicrousMango: has joined #RubyOnRails
[08:10:05] cheeti: hi,we can get the banwidth of a website using rails code?
[08:11:11] nurbson: cheeti: we need more info about your project. what do you try to measure? what system do you have (OS, webserver, etc)
[08:12:36] annlewis: has joined #RubyOnRails
[08:12:47] cheeti: nurbson hi, i have ubuntu 12.04 if client register with a website i want measure that website bandwidth
[08:12:59] Cervajz: has joined #RubyOnRails
[08:13:57] Cervajz_: has joined #RubyOnRails
[08:13:57] nurbson: more details please. do you have several rails installations running which your clients can use? and you want to now how much bandwidth per month they are using?
[08:14:58] codezomb: has joined #RubyOnRails
[08:15:44] adre: has joined #RubyOnRails
[08:16:19] cheeti: nurbson yes i want to find how much bandwidth per month they are using
[08:17:43] jxs_: has joined #RubyOnRails
[08:18:10] nurbson: https://goo.gl/Nmkfjz
[08:18:13] tvw: has joined #RubyOnRails
[08:18:20] bruno-: has joined #RubyOnRails
[08:18:29] nurbson: hope that helps
[08:18:56] darutoko: has joined #RubyOnRails
[08:23:19] dhjondoh: has joined #RubyOnRails
[08:23:33] bmalum: has joined #RubyOnRails
[08:25:50] Pumukel: has joined #RubyOnRails
[08:26:15] htmldrum: has joined #RubyOnRails
[08:30:08] mark2: has joined #RubyOnRails
[08:30:46] curses: out of curiosity does anyone use dokku for production apps?
[08:31:27] abdulhannanali: has joined #RubyOnRails
[08:31:51] lea: has joined #RubyOnRails
[08:32:04] workmad3: has joined #RubyOnRails
[08:32:04] andywww: has joined #RubyOnRails
[08:35:55] nemo_: has joined #RubyOnRails
[08:38:15] jxs_: has joined #RubyOnRails
[08:38:42] mwat: has joined #RubyOnRails
[08:40:40] nemo__: has joined #RubyOnRails
[08:41:37] hendricius: has joined #RubyOnRails
[08:43:57] mordocai: has joined #RubyOnRails
[08:47:12] nettoweb: has joined #RubyOnRails
[08:48:18] dANO-: has joined #RubyOnRails
[08:48:46] shivil: has joined #RubyOnRails
[08:48:59] teclator: has joined #RubyOnRails
[08:51:11] teclator: has left #RubyOnRails: ()
[08:51:14] teclator: has joined #RubyOnRails
[08:53:44] Pumukel: has joined #RubyOnRails
[08:54:44] silverdust: not really laravel based but a database decision. I have a users table and I want a table with user profiles. I don't have profiles for anythig else. Is it better to have a user_profiles table or a profiles table?
[08:55:33] sevenseacat: why do you need a separate table?
[08:56:43] silverdust: The users table has too many in it already. We want it keep it majorly for login credentials and a few other neccessary thigs
[08:57:10] wethu: has joined #RubyOnRails
[08:57:12] silverdust: and the profile contains all the user preferences which are too much
[09:01:14] silverdust: sevenseacat: you think it's not a good idea?
[09:01:33] silverdust: And it'll better to have them all in users anyway??
[09:01:35] sevenseacat: didnt say that, was just curious as to why you were deciding between A or B and not C
[09:03:40] krz: has joined #RubyOnRails
[09:04:53] silverdust: sevenseacat: you freelance right? Not giving a job just need an advice
[09:05:02] renegadeandy: has joined #RubyOnRails
[09:05:41] blackmesa: has joined #RubyOnRails
[09:07:05] renegadeandy: Hey everyone, can somebody help me with this SSL question: https://gist.github.com/renegadeandy/2ba52e6ff7f47a1eee43
[09:08:00] vigintas: has joined #RubyOnRails
[09:08:14] silverdust: okay but if you got a freelance job in somethig like say laravel PHP which you kow you can work with but yet know you'd do better with rails, will you take it?
[09:09:35] tuelz: has joined #RubyOnRails
[09:10:29] Cervajz: has joined #RubyOnRails
[09:10:29] sevenseacat: I wouldnt get a freelance job in laravel.
[09:10:52] nfk|laptop: has joined #RubyOnRails
[09:11:31] vigintas: has joined #RubyOnRails
[09:11:33] dhjondoh1: has joined #RubyOnRails
[09:11:47] ngn999: has joined #RubyOnRails
[09:12:40] norc: renegadeandy: Here is a random idea. Are you sure thin is actually using that config?
[09:13:09] renegadeandy: norc: hmmm, not entirely, how can i validate it?
[09:13:23] annlewis: has joined #RubyOnRails
[09:14:19] Majadon: has joined #RubyOnRails
[09:15:58] workmad3: has joined #RubyOnRails
[09:16:12] norc: renegadeandy: anyway, the flag uses dashes (-) not underscores (_) - that is likely your culprit.
[09:16:25] renegadeandy: norc: :O which flag!?
[09:16:31] norc: or wait.
[09:16:50] norc: renegadeandy: the ssl-key / ssl-cert thingies
[09:17:26] yogeshrt: has joined #RubyOnRails
[09:18:19] Lightsword: has joined #RubyOnRails
[09:18:30] renegadeandy: so ill try replacing that , one momento
[09:19:19] bruno-: has joined #RubyOnRails
[09:20:01] renegadeandy: norc: where is the docs showing each of these variables for the config and their names?
[09:20:23] norc: renegadeandy: Yeah Im actually not so sure. Let me go back and check
[09:20:56] GriffinHeart: has joined #RubyOnRails
[09:21:30] nurbson: just finished the first milestone of my first TDD project...almost...completely forgot one show action of one controller :D
[09:21:44] dopie: Hey all I'm getting a ActiveRecord::AssociationTypeMismatch in VideosController#update
[09:21:54] dopie: https://gist.github.com/staycreativedesign/2e6715e80ccdb6655141
[09:23:31] renegadeandy: nurbson: yay!
[09:24:29] norc: renegadeandy: Show me the message that thin emits please
[09:24:54] dopie: = f.select :model_ids, options_from_collection_for_select(@models, :id, :name), {}, { :multiple => true, class: "full-width", :size => "10" }
[09:24:56] dopie: got it working
[09:25:50] renegadeandy: norc: in the logs???.there is next to nothing
[09:26:00] Peg-leg: has joined #RubyOnRails
[09:26:45] renegadeandy: norc: https://gist.github.com/renegadeandy/2ba52e6ff7f47a1eee43 added here
[09:26:50] DEA7TH: has joined #RubyOnRails
[09:27:14] scottsherwood: has joined #RubyOnRails
[09:27:37] renegadeandy: norc: if you want to see the message im talking about???.visit this URL in your browser : https://www.clazzoo.com:4443/faye.js
[09:28:08] norc: renegadeandy: Works fine for me.
[09:28:10] renegadeandy: norc: note your browser asks for a client cert,,,,but if you just go to www.clazzoo.com it does not???.and its this difference i want to fix.
[09:28:20] renegadeandy: norc: so it didnt ask you for a client cert/
[09:28:33] renegadeandy: norc: whats going on!?!?!
[09:28:34] sheepman: has joined #RubyOnRails
[09:28:41] norc: renegadeandy: I recommend you bust your browser cache (use a private browser window).
[09:29:01] vigintas: has joined #RubyOnRails
[09:29:12] renegadeandy: norc: so is the parameter ssl_key_cert or ssl-key-cert
[09:29:18] norc: renegadeandy: underscore should be fine
[09:29:38] lea: has joined #RubyOnRails
[09:30:41] sheepman: looks like if i put a button_to inside a form RoR does something funky and it becomes the submit button even though I have a submit button further down the form... is that normal?
[09:30:48] sunya7a: has joined #RubyOnRails
[09:30:59] herbst: is there any pattern for searching full name "Hugo Rails" in a table where it is "name: Hugo, surname: Rails" ?
[09:31:14] norc: renegadeandy: Id say bust/clear your browser cache - that can cause all sorts of most bizarre undebuggable issues
[09:31:49] d34th4ck3r: What is a good way to name controllers? camelCase?
[09:31:56] norc: herbst: Does it always follow that pattern or do you want full text search?
[09:32:05] renegadeandy: d34th4ck3r: always snake_case in ruby
[09:32:09] norc: d34th4ck3r: http://guides.rubyonrails.org/active_record_basics.html#naming-conventions
[09:32:09] herbst: norc: more or less full text search
[09:32:39] d34th4ck3r: but doesn???t it create confusion because we also use snake_case for variables.
[09:32:44] norc: herbst: Which database are you using?
[09:32:53] herbst: norc: Postgres
[09:33:40] `based_pdev`: has joined #RubyOnRails
[09:33:43] nemo_: has joined #RubyOnRails
[09:33:46] bruno-: has joined #RubyOnRails
[09:34:08] sheepman: ah button_to generates a whole form... that'll be why
[09:34:13] norc: herbst: http://www.postgresql.org/docs/9.4/static/textsearch-tables.html -- that will explain how you set up your ts vectors for mulitple columns even.
[09:34:39] herbst: norc: oh. seems simpler than imagined. thanks
[09:35:27] nemo___: has joined #RubyOnRails
[09:35:38] norc: renegadeandy: Mind my asking, any progress?
[09:36:19] `based_pdev`: has joined #RubyOnRails
[09:36:25] renegadeandy: norc: checking on another pc with cleared cookies!
[09:37:46] thither: has joined #RubyOnRails
[09:37:58] nemo__: has joined #RubyOnRails
[09:38:22] nurbson: renegadeandy: for testing I use Safari and reset it before every request. I used to use chrome but with some of the recent updates it caches to much. I noticed that chrome sometime even doesn't fire a request to the server if you reload a page to often
[09:38:54] nurbson: *too often
[09:38:58] norc: renegadeandy: Generally when toying with web server configurations, ssl, domains (especially things like apache vhosts) - I always use my browsers incognito mode. Makes it really easy to reset the browser state.
[09:39:09] FailBit: nurbson: hit ctrl+shift+s to bust caches in chrome
[09:39:11] nemo_: has joined #RubyOnRails
[09:39:12] bruno-: has joined #RubyOnRails
[09:39:24] FailBit: *to reload without caching
[09:39:42] nurbson: FailBit: i know, but this didn't help
[09:39:51] FailBit: then it wasn't caching
[09:39:55] FailBit: it's that simple
[09:40:19] nemo_: has joined #RubyOnRails
[09:41:03] nurbson: for some reason chrome didn't send a get request to the server but rerendered the whole page. it was really confusing and until today I don't know what was going on.
[09:41:32] workmad3: nurbson: turbolinks storing stuff in memory in JS?
[09:41:40] speaking1ode: has joined #RubyOnRails
[09:42:01] Synthead: has joined #RubyOnRails
[09:43:43] gasbakid__: has joined #RubyOnRails
[09:44:07] MichD: has joined #RubyOnRails
[09:44:17] kaspergrubbe: has joined #RubyOnRails
[09:44:28] bruno-: has joined #RubyOnRails
[09:44:53] nurbson: I doubt that, it was TYPO3 page running locally inside a VM
[09:44:59] MichD: has left #RubyOnRails: ()
[09:45:16] defsdoor: has joined #RubyOnRails
[09:45:30] renegadeandy: norc: It is happening on other pcs as well
[09:45:34] norc: Interesting. Just figured out that chrome dev tools have an option to disable the cache entirely while they are opened.
[09:45:42] norc: renegadeandy: Which browser?
[09:46:08] renegadeandy: norc: chrome, which browser did you use? https://www.clazzoo.com:4443/faye.js
[09:46:14] norc: renegadeandy: Chrome and FF
[09:46:50] norc: renegadeandy: Is it possible you have messed with your root certificates somehow?
[09:47:11] renegadeandy: norc: i don???t think so, and as i said???if you go to www.clazzoo.com - it does not popup askign for a client cert....
[09:47:49] andywww: has joined #RubyOnRails
[09:48:10] renegadeandy: so its working under nginx, but not udner thin
[09:48:24] andywww: i???ve come across this code and can???t suss out what it means, plese can someone tell me what it???s doing?
[09:48:25] andywww: responds_to?(:[])
[09:48:58] renegadeandy: norc: ive tried it on 3 different pcs, all running FF and Chrome and Mac OSX and its behaving the same on all 3???.asking the user for a client cert for that faye.js request
[09:49:17] unreal_: has joined #RubyOnRails
[09:49:29] workmad3: andywww: it's checking if something responds to the `[]` method
[09:49:53] andywww: i read that as an array
[09:49:56] andywww: is that correct?
[09:50:06] andywww: checking if it responds to an array?
[09:50:28] workmad3: andywww: no, it's checking for the [] method
[09:50:39] andywww: what is the [] method?
[09:50:43] andywww: can you link me?
[09:50:48] sevenseacat: same as any other method
[09:51:05] workmad3: andywww: it's the method that gets called with the syntactic sugar `some_object[foo]`
[09:51:13] renegadeandy: norc: why would it be behaving like this?
[09:51:18] andywww: aah gotcha
[09:51:33] workmad3: `some_object[foo]` == `some_object.[](foo)`
[09:52:03] gasbakid_: has joined #RubyOnRails
[09:52:56] andywww: does it have a name or can you link me to somewhere i can read up?
[09:53:14] andywww: i also struggle with (&:save)
[09:53:18] norc: renegadeandy: best guess is the signing path is screwed i??
[09:53:23] andywww: but aren???t entirely sure what it is
[09:53:40] workmad3: andywww: the `[]` method can be defined on any object... same as any other method
[09:53:58] workmad3: not sure what you want linked to, unless you really just want a link to "This is how you define a method in ruby" style things
[09:54:11] pawnbox: has joined #RubyOnRails
[09:54:14] andywww: https://www.airpair.com/ruby-on-rails/posts/building-a-restful-api-in-a-rails-application#4-2-2-1-defensive-programming
[09:54:18] andywww: i???m reading this
[09:54:22] workmad3: andywww: so it's a method, it has some syntactic sugar... what more do you actually want to know?
[09:54:26] EasyRider0: has joined #RubyOnRails
[09:54:30] andywww: The more significant defensive choice was the inclusion of responds_to?(:[]).
[09:54:41] andywww: but i don???t actually know what that is doing in this context
[09:55:03] workmad3: andywww: it's checking that something responds to `[]` before trying to access with `foo[bar]`
[09:55:21] norc: renegadeandy: From what I can tell, this could happen if the signing order is reversed (which would mean its a bad ca bundle)
[09:55:37] gasbakid__: has joined #RubyOnRails
[09:55:44] workmad3: andywww: same as you can do `foo.save if foo.responds_to?(:save)` to make sure you don't call the `save` method if it doesn't exist
[09:56:17] andywww: righto, that makes more sense
[09:56:48] yashinbasement: has joined #RubyOnRails
[09:56:54] GriffinHeart: has joined #RubyOnRails
[09:58:26] GriffinHeart: has joined #RubyOnRails
[09:58:38] zpe: has joined #RubyOnRails
[09:58:41] andywww: has left #RubyOnRails: ()
[10:00:09] Guest28: has joined #RubyOnRails
[10:00:42] EasyRider0: Hi, i'm trying to figure out how to set up a multi column unique constraint, where one column can be null
[10:01:35] EasyRider0: For example i want to have : subject_class, action, subject_id = unique, but also allow a subject_class, action, subject_id = null
[10:02:19] EasyRider0: I've been reading through some stuff on it, like : http://nyonura.com/blog/2014/Partial-Indexes-with-PostgreSQL-and-Rails/ but I can't really figure out if i need to set up one or two indexes for this, and how exactly to do this
[10:03:37] rodfersou: has joined #RubyOnRails
[10:04:50] norc: EasyRider0: I get a headache just looking at that article.
[10:05:00] norc: EasyRider0: Really. Close the tab and do not look at it again.
[10:05:35] norc: EasyRider0: Constraints are used to enforce things like uniqueness. Not indices....
[10:05:46] workmad3: norc: a unique index is a constraint
[10:06:14] Cervajz_: has joined #RubyOnRails
[10:06:20] workmad3: EasyRider0: you're in trouble when you want to allow NULL into a unique index
[10:06:37] norc: workmad3: Well not exactly. The constraint adds the index.
[10:07:01] workmad3: norc: the constraint is on the index in the form of a unique index
[10:07:20] lea: has joined #RubyOnRails
[10:07:30] renegadeandy: norc: but why would it work ok from nginx if that was the issue?
[10:07:33] workmad3: norc: but that's splitting hairs :)
[10:07:48] norc: workmad3: Sec. Let me verify something
[10:07:50] workmad3: EasyRider0: still... allowing a NULL in causes issues, because NULL != NULL
[10:07:56] mary5030: has joined #RubyOnRails
[10:08:35] workmad3: EasyRider0: so a nullable column in the multi-column set means that `(a, b, NULL)` and `(a, b, NULL)` don't violate the uniqueness constraint
[10:08:42] jenrzzz: has joined #RubyOnRails
[10:09:39] cornerma1: has joined #RubyOnRails
[10:09:50] norc: workmad3: the index is the implementation behind it. It can make difference up into ActiveRecord if it probes pg_constraint
[10:10:03] norc: workmad3: Creating a unique index does not modify pg_constraint mind you.
[10:10:15] EasyRider0: workmad3: makes sense. still I'd want to have (a,b,c=1) (a,b,c=2) (a,b) being unique values allowing a,b in all cases but not (a,b,c=NULL) twice
[10:10:16] norc: (That thing with AR is just a guess, I dont know the implementation)
[10:10:34] workmad3: norc: I have no idea what you're talking about now :P
[10:10:44] EasyRider0: i have a hard time spinning my head around it
[10:11:32] workmad3: EasyRider0: yeah, that last one (not having (a,b,NULL) twice) is the problematic one... I've yet to come across a good way to solve that
[10:11:39] EasyRider0: workmad3: what you said is the thing that I can't figure out
[10:12:09] netzfisch: has joined #RubyOnRails
[10:12:38] norc: workmad3: If you ALTER TABLE ... ADD CONSTRAINT it will modify the internal system catalog pg_constraint for state keeping, and then create a unique index.
[10:14:10] annlewis: has joined #RubyOnRails
[10:14:12] workmad3: norc: tbh, I don't think there's much actual help in the hairs we're splitting now... the issue isn't really whether a uniqueness constraint is on an index or a column... the issue is that NULLs in a unique constraint don't prevent duplicates
[10:15:04] EasyRider0: The use case is I'm writing a Permission system where I'm storing permissions in the DB for CanCanCan. So i have a Permissables table where I store all possible permissable action controllers and possibly granulate down to a subject_id (Role is only or not able to modify subject_id x in a certain controller(subject_class) action
[10:15:26] srinidhi: has joined #RubyOnRails
[10:15:34] stamina: has joined #RubyOnRails
[10:15:46] EasyRider0: The actual permissions for users/role are defined in a permissions table. But I need to be able to gegenerate this table when "Permissables" change
[10:16:24] workmad3: EasyRider0: you'll probably need a separate partial index for each combination of nullable columns... e.g. a unique partial index on (a,b) with `WHERE c IS NULL`, a unique partial index on (a,c) with `WHERE b IS NULL`, etc.
[10:16:26] Linuus: has joined #RubyOnRails
[10:16:36] workmad3: (not sure how many columns you have in the index that are nullable )
[10:16:43] norc: workmad3: Oh absolutely. I was just saying that it could actually make a difference there. ;-)
[10:16:51] norc: Not one relevant to this discussion however.
[10:16:53] renegadeandy: norc: pinged ya
[10:17:12] GriffinHeart: has joined #RubyOnRails
[10:17:35] workmad3: EasyRider0: ah good, so just the one extra unique partial index on (a,b) with `WHERE c IS NULL` then
[10:17:43] matthewd: If there's an impossible value for the column, an index over (a, b, (coalesce(c, 0))) might do it?
[10:18:13] EasyRider0: workmad3: So i'd probably just have to write this in a pure SQL migration right?
[10:19:33] workmad3: EasyRider0: don't think so... the docs indicate support for partial indexes with a `where:` option - so `add_index :foobars, [:a, :b], unique: true, where: "c IS NULL"`
[10:20:03] EasyRider0: So I end up having add_index :permissables, [:subject_class, :action] , :unique => true and then another partial index?
[10:20:13] Gustavo: has joined #RubyOnRails
[10:20:34] rickmasta: has joined #RubyOnRails
[10:20:48] cleopatra: has joined #RubyOnRails
[10:20:50] workmad3: EasyRider0: you end up with `add_index :permissables, [:subject_class, :action, :subject_id], unique: true` and `add_index :permissables, [:subject_class, :action], unique: true, where: "subject_id IS NULL"`
[10:21:19] EasyRider0: workmad3: thanks, i'll give it a shot :)
[10:22:17] workmad3: norc: I don't think AR probes `pg_constraint` btw... AR tends to pretty much ignore constraints set in the db ;)
[10:22:49] norc: workmad3: I was thinking schema dumper just might. ;-)
[10:23:15] trosborn: has joined #RubyOnRails
[10:23:19] workmad3: norc: hmm... possibly... but that would also dump the uniqueness constraint from indices it dumps too ;)
[10:24:43] workmad3: norc: afaict, the only way things could differ is if AR tried to set up automatic uniqueness constraints based on a probe of `pg_constraint`... which it definitely doesn't do
[10:25:28] claeseman: has joined #RubyOnRails
[10:26:01] norc: workmad3: *shrugs* - I mean immediately it should not make a difference. I just dislike taking meta information away which might now or in the future be used by some library or tool.
[10:26:16] norc: (These things become habits rather quickly)
[10:26:43] norc: Especially when the alternative comes at no disadvantage and is even recommend by Postgres docs directly.
[10:26:51] norc: But either way, you are right. Im just splitting hairs here.
[10:28:05] EasyRider0: norc: workmad: Yes, this was the way to go: http://pastebin.com/jsrnrVHu
[10:28:12] workmad3: norc: hehe :) you could also argue the point that pg is doing something wrong by not adding an entry to `pg_constraint` when a unique index is created outside of a table schema definition
[10:28:41] EasyRider0: helpa: yes daddy
[10:28:53] pwnd_nsfw: has joined #RubyOnRails
[10:31:20] norc: workmad3: The docs themselves say that you shouldnt create an index because its fiddling around with the interna of pg
[10:32:21] norc: Doing things internally tends to not completely finish the job. ;)
[10:32:24] workmad3: norc: hmm... where?
[10:33:35] spkprav: has joined #RubyOnRails
[10:33:36] ldnunes: has joined #RubyOnRails
[10:35:30] bobbobbins: has joined #RubyOnRails
[10:35:51] workmad3: norc: ah, found it... it would be much more useful if that bit was mentioned on the `CREATE INDEX` doc page ;)
[10:36:13] workmad3: norc: also, it says 'could be considered', not 'is'
[10:37:55] workmad3: norc: also fun - creating a partial unique index directly is the mechanism the same pg docs recommend for EasyRider0's situation ;)
[10:37:57] arBmind: has joined #RubyOnRails
[10:38:01] workmad3: norc: http://www.postgresql.org/docs/9.4/static/indexes-partial.html
[10:38:21] workmad3: (sorry, suggests, not recommends)
[10:39:20] bobbobbins: I'm trying to turn a model function into a scope, but I'm not sure I know what I'm doing...my function just returns self.status.first and now I want my scope to be where self.status.first.status_id != 0 but calling the function name in the scope gives an undefined method error, as does calling self.status...can someone help me out here?
[10:39:45] bobbobbins: sorry, its statuses, not status
[10:40:03] bobbobbins: (statuses being a has many to the current model)
[10:43:55] Cervajz: has joined #RubyOnRails
[10:44:21] EasyRider0: workmad3: I kinda figured out the partial index thing from the psql docs already, was just confused how to do this cleanly in rails. Bloated articles didn't make it easier on my head :(
[10:44:37] EasyRider0: Also there's a bit of ambiguity when using the word 'constraint' I admit
[10:45:16] EasyRider0: When wer're talking about a classic constraint, like pg_constraint are cross table pkey constraints
[10:45:40] raphagodoi: has joined #RubyOnRails
[10:46:09] raphagodoi: has left #RubyOnRails: ()
[10:46:44] EasyRider0: But then constraint is also used in unique indices, and does indeed inflect a constraint on the data inside the table
[10:46:49] Cervajz_: has joined #RubyOnRails
[10:47:31] allcentury: has joined #RubyOnRails
[10:50:24] norc: workmad3: Ah. Okay well then. :)
[10:52:18] EasyRider0: bobbobbins: Could you show some code through a gist or pastie.org ?
[10:52:31] bobbobbins: EasyRider0: yeah, one sec
[10:54:12] bobbobbins: EasyRider0: https://gist.github.com/anonymous/0c6f82c1c4711ef9e348
[10:54:24] bobbobbins: the open and completed scopes are what I'm talking about
[10:54:31] Ergo: has joined #RubyOnRails
[10:54:50] bobbobbins: lines 21 and 22
[10:55:40] ruurd: has joined #RubyOnRails
[10:55:41] EasyRider0: def self.current_status
[10:56:04] trautwein: has joined #RubyOnRails
[10:57:13] bobbobbins: EasyRider0: but it usually applies to the current project
[10:57:24] bobbobbins: then I couldn't do @project.current_status, right?
[10:57:38] pwnd_nsfw: Why would you want to?
[10:57:56] pwnd_nsfw: I'm not even sure that code will work with that modification? Do scopes really work like that?
[10:57:58] bobbobbins: pwnd_nsfw: if I want the current status of the project I'm in
[10:58:21] Detch: has joined #RubyOnRails
[10:58:23] pwnd_nsfw: then @project.current_status
[10:58:31] bobbobbins: basically the most recent status update of a project is its current status, so I want to pull all projects who's most recent status isn't 5
[10:59:48] pwnd_nsfw: projects.where.not(status_id: 5)
[11:00:10] bobbobbins: pwnd_nsfw: yeah, but it needs to only check the first status record
[11:00:21] bobbobbins: which is why the function has that .first in there
[11:00:31] pwnd_nsfw: I'm doing it for the wrong relation anyways
[11:00:52] nemo__: has joined #RubyOnRails
[11:02:38] lipoqil: has joined #RubyOnRails
[11:02:39] EasyRider0: bobbobbins: In think you should handle this in the controller imho
[11:03:08] pwnd_nsfw: Or at least a different object
[11:03:11] arBmind: has joined #RubyOnRails
[11:03:26] bobbobbins: EasyRider0: ok, that I can do...doing it this way hurts my brain
[11:04:13] spkprav_: has joined #RubyOnRails
[11:04:24] chills42: has joined #RubyOnRails
[11:04:29] EasyRider0: bobbobbins: this might answer your question and avoid code duplication in controllers: http://stackoverflow.com/questions/4859099/using-scope-on-an-association
[11:04:53] EasyRider0: I think it's what you want
[11:05:27] bobbobbins: yeah, I actually looked at that, but I don't see how to incorporate checking just the first result of the association instead of the entire thing
[11:05:36] EasyRider0: you need to do the includes i think because without it project_statuses are not available yet on initialization of the instance
[11:05:50] dhjondoh1: has joined #RubyOnRails
[11:06:14] bobbobbins: hmm, lemmie try that
[11:06:29] EasyRider0: are these scopes for inserting records?
[11:06:39] EasyRider0: or are you using them for selects?
[11:06:48] bobbobbins: just selects
[11:08:26] mordocai: has joined #RubyOnRails
[11:10:21] tuelz: has joined #RubyOnRails
[11:11:39] pawnbox: has joined #RubyOnRails
[11:12:04] jsrn_: has joined #RubyOnRails
[11:13:48] EasyRider0: bobbobins: I thinnk you can accomplish this by defining two has_many definitions for project_statuses
[11:14:08] bobbobbins: EasyRider0: hmm...that might work
[11:14:17] EasyRider0: has_many :project_statuses_first, :class_name => 'ProjectStatus', :limit => 1
[11:14:20] bobbobbins: i just did it in the controller though and it seems to be working, so i think I might just leave it
[11:14:54] annlewis: has joined #RubyOnRails
[11:14:55] EasyRider0: then you can reference :project_statuses_first in your includes( )
[11:15:30] pawnbox: has joined #RubyOnRails
[11:15:57] vigintas: has joined #RubyOnRails
[11:16:12] yogeshrt: has joined #RubyOnRails
[11:16:14] EasyRider0: But yes, I'd only see the point if you want to use your scope in multiple controllers
[11:17:14] EasyRider0: I'm no rails expert by far either, so don't take my word for it :)
[11:17:15] bobbobbins: I'll wait until that actually happens, right now I don't have to so I'm going to leave it in the controller
[11:17:17] MartinElvar: has joined #RubyOnRails
[11:18:52] sunya7a: has joined #RubyOnRails
[11:20:02] MartinElvar: has joined #RubyOnRails
[11:24:13] Gustavo: has joined #RubyOnRails
[11:26:38] rvanlieshout: has joined #RubyOnRails
[11:27:09] w0rd-driven: has joined #RubyOnRails
[11:27:34] broman: has joined #RubyOnRails
[11:27:39] broman: can someone please help me??
[11:27:54] GriffinHeart: has joined #RubyOnRails
[11:28:21] broman: can someone please help me?? /usr/local/rvm/gems/ruby-2.0.0-p643/gems/bundler-1.10.6/lib/bundler/runtime.rb:34:in `block in setup': You have already activated rack 1.6.0, but your Gemfile requires rack 1.4.7. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)
[11:28:55] workmad3: broman: did you try following the advice the error gives?
[11:29:16] workmad3: broman: so what command did you run?
[11:29:22] broman: i did bundle exec unicorn_rails -c config/unicorn -D
[11:30:29] nurbson: borman: post your Gemfile to gist
[11:31:27] voker57: has joined #RubyOnRails
[11:31:59] broman: nurbson, https://gist.github.com/anonymous/f748b03af7cba4c15572
[11:33:27] jacksparrow007: has left #RubyOnRails: ()
[11:34:49] yogeshrt: has joined #RubyOnRails
[11:34:53] broman: rvm use ruby-2.0.0@rack-1.4.5 --default
[11:34:53] broman: Gemset 'rack-1.4.5' does not exist, 'rvm ruby-2.0.0-p643 do rvm gemset create rack-1.4.5' first, or append '--create'.
[11:35:07] broman: but my gem list shows rack (1.6.0, 1.4.7, 1.4.5)
[11:36:59] xIzIv: has joined #RubyOnRails
[11:37:40] xIzIv: has left #RubyOnRails: ()
[11:38:03] jgt: has joined #RubyOnRails
[11:38:17] nurbson: which rack folders do you have in ~/.rvm/gems/ruby-2.0.0@rack-1.4.5/gems/ ?
[11:38:49] Pazician: has joined #RubyOnRails
[11:38:57] Guest11190: has left #RubyOnRails: ()
[11:39:41] xIzIv: has joined #RubyOnRails
[11:39:48] xIzIv: hello here
[11:39:53] wpp: has joined #RubyOnRails
[11:40:20] RandyT_: has joined #RubyOnRails
[11:40:35] broman: nurbson, i dont have a ruby2..@rack folder.. i have ruby2/gems... and i have rack 1.4.5, 1.4.7 and 1.6.0
[11:41:12] RandyT-: has joined #RubyOnRails
[11:41:15] xIzIv: can I get some help for rails-admin?
[11:41:56] broman: rvm use ruby-2.0.0@rack-1.4.5 --default
[11:41:57] broman: Gemset 'rack-1.4.5' does not exist, 'rvm ruby-2.0.0-p643 do rvm gemset create rack-1.4.5' first, or append '--create'.
[11:41:58] quazimodo: has joined #RubyOnRails
[11:41:59] nurbson: broman: to me it looks like you installed your gems for a different ruby version than you are using inside your rails app. what does rvm list say?
[11:42:32] broman: there's only one version of ruby... 2.0.0.0-p643
[11:42:59] nurbson: and ruby -v ?
[11:43:19] RandyT|: has joined #RubyOnRails
[11:43:26] xIzIv: guys, rails-admin rules works for me just when I open page first time, then rules doesn't works, why it happens?
[11:43:33] broman: same thing
[11:43:37] wpp: Hi, I'm trying to run delayed_job under supervisord, since programs meant to be run under supervisor should not daemonize themselves I've switched from delayed_job start to delayed_job run
[11:43:55] wpp: the problem however is that I cannot start multiple runners (there is already one or more instance(s) of the program running)
[11:44:02] vigintas: has joined #RubyOnRails
[11:44:05] xIzIv: but if I define rules as initializer all works fine
[11:44:10] RandyT: has joined #RubyOnRails
[11:44:52] RandyT^: has joined #RubyOnRails
[11:45:48] RandyT_: has joined #RubyOnRails
[11:46:23] RandyT-: has joined #RubyOnRails
[11:46:29] nurbson: broman: try uninstalling all rack versions and install only 1.4.5
[11:47:07] RandyTa: has joined #RubyOnRails
[11:48:16] Pumukel: has joined #RubyOnRails
[11:48:18] broman: nurbson, i will try to do this
[11:49:52] RandyT|: has joined #RubyOnRails
[11:50:42] RandyT: has joined #RubyOnRails
[11:50:46] darrencauthon: has joined #RubyOnRails
[11:51:01] broman: nurbson, :D yay!! \o/
[11:51:08] Icey: has joined #RubyOnRails
[11:51:33] nurbson: broman: you can add a specific version of rack to your Gemfile
[11:51:51] RandyT_: has joined #RubyOnRails
[11:52:22] atomical: has joined #RubyOnRails
[11:52:31] travis_: has joined #RubyOnRails
[11:52:44] travis_: has left #RubyOnRails: ()
[11:52:55] Axilla: has joined #RubyOnRails
[11:52:58] RandyT-: has joined #RubyOnRails
[11:52:59] Axilla: anyone have any suggestions on minifying HTML in rails 4?
[11:54:20] RandyT^: has joined #RubyOnRails
[11:54:54] RandyTa: has joined #RubyOnRails
[11:55:23] RandyT: has joined #RubyOnRails
[11:56:00] RandyT|: has joined #RubyOnRails
[11:57:09] RandyT_: has joined #RubyOnRails
[11:57:12] [BNC]WizJin: has joined #RubyOnRails
[11:58:02] jbrinkmusic: does anyone know if it's possible to populate a table in the database from JSON objects?
[11:58:08] dhjondoh: has joined #RubyOnRails
[11:58:17] RandyT-: has joined #RubyOnRails
[11:58:20] rvanlieshout: jbrinkmusic: anything is possible
[11:58:28] zpe: has joined #RubyOnRails
[11:58:46] dhjondoh: has joined #RubyOnRails
[11:58:58] RandyTb: has joined #RubyOnRails
[11:59:09] jbrinkmusic: eg. I have a JSON file that has projects as objects and I want to create a "Project" model that takes its members from the JSON file...
[11:59:40] EasyRider0: jbrinkmusic: if you created all the fields, ofcourse. Project.new.from_json( json)
[11:59:50] RandyT^: has joined #RubyOnRails
[12:00:12] jbrinkmusic: and since the JSON file updates often I need to be able to check if an item already exists in the table so I don't get duplicates
[12:00:20] RandyT: has joined #RubyOnRails
[12:00:43] jhass: jbrinkmusic: what are you stuck with specifically?
[12:01:20] EasyRider0: JSON.parse to iterate over your Json array
[12:01:26] jbrinkmusic: jhass: I'm currently just trying to figure out if this is possible and if so, what is the best way to do it
[12:01:56] [BNC]WizJin: has left #RubyOnRails: ()
[12:02:01] RandyT_: has joined #RubyOnRails
[12:02:05] jhass: who or what updates the JSON file? what does often mean?
[12:02:22] EasyRider0: Json.parse(json).each do |item|
[12:02:52] RandyT|: has joined #RubyOnRails
[12:02:53] jbrinkmusic: jhass: the JSON file is downloaded at preconfigured intervals from an external server
[12:03:16] EasyRider0: this will iterate over your json, and convert the item to a ruby hash
[12:03:30] RandyT-: has joined #RubyOnRails
[12:03:30] EasyRider0: then just do Project.new(item)
[12:03:33] stamina: has joined #RubyOnRails
[12:03:45] EasyRider0: you will need to add unique validations to your project model to handle uniqueness
[12:03:48] jhass: jbrinkmusic: well I guess just make a rake task that depends on the :environment task and call it via cron or something
[12:04:07] gasbakid__: has joined #RubyOnRails
[12:04:17] jbrinkmusic: EasyRider0: I'm actually using Json.parse already to display the contents, the saving to database is what I hadn't figured out yet
[12:04:52] EasyRider0: just Project.new(item) should work? if fields in json and your table match
[12:04:53] jhass: jbrinkmusic: http://guides.rubyonrails.org/active_record_basics.html then
[12:05:26] jhass: and if not simply map them, easy
[12:05:33] RandyT: has joined #RubyOnRails
[12:06:04] EasyRider0: http://guides.rubyonrails.org/active_record_validations.html
[12:06:10] jbrinkmusic: EasyRider0: yeah, that should be easy since I haven't created the model yet, I can make the fields exactly what I need
[12:06:15] RandyT^: has joined #RubyOnRails
[12:07:16] diegobiavati: has joined #RubyOnRails
[12:08:14] MartinElvar: has joined #RubyOnRails
[12:08:21] RandyT_: has joined #RubyOnRails
[12:08:59] RandyT-: has joined #RubyOnRails
[12:09:38] RandyT|: has joined #RubyOnRails
[12:09:41] EasyRider0: The docs should be self explainatory
[12:10:07] oflannabhra: has joined #RubyOnRails
[12:10:31] RandyT: has joined #RubyOnRails
[12:11:07] RandyTa: has joined #RubyOnRails
[12:11:41] RandyT^: has joined #RubyOnRails
[12:12:58] jbrinkmusic: EasyRider0: jhass: thanks for your help guys
[12:13:06] nemo_: has joined #RubyOnRails
[12:13:35] darkhex: has joined #RubyOnRails
[12:13:46] RandyT_: has joined #RubyOnRails
[12:14:30] jenrzzz: has joined #RubyOnRails
[12:15:41] annlewis: has joined #RubyOnRails
[12:15:48] dnewkerk: has joined #RubyOnRails
[12:15:53] sunya7a: has joined #RubyOnRails
[12:16:50] RandyT: has joined #RubyOnRails
[12:18:34] annlewis_: has joined #RubyOnRails
[12:18:55] RandyT_: has joined #RubyOnRails
[12:19:29] RandyT-: has joined #RubyOnRails
[12:19:50] wethu: has joined #RubyOnRails
[12:21:04] RandyT|: has joined #RubyOnRails
[12:22:41] RandyT: has joined #RubyOnRails
[12:23:19] RandyT^: has joined #RubyOnRails
[12:24:15] RandyT_: has joined #RubyOnRails
[12:24:19] Ropeney: has joined #RubyOnRails
[12:24:47] RandyT-: has joined #RubyOnRails
[12:25:29] bonhoeffer: has joined #RubyOnRails
[12:25:29] silverdust: How long have rails been using bcrypt? Has it been since Rails 1
[12:26:07] tuelz: has joined #RubyOnRails
[12:26:23] chrislotix: has joined #RubyOnRails
[12:28:04] RandyT: has joined #RubyOnRails
[12:29:12] RandyT_: has joined #RubyOnRails
[12:29:26] Gustavo: has joined #RubyOnRails
[12:31:49] zpe: has joined #RubyOnRails
[12:32:13] RandyT-: has joined #RubyOnRails
[12:33:04] RandyT: has joined #RubyOnRails
[12:33:25] wethu: has joined #RubyOnRails
[12:33:33] wethu: has joined #RubyOnRails
[12:34:48] RandyT_: has joined #RubyOnRails
[12:35:22] RandyT|: has joined #RubyOnRails
[12:36:32] RandyT^: has joined #RubyOnRails
[12:37:06] RandyTa: has joined #RubyOnRails
[12:37:41] spkprav: has joined #RubyOnRails
[12:38:41] danoph: has joined #RubyOnRails
[12:39:27] GriffinHeart: has joined #RubyOnRails
[12:39:55] danoph: has joined #RubyOnRails
[12:40:20] RandyT: has joined #RubyOnRails
[12:41:07] danoph: havent been here in a while...was just checkin to see if i could talk :)
[12:41:10] n008f4g_: has joined #RubyOnRails
[12:42:25] RandyT_: has joined #RubyOnRails
[12:43:28] RandyT-: has joined #RubyOnRails
[12:44:02] RandyT|: has joined #RubyOnRails
[12:44:47] toy_: has joined #RubyOnRails
[12:45:12] jkamenik: has joined #RubyOnRails
[12:45:24] joshkovach: has joined #RubyOnRails
[12:47:24] RandyT: has joined #RubyOnRails
[12:48:29] big|bad|wolf: has joined #RubyOnRails
[12:49:00] RandyT_: has joined #RubyOnRails
[12:49:38] RandyT-: has joined #RubyOnRails
[12:50:09] RandyT|: has joined #RubyOnRails
[12:50:19] krz: has joined #RubyOnRails
[12:50:47] RandyT^: has joined #RubyOnRails
[12:51:22] RandyTa: has joined #RubyOnRails
[12:51:59] RandyTb: has joined #RubyOnRails
[12:52:17] demonlove: has joined #RubyOnRails
[12:52:27] RandyT: has joined #RubyOnRails
[12:53:15] ddv: so I have a habtm for example: user has many companies, company has many users. I'm using has_many, through for this (membership). Now I want a list of user ids of each company the currently logged in user is a member of. What is the preferred way to do this? Maybe this? User.joins(:companies).where(companies: {id: User.last.companies.pluck(:id)})
[12:53:19] demonlove: can anyone just expliain me whats the difference between twitter bootstrap making websilte and template website making in rails?
[12:53:35] RandyTc: has joined #RubyOnRails
[12:53:55] treehug88: has joined #RubyOnRails
[12:53:57] rvanlieshout: demonlove: wut?
[12:54:02] RandyT_: has joined #RubyOnRails
[12:54:22] spkprav_: has joined #RubyOnRails
[12:54:35] yogeshrt: has joined #RubyOnRails
[12:54:50] rvanlieshout: ddv: User.joins(companies: :users).where(<lookup_name_of_second_user_join_table): User.last.id)
[12:54:51] symbol: has joined #RubyOnRails
[12:54:53] demonlove: m learning ror with little knowledge of ruby for making website is it ok?
[12:55:05] RandyT-: has joined #RubyOnRails
[12:55:09] rvanlieshout: demonlove: that depends on your defenition of a 'website'
[12:55:15] rvanlieshout: i wouldn't use it for a plain static site
[12:55:43] danoph: demonlove railscasts.com is a good resource
[12:55:47] demonlove: twitter bootstrap seems diffrent from template website making..
[12:55:48] toy: has joined #RubyOnRails
[12:56:11] demonlove: they are too fast anyway m goona get it
[12:56:12] rvanlieshout: twitter bootstrap is 'just' a html / css / js framework you can use for a responsive site
[12:56:36] demonlove: ya that can be made in 15 min isn't?
[12:56:53] rvanlieshout: <html><body>Hello world!</body></html>
[12:56:56] NBarnes: has joined #RubyOnRails
[12:56:59] rvanlieshout: tadaa.. even way < 15 minutes
[12:57:31] demonlove: what does basically reposive means is it adjustting in all size of screen
[12:57:44] Gustavo: has joined #RubyOnRails
[12:57:44] n1lo: has joined #RubyOnRails
[12:57:44] rvanlieshout: maybe you need to read about a lot of things before you just dive in
[12:57:53] RandyT: has joined #RubyOnRails
[12:58:15] demonlove: machel harti
[12:58:17] toy: has joined #RubyOnRails
[12:58:45] RandyT_: has joined #RubyOnRails
[12:58:53] demonlove: how much time do it take for making e commerce website
[12:59:04] sunya7a: has joined #RubyOnRails
[12:59:18] RandyT|: has joined #RubyOnRails
[12:59:36] demonlove: i seen from twittre bootstrap one can only make one page portfolio type website
[12:59:49] RandyT-: has joined #RubyOnRails
[12:59:51] demonlove: rvanlieshout:?
[13:00:22] Pazician: has joined #RubyOnRails
[13:00:23] RandyT^: has joined #RubyOnRails
[13:01:04] pwnd_nsfw: demonlove, not long. Would take learning how to use the API for whatever payment gateway you choose, if you go that route
[13:02:00] RandyTa: has joined #RubyOnRails
[13:02:04] allcentury: has joined #RubyOnRails
[13:03:03] RandyT: has joined #RubyOnRails
[13:03:09] herbst: or use the shopify gem which name i just cant remember
[13:03:13] demonlove: pwnd_nsfw: means it cant be like bootstrap..
[13:03:57] pwnd_nsfw: demonlove, what do you mean?
[13:04:02] RandyT_: has joined #RubyOnRails
[13:04:22] pwnd_nsfw: Bootstrap isn't limited to only making one page websites..
[13:04:32] pwnd_nsfw: Bootstrap is as limited as your knowledge, really.
[13:04:39] RandyT-: has joined #RubyOnRails
[13:05:03] demonlove: ohoo ineeded to dive in more..
[13:05:18] spkprav: has joined #RubyOnRails
[13:05:53] pwnd_nsfw: I mean, I'm assuming Twitter itself isn't a one page site..
[13:05:58] RandyT|: has joined #RubyOnRails
[13:06:10] demonlove: but in railcast its one page i think
[13:06:19] danoph: demonlove bootstrap is a CSS framework for creating responsive sites. all you get out of the box is responsive styling, if you use it correctly
[13:06:33] RandyT^: has joined #RubyOnRails
[13:06:34] danoph: it doesnt build any HTML for you, you have to do that yourself
[13:06:53] demonlove: now i got it
[13:07:04] RandyTa: has joined #RubyOnRails
[13:07:14] big|bad|wolf: has joined #RubyOnRails
[13:07:17] danoph: you can build an ecommerce site pretty quickly using the stripe gem
[13:07:28] danoph: you can use bootstrap for styling
[13:07:35] danoph: or foundation
[13:07:45] ramortegui: has joined #RubyOnRails
[13:08:26] RandyT_: has joined #RubyOnRails
[13:10:13] big|bad|wolf: has joined #RubyOnRails
[13:10:33] RandyT: has joined #RubyOnRails
[13:10:41] jminch: has joined #RubyOnRails
[13:10:45] danman: has joined #RubyOnRails
[13:12:22] RandyT-: has joined #RubyOnRails
[13:13:19] sdwrage: has joined #RubyOnRails
[13:13:42] sadaf2605: has joined #RubyOnRails
[13:14:16] wpp: has joined #RubyOnRails
[13:14:36] RandyT_: has joined #RubyOnRails
[13:15:10] FailBit: smoke weed everyday
[13:16:31] ddv: rvanlieshout: something like this: User.joins(companies: :users).where(users: {id: current_user.id})?
[13:17:20] O47m341: has joined #RubyOnRails
[13:18:13] TPBallbag: has joined #RubyOnRails
[13:19:05] sankaber: has joined #RubyOnRails
[13:20:01] nemo_: has joined #RubyOnRails
[13:20:36] krz: has joined #RubyOnRails
[13:20:39] tuelz: has joined #RubyOnRails
[13:20:41] bmalum: has joined #RubyOnRails
[13:21:18] Pazician: has joined #RubyOnRails
[13:21:32] roshanavand: has joined #RubyOnRails
[13:23:56] rvanlieshout: cause your users would refer to the initial User
[13:24:01] rvanlieshout: not to the joined companys: :users
[13:24:09] rvanlieshout: perform a User.joins(companies: :user).to_sql
[13:24:13] rvanlieshout: and see how rails calles that secoond join
[13:24:25] oflannabhra: has joined #RubyOnRails
[13:24:25] ddv: rvanlieshout: yeah Ok
[13:24:32] rvanlieshout: comapnies_users maybe
[13:24:34] rvanlieshout: but it'll show you
[13:24:56] treehug88: has joined #RubyOnRails
[13:25:52] O47m341: has joined #RubyOnRails
[13:26:24] eoy: has joined #RubyOnRails
[13:26:51] rubyonrails612: has joined #RubyOnRails
[13:27:09] moei: has joined #RubyOnRails
[13:27:32] gizmac: has joined #RubyOnRails
[13:27:36] mrbubbles: has joined #RubyOnRails
[13:28:31] zpe: has joined #RubyOnRails
[13:28:58] sankaber: has joined #RubyOnRails
[13:29:53] devdazed: has joined #RubyOnRails
[13:30:55] chrislotix: Meta question: Are ruby code review questions welcome here or shall i stick to stack exchange?
[13:31:31] big|bad|wolf: has joined #RubyOnRails
[13:31:58] Linuus: has joined #RubyOnRails
[13:32:38] teclator: has joined #RubyOnRails
[13:33:03] ddv: chrislotix: #ruby
[13:33:30] TheMoonMaster: has joined #RubyOnRails
[13:33:54] chrislotix: ddv: fair enough, silly me.
[13:34:26] roshanavand: has joined #RubyOnRails
[13:34:46] rvanlieshout: chrislotix: welcome here
[13:35:04] GlebMas: has joined #RubyOnRails
[13:37:13] netzfisch: has joined #RubyOnRails
[13:38:08] hmsimha: has joined #RubyOnRails
[13:38:34] darrencauthon: has joined #RubyOnRails
[13:39:29] Ergo: has joined #RubyOnRails
[13:39:43] greengriminal: has joined #RubyOnRails
[13:40:15] jgt: has joined #RubyOnRails
[13:41:40] marr: has joined #RubyOnRails
[13:41:50] danielbucher: has joined #RubyOnRails
[13:45:53] jenrzzz: has joined #RubyOnRails
[13:46:23] Doddlin: has joined #RubyOnRails
[13:47:50] big|bad|wolf: has joined #RubyOnRails
[13:50:12] oflannabhra: has joined #RubyOnRails
[13:50:22] jamey-uk: has joined #RubyOnRails
[13:50:30] jamey-uk: I'm trying to use Elasticsearch with Ruby on Rails but I'm stuck because I get the error "case_studies does not exist to be imported into. Use create_index! or the :force option to create it." Does anyone know what I'm doing wrong?
[13:50:52] darrencauthon: has joined #RubyOnRails
[13:51:09] Rodya_: has joined #RubyOnRails
[13:53:45] sevenseacat: without seeing any code? no.
[13:54:37] ericjphillips: has joined #RubyOnRails
[13:54:38] BaNzounet: Hello, I've an ordered list of IDs, than I do Model.where(id: IDs), how would you do to order the results as the list was in the first place?
[13:56:00] zpe: has joined #RubyOnRails
[13:57:06] FailBit: <rvanlieshout> because
[13:57:07] jamey-uk: sevenseacat: well I'm basically trying to replicate the steps when you run the "rails new" command on this page where it says "You can generate a simple Ruby on Rails application???": https://github.com/elastic/elasticsearch-rails/
[13:57:08] FailBit: because weed
[13:57:42] rvanlieshout: you're not dutch are you? :)
[13:57:46] mostlybadfly: 7:15 AM <mostlybadfly> Has anyone used the unobtrusive flash gem ? I'm currently trying to give the container holding the flash message a specific styling but only for one page/controller
[13:57:53] amortimer: I have a question about testing this instance method. It gets called by an #after_save callback. I want to assert that the two class methods (ActiveJobs) internal to the #integrate_with_services method are being called and instantiating ActiveJobs. https://gist.github.com/412andrewmortimer/7454810e8d6d8d9e03c8
[13:58:02] mostlybadfly: This is probably more JS but rails related! Anyway here is the js.erb calling the flash message https://github.com/tomekr/giggle_water/blob/ajax-add-ingredient-button/app/views/ingredients/add_or_remove.js.erb
[13:59:02] sevenseacat: jamey-uk: and what are you doing to get that error?
[13:59:06] bratsche: has joined #RubyOnRails
[13:59:16] dici: has joined #RubyOnRails
[13:59:52] rvanlieshout: ok.. enough for today
[14:00:28] dionysus69: has joined #RubyOnRails
[14:00:28] rubyonrailed: has joined #RubyOnRails
[14:00:52] sevenseacat: jamey-uk: I ran that command without error, so
[14:01:03] dionysus69: has joined #RubyOnRails
[14:01:15] FailBit: rvanlieshout: I'm murrican
[14:01:35] rvanlieshout: yeah. then weed is a thing i guess
[14:03:06] tuelz: has joined #RubyOnRails
[14:04:08] maxx88: has joined #RubyOnRails
[14:06:33] greengriminal: has joined #RubyOnRails
[14:07:52] shmilan: has joined #RubyOnRails
[14:09:47] roshanav_: has joined #RubyOnRails
[14:10:38] demonlove: has joined #RubyOnRails
[14:11:29] bjaX: has joined #RubyOnRails
[14:11:30] alienaut: BaNzounet: Did you ask how to order with active record? For example: ModelName.where(id: [1, 2, 3]).order("id DESC"), see: http://guides.rubyonrails.org/active_record_querying.html#ordering
[14:12:37] jocuman: has joined #RubyOnRails
[14:13:48] umgrosscol: has joined #RubyOnRails
[14:14:30] doublemalt__: has joined #RubyOnRails
[14:14:33] mary5030: has joined #RubyOnRails
[14:14:45] sevenseacat: ACTION gives up waiting for a response from jamey-uk 
[14:14:49] oflannabhra: has joined #RubyOnRails
[14:15:26] mary5030: has joined #RubyOnRails
[14:15:31] jamey-uk: has left #RubyOnRails: ()
[14:17:10] mary5030: has joined #RubyOnRails
[14:17:22] Fire-Dragon-DoL: has joined #RubyOnRails
[14:17:25] tvon: has joined #RubyOnRails
[14:18:38] chouhoulis: has joined #RubyOnRails
[14:21:04] Gustavo: has joined #RubyOnRails
[14:21:51] chills42: has joined #RubyOnRails
[14:22:10] big|bad|wolf: has joined #RubyOnRails
[14:22:28] silverdust: How long has rails been using bcrypt? Has it been since Rails 1?
[14:23:06] kies^: has joined #RubyOnRails
[14:23:14] silverdust: Anyone with experience from Rails1 please. I just have to talk about it in a write-up
[14:23:46] sevenseacat: silverdust: look it up
[14:24:38] chouhoulis: has joined #RubyOnRails
[14:25:34] danoph: silverdust i think since rails 3
[14:25:52] IrishGringo: has joined #RubyOnRails
[14:26:07] The_Phoenix: has joined #RubyOnRails
[14:26:13] sunya7a: has joined #RubyOnRails
[14:26:20] rickmasta: has joined #RubyOnRails
[14:27:11] The_Phoenix: has joined #RubyOnRails
[14:27:40] null__: has joined #RubyOnRails
[14:27:40] null__: has joined #RubyOnRails
[14:27:49] silverdust: okay. Still searching though. Thought I'd get a quicker answer here
[14:28:59] tenderlove: has joined #RubyOnRails
[14:29:02] The_Phoenix: has joined #RubyOnRails
[14:30:17] dopamean_: has joined #RubyOnRails
[14:30:26] The_Phoenix: has joined #RubyOnRails
[14:30:47] blackmesa: has joined #RubyOnRails
[14:31:40] SamGerber: has joined #RubyOnRails
[14:31:46] Sam_Gerber: has joined #RubyOnRails
[14:32:18] danoph: silverdust from my memory, they recommended you start using it when they came out with has_secure_password. I'm pretty sure you still had to explicitly require bcrypt in your gemfile though
[14:32:30] k1t: has joined #RubyOnRails
[14:34:49] rodfersou: has joined #RubyOnRails
[14:35:10] null__: has joined #RubyOnRails
[14:35:10] null__: has joined #RubyOnRails
[14:39:24] havenwood: silverdust: Dec 2010: https://github.com/rails/rails/commit/39b5ea6e01f6fc652cc63ab4e7e701cfaa9f9405
[14:39:49] havenwood: silverdust: Oops, wrong link. Here: https://github.com/rails/rails/commit/39b5ea6e01f6fc652cc63ab4e7e701cfaa9f9405
[14:40:24] tenderlove: has joined #RubyOnRails
[14:40:29] havenwood: silverdust: Moved to the Gemfile here: https://github.com/rails/rails/commit/67790644372ad3a771810f1d6d99687d795789ea
[14:40:34] GriffinHeart: has joined #RubyOnRails
[14:41:47] null__: has joined #RubyOnRails
[14:41:47] null__: has joined #RubyOnRails
[14:42:08] havenwood: "dead-simple password usage with SHA2 encryption" ;)
[14:43:18] The_Phoenix: has joined #RubyOnRails
[14:43:18] treehug88: has joined #RubyOnRails
[14:45:44] relix: has joined #RubyOnRails
[14:46:06] chouhoulis: has joined #RubyOnRails
[14:49:39] null__: has joined #RubyOnRails
[14:49:40] null__: has joined #RubyOnRails
[14:49:48] The_Phoenix: has joined #RubyOnRails
[14:51:00] oflannabhra: has joined #RubyOnRails
[14:51:05] The_Phoenix: has joined #RubyOnRails
[14:52:12] ruurd: has joined #RubyOnRails
[14:52:28] sunya7a: has joined #RubyOnRails
[14:52:52] acti0nman: has joined #RubyOnRails
[14:53:03] herbst: why the fuck does `visit search_index_path( format: :json, q: "start" )` drop the ?q=start part? (at least there is no params[:q] in my controller ... -.-
[14:53:41] pwnd_nsfw: has joined #RubyOnRails
[14:54:24] IFrank00: has joined #RubyOnRails
[14:54:34] tuelz: has joined #RubyOnRails
[14:55:05] thither: has joined #RubyOnRails
[14:55:57] herbst: any ideas? i am trying to write this 3 line test since like 2 hours
[14:57:04] gremly: has joined #RubyOnRails
[14:58:04] chopin: has joined #RubyOnRails
[14:58:32] tenderlove: has joined #RubyOnRails
[14:58:35] nhhagen: has joined #RubyOnRails
[14:59:06] tuelz: herbst: can we see some of your code? I would expect that to work
[14:59:41] pwnd_nfsw: has joined #RubyOnRails
[15:00:11] ericjphillips: has joined #RubyOnRails
[15:00:15] herbst: tuelz: sure. essentially this: https://gist.github.com/b1nary/2ffe3348e3899ab34e3e
[15:00:29] jkamenik1: has joined #RubyOnRails
[15:01:09] dionysus69: has joined #RubyOnRails
[15:01:30] tuelz: and what's your error?
[15:01:47] herbst: there is no q in the controller when called over the test
[15:01:54] herbst: it works perfectly fine in the browser tho
[15:02:10] gremly: Hi folks, I'm trying to test a controller using rspec in RoR 3.2.19. There is a Thread that has a variable which determine some behaviours. Within the test i try to set manually that var using `Thread.current["MyVariable"] = MyClas::Base.new`, but when the controller is called `Thread.current["MyVariable"] value is different to MyClas::Base.new. May anybody help me please?
[15:02:18] tuelz: are you 100% you're hitting the action you think you're hitting?
[15:02:34] herbst: absolutely. there are just like 3 others in the whole project
[15:02:44] tuelz: search_index_path isn't what I would expect that path to be
[15:02:51] tuelz: I would expect search_path
[15:03:05] tuelz: what does `bundle exec rake routes` tell you?
[15:03:29] herbst: wondered about that name as well, yeah: search_index GET /search(.:format) search#index
[15:03:34] podman: has joined #RubyOnRails
[15:04:44] herbst: i assumed the name comes from my route: resources :search, only: [:index]
[15:05:16] NBarnes: has joined #RubyOnRails
[15:05:32] vigintas: has joined #RubyOnRails
[15:05:36] tuelz: based on what you've told me I would expect it to work. So at this point I'll either need real code or I'm just as stumped as you ;P
[15:05:54] jgpawletko: has joined #RubyOnRails
[15:06:00] tuelz: real code and a real error
[15:06:45] herbst: there is no error. it is just empty. here i added all the other code of the 2 files: https://gist.github.com/b1nary/2ffe3348e3899ab34e3e
[15:06:53] tuelz: oh yeah, right, sorry
[15:07:41] silverdust: danoph, havenwood thanks. I've been searching to no avail
[15:07:45] tuelz: you broke gist!!
[15:07:45] ischwartz: has joined #RubyOnRails
[15:07:49] tuelz: nvm it's up
[15:10:08] null__: has joined #RubyOnRails
[15:10:08] null__: has joined #RubyOnRails
[15:10:20] shmilan: has joined #RubyOnRails
[15:10:43] danoph: silverdust no prob
[15:12:25] lindii_: has joined #RubyOnRails
[15:12:45] youngbaks: has joined #RubyOnRails
[15:12:58] draken: has joined #RubyOnRails
[15:14:25] Coldblackice: has joined #RubyOnRails
[15:14:32] tuelz: herbst: can you confirm search_params actually contains anything when you're inside your controller#action?
[15:14:46] teclator: has joined #RubyOnRails
[15:15:04] tuelz: I suspect that code is wrong, but I don't do rails enough to remember the right syntax offhand so I'm playing with it
[15:15:14] axl_: has joined #RubyOnRails
[15:15:19] herbst: a co worker just rescued me, it was something really random and stupuid
[15:15:24] herbst: but thanks a lot for looking into it
[15:15:44] tuelz: no prob, have a good one
[15:15:51] herbst: in short: it redirect to the CAS login, and redirected me back without parameters because he use path instead of full_path ... -.-
[15:16:03] tenderlove: has joined #RubyOnRails
[15:16:21] tuelz: hah, happens to the best of us
[15:17:14] disgrntld: has joined #RubyOnRails
[15:17:17] roshanavand: has joined #RubyOnRails
[15:17:46] herbst: i really started to question my whole skills. i was so sure that it works this way, but it didnt xD
[15:18:21] tuelz: implicit code screws up the best developers, no worries
[15:18:37] tuelz: assuming your redirect was a before_action or something
[15:19:10] syath: has joined #RubyOnRails
[15:19:54] tuelz: guess a before_action isn't implicit, but it's certainly not right in front of you when you're playing with a controller action
[15:20:14] smathy: The logs should be though.
[15:21:25] chouhoul_: has joined #RubyOnRails
[15:21:52] tuelz: true, his problem was debugging - he assumed his route helper was wrong when he should've been confirming he was getting inside the action with the correct data while inside a testing env - confusion probbaly happened when he confirmed the data was there inside his dev env
[15:22:52] tuelz: s/he/#{gender_nuetral_pronouns}/g
[15:24:02] greengriminal: has joined #RubyOnRails
[15:24:57] MartinElvar: has joined #RubyOnRails
[15:25:14] nettoweb: has joined #RubyOnRails
[15:25:28] nemo_: has joined #RubyOnRails
[15:26:26] yogeshrt: has joined #RubyOnRails
[15:27:23] tenderlove: has joined #RubyOnRails
[15:29:08] The_Phoenix: has joined #RubyOnRails
[15:30:29] FCser: has joined #RubyOnRails
[15:31:48] atmosx: has joined #RubyOnRails
[15:33:08] roshanavand: has joined #RubyOnRails
[15:33:16] darrencauthon: has joined #RubyOnRails
[15:34:10] Cache_Money: has joined #RubyOnRails
[15:35:22] aldodelgado: has joined #RubyOnRails
[15:35:22] riotjones: has joined #RubyOnRails
[15:36:33] centrx: has joined #RubyOnRails
[15:36:34] riotjones: has joined #RubyOnRails
[15:37:13] herbst: has joined #RubyOnRails
[15:39:06] chouhoulis: has joined #RubyOnRails
[15:39:29] tubbo: is there a way to configure capybara so that `save_and_open_page` is called when a test fails?
[15:39:34] tubbo: just like, automatically
[15:39:35] aldodelgado: Question: I'm working on an app and really haven't used much mongodb before. However I created a before_save method on the user model and it looks like its firing the before_save method anytime the user moves around the web app. My question is 1) Does mongodb objects constantly save? 2) If it doesnt whats a good way to finding whats making the user model object keep saving?
[15:39:36] tubbo: (using poltergeist)
[15:41:01] smathy: Like a failure callback.
[15:41:17] cschneid_: has joined #RubyOnRails
[15:41:54] tenderlove: has joined #RubyOnRails
[15:42:16] tubbo: smathy: was that to me? if so, then yes
[15:42:23] htmldrum: has joined #RubyOnRails
[15:42:32] smathy: Yeah, I've never heard of that existing - but it *would* be cool.
[15:42:36] tubbo: right? :D
[15:42:48] tubbo: what would i have to fork to make that work lol
[15:43:10] smathy: It might just exist, like something those minitest guys added or something.
[15:43:19] smathy: It seems like it'd be so useful that someone would have added it.
[15:43:49] comm64x: has joined #RubyOnRails
[15:44:04] smathy: aldodelgado, sorry, I don't know mongo at all, although I doubt that it constantly saves. The best way to see what's calling your callback is to just raise an exception in it and then look through the stack trace.
[15:44:40] aldodelgado: smathy: thanks, I'll try that
[15:44:57] EminenceHC: has joined #RubyOnRails
[15:45:34] comm64x: Super frustration here...any particular reason WHY!! this <%= link_to "update", admin_update_core_index_path, %> isn't working?!?!?! The syntax is correct, the route exists and I'm still getting a syntax error unexpected ")" when it is not there
[15:46:00] adaedra: maybe the extra comma at the end?
[15:46:58] jenrzzz: has joined #RubyOnRails
[15:46:58] comm64x: adaedra: yep, that was it, man I need some sleep
[15:47:49] only6d65: has joined #RubyOnRails
[15:48:05] blackmesa: has joined #RubyOnRails
[15:48:08] centrx: could be the extra punctuation at the end!?!?!
[15:48:13] yogeshrt: has joined #RubyOnRails
[15:49:56] only6d65: has left #RubyOnRails: ()
[15:50:45] tubbo: centrx: its probably a rails bug thanks to the dasterdbly dhh!!!11
[15:52:32] bmalum: has joined #RubyOnRails
[15:52:46] chrislotix: how come it says " unexpected ")"" ?
[15:52:52] bruno-: has joined #RubyOnRails
[15:53:00] chrislotix: refering to comm64x question
[15:53:25] arup_r: has joined #RubyOnRails
[15:53:28] chrislotix: even though it's an extra comma
[15:53:28] tubbo: chrislotix: it probably is getting confused whether that comma is an argument of the outer link_to or the inner *_path route helper method
[15:53:32] matthewd: chrislotix: The erb compiler (effectively) translates the %> to a )
[15:53:59] tubbo: matthewd: that is not true, otherwise <%= link_to('update, 'href' %> would work.
[15:53:59] chrislotix: that makes sense
[15:54:04] tubbo: and it doesn't.
[15:54:12] woods: has joined #RubyOnRails
[15:54:15] matthewd: tubbo: Well, the <%= has a matching (
[15:54:34] tubbo: matthewd: yeah i guess you could think of it that way
[15:54:41] tubbo: it's like <%= %> is an expression
[15:54:52] tubbo: and of course link_to is also an expression, but is executed inside the ERb expression
[15:54:53] matthewd: `<%= x %>` --> `_erbout << (x)` or something, from memory
[15:56:37] ruurd: has joined #RubyOnRails
[15:57:09] safety_cut: has joined #RubyOnRails
[15:57:46] MrPunkin: has joined #RubyOnRails
[15:57:51] NBarnes: has joined #RubyOnRails
[15:58:11] matthias_: has joined #RubyOnRails
[15:58:17] bruno-: has joined #RubyOnRails
[15:59:00] atomical: has joined #RubyOnRails
[15:59:13] tenderlove: has joined #RubyOnRails
[16:01:16] jkamenik: has joined #RubyOnRails
[16:01:31] Motoservo: has joined #RubyOnRails
[16:03:29] The_Phoenix1: has joined #RubyOnRails
[16:03:39] bruno-: has joined #RubyOnRails
[16:03:56] AzaToth: has joined #RubyOnRails
[16:04:38] ferr: has joined #RubyOnRails
[16:05:10] shmilan: has joined #RubyOnRails
[16:05:33] Pupeno: has joined #RubyOnRails
[16:06:50] mrtomme: has joined #RubyOnRails
[16:06:57] wldcordeiro: has joined #RubyOnRails
[16:08:55] bruno-_: has joined #RubyOnRails
[16:10:09] towski_: has joined #RubyOnRails
[16:12:15] krzkrz: has joined #RubyOnRails
[16:14:16] ruurd: has joined #RubyOnRails
[16:15:06] cac: has joined #RubyOnRails
[16:15:49] tenderlove: has joined #RubyOnRails
[16:17:45] Shoutsid: has joined #RubyOnRails
[16:22:15] ruurd: has joined #RubyOnRails
[16:25:19] jkamenik: has joined #RubyOnRails
[16:26:39] EminenceHC: has joined #RubyOnRails
[16:27:35] tenderlove: has joined #RubyOnRails
[16:33:16] draken: whats the best way to send a value along with a form_for ? Like i want to add the 'owner' of the send request
[16:33:29] draken: right now im making a hidden textfield that is uneditable and putting the value there lol
[16:34:10] tbuehlmann: draken, sounds good to me for some situations
[16:35:19] arup_r: draken: If the owner is the currently logged in user always, then you can add it in the controller action in the server side also.
[16:35:34] arup_r: before saving/updating
[16:36:54] Contigi: has joined #RubyOnRails
[16:37:13] aRaym: has joined #RubyOnRails
[16:38:49] SteenJobs: has joined #RubyOnRails
[16:39:08] spastorino: has joined #RubyOnRails
[16:41:44] ChanServ: +o spastorino
[16:41:47] corioliss: has joined #RubyOnRails
[16:41:55] youngbaks: has joined #RubyOnRails
[16:42:21] pawnbox: has joined #RubyOnRails
[16:42:46] draken: arup_r kk thanks :)
[16:43:05] draken: also, im trying to use java/ajax to get a comment to refresh in without the page doing so
[16:43:15] Doddlin: has joined #RubyOnRails
[16:43:19] draken: i added remote: true to the form, but it still tells the server html
[16:43:24] draken: so it 'reponds_to' the html
[16:44:36] arup_r: What is Java/ajax?
[16:45:12] roshanavand: has joined #RubyOnRails
[16:45:48] Icey: has joined #RubyOnRails
[16:45:53] arup_r: Java and Javascript are way different my friend............. ;(
[16:46:07] tenderlove: has joined #RubyOnRails
[16:46:55] FailBit: javascript should be called ECMAscript always
[16:47:05] andrew9184: has joined #RubyOnRails
[16:48:39] jobewan: has joined #RubyOnRails
[16:48:57] woods: has joined #RubyOnRails
[16:48:58] wharr: how many redirects in a controller is too many?
[16:49:02] tubbo: fuck that shit
[16:49:08] tubbo: i'd rather call it Whorescript
[16:49:19] wharr: I read somewhere each action should have at most 1 redirect
[16:49:23] tubbo: ECMAScript sounds like it's some kind of new terrible Hi-C flavor
[16:49:48] tubbo: wharr: well, you can get into the "too many redirects" issue if you go crazy with redirecting
[16:50:00] tubbo: but generally it's just better to keep your API simple, always
[16:50:38] FailBit: wharr: browsers will ward off redirect loops
[16:50:42] FailBit: be careful
[16:51:34] blackmesa: has joined #RubyOnRails
[16:51:47] ruurd: has joined #RubyOnRails
[16:52:21] yogeshrt: has joined #RubyOnRails
[16:54:23] rakm: has joined #RubyOnRails
[16:55:15] aRaym: has left #RubyOnRails: ()
[16:55:28] K3VA: has joined #RubyOnRails
[16:55:30] nogic: has joined #RubyOnRails
[16:56:12] ngscheurich: has joined #RubyOnRails
[16:59:04] blackmesa: has joined #RubyOnRails
[17:00:34] EminenceHC: has joined #RubyOnRails
[17:00:36] roshanavand: has joined #RubyOnRails
[17:01:39] dopie: Question when I create a namespace
[17:01:51] MrPunkin: has joined #RubyOnRails
[17:04:41] tenderlove: has joined #RubyOnRails
[17:07:16] manfrin: has joined #RubyOnRails
[17:07:24] ruurd: has joined #RubyOnRails
[17:07:28] Papierkorb: dopie: Exactly.
[17:07:39] dopie: i spaced out
[17:09:12] umdstu: has joined #RubyOnRails
[17:09:15] umdstu: so i need to be able to poll a server for xml, which contains latentencies for all the other servers. I want to get this periodically (30 seconds or so) so I can determine if the latency is abnormally high. what's the best way to do this in rails?
[17:10:19] tubbo: umdstu: depends on where you want the information. like if it's just something you want to show in html, you can probably just do it all with JS
[17:11:31] lapide_viridi: has joined #RubyOnRails
[17:12:03] jkamenik: has joined #RubyOnRails
[17:12:11] TeckniX: has joined #RubyOnRails
[17:12:42] jessemcgilallen: has joined #RubyOnRails
[17:13:22] Shoutsid: has joined #RubyOnRails
[17:13:27] wpp: has joined #RubyOnRails
[17:13:30] oflannabhra: has joined #RubyOnRails
[17:13:42] slash_nick: umdstu: is there a reason you can't poll the server using JS? A reason like "well, requesting xml from that server requires auth credentials only my rails server should have"
[17:13:52] bondibox: has joined #RubyOnRails
[17:14:23] NBarnes: has joined #RubyOnRails
[17:15:01] bondibox: Is anyone familiar with the PragProg depot app not showing the cart items when adding the first item?
[17:15:21] roshanavand: has joined #RubyOnRails
[17:15:40] bondibox: known bug, working on a fix
[17:15:44] draken: also, im trying to use js/ajax to get a comment to refresh in without the page doing so, i have remote: true but it just goes to the .html response and not the JS one
[17:17:05] slash_nick: sorry bondibox i'm not
[17:17:09] blackmesa: has joined #RubyOnRails
[17:17:18] bondibox: draken I would love to see your js.erb code because I'm working on almost the same thing here
[17:17:39] adac: has joined #RubyOnRails
[17:18:05] mikecmpbll: has joined #RubyOnRails
[17:19:56] tenderlove: has joined #RubyOnRails
[17:20:21] slash_nick: draken: meet bondibox ... bondibox , this is draken
[17:20:49] Shoutsid: has joined #RubyOnRails
[17:20:59] mary5030: has joined #RubyOnRails
[17:21:13] bondibox: actually I thought about it and I think my deal is a little more complicated
[17:21:23] shinnya: has joined #RubyOnRails
[17:21:24] Pazician: has joined #RubyOnRails
[17:21:32] bondibox: but thanks slash_nick :-)
[17:22:16] Denarii: has joined #RubyOnRails
[17:22:28] cstyles: has joined #RubyOnRails
[17:22:45] mary5030: has joined #RubyOnRails
[17:23:47] draken: its just a single simple line to append
[17:23:49] avemestr: has joined #RubyOnRails
[17:23:51] Maletor: has joined #RubyOnRails
[17:23:53] draken: but its not even getting to that point
[17:23:54] hephaestus_rg: has joined #RubyOnRails
[17:23:58] draken: its not excuting the .js file at all
[17:24:03] draken: even though remote: true
[17:24:19] mary5030: has joined #RubyOnRails
[17:24:25] diegorv: has joined #RubyOnRails
[17:24:25] Maletor: What SHOULD a PATCH request respond with if a PUT request SHOULD return a 204?
[17:24:46] bondibox: what is the name of your .js file?
[17:24:48] ruurd: has joined #RubyOnRails
[17:24:56] draken: create.js.erb
[17:25:06] Doddlin: has joined #RubyOnRails
[17:25:23] mostlybadfly: hi all, can anyone help add an additional class attribute to a flash container for use with css? I'm using the unobtrusive flash gem to render a flash notice from js.erb, but I want it to be styled differently than for the other views https://gist.github.com/mostlybadfly/c8d1cfb841ab9f795d87
[17:25:23] mostlybadfly: in the _messages.html.erb is my attempt just based on a railscasts on looping through flash message
[17:25:23] mostlybadfly: also to note, if i just put the style in the ingredients stylesheet, it impacts flash messages elsewhere
[17:26:35] lea: has joined #RubyOnRails
[17:27:09] okiuim: has joined #RubyOnRails
[17:27:11] draken: u can set style on the tag itself
[17:27:23] bondibox: you called //= require jquery ?
[17:27:43] bondibox: sorry basic stuff I know but I gotta ask
[17:28:05] Nuck: has joined #RubyOnRails
[17:28:12] sonOfRa_: has joined #RubyOnRails
[17:28:15] mostlybadfly: the tag seems to be shared for any flash notice so I'm trying to create it's own class so just that view is modified
[17:28:24] gasbakid: has joined #RubyOnRails
[17:28:30] bendangelo: has joined #RubyOnRails
[17:29:09] lele: has joined #RubyOnRails
[17:29:09] mostlybadfly: sorry not sure if that was to me :)
[17:29:24] bondibox: all I can say is that jquery doesn't necessarily throw an error the way other parts of the rails app do. My create.js file had a misplaced parenthesis and no error
[17:29:39] lord4163: has joined #RubyOnRails
[17:29:43] machty: has joined #RubyOnRails
[17:29:49] silverdust: has joined #RubyOnRails
[17:30:04] a1fa: has joined #RubyOnRails
[17:30:27] Olipro: has joined #RubyOnRails
[17:30:38] lele: has joined #RubyOnRails
[17:31:02] BBHoss: has joined #RubyOnRails
[17:31:57] bondibox: draken do you have js working on other parts of the app? Does a simple html js embed work?
[17:32:15] jamo: has joined #RubyOnRails
[17:32:28] gasbakid: has joined #RubyOnRails
[17:35:40] Shoutsid: has joined #RubyOnRails
[17:36:12] nemo_: has joined #RubyOnRails
[17:36:14] roshanav_: has joined #RubyOnRails
[17:36:18] cac: has joined #RubyOnRails
[17:38:36] riotjones: has joined #RubyOnRails
[17:38:59] SuzieQueue: has joined #RubyOnRails
[17:39:03] d5sx43: has joined #RubyOnRails
[17:39:23] tenderlove: has joined #RubyOnRails
[17:40:45] umdstu: slash_nick: that is correct
[17:41:23] SteenJobs: has joined #RubyOnRails
[17:41:26] smathy: has joined #RubyOnRails
[17:41:46] based_pdev_: has joined #RubyOnRails
[17:42:48] umdstu: tubbo: as slash_nick hypothesized , it's xml on an internal node and I dont want every client polling the server every x seconds. i want to poll it in the server and then emit a message to any clients connected if its really bad
[17:42:49] sharkman: has joined #RubyOnRails
[17:43:03] dnewkerk: bondibox: https://gorails.com/episodes/jquery-ujs-callbacks has some debugging advice for javascript responses, might help
[17:43:08] sharkman: if i have a form, with form_tag, how do i add a drop down menu to the form
[17:43:23] ff7f00: has joined #RubyOnRails
[17:43:25] sharkman: im seeing various options on google, like select, select_tag, collection_select... i cant get anything to work yet
[17:43:27] ruurd: yo sharkman
[17:43:32] Puffball: has joined #RubyOnRails
[17:43:40] jhass: sharkman: http://guides.rubyonrails.org/form_helpers.html#making-select-boxes-with-ease
[17:44:04] tfitts: is there a method similar to invert that can merge duplicate keys so the new value is an array containing each key?
[17:45:13] ff7f00: hi all, I'm using unobtrusive_flash with bootstrap and when I make an ajax call, the flash appears at the top of the main container (so if i've scrolled down I don't see the flash message until I scroll up). Is there any way to specify that you want the flash to appear underneath the <nav> instead of at the top of the main container?
[17:45:29] Depili: has joined #RubyOnRails
[17:45:41] tenderlove: has joined #RubyOnRails
[17:47:52] sharkman: i see thanks jhass that works
[17:48:14] jenrzzz: has joined #RubyOnRails
[17:48:17] TeckniX: has joined #RubyOnRails
[17:49:19] nym: has joined #RubyOnRails
[17:49:21] arBmind: has joined #RubyOnRails
[17:49:35] danman: has joined #RubyOnRails
[17:50:10] steveweb: has joined #RubyOnRails
[17:50:53] sp1rs: has joined #RubyOnRails
[17:51:07] steveweb: has joined #RubyOnRails
[17:51:50] moeabdol: has joined #RubyOnRails
[17:51:56] han`: has joined #RubyOnRails
[17:51:59] sp1rs: Hello everyone, I worked on rails 2 years back , and now i want to use it again ? Can someone tell me which version of rails should i use 3 or 4 ??
[17:52:02] jkamenik: has joined #RubyOnRails
[17:52:03] tenderlove: has joined #RubyOnRails
[17:52:07] dnewkerk: bondibox and draken here???s a snippet that should help you see better what went wrong with your javascript responses https://gist.github.com/dnewkerk/b2159bfd0de9b4f830f9
[17:52:44] dnewkerk: sp1rs: 5 is not far off, I wouldn???t purposely use 3 now
[17:53:06] s2013: has joined #RubyOnRails
[17:53:14] sp1rs: dnewkerk: cool thx
[17:53:30] ff7f00: sp1rs: Yea 3.2 will lose support when 5 comes out
[17:53:51] ff7f00: see http://guides.rubyonrails.org/maintenance_policy.html
[17:54:06] bmalum: has joined #RubyOnRails
[17:54:22] weaksauce: has joined #RubyOnRails
[17:55:20] stevenw: has joined #RubyOnRails
[17:55:30] annlewis: has joined #RubyOnRails
[17:56:21] dnewkerk: ff7f00: the readme says ???declare a .unobtrusive-flash-container element somewhere on the page to contain the alerts??? (or it will auto insert in the first .container)
[17:56:24] steveweb: has joined #RubyOnRails
[17:56:53] Ergo: has joined #RubyOnRails
[17:57:09] tenderlove: has joined #RubyOnRails
[17:58:00] sharkman: where do i genrate the list of dates im gonna put in the pulldown menu in app/models/views/index?
[17:58:06] sharkman: does that go right in the index page? in a controllor?
[17:58:18] Shoutsid: has joined #RubyOnRails
[17:58:49] Pazician: has joined #RubyOnRails
[17:59:49] tubbo: sharkman: what are you making this dropdown for? there are date_select, time_select, and date_time_select helper methods on FormBuilder (form_for's `f`) to make that a bit easier.
[17:59:53] symbole: has joined #RubyOnRails
[18:00:07] oflannabhra: has joined #RubyOnRails
[18:00:46] sharkman: oh good. i am making a pulldown menu which will have todays date, tomorrow date, up to 5 days from now
[18:01:36] yogeshrt: has joined #RubyOnRails
[18:02:03] ff7f00: dnewkerk: yea I attempted to put a <div> at the bottom of the <nav> element with the class unobtrusive-flash-container, and it displays the flash but it pulls down the black part of the nav
[18:02:15] ff7f00: and <div> after the nav shows the flash at the top of the page
[18:03:15] gustav__: has joined #RubyOnRails
[18:03:33] hooper: has joined #RubyOnRails
[18:03:59] hooper: has joined #RubyOnRails
[18:04:06] dnewkerk: ff7f00: yeah inserting elements where bootstrap doesn???t expect them can have odd effects (it???s kinda like Rails that way, gotta go with the flow to get along easily haha) ??? show code?
[18:04:23] hooper: has joined #RubyOnRails
[18:04:49] hooper: has joined #RubyOnRails
[18:05:13] hooper: has joined #RubyOnRails
[18:05:39] hooper: has joined #RubyOnRails
[18:06:35] kalusn: has joined #RubyOnRails
[18:07:12] ffsadsl: has joined #RubyOnRails
[18:10:07] d5sx43: has joined #RubyOnRails
[18:10:14] gizmac: has joined #RubyOnRails
[18:10:33] safety_cut: has joined #RubyOnRails
[18:10:35] wenchenx_: has joined #RubyOnRails
[18:11:16] sharkman: tubbo, do you have some advice on how this syntax should look, im new to rails html stuff
[18:11:17] sharkman: http://pastebin.com/KRAhmZ7c
[18:11:55] kidoz: has joined #RubyOnRails
[18:12:14] sharkman: https://gist.github.com/anonymous/ba20fa707abcb232e98e
[18:12:30] baweaver: has joined #RubyOnRails
[18:12:57] adaedra: protip: if you put a filename with the right extension in github, the syntax colors activate.
[18:13:36] Shoutsid: has joined #RubyOnRails
[18:14:21] andatche: has joined #RubyOnRails
[18:14:48] sharkman: https://gist.github.com/anonymous/12572e57475fb3eba88b
[18:14:52] c0py: has joined #RubyOnRails
[18:14:54] steveweb: has left #RubyOnRails: ()
[18:15:09] KensoDev: has joined #RubyOnRails
[18:15:40] sharkman: this crashes though do you know how i should fix the syntax of this select_tag field to make it work
[18:15:51] SteenJobs: has joined #RubyOnRails
[18:15:54] dnewkerk: adaedra: sadly I just noticed it doesn???t understand .coffee
[18:16:23] s2013: man this is annoying the hell out of me.. i keep getting OpenSSL errors randomly: OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
[18:16:29] s2013: this is when im tryign to update someone via console
[18:16:39] s2013: update a record
[18:16:45] stannard_: has joined #RubyOnRails
[18:16:54] tubbo: s2013: oh no!
[18:17:07] siaW: has joined #RubyOnRails
[18:17:07] s2013: happens very randomly.. i installed certified gem
[18:17:14] tubbo: s2013: when you say "update someone via console", you mean this happens when you run bin/rails console right?
[18:17:16] s2013: ssl certificate is fine.. so no clue what to do next
[18:17:28] s2013: i mean like u = User.find(123).. u.name = "blah". u.save
[18:17:45] tubbo: s2013: so it happens on sae
[18:17:51] s2013: but not always.. randomly.. but this is like the 5th - 6th time it happened this week..
[18:17:55] smathy: You're connecting to DB over SSL?
[18:18:06] s2013: no im in rails console in production server
[18:18:29] tubbo: s2013: lol we get that :P is your production app connected to the DB over SSL by any chance?
[18:18:36] s2013: but this is just an example.. i have had the openssl errors happen randomly
[18:18:45] tubbo: s2013: that is pretty strange, it sounds like it's got some rogue cert in there that's fucking shit up
[18:18:46] smathy: No, oh, yeah.
[18:18:47] s2013: i believe so
[18:19:02] s2013: i inherited this shitty project and its driving me nuts over the past couple of months
[18:19:09] tubbo: s2013: what happens when a user is saved?
[18:19:15] adaedra: sharkman: I think it may work better if you were not closing and reopening the tags. Put the whole select_tag call in one <%= %> block.
[18:19:16] tubbo: like, are there any callbacks?
[18:19:54] smathy: s2013, http://mislav.uniqpath.com/2013/07/ruby-openssl/
[18:19:55] sharkman: oh i see interesting
[18:20:01] beingjohnm: Looking for some help with something that works when typed into the rails console but doesn't work when ran: https://gist.github.com/willjohnson/0f7ce067be818484d1cc
[18:20:16] s2013: well like if we cancel an user, it will delete their cc information from authorize.net
[18:20:17] s2013: smathy i looked through that
[18:20:20] raldu: has joined #RubyOnRails
[18:20:33] tubbo: s2013: well, authorize.net does enforce SSL connections IIRC
[18:20:43] tubbo: s2013: you using active_merchant?
[18:20:48] s2013: yeah but we can cancel 99% of the users fine
[18:20:56] s2013: we use recurly
[18:20:59] s2013: on top of authorize.net
[18:21:09] s2013: but i do see active merchant is installed
[18:21:13] sp1rs: has joined #RubyOnRails
[18:21:31] baweaver: has joined #RubyOnRails
[18:21:39] tubbo: s2013: well active_merchant's auth.net library, for example, is going to use the ssl_post method, which does a POST over SSL
[18:21:53] smathy: s2013, you looked through it, and?
[18:24:17] arup_r: beingjohnm: seems @transaction1.account_transfer_transaction_id returns nil
[18:24:28] s2013: tubbo yeah but i wonder why it works for some and not others
[18:24:33] choke: has joined #RubyOnRails
[18:25:16] beingjohnm: arup_r: yeah, it does when ran through the browser but not when ran from the console directly
[18:25:21] momomomomo: has joined #RubyOnRails
[18:26:15] beingjohnm: which makes no sense to me...
[18:26:16] helpa: ¯\_(ツ)_/¯ Sorry, tubbo is not able to help you any further as they do not know.
[18:26:25] tubbo: that's a good one
[18:26:31] arup_r: Transaction.find(79).account_transfer_transaction_id # is not giving nil in console
[18:26:36] tubbo: i just thought it was gonna give me the ascii
[18:27:02] ff7f00: has left #RubyOnRails: ()
[18:27:03] beingjohnm: arup_r: I updated the gist with the output of when I type directly into the console
[18:27:12] arup_r: that is not a browser problen
[18:27:15] beingjohnm: arup_r: it correctly gives 80
[18:27:17] arup_r: lemme see
[18:27:42] beingjohnm: arup_r: I didn't think it was a browser problem but when ran by my app
[18:27:49] tubbo: beingjohnm: maybe try @transaction1.account_transfer_transaction_id.to_i
[18:27:50] bhegel: has joined #RubyOnRails
[18:27:58] tubbo: because i think that value has to be an integer, not a BigDecimal object
[18:28:02] stevenw_: has joined #RubyOnRails
[18:28:04] tubbo: but i thought rails converted that for you..
[18:28:16] tubbo: actually wait
[18:28:17] beingjohnm: tubbo: yeah, documentation said it converted for you
[18:28:19] smathy: s2013, probably the connection is cycling through a set of hosts, like in a DNS round-robin perhaps, so occasionally you're connecting to a server that you don't have the right CA bundle to verify.
[18:28:19] tubbo: why the hell is that a BigDecimal :P
[18:28:39] smathy: s2013, point is, don't just look through that article.
[18:28:53] sp1rs1: has joined #RubyOnRails
[18:29:27] d5sx43: has joined #RubyOnRails
[18:29:36] tubbo: i have a funny feeling this is it
[18:29:41] tubbo: or, someone is trying to MITM you :D
[18:29:57] arup_r: beingjohnm: show this method account_transfer_transaction_id
[18:30:24] beingjohnm: tubbo: the only decimal in that model is the amount of the transaction
[18:30:28] matthewd: beingjohnm: The controller action contains exactly those two lines, and no others?
[18:30:35] bhegel: Working on an old rails app which stores a column as a long text field, but the field is YAML, and to access the values you have to parse the YAML in the one string column. So the DB is writing multiple values into one DB column in a specialized format. Is it just me, or is this not good practice?
[18:30:48] tubbo: beingjohnm: the value of the BigDecimal value looked odd to me, like it was a huge negative number
[18:30:49] beingjohnm: matthewd: no, it does have more
[18:30:55] arup_r: beingjohnm: Yes, show the controller update action first
[18:31:16] s2013: smathy honestly the main reason im hesitant to do anything regarding ssl and all that is cause our setup is really finicky. i am afraid if i touch something, it will go down.
[18:31:38] arup_r: bhegel: serialize will do that for you.
[18:31:44] tubbo: s2013: it already has gone down :)
[18:32:28] beingjohnm: arup_r: gist updated with full controller https://gist.github.com/willjohnson/0f7ce067be818484d1cc
[18:32:29] arup_r: bhegel: use serialize. Then you don't need manual parsing
[18:32:31] tubbo: might help if you did this on staging rather than production
[18:32:44] tubbo: so you're not screwing with prod if things *do* go down
[18:32:48] smathy: s2013, well let me confirm for you, you're not going to solve this with a little code tweak here or there - unless you're happy to stop verifying the peer (which is a terrible idea).
[18:33:03] smathy: s2013, so either roll up your sleeves, or hire an expert who you're confident in.
[18:33:11] tubbo: not even sure you can do that if this is indeed coming from a call to a lib that's inside another gem
[18:33:17] arup_r: beingjohnm: fat controller :D
[18:33:27] beingjohnm: arup_r: account_transfer_transaction_id is a column for the tranaction model rather than a method (maybe this is where my understanding is breaking down..)
[18:33:34] matthewd: beingjohnm: Oh, I see... what you think is happening is not what is happening
[18:33:46] s2013: yeah ill probably try it at night time
[18:33:52] jsrn_: has joined #RubyOnRails
[18:34:02] beingjohnm: matthewd: I'm pretty dense so that happens a lot :)
[18:34:08] matthewd: Your original report implies, at least, that it's the second find that's failing... it's actually the first.
[18:34:17] tubbo: s2013: if you have a staging deployment you can do it right now
[18:34:19] arBmind: has joined #RubyOnRails
[18:34:22] bhegel: arup_r: thanks.
[18:34:27] tubbo: if not, eh whatever. you said it was kinda legacy/inherited right?
[18:34:44] beingjohnm: matthewd: really?! dammit
[18:35:01] matthewd: The successful query is coming from elsewhere
[18:35:13] matthewd: (and if you compare the successful find with the one that's failing, you should see why)
[18:35:16] s2013: lol staging.. tubbo we have no staging, no testing, nothing
[18:35:35] tubbo: no tests? no service. :)
[18:35:40] arup_r: beingjohnm: Just add a debugger to the entry point, and check
[18:36:11] beingjohnm: matthewd: ok, that makes more sense. Maybe update does the query automatically
[18:36:13] tubbo: if i ever work at a company that tries to make me fuck around with a rails app that has NO tests, i'm just going to never come back there. :P
[18:36:28] tubbo: i wonder how long it would take to figure that out if you are a fully remote worker
[18:36:29] matthewd: beingjohnm: No, you're doing the query
[18:36:39] beingjohnm: arup_r: I tried that but did the debugger after the first transaction.
[18:36:42] tubbo: pretty sure i could get away with at least 1-2 paychecks before they realized i'm not coming to work anymore
[18:36:42] matthewd: btw, the line number in the backtrace does point at the first one
[18:37:10] beingjohnm: ,atrius dodm
[18:37:20] jessemcgilallen: has joined #RubyOnRails
[18:37:29] beingjohnm: matthewd: didn't even look at the line number. Not sure where the first query came from.
[18:37:48] beingjohnm: matthewd: arup_r: I can probably figure it out from here. Thanks for the help.
[18:38:03] matthewd: beingjohnm: Scroll down.
[18:38:07] s2013: tubbo trust me.. we have hardcoded primary ids and what not
[18:38:13] sunya7a: has joined #RubyOnRails
[18:38:16] s2013: anyways as a temporary solution i just used update_column
[18:39:14] srinidhi: has joined #RubyOnRails
[18:39:36] smathy: Heh, so the fix for your connection to an external service occasionally failing is to not call the external service.
[18:39:58] siddart: has joined #RubyOnRails
[18:39:59] riotjones: has joined #RubyOnRails
[18:40:15] tubbo: s2013: oh yeah if you're just trying to save data on a user then fuck it :P
[18:40:19] smathy: One of the rare times when, "Well, just stop doing that." would actually have been viable advice.
[18:40:27] srinidhi: has joined #RubyOnRails
[18:40:49] tuelz: has joined #RubyOnRails
[18:40:55] s2013: basically we are trying to cancel the user account and when we do it automatically deltes their info off authoroize.net.. so i manually cancelled it and then manually going to go remove their info from authorize.net
[18:40:59] roshanavand: has joined #RubyOnRails
[18:41:01] techsethi: has joined #RubyOnRails
[18:41:16] s2013: i realized one pattern of those errors im getting are related to really old user accounts before we started using recurly
[18:41:34] srinidhi: has joined #RubyOnRails
[18:41:39] iateadonut: has left #RubyOnRails: ()
[18:42:25] TeckniX: has joined #RubyOnRails
[18:42:46] arup_r: tubbo: do you write blogs ?
[18:42:49] kies^: has joined #RubyOnRails
[18:43:02] greengriminal: has joined #RubyOnRails
[18:43:03] tubbo: arup_r: i've written a few posts. http://psychedeli.ca
[18:43:06] tubbo: but i don't write regularly
[18:43:48] eikood: has joined #RubyOnRails
[18:43:51] arup_r: ACTION hopes tubbo will write a lot about Jquery-ujs and trubolinks there..
[18:44:19] s2013: more like tubbolinks am i right
[18:44:27] hahuang65: has joined #RubyOnRails
[18:44:39] hephaestus_rg: has joined #RubyOnRails
[18:45:16] annlewis: has joined #RubyOnRails
[18:45:25] arup_r: wut......
[18:45:38] FailBit: ye u r rite
[18:45:51] bmalum: has joined #RubyOnRails
[18:46:24] cryptocronus: has joined #RubyOnRails
[18:46:28] bklane: has joined #RubyOnRails
[18:47:14] arup_r: tubbo: knows nice tricks on those 2 topics.. so I was trying to check what he shared
[18:47:29] tubbo: !tubbolinks
[18:47:35] tubbo: never mind :P
[18:47:50] tubbo: arup_r: oh yeah, i probably should.
[18:48:01] arup_r: yes. pleasee..........
[18:48:37] jkamenik: has joined #RubyOnRails
[18:48:40] FCser: has joined #RubyOnRails
[18:48:46] cryptocronus: what???s a good strategy to prevent a race condition during an oauth2 flow when requesting an access_token from a passed in authorization_code. If the user spams the authorize button twice really fast we will get to concurrent requests with two different authorization_code???s which will lead to two different access_tokens but only the newest one will be valid?
[18:48:52] siaW: has left #RubyOnRails: ()
[18:49:31] srinidhi: has joined #RubyOnRails
[18:50:52] barttenbrinke: cryptocronus: Disable the button via javascript
[18:51:04] FailBit: barttenbrinke: uh
[18:51:05] cryptocronus: the authorize button isn???t in my control, it???s third party oauth flow
[18:51:10] FailBit: please rethink your statement
[18:51:48] barttenbrinke: FailBit: It's ugly, but double clicking form users are a real thing :(
[18:51:51] lacuna: has joined #RubyOnRails
[18:52:11] FailBit: barttenbrinke: that's not what cryptocronus means
[18:52:35] cryptocronus: well it kind of is actually, but the main issue is im not the one who controls the button
[18:52:56] FailBit: because the user can certainly spam the endpoint without clicking the button
[18:53:18] lacuna: has joined #RubyOnRails
[18:54:15] centrx: has joined #RubyOnRails
[18:54:15] kara_sweets: has joined #RubyOnRails
[18:55:42] d5sx43: has joined #RubyOnRails
[18:56:10] smathy: cryptocronus, when they click the button they are sending an ajax request or something to your server?
[18:56:31] cryptocronus: its a direct link
[18:57:12] greengriminal: has joined #RubyOnRails
[18:57:18] smathy: cryptocronus, ok, so it makes a full http request. So the issue will be that if they click again then the browser won't even be able to receive the initial response because a new request has been issued.
[18:57:35] cryptocronus: well that???s a separate problem
[18:57:48] cryptocronus: the real problem is i generate an access_token from the authorization_code on both requests
[18:57:53] cryptocronus: and only the most recent one is valid
[18:58:03] cryptocronus: but the time it takes to generate one is dependent on the 3rd party request
[18:58:16] cryptocronus: so its possible that the second request actually reaches database first
[18:58:24] cryptocronus: in which case the first request overwrites the now valid token
[18:58:34] cryptocronus: or at least that???s what seems like is happening
[18:58:55] cryptocronus: my current fix im attempting is to record a microsecond timestamp of when I received the token from server and only update if it???s newer
[19:00:03] slash_nick: umdstu: you could let a background worker poll your service, populating some cache (redis) with its results... then, per request, check that cache...
[19:01:22] oflannabhra: has joined #RubyOnRails
[19:02:38] siddart: has joined #RubyOnRails
[19:03:06] Shoutsid: has joined #RubyOnRails
[19:04:41] quazimodo: has joined #RubyOnRails
[19:05:09] umdstu: slash_nick: i'll play with it a bit more. thanks
[19:05:17] d5sx43: has joined #RubyOnRails
[19:09:05] youngbaks: has joined #RubyOnRails
[19:09:17] choke: has joined #RubyOnRails
[19:10:34] youngbaks: has joined #RubyOnRails
[19:10:46] andrewray: has joined #RubyOnRails
[19:10:58] paulodiovani: has joined #RubyOnRails
[19:11:22] nogic: has joined #RubyOnRails
[19:11:32] smathy: cryptocronus, create a "in_process" flag in your DB and set it before making the 3rd party request. Only make a 3rd party request if that flag is unset and if there's no valid token already.
[19:11:39] baweaver: has joined #RubyOnRails
[19:12:33] cryptocronus: yeah, seems like I could just use a table lock on the oauth_tokens table and make the request inside the transaction
[19:12:55] cryptocronus: so OauthToken.transaction do # make request # store token end
[19:13:03] cryptocronus: and the second request would have to wait for the first to finish
[19:13:06] s2013: has joined #RubyOnRails
[19:13:07] cryptocronus: and would update the record
[19:13:26] rhizome: locking a table for a third party request seems a little extreme
[19:14:15] smathy: cryptocronus, yeah, although you only need to put the read/update in the with_lock - not the 3rd party request. The race is only between reading your own DB and updating the flag.
[19:14:56] Shoutsid: has joined #RubyOnRails
[19:15:10] theblang: has joined #RubyOnRails
[19:15:35] andrewray: has left #RubyOnRails: ()
[19:16:04] kara_sweets: has joined #RubyOnRails
[19:16:05] cryptocronus: hm well not exactly
[19:16:30] cryptocronus: hm maybe that???s true
[19:17:36] hephaestus_rg: has joined #RubyOnRails
[19:18:07] ruurd: has joined #RubyOnRails
[19:18:33] cryptocronus: only issue i think is if it somehow generated token first but wasn???t able to get the lock before the second guy
[19:18:52] cryptocronus: the first token would get database second and write over new token
[19:19:36] cryptocronus: i think my current fix of just storing a generated_at flag with the token and only updating if it???s generated_at timestamp is more recent
[19:20:52] lacuna: has joined #RubyOnRails
[19:22:20] nogic: has joined #RubyOnRails
[19:22:35] barttenbrinke: cryptocronus: Javascript hack not looking so bad now h?? :) Goodluck!
[19:22:47] smathy: It's hard because SQL locking won't block, if you could block then the second request in would just block until the first had returned and then could return the one and only valid token, so all requests would respond with the one and only valid token.
[19:22:58] cryptocronus: barttenbrinke: that???s not an option. like I said, I don???t control the link
[19:23:14] adac: has joined #RubyOnRails
[19:23:25] cryptocronus: sql locking will block updates to the table though, right?
[19:23:32] smathy: cryptocronus, that might lead me to use a flock actually, just so I could force a block on the second request, so it could return the valid token from the first request.
[19:23:59] tubbo: cryptocronus: probably. either way, it shouldn't matter which access token they receive. any of them will work.
[19:24:02] smathy: cryptocronus, yes, subsequent updates will cause a ROLLBACK
[19:24:18] tubbo: like even if it accidentally saved a few tokens into the DB, as long as you use *one* of them it's fine afaik
[19:24:39] cryptocronus: i thought with OAuth2 subsequent authorizations nullified old tokens
[19:25:01] cryptocronus: at least that???s the behavior I appear to be seeing
[19:25:15] cryptocronus: this is all just a guess at what???s ahppening though, could be 3rd party bug and not my fault
[19:25:40] VeryBewitching: has joined #RubyOnRails
[19:26:08] loc22: has joined #RubyOnRails
[19:27:09] matthias_: has joined #RubyOnRails
[19:27:28] loc22: Hi guys. Quick question. I want to deleted last 20 elements from a table, ordered by date. Model.oder(:date).last(20).destroy ... but is not working because the querry result is an Array. Any idea how to do that?
[19:27:52] tubbo: loc22: loc22 try limit(20) rather than last(20).
[19:28:01] tubbo: sorry for mentioning you twice lol
[19:28:10] loc22: tubbo: Thanks! It worked perfect ;)
[19:28:41] smathy: ACTION thinks you'll want to DESC your order
[19:29:07] TeckniX: has joined #RubyOnRails
[19:29:28] lacuna: has joined #RubyOnRails
[19:29:31] tubbo: unless pg is configurd to ORDER DESC by default :)
[19:29:46] smathy: Yep, unless that ;)
[19:29:58] smathy: ...or unless you have fewer than 20 records ;)
[19:30:04] barttenbrinke: tubbo: No, because it will probably order by ID DESC :)
[19:30:06] matthias_: has joined #RubyOnRails
[19:30:23] tubbo: barttenbrinke: the Model.order(:date) would cancel that out
[19:30:38] smathy: ...or unless `date` is actually an oddly named field which is set to the difference between the year 3000 and the date inserted.
[19:30:53] paulodiovani: Heym is there some way to disable database connection when run `rake assets:precompile` on Rails 4?
[19:31:17] barttenbrinke: tubbo: "World of pain, do not go here!" -sign :)
[19:31:31] dionysus69: has joined #RubyOnRails
[19:31:51] tubbo: barttenbrinke: yeah that's basically how i get when someone in here tries to argue that STI is a good idea ever
[19:33:47] cryptocronus: here???s a gist around the code im talking about: https://gist.github.com/jamespeerless/70ff41ce2fdbbf57a5a1
[19:34:05] baweaver: has joined #RubyOnRails
[19:34:47] hanss: has joined #RubyOnRails
[19:35:24] Jasaka: has joined #RubyOnRails
[19:35:45] Galas: has joined #RubyOnRails
[19:36:24] willharrison: has joined #RubyOnRails
[19:37:10] cac: has joined #RubyOnRails
[19:39:35] relix: has joined #RubyOnRails
[19:40:14] kara_sweets: has left #RubyOnRails: ()
[19:40:48] riotjones: has joined #RubyOnRails
[19:41:21] SteenJobs: has joined #RubyOnRails
[19:42:28] siddart: has joined #RubyOnRails
[19:44:16] Shoutsid: has joined #RubyOnRails
[19:46:18] kshah: has joined #RubyOnRails
[19:46:31] cac: has joined #RubyOnRails
[19:48:02] kshah: I have routes dependent on subclasses of a non-AR backed model ???Item???, that is, I get descendants of Item and make a bunch of routes by iterating over that collection of subclasses. In development when I change any file this results in the constants being lost and me losing my routes ??? what can I do to fix this? is this autoload related?
[19:48:10] IFrank00: has joined #RubyOnRails
[19:48:52] PhaseCode: has joined #RubyOnRails
[19:49:01] sunya7a: has joined #RubyOnRails
[19:49:57] jenrzzz: has joined #RubyOnRails
[19:51:15] smathy: kshah, probably.
[19:51:34] kshah: smathy: so what am I not understanding about autoload because I seem to get tripped up by it often
[19:51:37] smathy: kshah, do you have the classes in the corresponding directory/filename?
[19:51:47] smathy: kshah, also, are you running spring?
[19:52:02] smathy: (or a better question, have you knowingly disabled spring?)
[19:52:08] kshah: smathy: item.rb is in /app/models/ and it???s subclasses are located in /app/models/items/
[19:52:36] smathy: kshah, ok, and the subclasses' names? They're like: module Items; class Foo ...whatever?
[19:53:01] kshah: smathy: no, they are directly subclassed, as ???class Foo < Item???
[19:53:35] kshah: smathy: as for spring `ps aux | grep spring` after rails s is running reveals no instances, this is a 4.2.0 app, but perhaps is missing some configuration as a result of several upgrades
[19:53:49] jkamenik: has joined #RubyOnRails
[19:53:55] kshah: reveals no instances of spring that is
[19:54:25] smathy: kshah, "directly subclassed" and the namespace they're in are not contradictory.
[19:54:29] SamGerber: has joined #RubyOnRails
[19:54:47] smathy: kshah, ie. you could still have: module Items; class Foo < Item
[19:54:49] Sam_Gerber: has joined #RubyOnRails
[19:54:50] kshah: smathy: that could be it??? there is *also* a database backed item.rb
[19:55:06] dps: has joined #RubyOnRails
[19:55:07] kshah: smathy: by databased backed I mean there is also an AR Model Item which subclasses AR::Base
[19:55:21] smathy: kshah, and that's what you're inheriting from?
[19:55:52] kshah: smathy: no, the AR backed item is actually namespace, sorry, shouldn???t have brought that up
[19:56:22] smathy: So yeah, I'm not sure how much this matters for the autoloader and reloading, but it's something I'd try.
[19:56:38] smathy: ...to ensure that the full class names match the directory structure.
[19:56:42] nettoweb: has joined #RubyOnRails
[19:56:57] mrbubbles: anyone use activemodel serializers? is there a way to access the attribute value in the serializer?
[19:57:13] smathy: I'd do it as much for your own sanity, otherwise if you have `app/models/items/foo.rb which defines Foo (rather than Items::Foo) then you can get name clashes if you ever created an app/models/foo.rb
[19:57:13] Kando: has joined #RubyOnRails
[19:57:16] mrbubbles: I know you have attributes :id, :name, etc, but I actually want to use the value of the attribute for something
[19:57:57] kshah: smathy: yes app/models/items/foo.rb defines for example Foo < Item
[19:58:15] smathy: kshah, right, it should define Items::Foo
[19:58:17] dionysus69: has joined #RubyOnRails
[19:58:32] Jasaka: has joined #RubyOnRails
[19:58:35] kshah: smathy: in module Items ? plural?
[19:58:41] shilon: has joined #RubyOnRails
[19:58:50] Kando: has left #RubyOnRails: ()
[19:59:00] kshah: smathy: asking plural? just for clarity if you meant Item::Foo
[19:59:20] dps: I have what is perhaps a dumb question: is it stupid to try to implement the partial replacement capabilities of turbolinks 3.0 to leverage rails as a SPA architectural design?
[19:59:27] smathy: No, that would be in app/models/item/foo.rb
[19:59:40] Kando: has joined #RubyOnRails
[19:59:51] kshah: ohhhh??? my directory structure is wrong
[19:59:56] smathy: kshah, only the case gets changed.
[20:00:24] kshah: I can rename the directory
[20:00:50] ffsadsl: has left #RubyOnRails: ()
[20:01:07] herbst: has joined #RubyOnRails
[20:03:52] Shoutsid: has joined #RubyOnRails
[20:04:07] kshah: sorry, that sounded daft. This is a namespacing conflict. I???m just not sure what the convention Rails expects is anymore
[20:04:44] Kando: Was wondering how to get the whole Nickname thing to work, Wouldn't allow me to send a message without it
[20:04:45] rhizome: kshah: same as ruby
[20:05:01] cstyles: kshah: possibly related: https://github.com/rails/rails/issues/8699
[20:05:07] Kando: This is the acclaimed Rails IRC Channel, yes?
[20:05:35] tubbo: Kando: "acclaimed"? haha
[20:05:41] Jasaka: has joined #RubyOnRails
[20:06:01] paulodiovani: has joined #RubyOnRails
[20:06:01] kshah: rhizome: so ./module_name/class_name.rb and base class should be in that directory? as in ./module_name/base_class.rb ?
[20:06:26] tubbo: kshah: yeah typically you see people do module_name/base.rb and then inherit from ModuleName::Base in their module_name/ classes.
[20:06:56] kshah: okay, I???m going to move things around to follow that convention
[20:07:00] kshah: _thank you all_
[20:07:38] rails654: has joined #RubyOnRails
[20:07:51] rails654: WEll yeah :p
[20:07:55] stannard: has joined #RubyOnRails
[20:08:03] smathy: Kando, the one and only.
[20:08:39] Kando_: has joined #RubyOnRails
[20:08:55] Kando_: Everyone always says the Rails IRC Channel is always helpful
[20:09:21] Kando_: I'm currently following the Railstutorial book by Mr. Hartl, so expect a lot of noob questions from me in the future!
[20:09:33] Kando_: Although it's past 1 am here and I should be sleeping
[20:10:37] rubyonrails655: has joined #RubyOnRails
[20:12:28] milkohol: has joined #RubyOnRails
[20:12:34] hahuang65: has joined #RubyOnRails
[20:13:11] Kando: has joined #RubyOnRails
[20:13:30] Kando: The IRC Channel keeps timing out for some reason
[20:13:46] Kando: Switched to Kiwi irc, hope it settles
[20:14:18] Kando: I hope these messages are sending..
[20:14:25] woods: they are :)
[20:14:36] Shoutsid: has joined #RubyOnRails
[20:15:01] milkohol: has left #RubyOnRails: ()
[20:15:15] tubbo: Kando: they are not
[20:15:32] Kando: Awesome, Will not disturb you'll know :D... But soon haha
[20:17:02] simkessy: If I have a class with public and private methods, can private methods call a public one?
[20:17:20] Shoutsid: has joined #RubyOnRails
[20:17:27] jkamenik: has joined #RubyOnRails
[20:17:33] tubbo: simkessy: yes
[20:17:38] macowie: has joined #RubyOnRails
[20:17:58] stannard_: has joined #RubyOnRails
[20:19:10] KnownSyntax: has joined #RubyOnRails
[20:19:10] KnownSyntax: has joined #RubyOnRails
[20:20:41] Kando: I'm off now! Will be continuing with Hartl's book tomorrow, Will bug you all if I run into any problems :D
[20:20:48] EminenceHC: has joined #RubyOnRails
[20:20:57] ramortegui_: has joined #RubyOnRails
[20:21:46] pydave6367: has joined #RubyOnRails
[20:23:13] MartinEl_: has joined #RubyOnRails
[20:23:15] Shoutsid: has joined #RubyOnRails
[20:23:41] Netun0: has joined #RubyOnRails
[20:24:17] cac: has joined #RubyOnRails
[20:24:24] oflannabhra: has joined #RubyOnRails
[20:25:36] Maletor: has joined #RubyOnRails
[20:26:56] rakm: i seem to remember that there was a way to classes for the current page/action in views. having trouble finding that. how does `current_page` and `current_path` are not working. anyone know about this?
[20:27:22] rakm: I don't really want to set it on the controller level
[20:28:37] rakm: this works: `<main class="<%= controller_name%> <%= params[:action] %>">`
[20:28:46] mordocai: has joined #RubyOnRails
[20:28:50] rakm: i thought there was a better view helper though
[20:29:45] cstyles: rakm: there???s also <%= action_name %>
[20:29:54] CheckYourSix: has joined #RubyOnRails
[20:30:21] rakm: cstyles nice, i thought i tried that, but i didn't. i guess these work then
[20:30:38] mag42c: has joined #RubyOnRails
[20:31:03] cstyles: yep! here???s the guide for it: http://guides.rubyonrails.org/action_controller_overview.html#routing-parameters
[20:31:32] baweaver: has joined #RubyOnRails
[20:34:36] nettoweb: has joined #RubyOnRails
[20:35:02] TeckniX: has joined #RubyOnRails
[20:35:15] beauby: has joined #RubyOnRails
[20:35:23] rgtk: has joined #RubyOnRails
[20:35:24] pydave6367: has joined #RubyOnRails
[20:37:56] shivil: has joined #RubyOnRails
[20:41:36] riotjones: has joined #RubyOnRails
[20:41:51] safety_cut: has joined #RubyOnRails
[20:43:56] safety_cut: has joined #RubyOnRails
[20:44:05] ischwartz: has joined #RubyOnRails
[20:44:23] Lytol: has joined #RubyOnRails
[20:44:25] dionysus69: has joined #RubyOnRails
[20:44:43] ischwartz: I'm having an issue on an app I'm using with Nokogiri
[20:45:03] roshanavand: has joined #RubyOnRails
[20:45:20] ischwartz: I'm scraping a subreddit, The app scrapes the titles of all the posts on /r/quotes/new
[20:45:33] rickmasta: has joined #RubyOnRails
[20:45:36] ischwartz: def link links = @textpage.css('div.link a.title') links[rand(25)] end
[20:45:48] ischwartz: def text "#{link.text}" end
[20:46:05] rhizome: doesn't reddit have an api?
[20:46:18] ischwartz: probably but then I wouldn't get to learn about webscraping
[20:46:53] ischwartz: anyway, the issue isn't the scraping, but if I have the text more than once on the page, it chooses a random one again
[20:47:06] rhizome: that's like saying washing your dishes prevents you from learning how to strategically place food on a plate
[20:47:23] NBarnes: has joined #RubyOnRails
[20:47:46] rhizome: anyway, you'd probably want a .first of some kind
[20:47:53] ischwartz: I'm using reddit as a convenient site to learn about web scraping. I could have chosen anything, but it's not really the point
[20:48:56] smathy: ischwartz, so store the random result in an instance variable that you only set if not set.
[20:49:39] ischwartz: like @link ||= links[rand(25) ?
[20:50:18] Gustavo: has joined #RubyOnRails
[20:51:06] smathy: That's one way, yes.
[20:51:28] yardenbar: has joined #RubyOnRails
[20:51:35] EminenceHC: has joined #RubyOnRails
[20:51:43] ischwartz: what way would you recommend?
[20:52:01] yashinbasement: has joined #RubyOnRails
[20:52:19] oflannabhra: has joined #RubyOnRails
[20:52:29] ischwartz: oh that worked great
[20:52:34] smathy: ischwartz, you're welcome.
[20:53:46] draken: has joined #RubyOnRails
[20:54:12] draken: How would i go about using jquery to remove a div that has a 'id' of lets say 5 etc
[20:55:28] yfeldblum: has joined #RubyOnRails
[20:56:02] smathy: Draken, https://goo.gl/xCSKhQ
[20:58:00] zorbash: has joined #RubyOnRails
[20:58:44] roshanavand: has joined #RubyOnRails
[21:00:15] jobewan: has joined #RubyOnRails
[21:00:29] vigintas: has joined #RubyOnRails
[21:00:52] MartinElvar: has joined #RubyOnRails
[21:00:57] mag42c: has left #RubyOnRails: ()
[21:01:14] mag42c: has joined #RubyOnRails
[21:01:49] GriffinHeart: has joined #RubyOnRails
[21:02:27] _djbkd: has joined #RubyOnRails
[21:02:37] nogic: has joined #RubyOnRails
[21:03:09] arthurix: has joined #RubyOnRails
[21:04:10] sp1rs: has joined #RubyOnRails
[21:04:41] nogic_: has joined #RubyOnRails
[21:04:47] Shoutsid: has joined #RubyOnRails
[21:05:45] cac: has joined #RubyOnRails
[21:05:50] stevenw_: I've set 'set :linked_files, fetch(:linked_files, []).push('config/secrets.yml', 'config/database.yml')' in my capistrano deploy file, but the secrets file isn't being copied to the app/config file. Is there something else I need to set?
[21:06:41] rhizome: should they be copied or linked?
[21:07:14] mag42c: has left #RubyOnRails: ()
[21:07:27] mag42c: has joined #RubyOnRails
[21:08:13] Radar: stevenw_: Where is config/secrets.yml on your production server? Is it at /path/to/your/app/shared?
[21:08:19] stevenw_: I'm getting the error that I need to set secret vars
[21:08:20] Gustavo: has joined #RubyOnRails
[21:08:29] EminenceHC: has joined #RubyOnRails
[21:08:47] stevenw_: I assume the file in app/config/secrets.yml will be the same as the one in my shared/ folder. Is that wrong?
[21:08:49] rhizome: normal when they aren't found
[21:09:08] rhizome: based on what you've typed, it should be symlinked from there
[21:10:25] Radar: stevenw_: If it's just the same one then it's failing because ENV['SECRET_KEY_BASE'] is not set.
[21:11:02] kadoppe: has joined #RubyOnRails
[21:11:24] Radar: stevenw_: This is what your shared/secrets.yml should look like" https://gist.github.com/radar/8f0195a1ff16ae9bb64d
[21:11:33] Radar: stevenw_: Don't use that value because it's a public value. Generate your own value with `rake secret`.
[21:12:06] stevenw_: Radar: I'm trying to copy or link the file over to the app when I deploy
[21:12:19] Scient: has joined #RubyOnRails
[21:12:20] momomomomo: has joined #RubyOnRails
[21:12:20] yardenbar: has joined #RubyOnRails
[21:12:24] Radar: ACTION rubs bridge of nose
[21:12:25] mag42c: has left #RubyOnRails: ()
[21:12:44] mag42c: has joined #RubyOnRails
[21:12:49] Radar: stevenw_: Does your production key have a secret_key base key which is set to ENV['SECRET_KEY_BASE'], or is it set to an actual value?
[21:12:58] Radar: This is inside of secrets.yml
[21:13:05] Radar: Does it look like the gist I just linked
[21:13:26] stevenw_: Radar: Not in the app, but that's what it looks like in my actual secrets.yml
[21:13:59] Senjai: has joined #RubyOnRails
[21:14:15] Radar: stevenw_: That does not conclusively answer my question. Please be more precise.
[21:14:22] Radar: stevenw_: If it's using ENV, say "it's using ENV".
[21:14:34] choke: has joined #RubyOnRails
[21:14:39] mag42c: is there a way to have custom polymorphic routes? I currently have edit_polymorphic_path(object) but would like to have archive_polymorphic_path(object) as well
[21:14:40] yardenbar: has joined #RubyOnRails
[21:15:11] Radar: mag42c: [:archive, object]
[21:15:19] Radar: mag42c: accomplishes the same thing
[21:15:28] Radar: Just that. No polymorphic_path mumbo-jumbo.
[21:15:48] The_Ball: has joined #RubyOnRails
[21:15:50] blackmesa: has joined #RubyOnRails
[21:15:53] rhizome: i still like to include it for clarity
[21:15:55] capin: how could I preserve the file name of file being uploaded to an API using the refile gem, currently the files are being saved within the rails with long string chars as the filename :l
[21:16:08] rhizome: polymorphic_path(:edit, object)
[21:16:14] rhizome: might need brackets
[21:16:37] stevenw_: Radar: shared/config/secrets.yml is not using ENV['SECRET_KEY_BASE']
[21:16:45] Radar: stevenw_: Thank you.
[21:16:50] Radar: stevenw_: Then I don't know why it would still be broken.
[21:16:52] The_Ball: can I use a url containing parameters like this: localhost:3000/index?a=1&a=2 to get params set to [a = [1, 2]] ?
[21:17:10] Radar: The_Ball: index?a[]=1&a[]=2
[21:17:26] The_Ball: Radar, ah, is that what that [] does
[21:17:32] Radar: The_Ball: indeed
[21:17:35] Radar: bbl, walking to work
[21:17:49] The_Ball: excellent, thanks
[21:17:50] stevenw_: stevenw_: thanks
[21:17:55] Encapsulation: has joined #RubyOnRails
[21:18:33] stevenw_: radar: thanks]
[21:18:40] Maletor: has joined #RubyOnRails
[21:18:43] konrath: has joined #RubyOnRails
[21:19:55] aarkerio: has joined #RubyOnRails
[21:21:08] iamdevnul: is there a preferred way in rails to get all the has many relations of a collections?
[21:21:23] quazimodo: has joined #RubyOnRails
[21:21:33] iamdevnul: for instance, there's a library model which has_many books and a book has_many pages, to get a collection of all of the pages
[21:22:04] dionysus69: has joined #RubyOnRails
[21:22:22] LambdaSource: has joined #RubyOnRails
[21:23:25] dionysus69: evening all I am back from mini break
[21:23:34] rromanchuk: has joined #RubyOnRails
[21:23:36] dikaio: has joined #RubyOnRails
[21:24:14] rromanchuk: has joined #RubyOnRails
[21:24:29] Maletor: has joined #RubyOnRails
[21:28:02] Shoutsid: has joined #RubyOnRails
[21:29:58] Aeyrix: Good news.
[21:30:07] dionysus69: has joined #RubyOnRails
[21:30:33] Coldblackice: has joined #RubyOnRails
[21:32:23] cryptocronus_: has joined #RubyOnRails
[21:32:23] mary5030: has joined #RubyOnRails
[21:32:24] llakey: has joined #RubyOnRails
[21:32:57] chrisja: has joined #RubyOnRails
[21:33:40] ankhers: has joined #RubyOnRails
[21:34:20] petricore: has joined #RubyOnRails
[21:34:25] rromanchuk: has joined #RubyOnRails
[21:36:59] stamina: has joined #RubyOnRails
[21:37:08] duderonomy: has joined #RubyOnRails
[21:38:04] idis: has joined #RubyOnRails
[21:38:12] EminenceHC: has joined #RubyOnRails
[21:38:56] arthurnn: has joined #RubyOnRails
[21:39:37] mag42c: Radar: Thanks!
[21:40:41] cstyles: has joined #RubyOnRails
[21:41:25] hephaestus_rg: has joined #RubyOnRails
[21:44:31] Shoutsid: has joined #RubyOnRails
[21:46:06] n1lo: has joined #RubyOnRails
[21:46:23] ModusPwnens: has joined #RubyOnRails
[21:47:22] chouhoul_: has joined #RubyOnRails
[21:47:49] ModusPwnens: When should I consider packaging something as a model? Right now, the entity in question is not persisted. It's populated using GETs to other services, and there is some sort of massaging with the response of that call to display it in a view-friendly way. Does it make sense to put that in a non-active record model, or does it suffice to just use helpers to prettify it for the view?
[21:47:50] sdwrage: has joined #RubyOnRails
[21:50:28] chouhoul_: has joined #RubyOnRails
[21:50:39] rails289: has joined #RubyOnRails
[21:50:57] jenrzzz: has joined #RubyOnRails
[21:52:03] rickmasta: has joined #RubyOnRails
[21:52:31] leeky: has joined #RubyOnRails
[21:52:45] Radar: ModusPwnens: Sounds like a model to me.
[21:52:56] Radar: ModusPwnens: Is there any particular reason why you're not storing a representation of that data locally too?
[21:53:05] Radar: ModusPwnens: Is the request quick enough that you don't need to do that?
[21:53:53] ss_much: has joined #RubyOnRails
[21:54:20] ModusPwnens_: has joined #RubyOnRails
[21:54:53] oflannabhra: has joined #RubyOnRails
[21:54:56] jessemcgilallen: has joined #RubyOnRails
[21:54:58] ModusPwnens: has joined #RubyOnRails
[21:55:05] ModusPwnens: Radar: Sorry about that, I disconnected.
[21:55:14] roshanavand: has joined #RubyOnRails
[21:55:16] ModusPwnens: Radar: Could you repeat your questions? I lost the chyat.
[21:55:39] Radar: ModusPwnens: http://logs.ryanbigg.com/RubyOnRails#4381705
[21:55:40] havenwood: ModusPwnens: Logs: http://logs.ryanbigg.com/RubyOnRails
[21:55:45] Radar: havenwood: snap :)
[21:55:51] havenwood: Radar: touche
[21:56:25] ModusPwnens: Radar: Oh dang. I didn't know about that. And now looking at the title at the top, I see that it's there. I feel silly now.
[21:56:52] Radar: ModusPwnens: heh :) Some things are more obvious in hindsight.
[21:57:06] ModusPwnens: Radar: I'm not storing a local representation because the request is quick enough that we can simply wait for it to return and then dump the results on the page.
[21:57:24] Radar: Then chucking it in app/models is fine imo
[21:57:50] ModusPwnens: Radar: I always thought things only go into the models folder if they have some sort of underlying database interaction.
[21:58:15] ModusPwnens: Radar: Is that the wrong heuristic to use when trying to decide what to create as a "model"?
[21:58:15] Radar: ModusPwnens: imo they are classes that fetch data from a datastore, not necessarily a database.
[21:58:32] cac: has joined #RubyOnRails
[21:58:54] jessemcgilallen: has joined #RubyOnRails
[21:59:35] ModusPwnens: Radar: In that case, when does something turn from a service object into a model?
[21:59:55] Shoutsid: has joined #RubyOnRails
[22:00:02] safety_cut: has joined #RubyOnRails
[22:00:08] LambdaSource: has joined #RubyOnRails
[22:00:32] jobewan: has joined #RubyOnRails
[22:00:59] zorbash: has joined #RubyOnRails
[22:01:41] cstyles: capin: take a look at the ???Additional metadata??? section of the readme: https://github.com/refile/refile#additional-metadata
[22:03:01] chipotle: has joined #RubyOnRails
[22:03:10] cac: has joined #RubyOnRails
[22:03:39] baweaver: has joined #RubyOnRails
[22:05:28] sdwrage: has joined #RubyOnRails
[22:05:33] mag42c_: has joined #RubyOnRails
[22:06:19] yfeldblum: has joined #RubyOnRails
[22:07:13] rickmasta: has joined #RubyOnRails
[22:09:07] Gustavo: has joined #RubyOnRails
[22:10:02] dionysus69: has joined #RubyOnRails
[22:11:35] jessemcgilallen: has joined #RubyOnRails
[22:11:52] d5sx43: has joined #RubyOnRails
[22:12:14] simkessy: is there a better way to write this
[22:12:15] simkessy: @card = params[:stripeToken].present? ? params[:stripeToken] : params[:stripeCard]
[22:12:52] rhizome: that doesn't make sense
[22:12:55] simkessy: would this work the same
[22:12:55] simkessy: @card = params[:stripeToken] || params[:stripeCard]
[22:13:17] sankaber: has joined #RubyOnRails
[22:13:19] hephaestus_rg: has joined #RubyOnRails
[22:13:39] pydave6367: has joined #RubyOnRails
[22:14:09] sankaber: has joined #RubyOnRails
[22:14:20] rhizome: stripeToken points to a transaction record, not a card
[22:14:47] ericjphillips: has joined #RubyOnRails
[22:15:09] smathy: simkessy, that's not the same thing.
[22:15:32] smathy: @card = params[:stripeToken].presence || params[:stripeCard]
[22:16:08] simkessy: smathy: won't presence return true/false?
[22:16:41] simkessy: so if stroketoken is present @card = true (instead of the token)
[22:17:34] RegulationD: has joined #RubyOnRails
[22:18:51] simkessy: this is what I'd get doing a presence check: NameError: undefined local variable or method `params' for main:Object
[22:19:13] smathy: simkessy, no, look it up.
[22:20:18] beauby: has joined #RubyOnRails
[22:20:19] simkessy: ah i see, yea that's pretty much what I'm going for
[22:20:27] smathy: simkessy, not sure what your last comment meant, params is undefined?
[22:20:28] siddart: has joined #RubyOnRails
[22:20:31] Ropeney: has joined #RubyOnRails
[22:20:49] nertzy: has joined #RubyOnRails
[22:20:49] simkessy: I tried it in the console and got that error
[22:21:07] simkessy: but that's cause 'params' doesnt exist in the console so nvm
[22:21:07] smathy: simkessy, right, of course. `params` is a controller method.
[22:21:20] lagweezle: simkessy: I suspect you won't have a params outside of a controller handling a request.
[22:21:30] macowie: params won't exist outside of a request in a controller
[22:21:39] trosborn: has joined #RubyOnRails
[22:21:44] simkessy: yea my mistake
[22:21:52] simkessy: smathy's solution should work fine
[22:21:53] tuelz: has joined #RubyOnRails
[22:21:55] simkessy: thank you all
[22:22:02] smathy: simkessy, you're welcome.
[22:22:37] TeckniX: has joined #RubyOnRails
[22:24:31] d5sx43: has joined #RubyOnRails
[22:24:48] bphogan_afk: has joined #RubyOnRails
[22:24:56] Trynemjoel: has joined #RubyOnRails
[22:26:16] ericjphillips: has joined #RubyOnRails
[22:27:34] wethu: has joined #RubyOnRails
[22:27:46] rakm: has joined #RubyOnRails
[22:27:59] EminenceHC: has joined #RubyOnRails
[22:29:04] bphogan_afk: has joined #RubyOnRails
[22:31:07] bphogan_afk: has joined #RubyOnRails
[22:31:17] safety_cut: has joined #RubyOnRails
[22:33:10] Pupeno: has joined #RubyOnRails
[22:33:10] Pupeno: has joined #RubyOnRails
[22:33:39] baweaver: has joined #RubyOnRails
[22:35:23] trosborn: has joined #RubyOnRails
[22:39:42] willharrison: has joined #RubyOnRails
[22:39:59] _wldcordeiro: has joined #RubyOnRails
[22:40:22] cryptocronus: has joined #RubyOnRails
[22:42:24] riotjones: has joined #RubyOnRails
[22:43:29] beauby: has joined #RubyOnRails
[22:44:40] ericjphillips: has joined #RubyOnRails
[22:45:10] rodfersou: has joined #RubyOnRails
[22:45:15] Salve: has joined #RubyOnRails
[22:46:42] quazimodo: has joined #RubyOnRails
[22:46:44] jgt: has joined #RubyOnRails
[22:48:00] walkingtoast: has joined #RubyOnRails
[22:48:58] nogic: has joined #RubyOnRails
[22:49:32] seank_: has joined #RubyOnRails
[22:55:06] kshah: has left #RubyOnRails: ()
[23:00:15] Scriptonaut: has joined #RubyOnRails
[23:00:44] cstyles: has joined #RubyOnRails
[23:01:01] wildlander: has joined #RubyOnRails
[23:01:40] wildlander: has joined #RubyOnRails
[23:01:43] nertzy: has joined #RubyOnRails
[23:02:32] nogic: has joined #RubyOnRails
[23:03:59] tuelz: has joined #RubyOnRails
[23:04:16] blackhuey: has joined #RubyOnRails
[23:05:32] jessemcgilallen: has joined #RubyOnRails
[23:05:36] dideler: has joined #RubyOnRails
[23:05:45] yfeldblum: has joined #RubyOnRails
[23:05:45] Maletor: has joined #RubyOnRails
[23:06:12] chouhoulis: has joined #RubyOnRails
[23:06:41] dopamean_: has joined #RubyOnRails
[23:08:14] hooper: has joined #RubyOnRails
[23:10:17] yfeldblum: has joined #RubyOnRails
[23:11:35] baweaver: has joined #RubyOnRails
[23:12:33] hahuang65: has joined #RubyOnRails
[23:14:05] GeissT: has joined #RubyOnRails
[23:15:36] jgpawletko: has joined #RubyOnRails
[23:16:45] qejk: has joined #RubyOnRails
[23:17:52] Scriptonaut: has left #RubyOnRails: ()
[23:19:20] darrencauthon: has joined #RubyOnRails
[23:21:08] SteenJobs: has joined #RubyOnRails
[23:21:27] barhum2013: has joined #RubyOnRails
[23:21:31] bendangelo: has joined #RubyOnRails
[23:23:18] EminenceHC: has joined #RubyOnRails
[23:26:34] chills42: has joined #RubyOnRails
[23:34:00] cleopatra: has joined #RubyOnRails
[23:38:03] stardiviner: has joined #RubyOnRails
[23:38:35] arthurix_: has joined #RubyOnRails
[23:38:39] nogic: has joined #RubyOnRails
[23:49:34] RegulationD: has joined #RubyOnRails
[23:50:19] seank_: has joined #RubyOnRails
[23:52:05] cryptocronus: has joined #RubyOnRails
[23:52:16] iateadonut: has joined #RubyOnRails
[23:54:29] ishikawa91: has joined #RubyOnRails
[23:55:59] smathy: has joined #RubyOnRails
[23:57:53] Gustavo: has joined #RubyOnRails
[23:58:28] sevenseacat: has joined #RubyOnRails
[23:59:03] oflannabhra: has joined #RubyOnRails
[23:59:16] nettoweb: has joined #RubyOnRails
[23:59:34] reptilain_brain: has joined #RubyOnRails