« Back to channel list

#RubyOnRails - 23 July 2015

« Back 1 day Forward 1 day »
[00:00:02] Kalov: has joined #RubyOnRails
[00:00:06] Radar: Papierkorb: example of what you're trying to do, please.
[00:00:18] Kalov: hi, any tutorial for using Postgres?
[00:00:26] Radar: Kalov: in what context?
[00:00:33] Lightsword: has joined #RubyOnRails
[00:00:59] Kalov: for beginners
[00:01:08] Kalov: i'm on rails ofc
[00:01:14] Papipo: Papierkorb: usually you will be sending a hash of parameters, that's why require() only accepts a key
[00:01:17] Radar: Kalov: gem 'pg'
[00:01:24] Papierkorb: Radar: http://pastie.org/private/jjbgez6zwhhpxee7xgudaq
[00:01:26] Radar: Kalov: change config/database.yml to use postgresql as the adapter
[00:01:27] Radar: Kalov: done
[00:01:40] Radar: Papierkorb: params.permit(:name, :email, :password
[00:01:49] Papipo: For example when creating a Post, you will require(:post).permit(:title ...)
[00:01:52] Papierkorb: Papipo: I'm using JSON there, and even in that hash, I'd want to check for 'valid' content
[00:01:54] Radar: Papierkorb: Then pass that hash to your user model.
[00:02:03] Radar: Papierkorb: The user model has the validations for the required-ness of those fields.
[00:02:06] Kalov: yes Radar, i asking a tutorial of how using it
[00:02:12] Kalov: i already have it on
[00:02:13] Radar: Kalov: I just gave you one
[00:02:34] Radar: Kalov: Your question is very vague and open ended. Are you having trouble with a particular feature of Rails + PostgreSQL interop?
[00:02:54] Kalov: i don't know anything of postgre
[00:03:10] Radar: Kalov: What do you know then? SQLite? MySQL?
[00:03:23] Papierkorb: Radar: yeah that's good enough there. thanks
[00:03:25] Kalov: no nothing, i'm new
[00:03:46] Radar: Kalov: Start with what I have told you and then when something breaks, tell us what breaks and we'll help you fix it.
[00:03:57] Radar: Kalov: There's nothing more a tutorial could tell you than I already have.
[00:04:07] Scripore: has joined #RubyOnRails
[00:04:15] graft: has joined #RubyOnRails
[00:04:26] graft: can someone explain this whole "cannot render console from XXX" in my logs to me?
[00:05:05] Radar: graft: !gist the full and complete error please
[00:05:05] helpa: graft: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[00:05:38] RegulationD: has joined #RubyOnRails
[00:06:09] graft: https://gist.github.com/graft/5dcd5ed214b5e4308fd3
[00:06:28] graft: has something to do with web-console, whatever the hell that is
[00:06:38] Radar: graft: You can remove web-console from your Gemfile
[00:06:51] Radar: Yet another ridiculous addition to Rails Gemfiles that 37signals thinks is great to have on-by-default
[00:07:27] graft: wait, this thing renders a ruby console in my browser?
[00:07:52] Papipo: apparently not :P
[00:08:12] graft: yeah... okay, so i should just axe this gem
[00:08:24] Radar: graft: Think of it like better-errors if you've ever seen it
[00:08:42] Radar: It's ridiculous that Rails had to do their own version.
[00:08:52] graft: since it seems to be blocking errors in my dev logs, i fail to see how it is better
[00:08:54] Aeyrix: Is it, really?
[00:08:58] Aeyrix: It's pretty much the Rails way.
[00:09:11] Aeyrix: Rails has a larger case of NIHS than Microsoft.
[00:09:14] Radar: Turbolinks replaces the SPA, jbuilder replaces AMS, web-console replaces better_errors...
[00:09:21] workmad3: has joined #RubyOnRails
[00:09:27] Radar: Aeyrix: It's 37S that does it.
[00:09:43] Radar: I get so caremad about 37S introducing features that are halfbaked
[00:09:48] Radar: Oh and ActionCable replaces Faye
[00:10:06] simplyianm: has joined #RubyOnRails
[00:10:13] Radar: Do you know who wrote http://edgeguides.rubyonrails.org/asset_pipeline.html ?
[00:10:17] Papipo: is this all rails 5 stuff?
[00:10:23] Radar: I wrote that guide because DHH & friends were too fucking lazy to
[00:10:24] Papipo: because I haven't heard of half of it
[00:10:39] bonhoeffer: has joined #RubyOnRails
[00:10:41] Aeyrix: Radar: you?
[00:10:45] Radar: Papipo: Turbolinks + jbuilder + web-console are Rails 4 / 4.2 new things, ActionCable will (probably) be in Rails 5.
[00:11:08] Papipo: I know turbolinks and jbuilder, but not web-console
[00:11:11] Aeyrix: Radar: Should probably mention how garbage Turbolinks and jbuilder are in that guide. ;)
[00:11:15] Radar: DHH needs to stop writing code and run a business. He's only good at one of those two things.
[00:11:33] Papipo: he might write a business
[00:11:48] logik-bomb: ok, I'm a bit lost here. Album as_many photos and accepts_nested_resources for photos.. Is it possible to save my photos even when the album validation fails?
[00:11:55] Aeyrix: Radar: This talk is making me want to start learning another framework. Stoooop.
[00:11:55] Papipo: wasn't faye good enough?
[00:12:01] Aeyrix: Papipo: Faye was NIH.
[00:12:11] Radar: OH! and rbenv
[00:12:15] Aeyrix: That's the ONLY reason.
[00:12:17] Aeyrix: Radar: STOP
[00:12:23] Aeyrix: Don't make me cubify it.
[00:12:25] pipework: Ooh, it's whinge hour!
[00:12:32] Aeyrix: Go away pipework.
[00:12:35] pipework: Aeyrix: rood!
[00:12:39] pipework: Also, hi Aeyrix.
[00:12:45] Aeyrix: Long time no see.
[00:12:49] Papipo: rbenv instead of what
[00:12:56] pipework: At the time, rvm.
[00:13:02] pipework: chruby+ruby-install pls
[00:13:05] Aeyrix: To be fair, RVM is awful.
[00:13:08] Sypheren_: has left #RubyOnRails: ()
[00:13:12] Aeyrix: The only good RVM command is rvm implode.
[00:13:12] Papipo: I still use it xD
[00:13:14] sypheren: has joined #RubyOnRails
[00:13:19] pipework: awful good at too many edge cases though.
[00:13:21] sypheren: Radar, on your tutorial where you have us push to github on a server called origin, it's telling me that it couldn't read from the remote repository. Is this because origin is a made up server?
[00:13:22] Radar: Aeyrix: I have never agreed so strongly with you.
[00:13:29] pipework: Radar: Probably a sign.
[00:13:32] Radar: Sypheren: Which tutorial?
[00:13:44] sypheren: Or is something happening that shouldnt? R4IA
[00:13:47] Aeyrix: Radar: mind if i pm about
[00:13:49] Aeyrix: #lifestyle
[00:13:50] Radar: Sypheren: You haven't setup your git remote
[00:13:51] Radar: Aeyrix: sure
[00:14:09] Radar: Sypheren: git remote add origin git@github.com:Sypheren/rails_4_in_action
[00:14:20] Aeyrix: > not using Mercurial
[00:14:24] Aeyrix: it's like you hate yourselves
[00:14:29] sypheren: I have done this, but created a repository for /ticketee.git
[00:14:45] pipework: ACTION loves git doe
[00:14:52] richipargo: has joined #RubyOnRails
[00:15:06] sypheren: Dude, git is amazing. I can't even seem to use it correctly and I recognize that it's amazing
[00:15:24] Radar: Sypheren: "git remote show origin" plz
[00:15:48] sypheren: permission denied (publickey)
[00:16:05] sypheren: ACTION panics
[00:16:10] Aeyrix: You need to add your public key to Github.
[00:16:20] Aeyrix: Have you generated an SSH key?
[00:16:27] pipework: Sypheren: Look at your .git/config for the remote config section.
[00:16:30] sypheren: I have not. I will look up how to do this
[00:16:43] Aeyrix: Linux or OS X?
[00:16:45] Aeyrix: Or Windows?
[00:16:47] sypheren: Thanks guys :>
[00:17:03] Aeyrix: I don't even know how to generate a key on Windows.
[00:17:06] pipework: Oh look! Something pressing I must do with haste.
[00:17:16] sypheren: I can find out how- XD
[00:17:16] mrbubbles: has joined #RubyOnRails
[00:17:51] Radar: If only there was some kind of document for this
[00:18:05] Radar: https://help.github.com/articles/generating-ssh-keys/#platform-windows
[00:18:17] sypheren: But I was looking it up D:
[00:18:42] sypheren: But thank you
[00:19:18] Papipo: I hate it when I find unmaintained relevant repos
[00:19:38] Papipo: some are even just a couple of years old, but that's enough
[00:19:51] bricker: Papipo: example?
[00:20:18] Papipo: erm... 90% of the stuff you can find on internet?
[00:20:49] pipework: I like waffles.
[00:21:16] Papipo: this one for example https://github.com/ayosec/adminful
[00:21:38] Papipo: I am looking for a backend agnostic admin ui
[00:21:40] pontiki: To get people to think for themselves, don't give them all the answers.
[00:21:41] pontiki: ??? Irene Nolan, editor.
[00:22:13] drale2k: has joined #RubyOnRails
[00:23:06] fgo_: has joined #RubyOnRails
[00:24:04] user1138: has joined #RubyOnRails
[00:24:07] Papierkorb: You know that magic moment, when you're ready to testdrive a new feature you've just built in your browser, click the link or button or whatever to make the request .. just to notice you forgot to bind some JS to that thing?!
[00:24:16] htmldrum: has joined #RubyOnRails
[00:25:10] Aeyrix: Papierkorb: I call that moment "time for another coffee"
[00:25:46] bricker: speaking of which...
[00:26:57] Aeyrix: Mine needs some Jameson's in it.
[00:27:53] blackmes1: has joined #RubyOnRails
[00:29:29] Supertanker2: has joined #RubyOnRails
[00:31:11] Aeyrix: the obtuseness of Git
[00:31:16] Aeyrix: makes me want to build a v. simple DCVS
[00:31:55] Radar: We've got enough of those :P
[00:32:19] Aeyrix: One not written in Python.
[00:32:24] Aeyrix: I'd probably write it in Go.
[00:33:04] paulcsmith: has joined #RubyOnRails
[00:36:30] FCser: has joined #RubyOnRails
[00:38:33] simplyianm: has joined #RubyOnRails
[00:38:41] bricker: Aeyrix: and how would it be better/different from Git?
[00:38:50] pontiki: it'd be there's
[00:38:53] pipework: bricker: It would be different, therefore better.
[00:39:05] bricker: ah yes, ye olde NIH
[00:39:10] pipework: pontiki: Drink more/less.
[00:39:20] pontiki: then i won't give a shit
[00:39:29] tweeeaks: has joined #RubyOnRails
[00:42:25] eggoez: has joined #RubyOnRails
[00:45:14] segy: has joined #RubyOnRails
[00:45:23] sonofdirt: has joined #RubyOnRails
[00:46:44] insu: has joined #RubyOnRails
[00:50:44] Mweshi_: has joined #RubyOnRails
[00:52:10] tuelz: has joined #RubyOnRails
[00:54:05] workmad3: has joined #RubyOnRails
[00:57:09] webguynow: has joined #RubyOnRails
[00:59:33] gorums: has left #RubyOnRails: ()
[00:59:50] bungoman: has joined #RubyOnRails
[01:00:00] VeryBewitching: Don't solve solved problems.
[01:02:31] Mendenhall: has joined #RubyOnRails
[01:07:55] eggoez: has joined #RubyOnRails
[01:08:20] JeramyRR: has joined #RubyOnRails
[01:08:21] chipotle: has joined #RubyOnRails
[01:08:38] bonhoeffer: has joined #RubyOnRails
[01:09:54] segy: has joined #RubyOnRails
[01:10:08] bungoman_: has joined #RubyOnRails
[01:11:03] giowong: has joined #RubyOnRails
[01:11:50] giowong: how do i get to a nested attribute in a many to many relationship?
[01:11:55] giowong: in rails console
[01:12:24] NodeNagant: has joined #RubyOnRails
[01:12:38] bonhoeffer: has joined #RubyOnRails
[01:14:11] Aeyrix: giowong: A nested attribute?
[01:14:57] giowong: i have a clients model that has many themes, and the themes has many clients
[01:15:03] htmldrum: has joined #RubyOnRails
[01:15:09] giowong: i was wondering how i access them in the console.
[01:15:12] giowong: clients.themes right?
[01:15:35] Radar: what is clients?
[01:15:35] NodeNagant: has joined #RubyOnRails
[01:15:40] Radar: client.themes should work
[01:15:47] Radar: clients.themes won't work unless clients is defined as a single client instance.
[01:18:15] k4nd4lf: has joined #RubyOnRails
[01:19:29] giowong: ok im getting a error im not sure how to fix
[01:20:04] giowong: https://gist.github.com/gwong89/f7aecb47ddb95013b5ed
[01:20:20] giowong: originally i had a relationship set up liek this
[01:20:35] htmldrum: has joined #RubyOnRails
[01:20:48] giowong: a client has many themes, and themes belong to client with foreign_key "client_id"
[01:21:10] Papipo: has left #RubyOnRails: ()
[01:21:15] giowong: but i realized that didnt work and changed to has_and_belongs_to_many for both sides
[01:21:21] giowong: not sure how to fix
[01:21:34] robbyoconnor: has joined #RubyOnRails
[01:22:01] christiandsg: has joined #RubyOnRails
[01:22:16] inoter: has joined #RubyOnRails
[01:25:25] bronson: has joined #RubyOnRails
[01:28:18] strcmp2: has joined #RubyOnRails
[01:28:41] jgpawletko: has joined #RubyOnRails
[01:29:43] charliesome: has joined #RubyOnRails
[01:31:59] waka: has joined #RubyOnRails
[01:32:43] nickenchuggets: has joined #RubyOnRails
[01:34:42] lethjakman: has joined #RubyOnRails
[01:35:27] fgo_: has joined #RubyOnRails
[01:37:31] pixelhandler: has joined #RubyOnRails
[01:42:45] giowong_: has joined #RubyOnRails
[01:44:29] waka: has joined #RubyOnRails
[01:44:39] Radar: Did you run the migrations?
[01:44:48] EminenceHC: has joined #RubyOnRails
[01:44:50] Radar: looks like the clients_vg_themes table is missing
[01:47:59] giowong_: yeah i found the active record guide and made the table
[01:48:07] giowong_: but now im running into a different problem
[01:48:07] giowong_: https://gist.github.com/gwong89/f7aecb47ddb95013b5ed
[01:48:19] Radar: Looks like the same problem to me.
[01:48:25] Radar: What is the table name?
[01:48:53] kies^: has joined #RubyOnRails
[01:48:55] Radar: is that the join table name or the name of the themes table?
[01:49:04] giowong_: name of the themes table
[01:49:09] Radar: you'll need a join table too
[01:49:15] Radar: client_vg_themes
[01:49:24] Radar: no primary key, and it has a client_id and a vg_theme_id column
[01:49:26] giowong_: to another join table?
[01:49:28] giowong_: i already made one
[01:49:31] Radar: giowong_: What.
[01:49:34] Radar: schema.rb plz
[01:50:19] giowong_: i think the problem is the has_and_belongs_to_many :themes with class_name part
[01:52:13] mike___1234: has joined #RubyOnRails
[01:52:39] shyshy: has joined #RubyOnRails
[01:53:56] giowong_: radar: plsssss
[01:53:57] giowong_: https://gist.github.com/gwong89/f7aecb47ddb95013b5ed
[01:54:08] giowong_: i was suggesting i wasn't sure
[01:54:20] Radar: PG::UndefinedColumn: ERROR: column clients_vg_themes.theme_id does not exist
[01:54:23] Radar: It's right there mate.
[01:57:01] sankaber: has joined #RubyOnRails
[01:57:08] NodeNagant: has joined #RubyOnRails
[01:57:08] drale2k: has joined #RubyOnRails
[01:57:20] giowong_: but in my migration i specified it as vg_theme_id
[01:57:36] one_zero: has joined #RubyOnRails
[01:57:46] giowong_: why is it trying to access theme_id then?
[02:00:45] Scripore: has joined #RubyOnRails
[02:03:52] NodeNagant: has joined #RubyOnRails
[02:07:03] RegulationD: has joined #RubyOnRails
[02:07:48] NodeNagant: has joined #RubyOnRails
[02:10:04] xcesariox: has joined #RubyOnRails
[02:10:10] cpruitt: has joined #RubyOnRails
[02:11:36] helpa: has joined #RubyOnRails
[02:13:14] xcesariox: has joined #RubyOnRails
[02:13:42] tuelz: has joined #RubyOnRails
[02:15:23] rromanchuk: has joined #RubyOnRails
[02:18:54] Radar: You don't specify it in your habtm association
[02:19:00] Radar: change it to theme_id in the table, or change the association
[02:23:27] iamjarvo: has joined #RubyOnRails
[02:25:24] bonhoeffer: has joined #RubyOnRails
[02:28:24] icosa1: has joined #RubyOnRails
[02:31:41] mcr-credil: has joined #RubyOnRails
[02:32:28] waka: has joined #RubyOnRails
[02:35:58] bradleyprice: has joined #RubyOnRails
[02:36:03] Creeves: has joined #RubyOnRails
[02:36:24] fgo: has joined #RubyOnRails
[02:36:30] NodeNagant: has joined #RubyOnRails
[02:39:12] baweaver: has joined #RubyOnRails
[02:40:51] Ropeney: Anyone loving rubymine?
[02:42:54] workmad3: has joined #RubyOnRails
[02:43:01] drale2k: has joined #RubyOnRails
[02:44:34] JasonKe: has joined #RubyOnRails
[02:45:02] iamjarvo: has joined #RubyOnRails
[02:48:02] nahtnam: has joined #RubyOnRails
[02:49:09] Ropeney: What did you come from using?
[02:50:05] VeryBewitching: I used Kate or vi for years for almost everything.
[02:50:12] VeryBewitching: QtCreator when I need it.
[02:51:29] Ropeney: How'd you find coming from vi? I currently use vi religiously but am loving some of the features I'm seeing in rubymine
[02:52:17] towski_: has joined #RubyOnRails
[02:53:45] VeryBewitching: Ropeney: I don't think I'd use vi for Rails now unless it was remote to the server.
[02:54:14] Aeyrix: > lunch time
[02:54:17] Aeyrix: > reddit is down
[02:54:29] Aeyrix: > hacker news is the same content as yesterday
[02:54:34] christiandsg: has joined #RubyOnRails
[02:55:02] pixelhandler: has joined #RubyOnRails
[02:55:22] tjbiddle: has joined #RubyOnRails
[02:55:22] Ropeney: VeryBewitching: The ctrl-b on methods to jump between files is what looks the handiest to me
[02:56:18] tjbiddle: Hey all. Is there any solution for ensuring system dependencies are installed along with a gem? Or maybe something that keeps track of them? Currently was planning on just keeping track of all of them manually and installing via Chef - but was wondering if I could keep it all isolated within the app *somehow*
[02:56:37] VeryBewitching: Ropeney: Integrating an SQL client, test framework integration, intellisense and generator/rake task integration is like 8% of why I like it. I bought it 13 days into my trial period.
[02:56:54] icaro: has joined #RubyOnRails
[02:57:40] bruno-: has joined #RubyOnRails
[03:00:05] jenrzzz: has joined #RubyOnRails
[03:00:54] Ropeney: VeryBewitching: Im guessing you meant 80% :P
[03:01:01] ChadyG: has joined #RubyOnRails
[03:01:27] LearningCN: has joined #RubyOnRails
[03:03:19] Ropeney: VeryBewitching: Care to share more then?
[03:03:35] VeryBewitching: Ropeney: Just download it and use it for a trial period.
[03:03:45] VeryBewitching: Decide for yourself :D
[03:03:51] earthquake: has joined #RubyOnRails
[03:03:52] a346: has joined #RubyOnRails
[03:04:23] dopie: has joined #RubyOnRails
[03:04:47] Ropeney: I did that a while ago and didnt gert enough play, now i cant seem to clean it off the mac to retry it haha
[03:04:54] Ropeney: so almost convinced to just purchase
[03:06:49] eggoez: has joined #RubyOnRails
[03:07:03] regnartim: has joined #RubyOnRails
[03:07:22] giowong_: how do i update the foreign key in the join table of a has_and_belong_to_many table?
[03:09:51] braincrash: has joined #RubyOnRails
[03:09:53] regnartim: standard `add_foreign_key :table, :other` migration, right?
[03:10:36] djbkd_: has joined #RubyOnRails
[03:12:10] sah_usmc: has joined #RubyOnRails
[03:12:22] VeryBewitching: Ropeney: I can confirm that I'm happy I paid for it.
[03:12:47] zorak8: has joined #RubyOnRails
[03:13:04] sevenseacat: has joined #RubyOnRails
[03:13:07] NodeNagant: has joined #RubyOnRails
[03:13:31] giowong_: regnartim: o i for saving to database
[03:16:49] jenrzzz: has joined #RubyOnRails
[03:17:01] one_zero: has joined #RubyOnRails
[03:17:17] ledestin: has joined #RubyOnRails
[03:17:49] arup_r: has joined #RubyOnRails
[03:18:18] Mendenhall: has joined #RubyOnRails
[03:24:03] mcr-credil: has joined #RubyOnRails
[03:24:36] bmurt: has joined #RubyOnRails
[03:25:21] NodeNagant: has joined #RubyOnRails
[03:25:59] Contigi: has joined #RubyOnRails
[03:26:23] NodeNagant: has joined #RubyOnRails
[03:27:47] Aeyrix: https://twitter.com/da_667/status/624056089978515456
[03:29:23] drale2k: has joined #RubyOnRails
[03:32:10] mojojoel: has joined #RubyOnRails
[03:32:20] giowong: has joined #RubyOnRails
[03:32:52] Rinzlit: has joined #RubyOnRails
[03:32:58] Rinzlit: I'm back :D
[03:33:42] Rinzlit: How is everyone? (even though people are probably afk)
[03:33:56] Radar: I am like Batman
[03:33:59] Radar: You think I'm not here, but I am.
[03:34:30] Rinzlit: lol fair enough xD
[03:34:52] dented42: has joined #RubyOnRails
[03:36:26] sah_usmc: has joined #RubyOnRails
[03:38:41] JoshGlzBrk: has joined #RubyOnRails
[03:40:42] nickenchuggets: has joined #RubyOnRails
[03:42:31] mojojoel: Hey guys, just started doing rails and got a quick question.
[03:42:50] Radar: We have quick answers.
[03:43:03] mojojoel: Have a User table and want to link to Language table - would you recommend has_many or has_many :through?
[03:43:17] Aeyrix: A user has many languages?
[03:43:23] Aeyrix: has_many :languages
[03:43:41] Aeyrix: :through is when you want a one-many relationship through another object.
[03:43:45] darutoko: has joined #RubyOnRails
[03:43:49] chipotle: has joined #RubyOnRails
[03:43:49] Aeyrix: Teacher -> Class -> Student for instance.
[03:43:54] Radar: mojojoel: Is this to indicate the languages that a user can speak?
[03:44:05] Radar: i.e. I can speak 100% good English and 10% OK German :P
[03:44:16] Aeyrix: > 100% good English
[03:44:18] Radar: mojojoel: I would have a has_many :through
[03:44:22] Aeyrix: It's at 90% now.
[03:44:22] sah_usmc: has joined #RubyOnRails
[03:44:34] Radar: mojojoel: users + languages each have their own table, then there's a join table of languages_users
[03:44:59] mojojoel: Yeah I'm wondering if a join table would make more sense than has_many :languages
[03:45:04] Radar: Aeyrix: Because a user can speak many languages, and a language can be spoken by many users.
[03:45:32] Aeyrix: Oops, that'll teach me to read IRC alongside my emails.
[03:46:25] mojojoel: Thanks for the help @Radar @Aeyrix!
[03:46:49] chipotle: has joined #RubyOnRails
[03:47:04] giowong: @radar i asked stack and fixed it, but it only goes one way...
[03:47:14] Radar: giowong: what
[03:47:20] sah_usmc: has joined #RubyOnRails
[03:47:25] giowong: the association problem i was having
[03:47:38] Radar: giowong: gist both models and schema.rb please
[03:48:29] mcr-credil: has joined #RubyOnRails
[03:51:03] bungoman: has joined #RubyOnRails
[03:51:51] giowong: https://gist.github.com/gwong89/f7aecb47ddb95013b5ed
[03:52:16] giowong: client.themes works
[03:53:03] webguynow: has joined #RubyOnRails
[03:53:53] Radar: giowong: You're missing an option on XY::Theme habtm. Please consult the docs.
[03:55:55] giowong: or could you link me the doc please
[03:57:05] Radar: giowong: !g rails has_and_belongs_to_many
[03:57:21] Radar: you're not telling it to use the right column for the field
[03:57:29] Radar: uhh, for the whatever it's called
[03:57:34] Radar: look at the docs. They'll tell you :)
[03:57:49] Aeyrix: fake values
[04:04:56] vigasdeep: has joined #RubyOnRails
[04:05:12] MarkTR: has joined #RubyOnRails
[04:05:56] Lightsword: has joined #RubyOnRails
[04:11:29] htmldrum: has joined #RubyOnRails
[04:12:10] giowong: radar: thanks
[04:12:29] giowong: is association foreign key linked to the join table?
[04:14:39] giowong: is it usually supposed to be name differently from the foreign key?
[04:14:48] giowong: i think i confused my self now
[04:14:52] giowong: stuff is not saving
[04:15:19] drale2k: has joined #RubyOnRails
[04:16:11] Radar: If you want our help with it you know the drill by now
[04:16:16] Radar: And if you don't...
[04:16:16] helpa: https://gist.github.com/996779
[04:17:01] ephantmon: has joined #RubyOnRails
[04:17:37] Obfuscate: has joined #RubyOnRails
[04:19:38] sarink: has joined #RubyOnRails
[04:22:06] mike___1234: has joined #RubyOnRails
[04:22:33] duncannz: has joined #RubyOnRails
[04:22:58] simplyianm: has joined #RubyOnRails
[04:26:41] bronson: has joined #RubyOnRails
[04:28:02] giowong: https://gist.github.com/gwong89/f7aecb47ddb95013b5ed
[04:28:28] simplyianm: has joined #RubyOnRails
[04:29:44] Mendenhall: has joined #RubyOnRails
[04:31:34] workmad3: has joined #RubyOnRails
[04:32:19] LearningCN: has joined #RubyOnRails
[04:33:03] htmldrum: has joined #RubyOnRails
[04:33:26] white_magic: has joined #RubyOnRails
[04:33:46] lxsameer: has joined #RubyOnRails
[04:33:47] lxsameer: has joined #RubyOnRails
[04:33:47] Marquel: has joined #RubyOnRails
[04:34:14] white_magic: hi.. I'm wondering, can someone recommend me a good project(s) to undertake to learn RoR better? All I've done so far is one of the hello world tutorials, where I'm displaying a basic resource with CRUD functionality
[04:34:26] Radar: white_magic: Did you read Rails 4 in Action yet?
[04:34:35] white_magic: is that on the main rails site?
[04:34:40] helpa: 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
[04:34:49] Radar: If you have a GitHub username I can get you free access :)
[04:34:58] lethjakman: has joined #RubyOnRails
[04:35:08] white_magic: i may have one .. but lemme research the book
[04:35:45] mcr-credil: has joined #RubyOnRails
[04:35:48] white_magic: i like the description of the book..
[04:35:55] white_magic: RESTful routing.. i need to grok that
[04:36:50] Radar: I am Ryan Bigg, one of the authors.
[04:37:12] Aeyrix: No you're not.
[04:37:24] iamjarvo: has joined #RubyOnRails
[04:37:30] Radar: http://ryanbigg.com/
[04:37:53] Aeyrix: I tried to launch the ruse cruise.
[04:38:02] Aeyrix: Alas, that battleship was sunk.
[04:38:05] white_magic: Radar, I signed up for an acct
[04:38:09] white_magic: will pm you my acct name
[04:38:39] white_magic: loll rekt indeed
[04:38:45] Radar: white_magic: Done. You should receive an invite in your email.
[04:38:50] white_magic: thank you kindly
[04:39:10] white_magic: the lazy man in me wants to know.. how long does it take to complete the project in your book.. approximately?
[04:39:17] Radar: It's 600 pages long.
[04:39:29] Radar: I'll give you a week :)
[04:39:58] Aeyrix: Rackspace are trying to force me to buy a firewall.
[04:40:02] white_magic: a couple hours a week, eh?
[04:40:03] white_magic: i can do that..
[04:40:22] Aeyrix: It's a shame OVH has such a bad reputation.
[04:40:33] Aeyrix: Their offerings nowadays are really quite good since they separated their brands out.
[04:40:33] Radar: Aeyrix: It's a shame we're hosted there oh wait what
[04:40:39] Aeyrix: OVH? Or Rackspace?
[04:40:50] Radar: bikeexchange.de
[04:40:58] Radar: It went down for 9 hours due to hardware failure at Railscamp
[04:41:01] Radar: That was fun.
[04:41:14] Aeyrix: > their SLA is 3hrs max
[04:41:24] Radar: about that
[04:41:29] Aeyrix: You got refunds right?
[04:41:32] Radar: I think so.
[04:41:36] Radar: I didn't handle the situation.
[04:41:42] Aeyrix: Are you on actual OVH? Or SYS / Kimsufi?
[04:41:52] sp1rs: has joined #RubyOnRails
[04:41:52] Radar: ACTION double checks
[04:41:55] Aeyrix: OVH OVH is exxie as fuck.
[04:42:01] Aeyrix: (Relative to Kimsufi / SYS)
[04:42:07] Aeyrix: $200+/mo generally.
[04:42:23] Radar: Sorry, we're on hetzner, not OVH.
[04:42:33] Aeyrix: Hetzner are okay.
[04:42:41] Aeyrix: I had a few boxen with them.
[04:42:48] Radar: brb helping people IRl
[04:42:55] sevenseacat: give away R4IA to everyone because we arent getting paid for it anyway! \o/
[04:43:05] Aeyrix: You're not getting paid? :|
[04:43:23] sevenseacat: havent seen a cent yet.
[04:43:35] giowong: is there a specific way to save foreign_key id to the association_foreign_key in a join table?
[04:43:36] htmldrum: has joined #RubyOnRails
[04:44:00] giowong: for habtm relationship?
[04:44:54] ephantmon: has joined #RubyOnRails
[04:45:50] schaerli: has joined #RubyOnRails
[04:46:26] vigasdeep: @gen_details.pluck(:id, :genType).each do|id, genType|
[04:46:26] vigasdeep: Above line of code used to work when I was using sqlite database, now that I am using postgres, it started giving error. Does anyone have any idea about this ?
[04:48:11] sevenseacat: depends on the error.
[04:48:18] mblair: has joined #RubyOnRails
[04:48:19] sevenseacat: and depends if you only want help from guys or not
[04:48:34] vigasdeep: PG::UndefinedColumn: ERROR: column "totalgen" does not exist LINE 1: ..."gen_details"."genType" FROM "gen_details" WHERE (totalGen >... ^ : SELECT "gen_details"."id", "gen_details"."genType" FROM "gen_details" WHERE (totalGen > 0)
[04:49:09] vigasdeep: But problem is that I have not used keywork totalGen anywhere in the code
[04:49:22] sevenseacat: you must have
[04:50:59] sah_usmc: has joined #RubyOnRails
[04:51:51] mblair_: has joined #RubyOnRails
[04:52:20] Aeyrix: > considering saying 'no' to rackspace
[04:52:29] Aeyrix: i wonder if there's a channel for hosting providers
[04:52:56] sah_usmc: has joined #RubyOnRails
[04:55:10] one_zero: has joined #RubyOnRails
[04:59:23] adavia: anyone familiar with private pub
[05:01:57] htmldrum: has joined #RubyOnRails
[05:02:27] marr: has joined #RubyOnRails
[05:02:27] giowong: https://gist.github.com/gwong89/f7aecb47ddb95013b5ed
[05:02:27] drale2k: has joined #RubyOnRails
[05:02:46] giowong: can someone tell me what i'm doing wrong that not saving my ids between the relationships?
[05:05:40] riotjones: has joined #RubyOnRails
[05:06:58] filipechagas: has joined #RubyOnRails
[05:08:11] CheckYourSix: has joined #RubyOnRails
[05:09:24] madebymarkca: has joined #RubyOnRails
[05:09:25] srinidhi: has joined #RubyOnRails
[05:09:54] Maletor: has joined #RubyOnRails
[05:09:56] chrissonar: has joined #RubyOnRails
[05:12:54] aganov: has joined #RubyOnRails
[05:13:04] arooni-mobile: has joined #RubyOnRails
[05:13:42] Rinzlit: Specifically for opinions: Do I want nice videos or a book for either do I want the noob friendly or the hard way?
[05:13:57] Rinzlit: For learning ruby
[05:16:02] helpa: 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
[05:16:12] Aeyrix: Wait has someone already linked you that book?
[05:16:13] Aeyrix: It's baller.
[05:16:23] Aeyrix: Hey ssc. :>
[05:16:33] Aeyrix: Haven't seen you around for a lil' while. :(
[05:16:37] Aeyrix: Or is it just me that's been AFK?
[05:16:57] Aeyrix: Rinzlit: Also Railscasts.
[05:17:00] Aeyrix: It's $9, that's it.
[05:17:11] sevenseacat: <-- on holidays
[05:17:12] Aeyrix: You get access to a bunch of videos. Some are getting a bit outdated but you'll be able to tell which.
[05:17:13] Rinzlit: Ermm not keen on paying things .-.
[05:17:19] Aeyrix: Rinzlit: $9 one-time.
[05:17:23] Aeyrix: I'm sure you can manage that.
[05:17:28] Rinzlit: The book is 40 >.<
[05:17:33] Rinzlit: I'll take the videos I guess
[05:17:54] sevenseacat: blame the publishers for the price.
[05:17:59] Radar: Rinzlit: Book is free if you know the right people :)
[05:18:07] adavia: Faye is driving me nuts
[05:18:10] Rinzlit: Ah ha ha, thats wrong
[05:18:15] Aeyrix: Rinzlit: What do you do for a living?
[05:18:20] htmldrum: has joined #RubyOnRails
[05:18:26] Rinzlit: I'm a 10$ an hour system admin
[05:18:41] Rinzlit: #IMakeGoodMoney
[05:18:53] Aeyrix: What're you trying to do?
[05:18:55] Rinzlit: Oh, and I do websites and usually get ripped off
[05:19:02] Aeyrix: Yeah welcome to freelancing.
[05:19:06] Rinzlit: I want to get paid more .-.
[05:19:39] Rinzlit: Well, I mean if I learn how to make really nice websites
[05:19:45] Rinzlit: I'm sure I could charge as much as other people
[05:19:50] sevenseacat: you generally need to invest in yourself to do so
[05:20:08] Rinzlit: Yeah... I'll go order the book xD
[05:20:14] Rinzlit: I'm sure the price will help me stick to the book
[05:20:16] Rinzlit: To be honest
[05:20:47] Rinzlit: to buy the physical or the ebook...
[05:21:00] Rinzlit: -tries to imagen self holding a physical book-
[05:21:01] Aeyrix: It's a PDF. You can take it anywhere.
[05:21:07] Rinzlit: Yeah I don't read books irl
[05:21:08] sevenseacat: well, you'll get the 99.999999% complete eBook right now
[05:21:09] Aeyrix: Including on a Kindle if you have it.
[05:21:24] Radar: I think buying the print book gets you access to it online as well.
[05:21:30] Radar: It's not clear from the text, but iirc that's right
[05:21:35] sevenseacat: though the publishers have put a few key bugs in it because theyre awesome
[05:21:45] Radar: sevenseacat: so awesome
[05:21:53] Aeyrix: The only thing that stopped me buying both is the fact that the authors get even less if I buy the print. ;)
[05:22:00] sevenseacat: honestly I wanted to scream and shout at them yesterday
[05:22:11] Radar: sevenseacat: This is exactly what it was like publishing the 1st ed too
[05:22:16] Aeyrix: Rinzlit: Oh yeah, two (maybe more?) of the authors are right here.
[05:22:16] Radar: Almost drove me to drink
[05:22:33] Rinzlit: Oh thats pretty cool .-.
[05:22:38] Aeyrix: >tfw not good enough to write a book
[05:23:03] Rinzlit: -opens pdf-
[05:23:07] Radar: sevenseacat: what'd they do yesterday?
[05:23:07] Rinzlit: -starts to read-
[05:23:08] sevenseacat: https://www.dropbox.com/s/a25fhtlp3fij02m/Screen%20Shot%202015-07-22%20at%2011.02.01%20pm.png?dl=0 "I still can't see the problem. Please look at the listing from the PDF compared with the MEAP listing screenshot and describe to me the difference; attached."
[05:23:12] Rinzlit: I'm going to sleep -_________-
[05:23:21] Aeyrix: Rinzlit: Read it on fresh eyes.
[05:23:24] Aeyrix: You'll thank me later.
[05:23:30] Radar: sevenseacat: wait that's seriously how the text was formatted?!
[05:23:48] Rinzlit: maybe ill go to sleep in a bit
[05:23:49] Radar: Motherfuckers.
[05:23:55] Aeyrix: Radar sevenseacat
[05:23:58] Radar: Aeyrix: hi
[05:23:59] Aeyrix: next time you want a book published
[05:24:00] Aeyrix: get me to do it
[05:24:05] Aeyrix: I'm clearly more capable than Manning.
[05:24:23] Radar: Aeyrix: My cat is my capable than Manning.
[05:24:33] Aeyrix: Your cat is a peer programming champion.
[05:24:38] Radar: absolutely
[05:24:38] sevenseacat: yes, two of the authors right here. hello.
[05:25:08] Radar: Rinzlit: TL;DR: the publisher is awful (not to put a too fine a point on it), but the book is amazing + life changing and all that
[05:25:30] sevenseacat: well, I hope so.
[05:25:35] Aeyrix: Given that it can take you from 0 to about 60 wrt Rails dev
[05:25:42] Aeyrix: it is technically life changing :P
[05:26:21] dhjondoh: has joined #RubyOnRails
[05:26:31] Radar: my #1 favourite comment about the book (of all time) is when someone said "I read your book, and quit my job as a real estate agent and now I'm a Rails programmer"
[05:26:54] givanse: has joined #RubyOnRails
[05:27:36] Aeyrix: Maybe one day.
[05:27:52] sevenseacat: anyway, back to holiday.
[05:27:56] Aeyrix: See ya. :)
[05:31:36] htmldrum: has joined #RubyOnRails
[05:31:38] tjbiddle: has joined #RubyOnRails
[05:34:25] srinidhi: has joined #RubyOnRails
[05:35:47] anti-freeze: has joined #RubyOnRails
[05:37:36] kies^: has joined #RubyOnRails
[05:38:39] iamjarvo: has joined #RubyOnRails
[05:41:30] yardenbar: has joined #RubyOnRails
[05:43:28] Scripore: has joined #RubyOnRails
[05:44:08] drale2k: has joined #RubyOnRails
[05:50:39] fighella: has joined #RubyOnRails
[05:53:43] tagrudev: has joined #RubyOnRails
[05:54:15] XCMer: has joined #RubyOnRails
[05:54:34] rails663: has joined #RubyOnRails
[05:59:18] metus_violarium: has joined #RubyOnRails
[06:01:32] Scripore: has joined #RubyOnRails
[06:04:27] icosa1: has joined #RubyOnRails
[06:04:36] Wizek: has joined #RubyOnRails
[06:05:20] drale2k: has joined #RubyOnRails
[06:05:24] kimegede: has joined #RubyOnRails
[06:05:24] safeforge: has joined #RubyOnRails
[06:06:41] riotjones: has joined #RubyOnRails
[06:08:13] RegulationD: has joined #RubyOnRails
[06:08:15] g3funk: has joined #RubyOnRails
[06:09:40] arBmind: has joined #RubyOnRails
[06:11:23] emilkarl: has joined #RubyOnRails
[06:14:37] roolo: has joined #RubyOnRails
[06:15:33] dhjondoh1: has joined #RubyOnRails
[06:16:28] ur5us: has joined #RubyOnRails
[06:17:53] hahuang65: has joined #RubyOnRails
[06:18:15] srinidhi: has joined #RubyOnRails
[06:18:27] sinkensabe: has joined #RubyOnRails
[06:19:15] riotjones: has joined #RubyOnRails
[06:20:02] sinkensabe: has joined #RubyOnRails
[06:20:20] workmad3: has joined #RubyOnRails
[06:20:32] eGGsha: has joined #RubyOnRails
[06:23:50] lethjakman: has joined #RubyOnRails
[06:28:03] htmldrum: has joined #RubyOnRails
[06:28:12] schaerli: has joined #RubyOnRails
[06:29:44] tagrudev: has joined #RubyOnRails
[06:29:47] comrad: has joined #RubyOnRails
[06:30:50] arup_r: has joined #RubyOnRails
[06:31:59] Ropeney: VeryBewitching: Commitment made :D
[06:32:31] VeryBewitching: Ropeney: Ah, enjoy :D
[06:32:43] silverdust: Trying to update a record where I need to check for two fields existence so rather than s = Tb.find(1); s.id = 1, I have s = Tb.where(id:1,xs:4); s.id = 3
[06:32:51] silverdust: I get a NoMethod error for this
[06:32:52] XCMer: has joined #RubyOnRails
[06:32:52] Ropeney: VeryBewitching: Is it cheating that i installed the IdeaVim pliugin?
[06:32:58] silverdust: Tried with .find() and it was fine
[06:33:24] VeryBewitching: Ropeney: Not at all, whatever you're comfortable with.
[06:33:37] Ropeney: silverdust: where returns a collection
[06:34:21] silverdust: Ropeney: so what should I do to check the two fields?
[06:34:57] Ropeney: silverdust: find_by(id: 1, xs: 4)
[06:35:11] silverdust: oh that works with more than one
[06:35:12] adavia: anyone familiar with private pub?
[06:35:39] silverdust: Also discovered .where().first() works from Googling now
[06:36:18] Ropeney: silverdust: But that is so ugly
[06:36:29] adavia: silverdust: is there any but any possible way to test if faye is working in your app
[06:37:21] MaDErroR123: has joined #RubyOnRails
[06:37:48] silverdust: Usually it makes some noise in the browser console. Look through the console
[06:38:28] silverdust: True Ropeney
[06:39:09] KamalKaur: has joined #RubyOnRails
[06:39:13] adavia: silverdust: thats the problem.. i have done absolutely everything and everything seems to work a expected. No errors in console but is not publishing real time
[06:40:26] adavia: im starting to think if is something wrong with rails 4.2
[06:40:40] silverdust: I used it with 4.1.7
[06:41:26] adavia: driving me nuts
[06:42:37] silverdust: adavia: I followed this guide then http://josephndungu.com/tutorials/gmail-like-chat-application-in-ruby-on-rails#reply-box-53&sref=https://delicious.com/joerex101/search/gmail%252Cchat%252Crails
[06:42:56] adavia: silverdust: i followed exactly the same guide
[06:42:58] silverdust: It helped me to build something similar buglessly
[06:43:53] silverdust: Are you hosting your own fayeserver?
[06:44:58] adavia: yeah locally im running my fayeserver with rackup private_pub.ru -s thin -E production
[06:46:06] silverdust: And you referenced it properly in config/private_pub.yml ?
[06:46:43] silverdust: See your localhost:9292/faye to see if it is up
[06:47:02] silverdust: I'm just suggesting. Don't have an idea why it didn't work for you
[06:47:38] Mendenhall: has joined #RubyOnRails
[06:48:50] adavia: silverdust: i get Sure you're not looking for /faye ?
[06:48:57] adavia: which means is working
[06:50:20] jenrzzz: has joined #RubyOnRails
[06:50:30] hahuang65: has joined #RubyOnRails
[06:50:43] adavia: i hate when i dont see errors
[06:50:54] duderonomy: has joined #RubyOnRails
[06:51:24] AzaToth: has joined #RubyOnRails
[06:52:13] mary5030: has joined #RubyOnRails
[06:54:18] quazimodo: how are all the things
[06:54:45] quazimodo: a stirring response as always
[06:54:54] krz: has joined #RubyOnRails
[06:55:12] quazimodo: Radar: i saw mushrooms growing out from under my pine tree
[06:55:34] rails663: has joined #RubyOnRails
[06:55:45] adavia: quazimodo: you should try them
[06:55:59] Radar: ^ probably bad advice
[06:56:15] quazimodo: already fried them up
[06:56:57] rails663: How do I add timestamps to logger? config.log_forrmatter = ::Logger::Formatter doesn't work.
[06:57:23] AnoHito: has joined #RubyOnRails
[06:57:36] kahuna_: has joined #RubyOnRails
[07:01:29] safeforge: has joined #RubyOnRails
[07:01:44] thinkswan: has joined #RubyOnRails
[07:02:49] solars: has joined #RubyOnRails
[07:04:01] xkickflip: has joined #RubyOnRails
[07:07:10] kostyay_: has joined #RubyOnRails
[07:07:13] yfeldblum: has joined #RubyOnRails
[07:08:08] kostyay_: hi. is it possible to tell activerecord to disable eager_loading and pulluting my queries with the different `AS t0_r0,` stuff?
[07:08:13] ur5us: has joined #RubyOnRails
[07:08:37] jenrzzz: has joined #RubyOnRails
[07:08:41] kostyay_: just run the query without trying to be too smart
[07:09:36] Supertanker2: has joined #RubyOnRails
[07:10:19] srinidhi: has joined #RubyOnRails
[07:10:38] SanguineAnomaly: has joined #RubyOnRails
[07:13:59] tjbiddle: has joined #RubyOnRails
[07:14:17] Juanchito: has joined #RubyOnRails
[07:14:40] cornerma1: has joined #RubyOnRails
[07:16:27] Palsson: has joined #RubyOnRails
[07:17:50] dideler: has joined #RubyOnRails
[07:17:59] Radar: kostyay_: no
[07:19:37] kimegede: has joined #RubyOnRails
[07:20:18] Mendenhall: this might be obvious but: the create action in an ApplicationController isn't the Model.create action right?
[07:20:33] Radar: Mendenhall: code example plz
[07:20:41] Radar: ApplicationController should not be creating anything
[07:20:58] Mendenhall: it's not the applicationcontroller sorry, it's the ModelController
[07:21:05] Mendenhall: *articlecontroller, strictly speaking
[07:21:22] Mendenhall: im trying to get it to let me create Articles with just a title and have it generate a slug from the title
[07:21:48] mary5030: has joined #RubyOnRails
[07:22:35] Radar: Mendenhall: The create action in the controller can call the create method in the model
[07:23:44] Mendenhall: what's the create method in the model used for?
[07:24:22] Mendenhall: https://gist.github.com/D-Vaillant/1a7ee2075b7e6ace481b also here's the code
[07:24:43] Mendenhall: no wait, no it's not
[07:25:22] Mendenhall: https://gist.github.com/D-Vaillant/b697bf410d5f81dfd39e ok here it is
[07:25:38] zpe: has joined #RubyOnRails
[07:25:46] kh0d: has joined #RubyOnRails
[07:25:56] Radar: It can be used for creating records in the database without the ceremony of new + then save
[07:26:03] Radar: it's new + save combined into the one method
[07:26:17] konsolebox: has joined #RubyOnRails
[07:28:03] Mendenhall: ooh, and controller create is just kind of a random method and it's conventional to use it for routing something something create model?
[07:28:26] Radar: Mendenhall: !getting-started explains it better than I could right now :)
[07:28:26] helpa: Mendenhall: http://guides.rubyonrails.org/getting_started.html - Getting started with Ruby on Rails guide written by Mike Gunderloy
[07:30:01] EminenceHC: has joined #RubyOnRails
[07:30:32] Synthead: has joined #RubyOnRails
[07:30:43] tjbiddle: Hey guys - wanted to gather opinions: Should RVM be installed via Chef, or via Capistrano? Both will already be in use
[07:30:53] Radar: My goodness.
[07:30:59] Radar: tjbiddle: please don't use RVM
[07:31:19] Radar: tjbiddle: Please use ruby-install as I advocate for here: http://ryanbigg.com/2015/07/deploying-a-rails-application-on-ubuntu-passenger-edition/
[07:31:25] Radar: tjbiddle: You should install it with Chef.
[07:31:52] Radar: I think of Chef as the "bootstrap" for the server and Capistrano is the "deployment"... where "bootstrap" is typically ran a few times and then deployment is ran quite a few times.
[07:32:58] workmad3: has joined #RubyOnRails
[07:33:41] tjbiddle: Radar: Looks like ruby-install aims for system-wide dependencies. What're your thoughts on that being against the 12factor dogma?
[07:34:53] tjbiddle: Radar: And I'm enjoying the irony in the fact that I originally switched to RVM when I started Ruby a couple years ago and ran into your guide on it (Which I noticed has been switched to ruby-install now :p)
[07:35:13] Radar: tjbiddle: This part of the 12factor I guess? http://12factor.net/dependencies
[07:35:20] tjbiddle: Radar: Correct
[07:35:22] Radar: tjbiddle: Bundler does the isolation of the dependencies quite nicely.
[07:35:26] towski_: has joined #RubyOnRails
[07:35:36] Radar: " It declares all dependencies, completely and exactly, via a dependency declaration manifest. Furthermore, it uses a dependency isolation tool during execution to ensure that no implicit dependencies ???leak in??? from the surrounding system"
[07:35:38] Radar: Sounds like Bundler
[07:35:53] Radar: It even has Bundler as an example in the next paragraph :P
[07:36:54] tjbiddle: Heheh. Hm, I was interpreting that as having the language interpreter being isolated as well.
[07:37:11] yardenbar: has joined #RubyOnRails
[07:37:19] tjbiddle: Okay - will read into ruby-install then. Will probably make my life easier as rvm wrappers are always a pain in the ass
[07:37:32] Macaveli: has joined #RubyOnRails
[07:37:33] Radar: tjbiddle: And yes, the irony of the guide switching is rich :D
[07:37:41] Radar: I'm off for the night now. Good luck!
[07:38:13] mike___1234: has joined #RubyOnRails
[07:38:24] htmldrum: has joined #RubyOnRails
[07:38:45] tjbiddle: Radar: Cheers, thanks!
[07:40:14] artto: has joined #RubyOnRails
[07:42:26] Mendenhall: ok i have solved my issue. it involved after_initialization
[07:44:18] kostyay_: has joined #RubyOnRails
[07:45:33] schaerli: has joined #RubyOnRails
[07:45:55] eGGsha: has joined #RubyOnRails
[07:47:59] Laurie: has joined #RubyOnRails
[07:48:45] livathinos: has joined #RubyOnRails
[07:49:24] elia: has joined #RubyOnRails
[07:50:35] aceRacer: has joined #RubyOnRails
[07:54:42] aceRacer: I had an entry in schema, t.string "state", and I wrote a migration change_column to add a default value to it.. what will be the reverse_migration ?
[07:55:42] aceRacer: dir.up { change_column :offers, :state, :string, default: "basic_info" }; dir.down { change_column :offers, :state, :string } , in the down part there will be default: false?
[07:55:53] jsrn_: has joined #RubyOnRails
[07:55:54] hololeap: has joined #RubyOnRails
[07:58:34] MaDErroR123: has joined #RubyOnRails
[07:59:15] hololeap|2: has joined #RubyOnRails
[07:59:57] matcouto: has joined #RubyOnRails
[08:00:04] tbuehlmann: aceRacer, there's a method for defaults: http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-change_column_default
[08:02:38] mikecmpbll: has joined #RubyOnRails
[08:02:56] nym: has joined #RubyOnRails
[08:02:58] hashrocket: has joined #RubyOnRails
[08:04:31] LaurieG: has joined #RubyOnRails
[08:04:44] jenrzzz: has joined #RubyOnRails
[08:05:44] KamalKaur: has joined #RubyOnRails
[08:05:44] eGGsha: has joined #RubyOnRails
[08:05:47] ruurd: has joined #RubyOnRails
[08:06:01] lurch_: has joined #RubyOnRails
[08:08:18] ur5us: has joined #RubyOnRails
[08:08:22] norc: has joined #RubyOnRails
[08:08:59] LaurieG: Hello, I have a question about associations.
[08:09:00] blackmes1: has joined #RubyOnRails
[08:09:19] LaurieG: I have a model that I want to associate with a picture model. The picture could be a desktop screenshot or a mobile screenshot. I tried adding in the lines "belongs_to :desktop_screenshot, class_name: "Picture"" and that works ok.
[08:09:28] htmldrum: has joined #RubyOnRails
[08:09:29] LaurieG: But the other side of the association I don't really understand. I just have "has_one post" in the picture model but it doesn't seem to be enough
[08:09:36] LaurieG: I've been pouring over the documentation on polymorphism but it doesn't seem to quite apply to this case
[08:09:55] norc: Hi, as backend Im using an Oracle database very happily so far. Now I have an object that is by far too complex to describe in static tables (the documentation describing how the structure can look like is over 100 pages with 12 additional documents describing special cases).
[08:10:37] norc: At this point these objects can be represented as YAML objects. Is simplz stashing that YAML object in a CLOB field ok, and having the model provide the logic how to obtain data from that YAML structure?
[08:10:58] ddv: LaurieG: why not a Picture model with a type field set to desktop or mobile
[08:11:05] lurch_: how do you handle rolling updates for rails apps? Especially the fingerprinting for assets? At some point I have 2 different versions of a rails app running. But the .js filenames it uses are different. There???s a haproxy in front of the rails app directing traffic in a round-robin fashion, so all assets (both the old and the new version) should be available on both instances, but not sure what the best practice is for this
[08:11:23] mikecmpbll: norc: does oracle have native json support?
[08:12:15] norc: mikecmpbll: Starting in 12cr1 it does, Im using 11gr2 though.
[08:12:34] lethjakman: has joined #RubyOnRails
[08:14:29] LaurieG: ddv: huh, that's a good point. I was asked to make it so the post always has a p.desktop_screenshot method and so on, but maybe that is a better way.
[08:14:49] ddv: LaurieG: yeah you probably shouldn't complicate this
[08:16:57] LaurieG: ddv: so then I'd access it like p.picture ???
[08:17:11] norc: mikecmpbll: Mind if I elaborate a bit more on my topic for a design question?
[08:17:15] axl_: has joined #RubyOnRails
[08:17:44] LaurieG: ddv: Sorry, I don't quite follow how it would work
[08:18:00] ddv: LaurieG: is picture associated with other models?
[08:18:43] LaurieG: Yeah allsorts
[08:18:43] mcr-credil: has joined #RubyOnRails
[08:18:55] ddv: LaurieG: Picture.find(1).desktop where deskop is a scope that does something where type == 'desktop'
[08:19:28] ddv: or maybe Picture.desktop.find
[08:19:54] norc: mikecmpbll: In essence these are messages, there can be many different message types (messages that describe how a contract has been accepted, messages that describe that some work is delayed)
[08:20:30] LaurieG: so I do post.picture.desktop and post.picture.mobile etc? That makes sense.
[08:20:34] norc: mikecmpbll: Obviously I want my actual models to describe these messages, rather than the generic container.
[08:20:51] ddv: LaurieG: yep
[08:21:00] ddv: LaurieG: well no
[08:21:15] ddv: LaurieG: post.pictures.desktop
[08:21:33] ddv: post has_many pictures right?
[08:21:37] LaurieG: oh, and do a has_many association?
[08:21:55] kimegede_: has joined #RubyOnRails
[08:21:55] dopieee: has joined #RubyOnRails
[08:22:01] ddv: post has_many pictures, picture belongs_to post
[08:22:14] LaurieG: each post should have exactly one desktop_screenshot and exactly one mobile_screenshot. Hence my avoidance of has_many
[08:22:27] inoter_: has joined #RubyOnRails
[08:22:30] norc: My feeling tells me I should just let go of the notion that any model has to be an ActiveRecord model.
[08:22:37] ddv: LaurieG: ok yeah than you can do post.picture.desktop if you defined the associations correctly
[08:23:11] mikecmpbll: norc: why do you need to describe the messages at all?
[08:23:11] sandelius: has joined #RubyOnRails
[08:24:03] xkickflip_: has joined #RubyOnRails
[08:24:48] Synthead: has joined #RubyOnRails
[08:25:03] LaurieG: ddv: so I just have two has_one lines in my post model?
[08:25:15] pontiki_: has joined #RubyOnRails
[08:25:22] arup_r: has joined #RubyOnRails
[08:25:33] pipecloud: has joined #RubyOnRails
[08:25:33] ddv: LaurieG: in your Post model has_one :picture
[08:25:42] ohhmaar_: has joined #RubyOnRails
[08:26:01] arup_r: After installing this https://github.com/TrevorS/bootstrap3-datetimepicker-rails ,,, getting error as "Undefined variable: "$gridGutterWidth"."
[08:26:03] ddv: in your picture model you define two scopes, scope :desktop -> { where type: 'desktop' }
[08:26:05] arup_r: I follow the Redame as they said
[08:26:08] gs: has joined #RubyOnRails
[08:26:13] silverdust: has joined #RubyOnRails
[08:26:21] icosa1: has joined #RubyOnRails
[08:26:24] norc: mikecmpbll: One example is we place an order. They will respond with some technical data about the order, a contract number and a schedule date. Currently a user reads this YAML hash, interprets it and creates technical documentation, schedules delivery dates for our customers, etc.
[08:26:31] ur5us: has joined #RubyOnRails
[08:26:46] jsrn_: has joined #RubyOnRails
[08:26:53] LaurieG: ddv: ahh yes yes yes, thank you so much. I was being dense
[08:27:09] duncannz: has joined #RubyOnRails
[08:28:01] arup_r: Had anyone faced this issue
[08:28:07] rails663: has joined #RubyOnRails
[08:28:16] htmldrum: has joined #RubyOnRails
[08:28:25] merryfett: has joined #RubyOnRails
[08:28:27] norc: mikecmpbll: Basically the data has strong relationships with our relational data, and causes interactions with these data as well.
[08:28:35] michael_mbp: has joined #RubyOnRails
[08:29:25] Olipro: has joined #RubyOnRails
[08:29:37] mikecmpbll: norc: right. it's not completely clear what those relationships are
[08:29:50] mikecmpbll: and as always it's difficult to give advice in that circumstance
[08:30:02] norc: mikecmpbll: Ok let me be more specific then.
[08:30:14] mikecmpbll: might you want to polymorphically associate messages with bits of your app?
[08:30:29] dtcristo: has joined #RubyOnRails
[08:31:33] schaerli: has joined #RubyOnRails
[08:31:54] norc: mikecmpbll: Yes. :=
[08:33:34] mikecmpbll: cool, should be pretty straightforward. Message belongs_to :messagable, polymorphic: true; Order has_many :messages, as: :messagable, etc
[08:34:00] rails663: Can someone suggest a gem that will allow saving file contents into database and not file system?
[08:35:50] norc: mikecmpbll: Yeah it just doesnt work that way simply because I cannot reasonably stuff the data into a relational database.
[08:36:03] mikecmpbll: norc: what data?
[08:36:22] mikecmpbll: and why not?
[08:37:32] norc: mikecmpbll: http://pastie.org/10307556
[08:37:33] elaptics: rails663: why do you want to save files to db?
[08:37:44] norc: That is an extremely simplified example of how generic these messages are.
[08:39:08] norc: mikecmpbll: Overall I have maybe 300 pages describing how these messages can be structures, messages can contain messages again
[08:40:26] mikecmpbll: well, it depends on what you want to be able to do with the messages
[08:41:20] skroon: is there a nice API testing and documentation framework for Ruby/Rails?
[08:41:23] mikecmpbll: obviously you'll have to describe the structure if you want to interrogate it or use it relationally
[08:41:36] mikecmpbll: not really much you can do about that, afaics.
[08:42:21] rails663: elaptics: Mostly to version files and to index content for search.
[08:43:51] tjbiddle: has joined #RubyOnRails
[08:46:56] amajuba: has joined #RubyOnRails
[08:46:57] arBmind: has joined #RubyOnRails
[08:47:06] mikecmpbll: i'm getting "Circular dependency detected while autoloading constant" in a rake task
[08:47:17] mikecmpbll: but not if I fire up the console and run the exact same code
[08:48:03] mikecmpbll: i'm running the rake task in production env, so why's rails even trying to autoload constants? should preload afaik
[08:48:20] yardenbar: has joined #RubyOnRails
[08:48:53] zpe: has joined #RubyOnRails
[08:49:04] freezevee: has joined #RubyOnRails
[08:49:28] mikecmpbll: # Rake tasks automatically ignore this option for performance.
[08:49:28] mikecmpbll: config.eager_load = true
[08:49:33] kostyay_: has joined #RubyOnRails
[08:49:36] mikecmpbll: oh. thank god for comments eh
[08:51:59] dangerousdave: has joined #RubyOnRails
[08:56:02] arup_r: has joined #RubyOnRails
[08:59:05] srinidhi: has joined #RubyOnRails
[09:00:27] matcouto: has joined #RubyOnRails
[09:00:50] krz: has joined #RubyOnRails
[09:04:28] user1138: has joined #RubyOnRails
[09:05:32] freezevee: how can I check my balance before saving in a model to not be negative ? Is this right ? validates :balance, presence: true, :numericality => { :greater_than => 0 }
[09:06:03] krz: has joined #RubyOnRails
[09:06:17] sevenseacat: freezevee: does it work?
[09:06:22] alex88: mikecmpbll: nice catch :)
[09:06:24] blackhuey: has joined #RubyOnRails
[09:06:47] alex88: I had that issue too
[09:06:48] freezevee: sevenseacat: I tried to run an rspec test with expect(account.save).not_to be_valid
[09:07:03] matcouto: has joined #RubyOnRails
[09:07:08] srinidhi: has joined #RubyOnRails
[09:07:10] alex88: freezevee: I think it's expect(account).not_to be_valid
[09:07:11] startupality: has joined #RubyOnRails
[09:07:20] freezevee: by substracting an amount from the existing balance
[09:07:28] sevenseacat: account.save returns true or false
[09:07:39] schaerli: has joined #RubyOnRails
[09:07:54] freezevee: how do I catch a validation ?
[09:08:01] freezevee: I mean If it fails on save
[09:08:18] sevenseacat: thats a totally different question entirely
[09:08:22] freezevee: I tried with have errors or raise_error
[09:08:22] sevenseacat: I forgot who I was talking to, apologies
[09:08:33] freezevee: I love you too
[09:09:01] alex88: freezevee: you either check account.save for true or false, or check account to be valid or not
[09:09:06] freezevee: I can't validate it by running a spec so I am thinking what is wrong with the validation
[09:09:43] freezevee: alex88: ok it passes the test so it fails to save
[09:10:02] freezevee: alex88: but how can I be more sure about the error type ?
[09:10:04] ruurd: has joined #RubyOnRails
[09:10:22] freezevee: that it fails specifically for the numericality validation in the model ?
[09:10:56] DEA7TH: has joined #RubyOnRails
[09:11:32] alex88: check account.errors.balance messages
[09:12:02] DoubleMalt: has joined #RubyOnRails
[09:12:04] freezevee: what should I expect().to ?
[09:13:00] yardenbar: has joined #RubyOnRails
[09:13:12] alex88: account.errors.balance should not be nil and the messages should contain "must be greater than 0" or something like that
[09:13:21] alex88: I don't remember the error structure right now
[09:15:33] freezevee: alex88: expect(account.errors).not_to be_nil passes the test but account.errors.balance gives a nomethod error
[09:15:38] DylanJ: i just call account.arrays, irb/pry will give you its .inspect
[09:15:38] freezevee: but that's no problem
[09:15:53] DylanJ: account.errors * >_>
[09:15:58] alex88: freezevee: maybe it's account.errors[:balance]
[09:16:03] alex88: inspect it and check
[09:16:12] alex88: also https://www.relishapp.com/rspec/rspec-rails/v/2-14/docs/model-specs/errors-on
[09:16:38] freezevee: alex88: thanks for the link
[09:16:45] freezevee: alex88: and the help once again
[09:17:30] Surt_Q: has joined #RubyOnRails
[09:20:25] nickenchuggets: has joined #RubyOnRails
[09:21:06] eGGsha: has joined #RubyOnRails
[09:23:23] aceRacer: has joined #RubyOnRails
[09:25:11] Mendenhall: has joined #RubyOnRails
[09:27:27] stamina: has joined #RubyOnRails
[09:27:29] freezevee: alex88: can you help in one more thing please ?
[09:27:42] alex88: freezevee: ask :) if I can
[09:27:44] freezevee: alex88: I have these two factories https://gist.github.com/chrisvel/e0fc8b6f85550d85043a
[09:27:53] rikkipitt: has joined #RubyOnRails
[09:28:27] freezevee: alex88: the test fails with a NameError: uninitialized constant PeterAccount
[09:28:47] DylanJ: you dont define a class for your factory
[09:28:51] freezevee: alex88: but not when I change the line expect(peter_account) to expect(account)
[09:29:03] freezevee: DylanJ: can you please explain ?
[09:29:05] DylanJ: account is a model right
[09:29:14] DylanJ: when you write factory :peter
[09:29:23] DylanJ: FactoryGirl is expecting there to be a class Peter defined
[09:29:27] Hobogrammer: has joined #RubyOnRails
[09:29:34] DylanJ: but since :peter is just an alias for an account with some settings
[09:29:36] DylanJ: you want to do
[09:29:43] freezevee: DylanJ: so I must define the class in the factory ?
[09:29:45] DylanJ: factory :peter, class_name: :account
[09:30:07] alex88: factory :peter, class: Account
[09:30:13] DylanJ: that's the one
[09:30:16] freezevee: no :peter is an association to the User class
[09:30:51] freezevee: DylanJ: to which factory are you referring to ?
[09:30:55] DylanJ: all of them
[09:31:02] DylanJ: in users.rb
[09:31:16] DylanJ: what class should those factories use?
[09:31:23] DylanJ: (probably User)
[09:31:30] freezevee: DylanJ: why does :user work ?
[09:31:33] srinidhi: has joined #RubyOnRails
[09:31:39] DylanJ: because you have a class called User
[09:31:41] freezevee: it guesses the User name from the :user ?
[09:31:45] Davedo: has joined #RubyOnRails
[09:31:57] DylanJ: it doesn't guess. it calls .constantize on the factory name
[09:31:57] nandx64: has joined #RubyOnRails
[09:32:40] DylanJ: well, likely .to_s.titleize.constantize
[09:32:52] freezevee: DylanJ: that was it
[09:32:56] freezevee: DylanJ: thanks!
[09:33:05] DylanJ: programming is most of the tiem
[09:33:18] freezevee: and needs declaring the class in all factories
[09:33:31] DylanJ: only on factories that have a name that isn't what the class name is.
[09:33:35] freezevee: isn't there a way to declare the class once ?
[09:33:44] freezevee: like require 'user'
[09:34:05] rhizome: use traits: create(:account, :peter)
[09:34:07] DylanJ: there are ways to clean up your factories but i dont feel like reading the rspec docs and spoonfeeding you the answer
[09:34:12] freezevee: because If you create 30 factories in users.rb
[09:34:25] freezevee: it's not DRY to write same things again and again
[09:34:26] DylanJ: https://github.com/brennovich/cheat-ruby-sheets/blob/master/factory_girl.md
[09:34:46] freezevee: DylanJ: no let me search
[09:34:49] DylanJ: look at traits like rhizome
[09:34:53] freezevee: DylanJ: but thanks a lot
[09:35:29] freezevee: rhizome: thanks
[09:39:45] Fire-Dragon-DoL: has joined #RubyOnRails
[09:40:02] Rinzlit: https://gist.github.com/anonymous/72a9f6a21799759a27b6
[09:40:07] Diabolik: does anyone here have experience with accepts nested atttributes?
[09:40:07] Rinzlit: Errmm thigies
[09:40:22] ddv: Diabolik: don't ask to ask
[09:40:40] DylanJ: Diabolik: whats up?
[09:40:59] Diabolik: im trying to validate a count
[09:41:14] Diabolik: so if posts has more than x number of posts then it should reject it
[09:41:39] ddv: Diabolik: ok so what is not working? show some cocde
[09:42:14] DEA7TH_: has joined #RubyOnRails
[09:42:27] leslie: when it comes to helpers, are they all available all the time or are they more scoped than that? like say, HomeHelper only being available to HomeController?
[09:42:27] Diabolik: ddv https://gist.github.com/askl56/d20e8afea81d3c5aa1ac
[09:42:40] Diabolik: the validation for maximum number isn't working
[09:42:48] DylanJ: leslie: available all the time
[09:42:54] leslie: ok, thanks DylanJ
[09:43:25] DylanJ: Diabolik: your link doesnt work
[09:43:53] pcpanic: has joined #RubyOnRails
[09:44:52] railsForDaiz: has joined #RubyOnRails
[09:45:57] pcpanic: Hi Guys, anybody here have experience with nested forms with a :through relationship ?
[09:46:27] pcpanic: https://gist.github.com/ysinc88/3ee5862d55cbc37ce3d3#file-controllers-rb
[09:48:55] shock_one: has joined #RubyOnRails
[09:49:21] mrbubbles: has joined #RubyOnRails
[09:51:17] marienz: has joined #RubyOnRails
[09:51:35] nandx64: has joined #RubyOnRails
[09:52:01] htmldrum: has joined #RubyOnRails
[09:52:40] schaerli: has joined #RubyOnRails
[09:55:14] startupality: has joined #RubyOnRails
[09:56:46] camilasan: has joined #RubyOnRails
[10:01:09] bruno-: has joined #RubyOnRails
[10:01:25] lethjakman: has joined #RubyOnRails
[10:07:54] mojojoel: has joined #RubyOnRails
[10:08:30] chridal: Anyone know about any in person courses that can give great insight into rails etc.?
[10:08:44] chridal: With price and location not being an issue
[10:09:27] chridal: Or any great computer science course that is not at a university, really
[10:09:45] chridal: With no SAT etc. admissions. Just money.
[10:09:45] RegulationD: has joined #RubyOnRails
[10:13:04] KamalKaur: Greetings! I want to use bootstrap 3 in Rails project. What is the best way to do? StackOverflow people say to manually place the files in vendor/assets/ and some say to use sass-bootstrap. Anyone with similar experience?
[10:13:22] jolg42: has joined #RubyOnRails
[10:14:39] ArchRogem: has joined #RubyOnRails
[10:14:39] mojojoel: chridal: www.switchup.org
[10:14:48] chridal: mojojoel: Thanks!
[10:15:26] eGGsha: has joined #RubyOnRails
[10:16:04] bonhoeffer: has joined #RubyOnRails
[10:16:10] blackmes1: has joined #RubyOnRails
[10:18:01] sandelius: has joined #RubyOnRails
[10:18:34] arup_r: has joined #RubyOnRails
[10:22:30] mojojoel: https://gist.github.com/mojojoel/e193ee41378a6166e4e3 Any ideas why the return json is in double nested array?
[10:23:04] alex88: KamalKaur: I think bootstrap-sass is the way to go, so you can handle dependencies in Gemfile as other libraries
[10:23:16] alex88: instead of having to manually update the file in vendor/assets
[10:25:43] snophey: has joined #RubyOnRails
[10:26:24] KamalKaur: alex88: Ok. And is there a way to check the stylesheets/ files being loaded, through browser, anyhow ?
[10:26:57] alex88: KamalKaur: you've to manually load them using require directives in your css/js files, btw looking at the browser you see what's loading
[10:27:24] KamalKaur: alex88: No, that all comes in single file.
[10:28:17] alex88: KamalKaur: the css is a single file isn't it?
[10:28:23] alex88: only the js can be splitted
[10:28:52] freezevee: alex88: do you have any idea how could I have an association to two factories in another factory ? https://gist.github.com/chrisvel/7ce9d6eec8066a8fbba5
[10:29:32] KamalKaur: alex88: Also, I added *= require bootstrap.min to application.scss but it threw an error
[10:29:36] alex88: freezevee: the transact class has just a user association, not 2 associations isn't it?
[10:30:02] alex88: KamalKaur: you don't want to include the minified version in yours application.scss
[10:30:22] alex88: also, the readme of https://github.com/twbs/bootstrap-sass clearly states what to do to use it
[10:31:07] freezevee: alex88: https://gist.github.com/chrisvel/4b468dd6f01f352f4688 added it
[10:32:22] alex88: freezevee: you can't call them both "user"
[10:32:48] alex88: you should call them from_user and to_user in the association name and add class_name: "User"
[10:33:29] blackmesa: has joined #RubyOnRails
[10:35:05] freezevee: alex88: ok got it but now I am getting a ActiveRecord::InvalidForeignKey: Mysql2::Error: Cannot add or update a child row: a foreign key constraint fails
[10:35:59] alex88: have you those columns in the db? paste your factory, transact model and schema.rb
[10:36:02] tagrudev: Anyone using simple_form with dropzone.js ... I am trying to figure out how one should define the upload input
[10:38:30] freezevee: alex88: https://gist.github.com/chrisvel/4b468dd6f01f352f4688
[10:39:35] alex88: freezevee: don't you get the full sql error?
[10:40:10] artto: has joined #RubyOnRails
[10:40:14] freezevee: alex88: I do but it says Cannot add or update a child row: a foreign key constraint fails
[10:40:21] freezevee: and the values
[10:40:36] alex88: what does the values show?
[10:40:40] freezevee: alex88: FOREIGN KEY (`to_user_id`) REFERENCES `users` (`id`))
[10:40:55] alex88: means the user is not there when it tries to reference it
[10:41:39] freezevee: alex88: https://gist.githubusercontent.com/chrisvel/4b468dd6f01f352f4688/raw/5a758feec732452d46840962aeb2d49e4f4eab3b/a.sql%2520
[10:43:10] srinidhi: has joined #RubyOnRails
[10:43:45] naftilos76: has joined #RubyOnRails
[10:44:15] Hates_: has joined #RubyOnRails
[10:44:39] mojojoel: https://gist.github.com/mojojoel/e193ee41378a6166e4e3 Any ideas why the return json is in double nested array?
[10:45:09] freezevee: alex88: I don't see the "from_user_id" in the schema as a foreign key but I did declare it in the migration. Can you please take a look ?
[10:45:54] alex88: freezevee: the problem is in the factory, you set both from_user_id and to_user_id
[10:45:58] alex88: but those users, aren't created
[10:46:09] alex88: the "association :from_user, factory: :peter" declarations are enough
[10:47:46] freezevee: alex88: shouldn't they be created ?
[10:48:13] alex88: freezevee: from_user and to_user are the models reference, from_user_id and to_user_id are the integers referring the other table's id
[10:48:24] alex88: you don't know if 2 and 3 are existant ids
[10:48:30] alex88: *existing
[10:49:01] freezevee: alex88: the users.rb factory includes them
[10:49:55] alex88: freezevee: no
[10:49:59] alex88: you don't set the ids on the users
[10:50:22] alex88: and a db, during tests, doesn't guarantee that ids starts from 1
[10:51:04] freezevee: so I set them manual in the factories to id 1, id 2, id 3
[10:51:17] freezevee: is there any other way ?
[10:51:27] freezevee: alex88: like peter.id ?
[10:51:56] freezevee: alex88: from_user.id or something
[10:52:11] noodman: has joined #RubyOnRails
[10:52:23] alex88: NO, just remove the from_user_id and to_user_id lines
[10:52:28] alex88: from the transact factory
[10:55:18] freezevee: alex88: and how will i set them in the specs ?
[10:55:36] schaerli: has joined #RubyOnRails
[10:56:46] nandx64: has joined #RubyOnRails
[10:58:19] mathie: has joined #RubyOnRails
[11:09:53] bruno-: has joined #RubyOnRails
[11:11:26] krz: has joined #RubyOnRails
[11:12:13] naftilos76: has joined #RubyOnRails
[11:14:14] Shoutsid: has joined #RubyOnRails
[11:14:22] terpo: has joined #RubyOnRails
[11:15:32] skroon: is there a nice API testing and documentation framework for Ruby/Rails?
[11:24:04] Creeves: has joined #RubyOnRails
[11:24:25] Detch: has joined #RubyOnRails
[11:25:52] Axy: has joined #RubyOnRails
[11:25:52] Axy: has joined #RubyOnRails
[11:26:21] _3by8: has joined #RubyOnRails
[11:30:23] allcentury: has joined #RubyOnRails
[11:31:04] nettoweb: has joined #RubyOnRails
[11:33:56] Mweshi: has joined #RubyOnRails
[11:34:19] _3by8: If I use form_for using :session as an argument, does it actually store the values returned from the form in the actual session method/hash/whatever?
[11:34:30] stoffus: has joined #RubyOnRails
[11:34:42] _3by8: Or does it create a separate hash?
[11:35:06] Scripore: has joined #RubyOnRails
[11:35:15] artto: has joined #RubyOnRails
[11:35:43] towski_: has joined #RubyOnRails
[11:36:09] Mweshi: has joined #RubyOnRails
[11:36:51] blackmesa: has joined #RubyOnRails
[11:36:55] tjbiddle_: has joined #RubyOnRails
[11:37:50] darutoko-: has joined #RubyOnRails
[11:38:24] ldnunes: has joined #RubyOnRails
[11:39:58] MaDErroR123: has joined #RubyOnRails
[11:40:24] Hates__: has joined #RubyOnRails
[11:40:27] bonhoeffer: has joined #RubyOnRails
[11:43:35] a346: has joined #RubyOnRails
[11:44:21] eGGsha: has joined #RubyOnRails
[11:44:51] hahuang61: has joined #RubyOnRails
[11:47:19] wideEyed: has joined #RubyOnRails
[11:49:13] Forbidden12: has joined #RubyOnRails
[11:50:06] lethjakman: has joined #RubyOnRails
[11:50:28] IceyEC: has joined #RubyOnRails
[11:53:10] nickenchuggets: has joined #RubyOnRails
[11:53:13] rafaj: has joined #RubyOnRails
[11:54:59] Ropeney: has joined #RubyOnRails
[11:55:30] rafaj: has joined #RubyOnRails
[11:55:56] rafaj: has left #RubyOnRails: ()
[11:56:07] rustymyers: has joined #RubyOnRails
[11:56:26] wideEyed: Have a question on JSON! Can somebody help
[11:57:56] juanpaucar: has joined #RubyOnRails
[11:58:33] krz: has joined #RubyOnRails
[11:59:43] kidoz: has joined #RubyOnRails
[12:00:29] workmad3: wideEyed: !ask2ask
[12:00:29] helpa: wideEyed: Don't ask to ask. Just ask your question, and if anybody can help, they will likely try to do so.
[12:02:53] eGGsha: has joined #RubyOnRails
[12:03:00] srinidhi: has joined #RubyOnRails
[12:03:06] wideEyed: In my index.html, I make an AJAX request on page load. This request is made to another function called lily_says. I respond_to with format.json. However I get a ActionView::MissingTemplate (Missing template assists/lily_says
[12:03:45] Rafa_81: has joined #RubyOnRails
[12:04:04] Spami: has joined #RubyOnRails
[12:04:45] railsForDaiz: has joined #RubyOnRails
[12:05:10] wideEyed: I used to think that if I make a JSON request, I will be able to simply get back the json object and work with it in the same .js file
[12:05:13] bungoman: has joined #RubyOnRails
[12:05:25] naftilos76: has joined #RubyOnRails
[12:05:30] shyshy: has joined #RubyOnRails
[12:05:56] blackmesa: has joined #RubyOnRails
[12:07:36] tsujp: has joined #RubyOnRails
[12:09:28] krz: has joined #RubyOnRails
[12:10:46] erich: has joined #RubyOnRails
[12:11:01] AugustoCesar: has joined #RubyOnRails
[12:11:43] bungoman_: has joined #RubyOnRails
[12:13:04] erich: has joined #RubyOnRails
[12:14:01] schaerli: has joined #RubyOnRails
[12:14:07] inoter: has joined #RubyOnRails
[12:14:28] benhuda: has joined #RubyOnRails
[12:16:20] tjbiddle: has joined #RubyOnRails
[12:17:24] DEA7TH_: has joined #RubyOnRails
[12:18:10] Papierkorb: has joined #RubyOnRails
[12:19:10] sankaber: has joined #RubyOnRails
[12:19:16] wideEyed: Is there a way to get the same effect as :remote => true from an JQuery AJAX call?
[12:19:28] fighella: has left #RubyOnRails: ()
[12:20:48] jkamenik: has joined #RubyOnRails
[12:21:29] naftilos76: has joined #RubyOnRails
[12:26:06] tjbiddle: has joined #RubyOnRails
[12:27:15] rails285: has joined #RubyOnRails
[12:27:16] manuscle: has joined #RubyOnRails
[12:28:06] rails285: has left #RubyOnRails: ()
[12:28:10] hfp: has joined #RubyOnRails
[12:28:26] mojojoel: has joined #RubyOnRails
[12:28:40] hfp_work: has joined #RubyOnRails
[12:28:54] Dbugger: has joined #RubyOnRails
[12:29:04] Dbugger: Hello guys
[12:29:33] mojojoel: https://gist.github.com/mojojoel/e193ee41378a6166e4e3 - Why is the json output in a double nested array?
[12:29:58] Dbugger: I have a problem. I have added this field to a Model (t.string :status, value: "pending", null: false), but even though it has a default value, this line gives me a CONSTRAINT NOT NULL error:
[12:30:08] Dbugger: @request = current_user.requests.build owner_id: current_book.user.id, pretender_id: current_user.id, book_id: current_book.id
[12:30:10] Dbugger: Why is that?
[12:30:15] allcentury: has joined #RubyOnRails
[12:32:24] konsolebox: has joined #RubyOnRails
[12:33:24] srinidhi: has joined #RubyOnRails
[12:33:43] TomasAchmedovas: has joined #RubyOnRails
[12:33:45] srinidhi: has joined #RubyOnRails
[12:34:10] nandx64: has joined #RubyOnRails
[12:35:05] DylanJ: i think you wanted to use default: "pending" in your migration
[12:36:28] TomasAchmedovas: has joined #RubyOnRails
[12:36:34] ruurd: has joined #RubyOnRails
[12:37:14] TomasAchmedovas: has joined #RubyOnRails
[12:40:47] mhf: has joined #RubyOnRails
[12:42:07] sshuff|gone: has joined #RubyOnRails
[12:47:03] syath: has joined #RubyOnRails
[12:47:28] htmldrum: has joined #RubyOnRails
[12:49:52] blackmesa: has joined #RubyOnRails
[12:50:54] lethjakman: has joined #RubyOnRails
[12:51:18] mojojoel: https://gist.github.com/mojojoel/e193ee41378a6166e4e3 - Any idea why is the json output in a double nested array?
[12:51:43] Grundell: has joined #RubyOnRails
[12:52:19] DEA7TH_: has joined #RubyOnRails
[12:53:44] MaDErroR123: has joined #RubyOnRails
[12:54:32] chills42: has joined #RubyOnRails
[12:54:38] DylanJ: mojojoel: .where returns a collection
[12:55:39] DylanJ: you likely want User.find(user_id) or User.where(id: user_id).take or User.where(id: user_id).first
[12:56:07] tbuehlmann: or: `users = User.where(id: params[:id].split(', '))`
[12:56:59] lukebennelick: has joined #RubyOnRails
[12:57:25] DylanJ: yeah that's better. i didn't even think about what mojojoel was doing.
[12:57:30] PlasmaStar: has joined #RubyOnRails
[12:58:22] chills42: has joined #RubyOnRails
[12:59:08] lukebennelick: has left #RubyOnRails: ()
[13:00:06] IFrank00: has joined #RubyOnRails
[13:00:52] noodman: has joined #RubyOnRails
[13:02:05] Creeves: has joined #RubyOnRails
[13:02:36] centrx: has joined #RubyOnRails
[13:02:56] bulldawgden: has joined #RubyOnRails
[13:04:35] rodfersou: has joined #RubyOnRails
[13:04:48] mojojoel: Thanks for the suggestions!
[13:04:56] ppati000: has joined #RubyOnRails
[13:05:22] k4nd4lf: has joined #RubyOnRails
[13:05:25] bmurt: has joined #RubyOnRails
[13:06:43] annlewis: has joined #RubyOnRails
[13:06:57] f3ttX]: has joined #RubyOnRails
[13:08:40] eGGsha: has joined #RubyOnRails
[13:09:26] bulldawgden: has joined #RubyOnRails
[13:09:53] doodlehaus: has joined #RubyOnRails
[13:10:00] IFrank00: has joined #RubyOnRails
[13:11:44] ppati000: Hey guys anyone willing to help me? i'm creating my first rails plugin and i'm not sure about how to use models and ActiveRecord with it
[13:12:05] blackmesa: has joined #RubyOnRails
[13:12:08] benhuda: has joined #RubyOnRails
[13:12:19] garrypolley: has joined #RubyOnRails
[13:12:26] rodfersou: has joined #RubyOnRails
[13:12:44] mojojoel: tbuehlmann: worked like a charm! Thanks @DylanJ too!
[13:13:06] mojojoel: ppati000: rails plugin?
[13:13:52] aganov: has joined #RubyOnRails
[13:14:07] poli: has joined #RubyOnRails
[13:14:52] poli: Hello all! Should I still consider Cancan for authorization? It is quite aged, but still ranks far from second most used in ruby toolbox.
[13:15:00] ppati000: mojojoel: yeah using rails plugin new
[13:15:29] mojojoel: poli: Devise you mean? It's still good imo
[13:15:58] poli: mojojoel: Devise is great! ;) I am talking about authorization. Cancan, pundit etc.
[13:15:59] bulldawgden: has joined #RubyOnRails
[13:16:57] arup_r: I have many to many assoc between Account and Event using the through: account_events ... I want to get the owner object of any Event... Currently I am Event.find(12).owner.first to do so.. Which I don't like.. what I want is `Event.find(12).owner` should give me the object
[13:17:05] arup_r: what to change https://gist.github.com/aruprakshit/9a83e30f4c339f3e9d26 here ?
[13:17:21] arup_r: I mean https://gist.github.com/aruprakshit/9a83e30f4c339f3e9d26#file-event-rb-L10
[13:18:04] arup_r: If I do `where("account_events.owned = true").first` query is breaking.. so other alternatuves ?
[13:18:50] allcentury: has joined #RubyOnRails
[13:19:12] balr0g: has joined #RubyOnRails
[13:19:32] waseem_: arup_r: where("account_events.owned = ?", true) should work.
[13:20:34] aaronr: has joined #RubyOnRails
[13:20:39] tvw: has joined #RubyOnRails
[13:21:55] rodferso1: has joined #RubyOnRails
[13:23:09] arup_r: It is working waseem_ as I said I need to call `.first` outside
[13:23:19] arup_r: which I am trying to avoid
[13:23:24] waseem_: arup_r: Why?
[13:23:27] sevenseacat: has joined #RubyOnRails
[13:23:49] arup_r: Because .where is giving the object inside a collection object
[13:23:58] arup_r: not a ActiveRecord object
[13:24:31] waseem_: arup_r: That's the default behavior. Why do you want to avoid .first?
[13:25:40] catcher: has joined #RubyOnRails
[13:25:50] arup_r: from outside everytime I need to call .first .. so looking for if I can make it there so that `.owner` gives me ActiveRecord object
[13:26:01] arup_r: not a collection..
[13:26:04] schaerli: has joined #RubyOnRails
[13:26:25] arup_r: waseem_: you mean `has_many` will give me always a collection ?
[13:27:16] waseem_: arup_r: Yes. `where` will always give you an active record relation object.
[13:28:03] erich: has joined #RubyOnRails
[13:28:03] arup_r: Humm.. That I know.. just wanted to know if I can get what I want.. I tried `where("account_events.owned = true").first` but it didn't work
[13:28:44] DylanJ: arup_r: sounds like your owner relation is a has_many instead of a has_one or a belongs_to
[13:28:47] mojojoel: poli: Ahh, yea cancan (or cancancan) still seems good for me!
[13:28:52] DylanJ: .owner should return a single instance of a thing.
[13:29:00] bmalum_: has joined #RubyOnRails
[13:29:13] DylanJ: an Event has_one owner. or an Event belongs_to and owner.
[13:29:18] DylanJ: belongs_to an owner*
[13:30:45] arup_r: DylanJ: I tried has_one .. it was then gave me an error .. you can't do like this as your through: is has_many something like that
[13:31:02] DylanJ: i'd read up on associations
[13:31:16] arup_r: You want me to show the error ?
[13:31:16] DylanJ: http://guides.rubyonrails.org/association_basics.html
[13:31:25] DylanJ: i dont really want to figure out your associations for you.
[13:31:47] tvw: has joined #RubyOnRails
[13:31:59] DylanJ: they can be tricky at first but unless you teach yourself how they work you'll always have problems with them.
[13:32:28] poli: mojojoel: Thanks!
[13:32:30] DylanJ: once you read that. come back and post the associations for your event and account models.
[13:32:34] IFrank00: Hi Im trying to Get a @section.components Array pick a random value 5 times and that is unique each time
[13:32:58] sonofdirt: has joined #RubyOnRails
[13:33:01] centrx: IFrank00, Use shuffle?
[13:33:01] arup_r: DylanJ: I didn't get your point.. You mean my associations are not correct..
[13:33:13] arup_r: sorry probably I didn't get you..
[13:33:24] Lightsword: has joined #RubyOnRails
[13:33:24] IFrank00: ok I look on shuffle
[13:33:26] DylanJ: arup_r: thats exactly what i meant. your associations aren't set up correctly from what i'm reading.
[13:33:30] centrx: IFrank00, Array#shuffle (perhaps into a new array)
[13:33:38] arup_r: and the Rails guide I read every day atlleast 2 times..
[13:33:52] arup_r: DylanJ: then I will create a instance method for this..
[13:33:57] arup_r: not a association
[13:34:06] DylanJ: well think about this for a second
[13:34:09] mhib: has joined #RubyOnRails
[13:34:16] DylanJ: an event has one owner. ignore rails lingo here.
[13:34:19] DylanJ: just english
[13:34:20] Eindoofus: has joined #RubyOnRails
[13:34:28] DylanJ: am i right? there's only "owner" for an event?
[13:34:33] DylanJ: only one owner*
[13:34:35] arup_r: yes.. you are right
[13:34:51] ducklobster: has joined #RubyOnRails
[13:34:53] DylanJ: so then in that case an event belongs_to <---*** a user
[13:35:21] DylanJ: your event table will have a owner_id or user_id column
[13:35:31] IFrank00: centrx thats the one I was looking for
[13:36:44] ledestin: has joined #RubyOnRails
[13:37:24] arup_r: ok.. I don't have but I have to add .. Right now I have account_id and event_if in the though: table
[13:37:41] josqu4red: has left #RubyOnRails: ()
[13:37:47] DylanJ: so you have some kind of AccountEvent table?
[13:38:00] arup_r: though: model as I said
[13:38:13] arup_r: https://gist.github.com/aruprakshit/9a83e30f4c339f3e9d26#file-event-rb-L4
[13:38:59] DylanJ: yeah you should rethink your schema here.
[13:39:51] nandx64: has joined #RubyOnRails
[13:42:00] snophey: has left #RubyOnRails: ()
[13:45:31] lathiat: has joined #RubyOnRails
[13:46:57] bruno-: has joined #RubyOnRails
[13:48:23] KamalKaur: has joined #RubyOnRails
[13:49:43] phil22: has joined #RubyOnRails
[13:49:46] paulcsmith: has joined #RubyOnRails
[13:50:01] phil22: has left #RubyOnRails: ()
[13:52:16] erich: has joined #RubyOnRails
[13:54:30] skroon: has joined #RubyOnRails
[13:54:53] tuelz: has joined #RubyOnRails
[13:55:30] rokj: has joined #RubyOnRails
[13:57:05] christiandsg: has joined #RubyOnRails
[13:59:36] rokj: i use something like Something.accessible_by(current_ability, :index).ransack(params[:q]) ... if Something has many third_things, how do I search through third_things?
[13:59:42] JoshL: has joined #RubyOnRails
[13:59:51] livathinos: has joined #RubyOnRails
[14:00:07] sshuff|gone: has left #RubyOnRails: ()
[14:00:24] A-ron: has joined #RubyOnRails
[14:00:53] sshuff: has joined #RubyOnRails
[14:01:25] dede: has joined #RubyOnRails
[14:01:29] yaltervox: has joined #RubyOnRails
[14:02:15] jonee: has joined #RubyOnRails
[14:02:24] darrencauthon: has joined #RubyOnRails
[14:03:00] sonofdirt: has joined #RubyOnRails
[14:03:21] darrencauthon: has joined #RubyOnRails
[14:03:27] yaltervox: has left #RubyOnRails: ()
[14:03:59] manuscle: has joined #RubyOnRails
[14:05:04] allcentury: has joined #RubyOnRails
[14:05:18] erich: has joined #RubyOnRails
[14:09:21] krz: has joined #RubyOnRails
[14:09:34] erich: has joined #RubyOnRails
[14:10:09] brazenbraden: has joined #RubyOnRails
[14:11:31] ararog: has joined #RubyOnRails
[14:14:34] werelivinginthef: has joined #RubyOnRails
[14:15:46] lele: has joined #RubyOnRails
[14:16:04] pcpanic: Hello Rails Masters! I have been battling for the past 3 days on nested forms with a through: relationship. Anyone in da house have some experience with nested forms? https://gist.github.com/ysinc88/3ee5862d55cbc37ce3d3
[14:16:11] schaerli: has joined #RubyOnRails
[14:16:41] christiandsg: has joined #RubyOnRails
[14:16:52] manuscle: has joined #RubyOnRails
[14:16:54] mfoo: has joined #RubyOnRails
[14:17:14] Axilla: has joined #RubyOnRails
[14:18:46] RegulationD: has joined #RubyOnRails
[14:19:48] mfoo: It looks like I have a JBuilder template that's throwing an exception in a certain case. In the rails log I just get told that it couldn't find the template. I know it can because it works under other circumstances. How do I get to the underlying error? Rendering the views manually is a bit of a PITA from the rails console.
[14:20:58] allcentury: has joined #RubyOnRails
[14:21:09] sarink: has joined #RubyOnRails
[14:22:11] Axilla: sorry i just stepped in mfoo if you've answered all this, are you using jbuilder for api stuff?
[14:22:15] Hates_: has joined #RubyOnRails
[14:22:16] Axilla: and can you link your view?
[14:22:27] Axilla: and code stuffs again
[14:23:53] chills42: has joined #RubyOnRails
[14:24:24] JoshL_: has joined #RubyOnRails
[14:26:53] bradleyprice: has joined #RubyOnRails
[14:27:06] code1o6: has joined #RubyOnRails
[14:27:27] terpo: has joined #RubyOnRails
[14:27:33] erik_p: has joined #RubyOnRails
[14:27:44] victortyau: has joined #RubyOnRails
[14:28:04] jkamenik1: has joined #RubyOnRails
[14:28:56] tubbo: jonee: didn't work
[14:29:02] dopie: has joined #RubyOnRails
[14:29:09] mary5030: has joined #RubyOnRails
[14:30:38] mary5030: has joined #RubyOnRails
[14:30:47] Lightsword: has joined #RubyOnRails
[14:30:52] mfoo: it's an old API, and unfortunately no I can't. I appreciate this is makes helping difficult. My question was how I see an underlying 'view cannot be found' exception (and why that happens rather than the actual exception bubbling up), rather than 'can you find what is causing my exception' :)
[14:31:29] mfoo: axilla, ^
[14:31:33] jkamenik: has joined #RubyOnRails
[14:31:38] lampd1: has joined #RubyOnRails
[14:31:49] carlosoliveira: has joined #RubyOnRails
[14:31:57] Trynemjoel: has joined #RubyOnRails
[14:32:49] mikecmpbll: can anyone help me understand why "Action Cable needs to run in its own server process." ? https://github.com/rails/actioncable#deployment
[14:33:14] mikecmpbll: just still in the "wrapping my head around it" phase before i use it in a project this weekend
[14:33:21] schaerli: has joined #RubyOnRails
[14:34:13] brazenbraden: mikecmpbll: action cable is essentially a wrapper around some of the WAMP concepts, similar to FAYE. if you read the WAMP docs, why it requires its own server will become apparent.
[14:34:32] mikecmpbll: i have no idea what WAMP is
[14:34:50] duduxz: has joined #RubyOnRails
[14:35:29] brazenbraden: mikecmpbll: its a websocket subprotocol. http://wamp.ws/
[14:36:46] mikecmpbll: is there some technological reason why the web sockets connections can't be handled with the same application instance that handles regular requests?
[14:37:06] workmad3: BrazenBraden: wait, WAMP is different from the windows version of LAMP/XAMP now? :(
[14:37:17] mikecmpbll: workmad3: heh, that's what i thought
[14:37:20] fryguy: mikecmpbll: it's a different protocol with different connection needs
[14:37:53] mikecmpbll: fryguy: sure, i guess.
[14:37:58] Trynemjoel: has joined #RubyOnRails
[14:38:11] brazenbraden: workmad3: wamp.ws != (windows apache mysql php)
[14:38:27] christiandsg: has joined #RubyOnRails
[14:38:48] mikecmpbll: does wamp support wamp tho?
[14:39:07] broman: has joined #RubyOnRails
[14:39:13] workmad3: mikecmpbll: to answer your initial question though - "It could do, but spinning up a websocket server in the same process as your rails server sucks in a lot of ways"
[14:39:27] mikecmpbll: where's that quote from? :D
[14:39:33] workmad3: mikecmpbll: me, just now :)
[14:39:35] mikecmpbll: or are you quoting yourself
[14:39:42] lethjakman: has joined #RubyOnRails
[14:39:55] mikecmpbll: that's fair enough
[14:40:06] workmad3: mikecmpbll: I was just making it clear what was the answer to your initial Q :)
[14:40:34] IFrank00: Hi im trying to use faker gem. I have a Project and a User a user can have many projects and a project can have many user whats the correct way of doing it with FFaker gem
[14:40:59] broman: can someone help me?? when i do a object.inspect it returns me http://pastie.org/10308032 .. when i try to get object.usuario_id it returns me an error
[14:41:10] bulldawgden: has joined #RubyOnRails
[14:41:24] broman: cant use object.usuario_id neither object[:usuario_id]
[14:41:53] workmad3: mikecmpbll: one of the frequent hacks around getting a websocket server inside a rails app has been to spin up event-machine with a WS server running in a separate thread in your rails process... but that essentially means you can't scale it out separately, you can't deploy pieces separately, you can't keep your WS connections open while restarting the rails server, and it means that your WS traffic
[14:41:59] charliesome: has joined #RubyOnRails
[14:41:59] workmad3: will suck memory and resources away from your rails traffic
[14:42:33] mfoo: axilla, seems to be https://github.com/rails/jbuilder/issues/40
[14:43:06] theBestNunu: has joined #RubyOnRails
[14:43:15] workmad3: mikecmpbll: about the only 'advantage' is that you can then talk directly from your rails requests to your EM thread... but that's the sort of shit you should be doing in a more controlled way using a message queue anyway, doing it through direct thread communication is *nasty*
[14:43:23] TinkerTyper: has joined #RubyOnRails
[14:43:26] mikecmpbll: workmad3: right, now that you put it like that.
[14:43:33] mikecmpbll: workmad3: makes perfect sense :)
[14:44:05] bulldawgden: has joined #RubyOnRails
[14:44:34] stantonnet: has joined #RubyOnRails
[14:45:01] mikecmpbll: i still need to properly get my head around EM/reactor pattern
[14:45:13] mikecmpbll: (on a slightly separate note)
[14:45:18] Lectus: has joined #RubyOnRails
[14:45:29] edward__: has joined #RubyOnRails
[14:46:04] srinidhi: has joined #RubyOnRails
[14:46:14] Lectus: Hello! I need to port an application from Rails 2 to Rails 4. Can anyone point me into the right direction?
[14:46:24] bobbobbins: has joined #RubyOnRails
[14:46:25] konsolebox: has joined #RubyOnRails
[14:46:41] diegorv: has joined #RubyOnRails
[14:47:02] pontiki: has joined #RubyOnRails
[14:47:02] mikecmpbll: Lectus: that's quite broad, anything specifically your having a problem with?
[14:47:25] pontiki: morning railsland
[14:47:37] mikecmpbll: Lectus: 1) update your gemfile 2) `bundle` 3) fix broken tests!
[14:47:48] pontiki: what a royal pain it is if irssi reconnects with an alternate nick
[14:47:53] mikecmpbll: pontiki: good morning
[14:47:57] pontiki: hi mikecmpbll
[14:48:07] bobbobbins: hey, I have a dev and test environment, and in dev a route is working fine, but when I try it in test, I'm getting a 404, when I run rake routes on test it shows the route...any idea what could be causing this?
[14:48:25] mikecmpbll: Lectus: also http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html
[14:48:28] IFrank00: How can I create a association many to many seed data for testing between Project and User with a UserProject Table for association that get the user and the project
[14:49:09] Gnut: has joined #RubyOnRails
[14:49:28] pontiki: question: this app is using CanCan, which works pretty well for us so far, BUT: i'm trying to write a controller action test and I want to use an instance spy for the object, and i cannot figure how to get cancan to shut up for this test
[14:49:43] danman: has joined #RubyOnRails
[14:49:49] pontiki: code coming up in a minute
[14:49:59] Lectus: mikecmpbll: Well, I'm new to Ruby and Rails. I just got a new job and my boss wants me to port Fedena (an app made in Rails 2).
[14:50:12] Lectus: I don't know how complex is this task
[14:50:31] srinidhi1: has joined #RubyOnRails
[14:50:54] mikecmpbll: Lectus: okay. probably not that complex but time consuming
[14:50:55] bobbobbins: bah, nevermind, I found it...sorry
[14:51:00] MaDErroR123: has joined #RubyOnRails
[14:51:20] konsolebox: has joined #RubyOnRails
[14:51:59] SteenJobs: has joined #RubyOnRails
[14:52:27] chouhoulis: has joined #RubyOnRails
[14:54:21] gambl0re: has joined #RubyOnRails
[14:55:26] christiandsg: has joined #RubyOnRails
[14:55:32] umgrosscol: has joined #RubyOnRails
[14:55:49] Seich: has joined #RubyOnRails
[14:55:52] artto: has joined #RubyOnRails
[14:57:43] edward__: has joined #RubyOnRails
[14:57:48] paulcsmith: has joined #RubyOnRails
[14:59:32] pontiki: interruptions, interruptions
[14:59:41] allcentury: has joined #RubyOnRails
[14:59:55] pontiki: anyway, here's the gist with the controller and controller spec (redacted): https://gist.github.com/tamouse/06d896c94797659607b8
[15:00:41] pontiki: what i *want* is to essentially skip authorization for the controller action during the test.
[15:01:50] higuys: has joined #RubyOnRails
[15:05:36] pontiki: oops, updated gist with rspec error
[15:06:20] Seich: has joined #RubyOnRails
[15:06:26] czerasz: has joined #RubyOnRails
[15:07:28] freezevee: has joined #RubyOnRails
[15:07:45] freezevee: alex88: can I ask something more ?
[15:07:45] MaDErroR123: has joined #RubyOnRails
[15:08:00] Encapsulation: has joined #RubyOnRails
[15:08:56] MaDErroR123: has joined #RubyOnRails
[15:09:47] dman777_alter: has joined #RubyOnRails
[15:10:30] dman777_alter: if all my controllers use format.json, is there a way to specify it globally?
[15:10:57] freezevee: can someone help me with an rspec/factorygirl issue ?
[15:11:26] Luun: has joined #RubyOnRails
[15:11:31] Trynemjoel: has joined #RubyOnRails
[15:11:40] werelivinginthef: has joined #RubyOnRails
[15:13:26] freezevee: I have a spec that fails https://github.com/chrisvel/The-ruby-bank/blob/master/spec/controllers/transacts_controller_spec.rb. User has Accounts and creates Transactions. I've created factories for them all and all tests pass, except the TransactController#create that POSTs and fails shortly
[15:13:32] JoshL_: has left #RubyOnRails: ()
[15:13:34] freezevee: Can someone please take a look ?
[15:13:46] JoshL: has joined #RubyOnRails
[15:13:56] [H]unt3r: has joined #RubyOnRails
[15:16:37] IFrank00: can somebody help me with this error https://gist.github.com/Frank004/b56bdf5707fb5af319f1
[15:17:09] NodeNagant: has joined #RubyOnRails
[15:17:52] Seich: has joined #RubyOnRails
[15:18:47] IFrank00: Im trying to get the project_ids form a array and random select form 1 to 4 ids to but on project_ids:
[15:19:38] dman777_alter: resources :platforms, only: :index, :defaults format: :json what is the correct format to specify default json?
[15:20:45] dman777_alter: I mean correct syntax?
[15:21:21] mikecmpbll: defaults: { format: 'json' }
[15:21:25] mikecmpbll: dman777_alter: ^
[15:21:40] Creeves: has joined #RubyOnRails
[15:21:57] riotjones: has joined #RubyOnRails
[15:22:44] mikecmpbll: and to answer your earlier question, you can use the `respond_to` class method
[15:23:07] zuQe8: has joined #RubyOnRails
[15:23:08] mikecmpbll: class FooController < ApplicationController; respond_to :json; ...
[15:23:43] mikecmpbll: and cut out all the respond_to do |format| .. format.json junk from your actions
[15:24:08] dman777_alter: mikecmpbll: ah....nice. thanks!
[15:26:07] wallaby: has joined #RubyOnRails
[15:26:09] czerasz2: has joined #RubyOnRails
[15:29:32] Trynemjoel: has joined #RubyOnRails
[15:30:40] freezevee: Can someone tell me why my factories aren't created in my controller RSpec test https://github.com/chrisvel/The-ruby-bank/blob/master/spec/factories/accounts.rb ?
[15:31:02] Rubie: has joined #RubyOnRails
[15:31:04] jkamenik: has joined #RubyOnRails
[15:31:30] EminenceHC: has joined #RubyOnRails
[15:31:39] BaNzounet: Hey guys, I've a Workshops model that has a `has_man :workshop_dates` I want to have in Workshops two field :start_at, :stop_at corresponding to the first workshop_dates.start_at and the last workshop_dates.stop_at. How/Where would you do this?
[15:32:19] BaNzounet: Workshop.start_at should be equals to Workshops.workshop_dates.order(:start_at).first
[15:32:33] BaNzounet: And I want to save it in the db
[15:32:48] BaNzounet: Should I do this in after_save in workshop_dates ?
[15:32:50] mikecmpbll: any particular reason you want to store it in the db?
[15:32:56] BaNzounet: Denormalization
[15:33:20] BaNzounet: It's gettings quite complexe/expensif to retrieve that information
[15:33:46] mikecmpbll: you could cache it but meh
[15:33:54] ascarter: has joined #RubyOnRails
[15:34:11] mikecmpbll: anyways, you'll have to implement callbacks on workshop_dates like you said.
[15:34:25] BaNzounet: You don't think it's a good thing to do that?
[15:35:02] Scripore: has joined #RubyOnRails
[15:35:09] mikecmpbll: i tend to prefer calculating stuff that can be calculated, unless there's a real world problem with that
[15:35:13] jtperreault: freezevee: what the message in the failing spec?
[15:35:33] jtperreault: freezevee: *what is*
[15:35:43] edward__: has left #RubyOnRails: ()
[15:36:28] freezevee: jtperreault: undefined method `debit' for nil:NilClass
[15:37:02] BaNzounet: mikecmpbll: I use this information a lot, in every query on workshop I need the first date et the last date
[15:37:03] Trynemjoel: has joined #RubyOnRails
[15:37:08] freezevee: jtperreault: actually the problem is in the TransactController and in the https://github.com/chrisvel/The-ruby-bank/blob/master/spec/controllers/transacts_controller_spec.rb
[15:37:22] freezevee: it seems that Account.count == 0 inside the controller
[15:37:33] freezevee: somehow the RSpec and FG do not create the accounts
[15:37:56] mwlang: has joined #RubyOnRails
[15:39:06] jtperreault: freezevee: I've experienced some issues similar to that, and using let!() vs. let() can sometimes help. Using let!() the facotries are run at the beginning of the test.
[15:39:33] jtperreault: freezevee: otherwise they are lazily run, when you call for the variable that let() is assigning
[15:39:44] freezevee: jtperreault: I checked this out. I get a message "the Email already exists" so it somehow tries to re-create the user accounts
[15:40:11] lampd1: anyone have some good troubleshooting tips re: include SomeNamespace::SomeModel not working
[15:40:13] sevenseacat: well yes, you're creating a transact, then trying to create another one with identical attributes
[15:40:26] mikecmpbll: BaNzounet: okidokes, nothing wrong with your approach anyway, go for it.
[15:40:27] sevenseacat: instead of creating one, you probably want to use FactoryGirl.attributes_for(:transact) in your spec
[15:40:30] lampd1: when... there are other models in the same module/class that can load the same namespaced models just fine
[15:40:31] lethjakman: has joined #RubyOnRails
[15:40:49] freezevee: sevenseacat: in my transact_controller spec ?
[15:41:09] sevenseacat: thats the only one youve posted
[15:41:26] sevenseacat: but then again, I haven't seen you post an error message
[15:41:41] freezevee: the error message is not related to the issue
[15:41:48] jtperreault: freezevee: an error would be helpful
[15:41:53] sevenseacat: yes, it is, by definitipn
[15:42:02] freezevee: I get a Nomethod error undefined method `debit' for nil:NilClass
[15:42:09] sevenseacat: ok, and the stacktrace for that error?
[15:42:15] sevenseacat: please add it to the gist
[15:42:17] artto: has joined #RubyOnRails
[15:42:56] artto: has joined #RubyOnRails
[15:43:02] freezevee: https://gist.github.com/chrisvel/758cb73a73d64af773a9
[15:43:13] sevenseacat: thats not a stacktrace
[15:44:01] mwlang: I just moved a Rails 1.2 application from Apache + Mongrel on Windows to Nginx + Passenger + Linux. It???s using Prototype 1.7.2. For some reason or another, the Prototype #each Enumerator is undefined: https://gist.github.com/mwlang/2c8a3fecd87edf2813b6 According to Chrome and Firefox Developer console, everything is loading just as it did on the Windows server, so I???m befuddled what might be the issue. Any ideas?
[15:44:09] freezevee: stacktrace is the entire output of spec ?
[15:44:11] eGGsha: has joined #RubyOnRails
[15:44:12] jtperreault: freezevee: we cant see where undefined method is being thrown.
[15:44:16] rasalghul_: has joined #RubyOnRails
[15:44:20] jtperreault: from which file
[15:44:22] sevenseacat: please gist the entire output of running the spec.
[15:44:27] jtperreault: or class rather
[15:44:33] mikecmpbll: BaNzounet: there's also hacky stuff you can do like def scope :with_dates, -> { joins(:workshop_dates).select("workshops.*, min(workshop_dates.start_date) as start_date, max(workshop_dates.end_date) as end_date").group("workshops.id") }
[15:44:35] arup_r: has joined #RubyOnRails
[15:44:48] adavia: has joined #RubyOnRails
[15:44:51] mikecmpbll: BaNzounet: but uh, yeah i don't recommend that
[15:44:57] mikecmpbll: necessarily.
[15:45:34] JoshL: has joined #RubyOnRails
[15:45:34] Trynemjoel: has joined #RubyOnRails
[15:45:48] sevenseacat: freezevee: we'll work back from the error to fix the problem, debugging like we've done many times before
[15:46:03] rustymyers: has joined #RubyOnRails
[15:46:05] chouhoulis: has joined #RubyOnRails
[15:46:18] freezevee: sevenseacat: I thought it could be easier for anyone to read the most important part of the rspec output
[15:46:27] sevenseacat: freezevee: we could, if you'd included it like we asked.
[15:46:42] freezevee: sevenseacat: I always try to catch you but I can't
[15:46:50] freezevee: I am always one step behind
[15:46:51] ruurd: has joined #RubyOnRails
[15:47:00] freezevee: just a moment please
[15:47:13] eGGsha: has joined #RubyOnRails
[15:47:25] mwlang: For the prototype error, if there???s a special way I need to cast the results so the checkboxes found are Enumerable, I???ll settle for changing the JS code, but I???m just not all that familiar with Prototype.
[15:47:58] hobodave: has joined #RubyOnRails
[15:48:36] ewilliam: has joined #RubyOnRails
[15:48:37] freezevee: sevenseacat: https://gist.github.com/chrisvel/08db8177c5455efdabdc
[15:49:08] sevenseacat: ok, so the first line of the error points to transacts_controller.rb, line 40
[15:49:19] sevenseacat: so now we need to look at that controller
[15:49:19] hobodave: has joined #RubyOnRails
[15:49:22] sevenseacat: whats on line 40?
[15:50:07] freezevee: @from_user.account.debit(amount)
[15:50:19] freezevee: because account is nil
[15:50:22] blackmesa: has joined #RubyOnRails
[15:50:25] sevenseacat: and the error tells you you're calling debit on nil, so @from_user.account is nil
[15:50:26] mikecmpbll: a how to debug guide for this channel would be pretty good, is there one already?
[15:50:28] helpa: Just the tips: http://logs.ryanbigg.com/tips
[15:50:30] helpa: Debugging Ruby, a new ebook written by Ryan Bigg. https://leanpub.com/debuggingruby
[15:50:39] sevenseacat: where are you setting @from_user.account
[15:50:53] freezevee: in the spec ?
[15:50:59] mikecmpbll: heh, a free one
[15:51:25] sevenseacat: freezevee: no, the error is in the controller
[15:51:25] freezevee: https://github.com/chrisvel/The-ruby-bank/blob/master/spec/factories/accounts.rb
[15:51:30] sevenseacat: so where are you setting it in the controller
[15:51:56] dudoom: has joined #RubyOnRails
[15:51:56] freezevee: @from_user is a parameter from the controller spec
[15:52:12] sevenseacat: (that was a hint for you t oshow me where its defined)
[15:52:12] freezevee: and it is related to its account
[15:52:23] zorak8: has joined #RubyOnRails
[15:52:27] safeforge: has joined #RubyOnRails
[15:52:57] freezevee: sevenseacat: User.find_by(id: params[:transact][:from_user_id]) finds out the user
[15:53:11] freezevee: sevenseacat: If I do a puts on it, I can get the id successfully
[15:53:29] freezevee: but the @from_user.account fails because there are no accounts
[15:53:34] sevenseacat: that can explode dramatically if params[:transact] isnt set, but that appears to be unrelated to the problem
[15:53:36] freezevee: Factory Girl hasn't created them
[15:53:45] sevenseacat: so why isnt there an account? where is your factory making them?
[15:54:02] dotty: has joined #RubyOnRails
[15:54:10] nettoweb: has joined #RubyOnRails
[15:54:23] freezevee: here https://github.com/chrisvel/The-ruby-bank/blob/master/spec/controllers/transacts_controller_spec.rb
[15:54:26] sevenseacat: does your code need to safeguard against users without accounts?
[15:54:38] sevenseacat: that creates a transact, it doesnt create an account
[15:55:07] sevenseacat: you also dont need to show me the same code ten times - if previous code was relevant, I can work that out :)
[15:55:17] sevenseacat: the fact that I'm asking means it isnt
[15:55:34] Schalla: has joined #RubyOnRails
[15:55:34] Schalla: has joined #RubyOnRails
[15:55:34] freezevee: let(:transact){ FactoryGirl.create :transact } triggers the users factory to create the users also
[15:55:52] freezevee: so Transact and User accounts are built when the test is ran
[15:55:59] freezevee: I fail to create the accounts
[15:56:03] sevenseacat: you havent shown me that part
[15:56:07] freezevee: let(:transact){ FactoryGirl.create :transact }
[15:56:12] sevenseacat: that creates a transact
[15:56:19] sevenseacat: nowhere does it mention accounts
[15:56:34] sevenseacat: so, where are you creating accounts?
[15:56:36] freezevee: because I don't know how
[15:56:51] sevenseacat: then its not 'your factory isnt creating them', its *you* arent creating them
[15:56:54] naftilos76: has joined #RubyOnRails
[15:56:59] towski_: has joined #RubyOnRails
[15:57:05] freezevee: the blame is on me
[15:57:09] freezevee: well there isn't a direct relation from the users to the accounts and that's why
[15:57:16] sevenseacat: there doesnt have to be
[15:57:35] sevenseacat: but I presume you're not just transferring from random accounts to other random accounts, because that would be a hell of a security hole
[15:57:40] freezevee: because as far as I know, FG automatically creates the entities that are "picked up" while running the tests
[15:57:48] sevenseacat: FG does what you tell it to do, and no more
[15:58:37] pushpak: has joined #RubyOnRails
[15:58:39] sevenseacat: so, how do users and accounts relate?
[15:58:41] freezevee: so the transacts are getting created, the users are getting created as a result but the accounts don't
[15:58:54] MiracleBlue: has joined #RubyOnRails
[15:58:55] sevenseacat: because you're not telling anything to create any accounts
[15:58:59] sevenseacat: therefore, none are created
[15:59:00] mwlang: Nuts. I just needed to wrap the getElementsByClassName() with $A(???). No idea why it continues to work fine on the Windows hosted app (same code) but not the Linux one.
[15:59:00] tvw: has joined #RubyOnRails
[15:59:03] freezevee: how ? in the accounts.rb factory
[15:59:19] freezevee: user has_one account and account belongs_to user
[15:59:34] sevenseacat: "there isn't a direct relation from the users to the accounts" ok , so there is now
[15:59:35] Trynemjoel: has joined #RubyOnRails
[15:59:56] sevenseacat: where are you creating the user that your controller is using?
[16:00:09] skroon: has joined #RubyOnRails
[16:00:10] disgrntld: has joined #RubyOnRails
[16:00:14] freezevee: sevenseacat: I tried to add let(:peter_account) { FactoryGirl.create :peter_account } in the transact_controller_spec but it failed also did an epic fail
[16:00:34] sevenseacat: well I presume you dont have a factory called peter_account so that makes perfect sense
[16:00:52] Cache_Money: has joined #RubyOnRails
[16:00:58] freezevee: sevenseacat: I do https://github.com/chrisvel/The-ruby-bank/blob/master/spec/factories/accounts.rb
[16:01:14] sevenseacat: so what was the error then>
[16:02:56] freezevee: running it now
[16:03:09] sevenseacat: debugging is all about tracing errors back to their source, and fixing them, not just trying random things.
[16:03:26] sevenseacat: ok, so there is no 'epic fail'
[16:03:49] freezevee: I took it personally
[16:03:54] mhib: has joined #RubyOnRails
[16:03:58] freezevee: that's why it's epic
[16:04:19] sevenseacat: so how does your transact create a user record?
[16:04:27] sevenseacat: *your transact factory
[16:05:09] sevenseacat: more importantly, shouldnt a transaction be between accounts, not between users?
[16:05:11] Tamal: has joined #RubyOnRails
[16:05:26] freezevee: as a best practise thing ?
[16:05:31] freezevee: I am not sure
[16:05:33] sevenseacat: no, as a common sense thing
[16:05:38] freezevee: because user has only one account
[16:05:53] freezevee: and could be accessible only by user.account
[16:05:54] sevenseacat: well no, your test user doesnt have any accounts
[16:06:04] sevenseacat: thats not one
[16:06:36] paulcsmith: has joined #RubyOnRails
[16:06:37] sevenseacat: how does your transact factory create a user record?
[16:06:41] freezevee: I 'll keep it for the next fixes
[16:07:00] freezevee: well the let(:transact){ FactoryGirl.create :transact } creates a transact
[16:07:06] sevenseacat: thats not what I asked
[16:07:31] freezevee: and the transact creates an association to association :to_user, factory: :jack
[16:07:37] urlgrey: has joined #RubyOnRails
[16:07:45] freezevee: so it understands it needs to create a new user
[16:07:55] sevenseacat: ok, so how do you think you can change your 'jack' factory to create an account?
[16:08:34] freezevee: make an association in the jack factory to the account ?
[16:08:44] sevenseacat: is that what you want to do?
[16:09:11] freezevee: I really don't know
[16:09:23] freezevee: it's the only way I see ?
[16:09:30] sevenseacat: well you're creating jack, and jack is trying to have money debited from his account, but he has no account, hence the error
[16:09:45] sevenseacat: so it makes sense to create an account for jack when jack is created by FG, no?
[16:09:55] freezevee: but all the other tests will fail
[16:10:01] sevenseacat: err, what? why?
[16:10:45] benlieb: has joined #RubyOnRails
[16:11:06] freezevee: will the spec be able to pass the user model test ?
[16:11:19] sevenseacat: I havent seen any user model tests, so I have no idea.
[16:11:25] freezevee: sorry I believe I am thinking the wrong way
[16:11:36] Trynemjoel: has joined #RubyOnRails
[16:11:37] freezevee: I initially created User & its specs
[16:11:55] freezevee: then I added accounts and after I added the transacts
[16:12:05] sevenseacat: okay? whats that got to do with failing specs?
[16:12:23] freezevee: but If you create a new user and the transact is there, it won't fail
[16:12:59] freezevee: so I 'll have to create the accounts from inside the user factory ?
[16:13:14] sevenseacat: you dont have to, but its one way to do it.
[16:13:39] freezevee: but when I'll run the account tests, won't it fail because it is going to create them again ?
[16:13:45] jonee: has joined #RubyOnRails
[16:14:06] sevenseacat: 'again'? where are you creating them the first time? again, you havent shown any account tests
[16:14:57] freezevee: If in the account factory there's an association association :user, factory: :user
[16:15:07] freezevee: it will try to create the user and as a result, the account again
[16:15:11] freezevee: I might be wrong
[16:15:17] sevenseacat: have you tried it?
[16:15:19] freezevee: but seems like a loop
[16:15:37] sevenseacat: why would you ever have an account without a user?
[16:16:01] freezevee: account should always depend on a user
[16:16:06] lxsameer: has joined #RubyOnRails
[16:16:07] Maletor: has joined #RubyOnRails
[16:16:12] sevenseacat: then why is your account factory in control of deciding whether or not it has a user
[16:16:32] freezevee: what do you mean deciding ?
[16:16:40] freezevee: it has an association
[16:16:44] freezevee: that's alll
[16:16:56] sevenseacat: yes, you're building an account, and then the account factory builds the related user
[16:16:56] freezevee: FG creates it as it picks up the association
[16:17:13] sevenseacat: it doesn't 'pick up' anything, you told it that it has the association
[16:17:18] sevenseacat: and that it should use it
[16:17:21] freezevee: If the account already exists ?
[16:17:33] Maletor: has joined #RubyOnRails
[16:17:35] sevenseacat: without a user?
[16:17:42] freezevee: with a user
[16:17:46] sevenseacat: i dont understand whatever you're trying to tell me
[16:18:01] freezevee: well If I run the account spec
[16:18:08] freezevee: I got to create some accounts
[16:18:14] sevenseacat: for the third time, *what account spec*?
[16:18:33] freezevee: https://github.com/chrisvel/The-ruby-bank/blob/master/spec/models/account_spec.rb
[16:18:52] freezevee: let(:account){ FactoryGirl.create :account }
[16:18:55] theery: has joined #RubyOnRails
[16:19:12] bricker: has joined #RubyOnRails
[16:19:13] sevenseacat: you're not using peter_account or jack_account
[16:19:28] DEA7TH_: has joined #RubyOnRails
[16:19:29] sevenseacat: nor is there anything in that code specific to users
[16:19:53] sevenseacat: so the fact there is an association is irrelevant to every one of those tests
[16:20:12] freezevee: I am planning to do so
[16:20:15] ctooley: has joined #RubyOnRails
[16:20:21] freezevee: but this is not related to the problem
[16:20:37] freezevee: association :user, factory: :user is inside the account factory
[16:20:40] sevenseacat: you dont understand the problem, so how tdo you know what is and isnt related to it?
[16:20:44] kachi8: has joined #RubyOnRails
[16:21:33] creature: has joined #RubyOnRails
[16:21:33] creature: has joined #RubyOnRails
[16:22:02] freezevee: I added these two lines when I finished the tests so I don't forget them
[16:22:06] sevenseacat: do you think i'm explaining this to you for shits and giggles?
[16:22:32] freezevee: nope, just trying to understand
[16:22:45] mwlang: sevenseacat: I do. :-D
[16:23:19] freezevee: sevenseacat: so you suggest to create user accounts from inside the user factories ?
[16:23:37] bmalum: has joined #RubyOnRails
[16:23:39] freezevee: that's sad because I have no idea
[16:24:22] michaeldeol: has joined #RubyOnRails
[16:24:24] freezevee: is FG so hard or I am just too unexperienced ? please don't answer
[16:24:29] arup_r: has joined #RubyOnRails
[16:24:43] freezevee: a factory inside a factory ?
[16:24:53] krokuz: has joined #RubyOnRails
[16:25:20] freezevee: is there any possibility you might shed a light on this ? speaking of code
[16:25:28] mwlang: freezevee: FG isn???t hard, but it does take some practice to master. The rules are simple, but how you combine them effectively can become complex.
[16:25:50] sevenseacat: so the transact creates the user with `association :to_user, factory: :jack`
[16:25:59] sevenseacat: now how can the jack factory create an account?
[16:26:15] freezevee: simply an association ?
[16:26:27] zpe: has joined #RubyOnRails
[16:27:09] skyjumper: is there a general consensus on named scopes these days?
[16:27:26] ElSif: in what context?
[16:27:45] sevenseacat: skyjumper: thats a vague question.
[16:27:46] skyjumper: for/against?
[16:27:54] ElSif: for in some cases, against in others?
[16:28:01] NodeNagant: has joined #RubyOnRails
[16:28:03] sevenseacat: use them when appropriate. dont use them when not appropriate.
[16:28:36] ElSif: what are you attempting to accomplish with a scope?
[16:29:09] freezevee: sevenseacat: https://gist.github.com/chrisvel/b919db3b6dc9a2d1d93f
[16:29:35] freezevee: sevenseacat: and the terminal did an endless error output, starting from stack level too deep
[16:30:07] jtperreault: freezevee: stack level too deep means you have factories calling each other creation in a loop
[16:30:12] k1t: has joined #RubyOnRails
[16:30:16] kachi8_: has joined #RubyOnRails
[16:30:20] sevenseacat: now when your jack factory creates the jack_account, which user should the account belong to?
[16:30:23] freezevee: that's what I was afraid of
[16:30:30] shock_one: has joined #RubyOnRails
[16:30:32] bryancp: has joined #RubyOnRails
[16:30:42] freezevee: sevenseacat: jack possibly
[16:32:17] sevenseacat: so the jack_account factory doesnt need to create a new user - you can tell it that by passing in nil
[16:32:18] markholmes: has joined #RubyOnRails
[16:32:25] EminenceHC: has joined #RubyOnRails
[16:32:42] sevenseacat: like this example https://github.com/thoughtbot/factory_girl/blob/master/GETTING_STARTED.md#associations sets the last_name attribute, you can set the uset attribute
[16:32:46] sevenseacat: *user attribute
[16:33:10] freezevee: sevenseacat: I don't get it
[16:33:38] sevenseacat: dont get what?
[16:34:03] freezevee: sevenseacat: an association to a nil user?
[16:34:15] freezevee: a user_id = nil ?
[16:34:25] mary5030_: has joined #RubyOnRails
[16:34:40] freezevee: the only reference to the user is by this association :user, factory: :jack
[16:34:42] sevenseacat: you passing in a value means 'dont do whatever your default implementation says to do, use this value instead'
[16:35:00] joerosion: has joined #RubyOnRails
[16:35:03] sevenseacat: in other words, dont create a new user, just skip it
[16:35:06] chouhoul_: has joined #RubyOnRails
[16:35:36] freezevee: in the factory ?
[16:35:37] skroon: has joined #RubyOnRails
[16:35:45] freezevee: you said about the jack_account factory
[16:36:19] schaerli: has joined #RubyOnRails
[16:36:20] freezevee: and "sets the last_name attribute, you can set the uset attribute"
[16:36:58] sevenseacat: yes, in te factory
[16:37:29] sevenseacat: "set the user attribute"
[16:38:03] freezevee: user: nil ?
[16:38:30] Scripore: has joined #RubyOnRails
[16:38:31] tuelz: has joined #RubyOnRails
[16:38:46] sevenseacat: it is always quicker for you to try something, than type it out and then someone will tell you to try it anyway
[16:38:59] freezevee: I am trying it in parallel, just confirming it
[16:39:05] baweaver: has joined #RubyOnRails
[16:39:06] freezevee: association :user, factory: :user, user: nil returns the same long trace
[16:39:20] BaNzounet: Is it normal that in an after_safe callback the belong_to relation returns nil?
[16:39:21] sevenseacat: ffffffffffffffff no
[16:39:39] maZtah: has joined #RubyOnRails
[16:39:47] freezevee: I am starting to understand what you're saying but I have no idea how could it be implemented
[16:40:12] sevenseacat: I don't think you're starting to understand anything, and I;m running out of ways to explain a very simple concept
[16:40:14] djbkd: has joined #RubyOnRails
[16:40:31] sevenseacat: why would you specify user: nil when creating a user? that makes no sense
[16:40:49] freezevee: you said about the user attribure
[16:40:57] chills42: has joined #RubyOnRails
[16:41:00] sevenseacat: yes, when you create an account
[16:41:07] freezevee: and the last_name in the example says "association :author, factory: :user, last_name: "Writely""
[16:41:25] lucha: has joined #RubyOnRails
[16:41:30] ElSif: where is factory: :peter_account defined freezevee? can you gist that?
[16:41:34] polpak: has joined #RubyOnRails
[16:41:45] freezevee: ElSif: https://github.com/chrisvel/The-ruby-bank/blob/master/spec/factories/accounts.rb
[16:41:49] sevenseacat: now that *is* irrelevant to the problem
[16:42:35] ElSif: ok, so what sevenseacat is saying (i think) that your `association :user, factory: :peter` is causing you to call the factory for peter (or whatever) which is causing you to call `account_peter` and so forever
[16:43:05] ElSif: if that doesn't make sense then i too am not able to explain any further
[16:43:15] sdwrage: has joined #RubyOnRails
[16:44:23] freezevee: I understood that
[16:44:24] blackmesa: has joined #RubyOnRails
[16:44:33] freezevee: what I don't get is how to set it nil ?
[16:44:38] Trynemjoel: has joined #RubyOnRails
[16:44:58] ElSif: ah, well that is just a matter of setting it to nil where you call the factory that calls the other factory
[16:45:24] ElSif: i think in your case where you call the factory for user set `account: nil`
[16:45:26] freezevee: sevenseacat: said about the accounts factory
[16:45:47] ElSif: no, i think he was saying it about the relation to the user factory of the accounts factory
[16:45:56] ElSif: (correct me please if i am wrong sevenseacat)
[16:46:30] freezevee: so in the users factory ?
[16:46:38] freezevee: I still don't get it
[16:46:45] weniqn: has joined #RubyOnRails
[16:46:58] Mweshi: has joined #RubyOnRails
[16:47:10] ElSif: yes, if you were to put `account: nil` into your calling of the user factory it would work, or give you a new error :)
[16:47:33] smathy: BaNzounet, not normal at all, no.
[16:47:37] freezevee: ElSif: what's the point ?
[16:47:50] ElSif: to make it not loop infinitely?
[16:47:53] freezevee: ElSif: the user will be created and a nil account ?
[16:47:59] wenqinye: has joined #RubyOnRails
[16:48:10] ElSif: trying to make an account for the user by making a user for the account by making an account for the user by making a user for the account ...
[16:48:15] ElSif: my fingers are already tired
[16:48:28] ElSif: yes, but the point is that you should now see the cause
[16:48:40] ElSif: i dont want to give you the complete answer or you don't learn anything :)
[16:48:54] nettoweb: has joined #RubyOnRails
[16:49:20] Mweshi: has joined #RubyOnRails
[16:50:05] ElSif: but you seem to see the loops, so i will say, what do you want for the account rather than a nil? and if you were to call that what would happen? and if you wanted to prevent it what could you do to the factory?
[16:50:12] ElSif: im gonna get more coffee now
[16:51:00] freezevee: ElSif: account :nil gives me a syntax error
[16:51:03] wenqinye: anybody know why the csrf_token in the <meta> tag is different from the session['_csrf_token'] value? Should this happen?
[16:51:23] ElSif: :nil would try to put a symbol thre
[16:51:28] ElSif: no need for the `:`
[16:51:35] relix: has joined #RubyOnRails
[16:51:48] ElSif: or maybe you just messed up the spacing accidentally?
[16:51:54] freezevee: ElSif: Account(#45460220) expected, got Symbol(#8134820)
[16:52:00] freezevee: ElSif: it's simply account nil
[16:52:11] freezevee: but then I get the same error as in the beginning
[16:52:24] TomasAchmedovas: has joined #RubyOnRails
[16:52:51] freezevee: undefined method `debit' for nil:NilClass because the account doesn't exist etc.
[16:52:54] ElSif: you passed a symbol `:nil` in, so of course it gave you one
[16:52:58] freezevee: sevenseacat: any ideas ?
[16:53:02] ElSif: yep, see my previous three questions
[16:53:12] hololeap: has joined #RubyOnRails
[16:53:31] ElSif: and now coffee
[16:53:33] freezevee: they don't help me to understand
[16:53:38] freezevee: ElSif: but thanks anyway
[16:53:40] ElSif: what are your answers?
[16:54:00] ElSif: ill check back soon
[16:54:07] freezevee: ElSif: what do you want for the account rather than a nil? and if you were to call that what would happen? and if you wanted to prevent it what could you do to the factory?
[16:54:22] freezevee: ElSif: what should I want for the account ?
[16:56:00] hfp: has joined #RubyOnRails
[16:56:06] glenab: has joined #RubyOnRails
[16:56:31] hfp_work: has joined #RubyOnRails
[16:56:37] sevenseacat: no, I'm just about done here.
[16:56:55] freezevee: sevenseacat: tell me at least what am I doing wrong
[16:56:55] sevenseacat: I spent an hour explaining the reasoning for a single line of code
[16:57:03] ElSif: freezevee: that is a very good equivalent question, and i think your test gave you the answer when you instead passed a symbol :)
[16:57:47] freezevee: ElSif: you mean the Account(#49772840) expected, got Symbol(#12435620)
[16:57:49] sevenseacat: what is :nil? where has that *ever* been used before?
[16:57:54] manfrin: has joined #RubyOnRails
[16:58:02] freezevee: ElSif: so the account waits for an Account ?
[16:58:10] brunno: has joined #RubyOnRails
[16:58:21] freezevee: ElSif: I am not lying, I don't get it
[16:58:22] ElSif: if you were an account woulnd't you want someone to call you an acccount?
[16:58:33] urlgrey_: has joined #RubyOnRails
[16:59:16] chipotle: has joined #RubyOnRails
[16:59:37] ElSif: excuse my spelling, coffee is not instantaneous sadly T_T
[16:59:41] freezevee: ElSif: I guess so
[16:59:49] vickleton: has joined #RubyOnRails
[16:59:55] freezevee: Account waits for an Account, it's straightforward
[17:00:01] freezevee: where am I doing a mistake ?
[17:00:10] ElSif: how would you make it happy then?
[17:00:19] freezevee: by giving it an account ?
[17:00:22] ElSif: what would you think you should call to give it that?
[17:00:35] sevenseacat: I dont understand the direction this conversation has turned. but then again, its 1am here.
[17:00:52] ElSif: lol im not entirely sure i do either, but im trying
[17:01:08] erich: has joined #RubyOnRails
[17:01:13] ElSif: time for a seveseacatnap :D
[17:01:50] freezevee: I don't know what else to say
[17:01:58] freezevee: thanks for your time
[17:02:05] smathy: wenqinye, yes, they're meant to be different.
[17:02:11] ElSif: sure, but youre getting there
[17:02:17] jobewan: has joined #RubyOnRails
[17:02:29] ElSif: just think about what you could call to give your user an account in place of a :nil
[17:02:48] smathy: wenqinye, the session one is static, and is used to generate unique ones that are sent out in the responses, and on subsequent requests those are checked against the session one using ActiveSupport::SecurityUtils.secure_compare
[17:03:18] KamalKaur: has joined #RubyOnRails
[17:04:24] BBHoss: has joined #RubyOnRails
[17:04:38] wenqinye: @smathy, http://faye.jcoglan.com/security/csrf.html the code in the tutorial for securing the pub/sub channel seems to imply that the two are the same
[17:04:50] wenqinye: go to the rails example
[17:05:36] smathy: wenqinye, I think they used to be the same in Rails 3.2 - but that security hole was plugged.
[17:05:44] freezevee: ElSif: what about telling me that one thing ?
[17:06:02] ElSif: nope, you gotta get there yourself man, it would be pointless for me to tell you]
[17:06:04] freezevee: ElSif: I am already more than 7 hours trying to understand/pass that test
[17:06:17] ElSif: well i think you will get there :)
[17:06:22] ElSif: 7 hours isnt too long right?
[17:06:34] ElSif: (or woman, no offense)
[17:06:38] wenqinye: @smathy, oh ok thank you, so how would you recommend implementing the csrf protection class then?
[17:06:44] freezevee: ElSif: considering that I must post an assignment tomorrow isn't
[17:06:51] cnk: has joined #RubyOnRails
[17:07:13] freezevee: ElSif: instead of it, it will save my ass
[17:07:32] ElSif: but the point of learning isnt to save your ass it is to learn things :)
[17:07:36] freezevee: ElSif: I am not being rude, I always get enough help from here
[17:07:39] Trynemjoel: has joined #RubyOnRails
[17:07:55] ElSif: ok, ill give you another hint, how would you normally go about creating an account?
[17:08:44] freezevee: ElSif: in the user factory ?
[17:08:49] schaerli: has joined #RubyOnRails
[17:08:53] ElSif: no, just anywhere
[17:09:03] Tamal: has joined #RubyOnRails
[17:09:05] freezevee: just .create it
[17:09:30] freezevee: but what has it to do with the user factory and the nil ?
[17:09:42] ElSif: you would be preventing the infinite loop
[17:09:46] ElSif: by overriding it :)
[17:10:13] ElSif: unless you really just cause it right?
[17:10:26] ElSif: you see where i am going?
[17:10:49] freezevee: seavenseacat told me to set the user as nil just an hour ago
[17:10:52] ElSif: ok, well im not sure i can really help much but just try deleting the line out of your account factory that calls your user facotry
[17:11:02] ElSif: im such a bad teacher T_T
[17:11:36] platosha: has joined #RubyOnRails
[17:11:41] freezevee: ElSif: what does account :nil have to do with that ?
[17:11:47] bobbobbins: has joined #RubyOnRails
[17:12:39] ElSif: yea, im not sure i can really explain further, thus just suggesting an experiment
[17:12:53] bricker: has joined #RubyOnRails
[17:13:11] smathy: wenqinye, I have no idea how Faye works, where that token is coming from, or what CSRF you're exposed to - sorry. You should start reading here: http://api.rubyonrails.org/classes/ActionController/RequestForgeryProtection.html
[17:13:21] danlucraft: has joined #RubyOnRails
[17:13:29] tandroid: has joined #RubyOnRails
[17:14:17] wenqinye: @smathy ok, thank you for the help, guess I will try to figure this out on my own
[17:14:40] freezevee: ElSif: so you mean to delete the association :user, factory: :user
[17:14:58] tandroid: Hey guys, I'm new to ruby and rails. I'm trying to get the request uri path and I'm not sure what module to include.
[17:15:00] dented42: has joined #RubyOnRails
[17:15:06] freezevee: ElSif: then I ran the test and I am where I started just more than an hour ago, where accounts cannot be found
[17:15:11] smathy: wenqinye, you really should understand it well.
[17:15:12] christiandsg: has joined #RubyOnRails
[17:15:14] tandroid: I thought it would be "request" because I saw that somewhere, but it doesn't seem to be right...
[17:15:15] manfrin: tandroid question doesnt make sense
[17:15:24] alxndr: has joined #RubyOnRails
[17:15:29] manfrin: what do you mean trying to get the request path?
[17:15:37] hellschreiber: has joined #RubyOnRails
[17:15:37] ElSif: freezevee: but you dont have a loop anymore :D
[17:15:46] tandroid: I want to get the base path from the current url.
[17:15:51] lurch_: has joined #RubyOnRails
[17:15:54] freezevee: ElSif: tha loop isn't the problem
[17:15:56] ElSif: so now just associate the records manually
[17:16:02] mikecmpbll: has joined #RubyOnRails
[17:16:07] ElSif: but it is `a` problem
[17:16:08] freezevee: ElSif: what ?
[17:16:29] freezevee: ElSif: where should I associate and what records ?
[17:16:31] DEA7TH_: has joined #RubyOnRails
[17:16:36] tandroid: so in "example.com/foo/bar", I want "/foo/bar"
[17:16:39] ElSif: looks like user to account?
[17:16:41] nettoweb: has joined #RubyOnRails
[17:16:58] ElSif: or account to user? i dont know what your associations are defined as
[17:17:04] ElSif: try both :D
[17:17:41] tandroid: manfrin: I don't know how to get either of those right now :/
[17:17:58] ElSif: why not step back to a simple case of creating an account and a user seperately (just 1 each), then try associating them
[17:17:59] freezevee: ElSif: you mean association :account, factory: :peter_account ?
[17:18:02] smathy: tandroid, request.path in your controller.
[17:18:10] freezevee: ElSif: in the user factory ?
[17:18:11] ElSif: no, in your test
[17:18:17] manfrin: http://stackoverflow.com/questions/8288138/how-to-parse-url-to-get-base-url-rails-3-1
[17:18:21] ElSif: if you do that, then you will be back at the loop
[17:18:39] freezevee: ElSif: I get the User can't be black
[17:18:47] ElSif: ah, so you have a validation then?
[17:18:57] ElSif: (or is your app just racist?)
[17:18:59] smathy: tandroid, but it's very rare in Rails that you need to use that, are you sure you do?
[17:19:05] freezevee: ElSif: just because you told me to delete the association line in the account factory
[17:19:27] freezevee: ElSif: so I deleted the association :user, factory: :user line and of course it can't find a user
[17:19:52] freezevee: ElSif: I mean, it seems to me that this isn't getting anywhere
[17:20:12] ElSif: well you are going in circles defintely, but that means your still moving :D
[17:20:20] gambl0re: has joined #RubyOnRails
[17:20:26] tandroid: smathy: On the timeline I'm on, I don't have much of a choice. Any other time I'd be happy to take the time to do things the right way, but this site will be gone in a few months anyway.
[17:20:47] ElSif: i think you are missing the basic idea of how records get associated, it is not magic, and neither are factories
[17:20:49] k1t_: has joined #RubyOnRails
[17:21:48] freezevee: ElSif: can you help ?
[17:21:51] ElSif: you have a validation in your account model yes?
[17:21:54] tandroid: also, has anyone ever used radiant cms?
[17:22:08] ElSif: my only suggestion is to eliminate code that you dont understand until you have only code that you do understand
[17:22:19] ElSif: try commenting out that validation
[17:22:35] DELL: has joined #RubyOnRails
[17:23:16] jdayvie: has joined #RubyOnRails
[17:25:51] roolo: has joined #RubyOnRails
[17:26:01] freezevee: ElSif: at least I am going somewhere
[17:26:03] smathy: tandroid, the right way isn't slower, it's faster.
[17:26:13] tandroid: smathy: I'm all for that
[17:26:16] freezevee: ElSif: I got a String can't be coerced into BigDecimal error
[17:26:22] bmurt: has joined #RubyOnRails
[17:26:32] smathy: tandroid, eg. using path helpers, if you're creating URLs for links or forms or whatever.
[17:26:32] ElSif: yay new error!
[17:26:45] ElSif: freezevee: can you gist the line that cause it?
[17:27:07] pontiki: today is just not my day
[17:27:17] smathy: freezevee, actually, can you make a full gist of the spec, the two factories involved, and the problem you're having.
[17:27:19] tandroid: smathy: what I'm doing is pretty bad to start with. I'm basically adding a template to pages based on their path.
[17:27:40] pontiki: what is the majic to get vendor/assets/images/* to actually get precompmiled??
[17:27:40] freezevee: smathy: I got a complete repo https://github.com/chrisvel/The-ruby-bank/blob/master/app/models/account.rb
[17:27:46] ElSif: smathy: he did that
[17:27:47] freezevee: ElSif: https://github.com/chrisvel/The-ruby-bank/blob/master/app/models/account.rb it's the 12 line here
[17:28:05] mloy: has joined #RubyOnRails
[17:28:19] freezevee: ElSif: https://github.com/chrisvel/The-ruby-bank/blob/master/spec/factories/transacts.rb and these are the data
[17:28:20] tandroid: for example any page under "about-us" gets the "about" banner image
[17:28:22] smathy: tandroid, oh, I just saw your question on radiant :) Ok, I'll leave you to your hacking, you're obviously very limited in what you can do there.
[17:28:58] tandroid: haha thanks. This thing was built in 2011 so there's quite a few things that are less than ideal.
[17:29:11] ElSif: freezevee: so you are setting amount to a string, but you need a number, you can solve that a few ways
[17:29:22] lethjakman: has joined #RubyOnRails
[17:29:26] alfie_max15: has joined #RubyOnRails
[17:29:43] freezevee: ElSif: to_d ?
[17:29:58] ElSif: freezevee: not the most common, but probably
[17:30:22] freezevee: ElSif: all right
[17:30:24] freezevee: ElSif: expected the response to have status code :ok (200) but it was :found (302)
[17:30:29] freezevee: this seems more solvable
[17:30:45] alfie_max15: Got a small issue, i'm not sure if it's related to rails or something else. Can any one please help me out here.
[17:30:55] ElSif: freezevee: see you are not getting nowhere :)
[17:31:07] ElSif: freezevee: im gonna step away for a bit, ill check back
[17:31:15] freezevee: ElSif: thanks for your time, really
[17:31:23] freezevee: sevenseacat: and thank you too
[17:31:47] pontiki: i have this in application.rb: config.assets.paths << Rails.root.join("vendor","assets","images")
[17:31:53] alfie_max15: = link_to "Reserve", reserve_path(vehicle), data: {:confirm => t('.confirm_reserve')}, :class => 'button', :method => :put
[17:32:06] pusewicz: has joined #RubyOnRails
[17:32:11] pontiki: when i fire up the console, Rails.configuration.assets.paths shows that addtiion
[17:32:21] alfie_max15: even when i cancel the confirmation box, it still proceeds
[17:33:46] eggoez: has joined #RubyOnRails
[17:34:05] bronson: has joined #RubyOnRails
[17:35:41] werelivinginthef: has joined #RubyOnRails
[17:36:11] sinkensabe: has joined #RubyOnRails
[17:36:16] mloy: Has anybody else had a problem with your Heroku rails app not updating its Procfile even after pushing changes?
[17:36:25] Betray1st: has joined #RubyOnRails
[17:37:07] chouhoulis: has joined #RubyOnRails
[17:37:11] mloy: 2015-07-23T17:34:29.278156+00:00 heroku[web.1]: Starting process with command `bundle exec puma -C config/puma.rb`
[17:37:14] mloy: 2015-07-23T17:34:32.379142+00:00 app[web.1]: bundler: command not found: puma
[17:37:40] zpe: has joined #RubyOnRails
[17:37:46] romdi: has joined #RubyOnRails
[17:37:47] mloy: I removed that line from my Procfile, staged, committed, pushed to Heroku, and yet it's still running that line. :/
[17:38:01] mloy: Is this the wrong channel to ask this sort of question? If so, I apologize, I suppose it's only tangentially related to Rails.
[17:38:07] davidheward_: has joined #RubyOnRails
[17:38:21] djbkd: has joined #RubyOnRails
[17:39:19] jhack: has joined #RubyOnRails
[17:41:04] bronson: has joined #RubyOnRails
[17:41:51] mwlang: mloy: There???s probably a heroku channel, but there???s not really enough info in your inquiry to respond with a good answer unless someone here has seen exactly your error recently.
[17:42:25] NodeNagant: has joined #RubyOnRails
[17:42:55] dented42: has joined #RubyOnRails
[17:43:11] mwlang: mloy: My guess is that the puma gem may be injecting it???s own deploy scripts or you???re requiring a capistrano/puma gem in your deploy script.
[17:43:29] mwlang: but I???m just speculating since I neither use Heroku nor Puma.
[17:44:17] mloy: mwlang, thanks, both are good guesses that I'll look into. I appreciate your offering advice even though this is def the wrong channel and I didn't give enough info. Currently trying to figure out what would be enough info, but at that point I'll probably have it figured out xD
[17:44:58] mwlang: mloy: gist your Gemfile and config/deploy.rb and related files.
[17:45:30] mwlang: mloy: I think you can also cap deploy interactively and try to narrow down the source of the command that way.
[17:45:44] roolo_: has joined #RubyOnRails
[17:45:51] mloy: mwlang, gracias. I guess what's weirding me out is I put that line in my Gemfile to generate a puma config file, but when it started crashing my Heroku app I removed it yet the line is still being run.
[17:46:46] mwlang: mloy: are you sure you???re deploying the changes? Perhaps added that on master branch, but removed the line in the development branch?
[17:46:53] mloy: currently I'm thinking maybe Heroku is just on the wrong branch
[17:47:04] mloy: mwlang, checking now
[17:47:33] bobbobbins: has joined #RubyOnRails
[17:47:36] theery: has joined #RubyOnRails
[17:48:32] theery_: has joined #RubyOnRails
[17:49:51] Rubie: has joined #RubyOnRails
[17:52:00] mloy: mwlang, okay I've discovered that that specific command isn't the source of my issues; it was still running that one due to using heroku rollback. Pushing the current master would tell me "everything is already up to date" but then the rollback would still be using the previous commit.
[17:52:07] alfie_max15: has left #RubyOnRails: ("Ex-Chat")
[17:52:35] mwlang: mloy: tricky one.
[17:52:49] mwlang: I can???t remember last time I dealt with a rollback.
[17:53:35] christiandsg: has joined #RubyOnRails
[17:55:41] bricker: has joined #RubyOnRails
[17:55:46] Scriptonaut: I am a bit confused about associations and was wondering if somebody could clear it up. Let's say I have a User model, and a Person model. Person belongs to user and is created by user, and has a created_by_id field. How do I set the created_by_id before saving the User? Do I have to save the user and then set the person and save them again?
[17:56:18] arup_r: has joined #RubyOnRails
[17:57:13] smathy: Scriptonaut, does your belongs_to declaration correctly map to that `created_by_id` field?
[17:57:24] mloy: mwlang, oh WOW. I'm so silly. I completely misread this tut and put CLI commands to generate the Procfile as the LINES OF THE PROCFILE. /facepalm
[17:57:28] tdguy: has joined #RubyOnRails
[17:57:39] smathy: Scriptonaut, eg with a :foreign_key option, or because you use `belongs_to :created_by` with a `:class_name` option?
[17:57:39] mloy: mwlang, to be fair it was 3AM last night and I was insanely tired.
[17:58:18] mloy: mwlang, wait actually I think that was the right thing to do??? Oh wait, sec
[17:58:21] mwlang: mloy: That???ll do it every time.
[17:58:29] zpe: has joined #RubyOnRails
[17:58:34] Scriptonaut: let me double chekc
[17:58:47] arup_r: I have resource :profile in my routes.rb file.. And rake routes is showing controller name as plural. But I want a singular controller name.. What is the option. I want to create Profile not Profiles controller.
[17:58:49] mloy: mwlang, I think that actually *is* right but for some reason my Heroku app isn't getting the puma gem. I'll check my gemfile.
[17:58:49] alphaatom: has joined #RubyOnRails
[17:58:56] Scriptonaut: yes, I have a: belongs_to :created_by, class_name: User
[17:59:03] Scriptonaut: in my Person model
[17:59:22] baweaver: has joined #RubyOnRails
[18:00:01] SirFunk: has joined #RubyOnRails
[18:00:12] arup_r: https://gist.github.com/aruprakshit/f0d43a0db6fce2b48d56
[18:00:25] Haydos: has joined #RubyOnRails
[18:01:17] siemprefresco: has joined #RubyOnRails
[18:01:49] g3funk: has joined #RubyOnRails
[18:02:23] kachi8: has joined #RubyOnRails
[18:05:59] gentle_giant: has joined #RubyOnRails
[18:06:35] gentle_g_: has joined #RubyOnRails
[18:07:53] yardenbar: has joined #RubyOnRails
[18:07:56] teegee543: has joined #RubyOnRails
[18:08:40] rickmasta: has joined #RubyOnRails
[18:08:43] bmalum: has joined #RubyOnRails
[18:08:48] shock_one: has joined #RubyOnRails
[18:09:01] kachi8_: has joined #RubyOnRails
[18:11:12] smathy: pontiki, you don't need to add vendor/assets to the assets.paths - it's already there implicitly.
[18:11:29] smathy: pontiki, what you *do* need to do, for images, is add them to config.assets.precompile
[18:11:35] smathy: ...because there's no manifest file for images.
[18:12:10] smathy: pontiki, you only need to add the *relative* name from `vendor/assets/images`
[18:12:11] acti0nman: has joined #RubyOnRails
[18:12:16] arup_r: any pointer on my question ? :)
[18:12:19] mloy: mwlang, ohhhhh, I added gem 'puma' after group :development, :test do in the Gemfile, lol. That's also why rack-timeout wasn't working earlier.
[18:12:37] drale2k: has joined #RubyOnRails
[18:12:49] smathy: Scriptonaut, ok so in User how are you creating the Person instance?
[18:12:54] towski_: has joined #RubyOnRails
[18:12:59] IFrank00: im trying to use the ran(1..20) and need it to be unique
[18:13:34] IFrank00: im using it to create some dummy data on my app
[18:13:54] Scriptonaut: smathy: I don't create Person inside user, but I am creating it with fields_for
[18:14:04] pramsky: has joined #RubyOnRails
[18:14:06] Scriptonaut: I have a form that submits for user, and fields_for for the person attributes
[18:14:12] mwlang: mloy: exhaustion ??? not a good thing.
[18:14:16] Scriptonaut: I think, test suite is running I'll double check
[18:14:20] IFrank00: 20.times project_id: ran(1..20) end
[18:14:38] IFrank00: but need to be unique
[18:14:54] mloy: mwlang, thanks again for your time!
[18:15:47] smathy: arup_r, first question really is - why would you care. But you can provide a `:controller` option to `resource`: http://guides.rubyonrails.org/routing.html#specifying-a-controller-to-use
[18:16:35] smathy: IFrank00, do you mean rand ?
[18:17:00] baweaver: has joined #RubyOnRails
[18:17:06] giowong: has joined #RubyOnRails
[18:18:01] smathy: IFrank00, well obviously that doesn't guarantee uniqueness unless you move the range, like: r = i * 10; rand(r..r+20)
[18:18:02] arup_r: smathy, Yes. thanks. I want it because Profile will be related to only one user at any point of time..
[18:18:12] bricker: smathy: OBVIOUSLY
[18:18:20] arup_r: controller: is the way to go.. thanks
[18:18:22] smathy: arup_r, you understand that your users never see the controller name.
[18:18:26] IFrank00: and another thing is I like to include the 1 and 20 on the select
[18:18:53] hobodave: has joined #RubyOnRails
[18:19:08] smathy: arup_r, and the reason controllers are plural is because they deal with the profiles in your system. Ie. your system has more than one profile.
[18:19:22] smathy: arup_r, anyway, the :controller option is the way, if you must/
[18:19:37] jdayvie: has joined #RubyOnRails
[18:19:50] mwlang: mloy: you???re welcome.
[18:20:23] smathy: Scriptonaut, and you have accepts_nested_attributes_for :person in your User model?
[18:20:57] Scriptonaut: oh, maybe not
[18:20:57] giowong: is there a way to return a array of ids after doing a specific search by id?
[18:21:29] giowong: example : Model.find(id1,id2)
[18:21:40] giowong: this will return array of objects
[18:23:00] mwlang: giowong: feed results into #map: Model.find(id1,id2).map(&:id)
[18:23:16] jdayvie: Hey there, quick question =) I implemented friendly_id to an existing project; however, the articles which are already on the site and they have not changed. I know it says to go into the console, save all the articles; however, I do not have my site database on my localhost. So is there a way to make it work?
[18:23:23] dudoom: has joined #RubyOnRails
[18:23:28] jdayvie: I cannot simply go to the site and update it because it throws an error.
[18:23:30] Scriptonaut: ah, smathy, I was able to move it up and it worked
[18:23:34] giowong: thanks mwlang!
[18:23:37] jdayvie: At least, I cannot change the title that way
[18:23:37] Scriptonaut: so I don't have to save twice
[18:24:06] smathy: Scriptonaut, no.
[18:24:12] smathy: Glad you got it sorted :)
[18:24:19] DEA7TH_: has joined #RubyOnRails
[18:24:45] smathy: giowong, or use pluck.
[18:24:56] joerosion_: has joined #RubyOnRails
[18:25:19] nym: has joined #RubyOnRails
[18:25:23] giowong: is there any difference smathy
[18:25:44] smathy: giowong, yeah, pluck is faster (only really important when the list is large)
[18:25:49] chills42: has joined #RubyOnRails
[18:26:09] Or1on: has joined #RubyOnRails
[18:26:52] smathy: giowong, pluck won't work on the results of find() - you need to use: Model.where(id: [id1,id2]).pluck :id
[18:27:32] urlgrey: has joined #RubyOnRails
[18:27:46] smathy: jdayvie, you have no console access to your production system>
[18:28:19] jdayvie: I do but not with the same data. I would have to just pull the data from heroku onto my localhost.
[18:28:35] sargas: has joined #RubyOnRails
[18:28:50] jdayvie: I did it once before, it was a little confusing but I was not sure if that is required/the only way.
[18:29:00] sargas: has joined #RubyOnRails
[18:30:04] lethjakman: has joined #RubyOnRails
[18:30:59] bruno-: has joined #RubyOnRails
[18:31:22] smathy: jdayvie, you're on heroku? https://devcenter.heroku.com/articles/getting-started-with-rails4#console
[18:31:29] smathy: You have console access to your heroku instance.
[18:31:52] JoshL: has joined #RubyOnRails
[18:32:29] jdayvie: smathy: Wait! So... heroku run rails console allows me into the console on the data on heroku?!!?
[18:32:56] smathy: jdayvie, yes.
[18:33:05] yfeldblum: has joined #RubyOnRails
[18:33:10] s2013: has joined #RubyOnRails
[18:33:14] jdayvie: Uhm...wow...I have no words! =P
[18:33:17] giowong: thanks smathy
[18:33:25] jdayvie: I am...special, to say the least =P Thanks for that information smathy.
[18:33:32] jdayvie: Would have made my life much easier last time! Haha
[18:34:00] DELL: has joined #RubyOnRails
[18:34:07] s2013: if you are running campaigns such as showing popups.. but you only want the user to see it once.. how do you guys go about doing that? i thought about having a popup field that shows popups that user has been shown before or something and if its not there then show it or wahtever
[18:34:38] tuelz: has joined #RubyOnRails
[18:34:57] chinmay_dd: has joined #RubyOnRails
[18:35:26] giowong: whats the proper way to delete a relationship between models?
[18:35:31] giowong: without destroying the actual object>
[18:35:35] nikolaj_basher: has joined #RubyOnRails
[18:35:54] slash_nick: giowong: nil out foreign keys
[18:37:10] smathy: jdayvie, you're welcome.
[18:37:22] jdayvie: Smathy: I hope you have a great day! =)
[18:37:22] roolo: has joined #RubyOnRails
[18:37:23] slash_nick: giowong: see here, just do Ctrl+F for "Removes" http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html
[18:37:25] smathy: jdayvie, not meaning to be an RTFM jerk, but RTFM :)
[18:37:33] smathy: jdayvie, there's a lot of info in those heroku dev docs.
[18:37:35] werelivinginthef: has joined #RubyOnRails
[18:37:39] yfeldblum: has joined #RubyOnRails
[18:38:02] doodlehaus: has joined #RubyOnRails
[18:38:08] tandroid: has joined #RubyOnRails
[18:38:10] naftilos76: has joined #RubyOnRails
[18:38:13] jdayvie: Smathy: Haha, you are right =P I think there are SO many docs, it is overwhelming. It was my mistake as I just assumed that was not possible but that was not smart =P
[18:38:38] smathy: jdayvie, yeah, but you see the title of the doc I linked you to, at least read that one.
[18:38:45] kinduff: has joined #RubyOnRails
[18:39:07] ElSif: s2013: session store of 'popup seen' boolean seems like it would suffice
[18:39:14] jdayvie: I will read that =)
[18:39:18] jdayvie: Thank you!
[18:39:26] smathy: jdayvie, you're welcome.
[18:40:14] s2013: ElSif no i mean these are logged in user..
[18:40:17] arooni-mobile: has joined #RubyOnRails
[18:40:21] s2013: if they log back in we dont wantthem to see it
[18:40:37] smathy: jdayvie, btw, don't feel too bad, I have never used heroku myself but started this year with a team of 6 other devs who have all used it many times. None of them knew you could bring up a rails console, nor did they know you could run any command you wanted (including `heroku run bash` :)
[18:40:48] ElSif: s2013: ok, then persist the session to the db
[18:40:50] smathy: (of course, I read that doc :)
[18:41:00] mloy: has joined #RubyOnRails
[18:41:03] s2013: yea obviously. but how would you model it
[18:41:11] ElSif: s2013: a column?
[18:41:19] mloy: So I updated to rails-4.2.3 and now I'm having to install all of the dependencies manually with gem install :I
[18:41:34] siemprefresco: has joined #RubyOnRails
[18:41:58] jdayvie: Smathy: Haha! Well...at least I am not alone in that thinking but more power to you for reading up and knowing your stuff.
[18:42:01] ElSif: s2013: if it isn't meant to be a permanent campaign then you could model a 'campaigns' object that relates to users
[18:42:20] jenrzzz: has joined #RubyOnRails
[18:42:25] ElSif: ElSif: probably with a many to many relationship
[18:42:30] smathy: s2013, just make a join table "CampaignStats" or something which you can store a join between users and campaigns with various details like whether they've seen it, whether they clicked on it, when you showed it to them, etc.
[18:42:32] NodeNagant: has joined #RubyOnRails
[18:42:36] ElSif: smathy: ^
[18:42:42] yfeldblum: has joined #RubyOnRails
[18:42:50] ElSif: i was trying to agree with smathy
[18:43:00] mloy: wait no, now bundle install is working.
[18:43:12] smathy: jdayvie, I love docs :)
[18:43:46] jdayvie: smathy: It's a great thing to love =P
[18:43:47] smathy: mloy, you need to run `bundle update` after updating a version of something in your Gemfile.
[18:44:00] mloy: smathy, thanks!
[18:44:06] pixelhandler: has joined #RubyOnRails
[18:44:22] s2013: nah these are temporary campaigns. i mean i have my way of doing it.. but just wondering how others tackle it
[18:44:26] chrissonar: has joined #RubyOnRails
[18:44:30] smathy: mloy, you're welcome.
[18:45:12] k1t: has joined #RubyOnRails
[18:45:17] ElSif: s2013: read smathy's suggestion, it is a good way to go about it
[18:46:42] bmalum: has joined #RubyOnRails
[18:48:10] podman: has joined #RubyOnRails
[18:48:15] bin_005: has joined #RubyOnRails
[18:49:18] [H]unt3r_: has joined #RubyOnRails
[18:49:38] yardenbar: has joined #RubyOnRails
[18:49:39] ElSif: s2013: and if that is the way you are doing it then gj :)
[18:49:44] priara: has joined #RubyOnRails
[18:50:16] tuelz: has joined #RubyOnRails
[18:50:22] smathy: ACTION has never understood the "it's too temporary/small/unimportant/whatever to store it in the DB"
[18:50:22] rromanchuk: has joined #RubyOnRails
[18:50:27] smathy: Stick it in there, delete it later if you want.
[18:50:43] smathy: FFS, you're not writing it in stone.
[18:51:51] richipargo: has joined #RubyOnRails
[18:51:56] giowong: hey slash_nick is inserting objects into a habtm relationship done with the << usually?
[18:52:11] giowong: ive tried setting the foreign key and had no luck
[18:52:16] shanson: has joined #RubyOnRails
[18:52:22] jhack: has joined #RubyOnRails
[18:53:00] ascarter: has joined #RubyOnRails
[18:54:16] bmalum: has joined #RubyOnRails
[18:56:10] christiandsg: has joined #RubyOnRails
[18:57:53] zpe: has joined #RubyOnRails
[18:57:57] smathy: giowong, there's no usual way.
[18:58:07] Jon30: when I am doing an ajax request I am getting (ActionController::InvalidAuthenticityToken on staging server... but not locally. Any ideas why? I am even adding the CSRF token within the Ajax request: https://gist.github.com/slavajacobson/888e64557afd2ec5a41f
[18:58:08] thelastinuit: has joined #RubyOnRails
[18:58:33] DELL: has joined #RubyOnRails
[18:59:54] Papierkorb: has joined #RubyOnRails
[19:00:05] safeforge: has joined #RubyOnRails
[19:01:02] Mendenhall: has joined #RubyOnRails
[19:01:50] someone_dell: has joined #RubyOnRails
[19:02:07] manfrin: Jon30 that means you're loading in js from a domain that is not the domain of the current server
[19:02:10] manfrin: what is the value of $('#private-vault').attr("action")
[19:03:07] davidheward_: has joined #RubyOnRails
[19:04:45] giowong: can someone suggest me a way to delete a relation from a habtm that has an array of objects
[19:05:02] Jon30: manfrin, it's a local URL of the server
[19:05:07] giowong: meaning that the arguement that im passing to delete is the array full of objects
[19:05:10] Jon30: it doesn't go to an external server
[19:05:16] manfrin: what is the actual url
[19:05:20] manfrin: or path you are using
[19:06:16] IFrank00: RangeError: 55694230940 is out of range for ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Integer with limit 4
[19:06:16] IFrank00: anybody can help me with this error https://gist.github.com/Frank004/a76e8dc0cd15d698c930
[19:06:39] IFrank00: I was creating some dummy data and got this error
[19:06:41] siddart: has joined #RubyOnRails
[19:06:53] sandelius: has joined #RubyOnRails
[19:06:59] roolo_: has joined #RubyOnRails
[19:07:44] manfrin: what does your db:populate look like
[19:07:58] kinduff: has joined #RubyOnRails
[19:09:25] rakm: has joined #RubyOnRails
[19:09:47] workmad3: has joined #RubyOnRails
[19:10:22] shock_one: has joined #RubyOnRails
[19:11:26] roolo: has joined #RubyOnRails
[19:12:51] IFrank00: has joined #RubyOnRails
[19:12:51] hobodave: has joined #RubyOnRails
[19:13:23] nikolaj_basher: has joined #RubyOnRails
[19:13:51] IFrank00: has left #RubyOnRails: ()
[19:14:03] IFrank00: has joined #RubyOnRails
[19:14:13] DEA7TH_: has joined #RubyOnRails
[19:14:15] kinduff: Hey guys and gals. So I have an RSS fetcher, this goes thru and parses a feed URL. All entries are being stored in the database, I'm also generating a slug for each entry. My question is what's the optimal way to verify duplicates by a field (slug in this example).
[19:14:23] k1t: has joined #RubyOnRails
[19:14:34] IFrank00: https://gist.github.com/Frank004/a76e8dc0cd15d698c930 need some help with this
[19:14:49] kinduff: I don't want to loop each entry and verify it agaisnt the db
[19:15:01] ciree: kinduff: add a validates uniqueness
[19:15:31] ciree: validates :slug, uniqueness: true
[19:15:46] ciree: kinduff: you can also do a database level constraint
[19:16:10] kinduff: ciree: is db constraint more optimal?
[19:16:56] cac: has joined #RubyOnRails
[19:17:24] Jon30: manfrin, the url is this: '/private-arbitration-decisions'
[19:17:34] Jon30: it doesn't include a hostname
[19:19:17] logik-bomb: is it possible to create a nested record bypassing the parent validation?
[19:20:11] aldodelgado: has joined #RubyOnRails
[19:20:33] aldodelgado: Any suggestions on handling ???buy one get one??? on products
[19:20:53] roolo_: has joined #RubyOnRails
[19:20:53] ciree: kinduff: I think so
[19:20:56] aldodelgado: I???m thinking the method should live in the model however the checkout should really handle it
[19:20:58] shock_one: has joined #RubyOnRails
[19:21:55] mbd2: has joined #RubyOnRails
[19:22:09] someone_dell: model is better
[19:22:13] blackmesa: has joined #RubyOnRails
[19:23:28] aldodelgado: someone_dell: thanks
[19:23:35] aldodelgado: thats wht I thought too
[19:24:07] jhack: has joined #RubyOnRails
[19:24:07] jhack: has joined #RubyOnRails
[19:25:27] s2013: has joined #RubyOnRails
[19:25:41] naftilos76: has joined #RubyOnRails
[19:25:52] kachi8_: has joined #RubyOnRails
[19:26:14] kinduff: ciree: thanks!
[19:26:52] DCio: has joined #RubyOnRails
[19:27:03] dented42: has joined #RubyOnRails
[19:27:05] someone_dell: has joined #RubyOnRails
[19:27:33] intuxicated: has joined #RubyOnRails
[19:27:43] smathy: Jon30, do you get the same error in staging when you refresh the page before triggering that ajax?
[19:27:56] DCio: hey, what would be the best way to store many excel fails without using third party content hosting? I'm going to have to look up these files by name or tag, as well as access them directly to easily manipulate data, so i think storing them in a database is necessary
[19:28:02] DCio: *files not fails
[19:28:16] someone_dell: has joined #RubyOnRails
[19:28:32] michaeldeol: has joined #RubyOnRails
[19:28:41] Axilla: finally, finished converting all my resque jobs into activejobs :)
[19:28:49] Axilla: tests are GREEEEEN! Weeee
[19:28:50] smathy: IFrank00, what part of the error isn't clear to you?
[19:29:16] qejk: has joined #RubyOnRails
[19:29:40] smathy: DCio, use one of the attachment gems like paperclip or carrierwave: https://www.ruby-toolbox.com/categories/rails_file_uploads
[19:30:01] smathy: axilla, yay you. Using which backend?
[19:30:24] Axilla: resque still
[19:30:38] brunno: has joined #RubyOnRails
[19:30:46] Axilla: but may want to switch in the future and we're upgrading the app to rails4 finally
[19:30:47] smathy: axilla, fair enough, good to change just one thing. You going to move to sidekiq too?
[19:30:49] dudoom: has joined #RubyOnRails
[19:30:50] Jon30: smathy, in the browser's console or something? nope... the page loads just fine with no errors.. really strange.
[19:30:56] Axilla: possibly in the future
[19:31:10] Axilla: only thing i'm not 100% sure of is how to use batched_jobs with activejobs
[19:31:22] Axilla: i have one set of batched_jobs, running my test suite now to see if everything works
[19:31:40] Axilla: before i did a special enqueue_batched_job or whatever
[19:31:43] IFrank00: smithy dont get what its telling me
[19:31:59] Axilla: IFrank00 its saying your number is to big
[19:32:02] Axilla: change the field to BigInt
[19:32:02] smathy: Jon30, sounds like a turbolinks problem then, maybe you're getting the wrong csrf value somewhere. Can you gist your code.
[19:32:21] Axilla: RangeError: 55694230940 is out of range for ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Integer with limit 4? is that what you're discussing?
[19:32:25] smathy: IFrank00, that value is out of range for the data type you're trying to store it in.
[19:32:29] Jon30: smathy, not using turbolinks. ok sec
[19:32:31] srinidhi: has joined #RubyOnRails
[19:32:33] smathy: axilla, yes.
[19:32:48] smathy: Jon30, but it works when you refresh, but not when you load through a link>
[19:32:58] VeryBewitching: has joined #RubyOnRails
[19:33:03] Axilla: i'm actually going to try and use turbolinks in rails5
[19:33:08] Axilla: it sounds good actually finally maybe?
[19:33:13] Jon30: smathy, I am just trying to get JSON data by sending a Post request to the server. Works fine locally
[19:33:15] Axilla: who's wants to hold their breath with me?
[19:33:21] smathy: logik-bomb, your question isn't clear, can you show what you're trying to do in a gist?
[19:33:39] smathy: axilla, I love it, and use it all the time. Just be sure to read the README.
[19:34:05] smathy: Jon30, I asked if when you reload the page, and then trigger the ajax, whether it works. You said it did.
[19:34:08] Axilla: i've read it, its just not quite there yet imo.
[19:34:19] Axilla: i think turbolinks "3" will be good though
[19:34:22] smathy: Jon30, so it only doesn't work when you load the page normally (ie. by clicking through to it)?
[19:34:32] Jon30: smathy, no it doesn't work, ever. except when i run the app locally in development.
[19:34:38] IFrank00: I'm using ffaker gem so it generate a email and I add it a count hombre on front it was working normal with out out of range
[19:35:05] Jon30: smathy, not trying to load any page, not using turbolinks, simply i am making a $.ajax request to the server to get some JSON data.
[19:35:07] smathy: Jon30, ok, so you said "the page loads just fine with no errors" - not sure what that meant now, but ok.
[19:35:47] Jon30: using the ajax while I am on a certain page
[19:35:57] smathy: Jon30, ok, so what about a normal form, does that work?
[19:36:29] Jon30: i'll try that.
[19:36:31] smathy: Jon30, actually, what did that last statement mean: "using the ajax while I am on a certain page" ?
[19:36:55] baweaver: has joined #RubyOnRails
[19:37:08] smathy: Jon30, I'm working on the assumption that in staging, the ajax never ever works, ie. no matter what you've tried you always get the invalid token error.
[19:37:33] DCio: smathy, it seems paperclip is for use with a filesystem, not a database
[19:37:40] Jon30: smathy, why would it happen though?
[19:38:25] aldodelgado: Where does the logic go if I wanted to pass an argument for the new method on create? https://gist.github.com/aldodelgado/cac80eed17050d247e31
[19:39:13] Guest64571: has left #RubyOnRails: ()
[19:39:27] Jon30: smathy, what's funny is.. Ajax works locally, but form with remote: true doesn't. lol!
[19:39:45] smathy: DCio, it stores the file contents in the filesystem, and a reference to them in your DB - which is what you should do.
[19:39:51] cornerma1: has joined #RubyOnRails
[19:39:57] Jon30: getting: ActionController::InvalidAuthenticityToken
[19:39:58] mloy: aldodelgado, you'd use a callback http://guides.rubyonrails.org/active_record_callbacks.html
[19:40:03] DCio: smathy, im going to be using heroku, so i can't do that.
[19:40:21] silverdust: has joined #RubyOnRails
[19:40:22] smathy: Jon30, sorry, you're losing me here. I asked if (in staging) you could submit a normal form?
[19:40:30] smathy: DCio, of course you can.
[19:40:40] DCio: I would use a third party file-system like amazon S3, but then each time i want to manipulate data, the program must download the file of the web which adds too much time as i am dealing with very large amounts of data
[19:40:44] ElSif: aldodelgado: consider why youa are passing any argument though, as callbacks are notoriously missused and annoying to debug :)
[19:40:45] mloy: aldodelgado, np I hope that helps. Let me know if it doesn't.
[19:40:52] Jon30: smathy, I tried to do it locally first, I used a regular form with remote: true enabled, and it sends me to an error page with: "ActionController::InvalidAuthenticityToken"
[19:40:56] smathy: DCio, just that you need to use a different file storage system like S3
[19:41:07] Jon30: smathy, sorry brb. washroom.
[19:41:27] aldodelgado: ElSif: its a coding excirse not really going to be used in production. Trying to make it as clean and little code as possible
[19:41:46] ElSif: aldodelgado: gotcha then callback away
[19:41:54] kinduff: Why is this not working: "before_save :create_slug; validates :slug, uniqueness: true"
[19:41:58] smathy: Jon30, ok so explicit $.ajax is broken in staging (but working in dev) and remote:true forms are broken in dev (and I assume staging as well).
[19:42:04] DCio: maaybe it can work, but file size is in the range of 7-10 MB so im afraid downloading each file will take far too long
[19:42:07] smathy: Jon30, still no news on what I asked for, a regular form in staging.
[19:42:09] IFrank00: smithy I'm trying to find what column its getting that value
[19:42:19] kinduff: The `create_slug` method is creating the slug with a parameterize function
[19:42:23] smathy: DCio, downloading to where?
[19:42:44] christiandsg: has joined #RubyOnRails
[19:43:17] DCio: the backend so our backend can process the data. These files will have to be manipulated because they contain survey data which we allow our clients to analyze. I'm essentially creating a data analyzing web-app
[19:43:50] poli: has joined #RubyOnRails
[19:43:57] DCio: each excel file contains the results of a survey. If a client wants to look at results across all surveys tagged with the keyword "iPhone" I would have to download each one from S3
[19:44:21] smathy: DCio, so you'll have a web user upload the file, that goes via your server and would be stored in S3, and then some async process does some post-processing on that file at some later point?
[19:44:48] tubbo: backends all the way down
[19:45:19] DCio: essentially.
[19:45:44] DCio: could be sifting through 100's of gigs of data though down the road as these results accumulate, so not sure if S3 is the best idea
[19:46:00] IFrank00: smathy I'm trying to find what column its getting that value
[19:46:08] k4nd4lf: has joined #RubyOnRails
[19:46:13] Tamal: DCio, I'm interested in something similar. My issue being I can't use an external system like S3 (has to be all behind the enterprise firewall)
[19:46:15] jgpawletko: has left #RubyOnRails: ()
[19:46:36] Tamal: I don't have any answers??? just interested
[19:46:55] DCio: i was going to try and use just a regular database with a paperclip-like method
[19:47:21] DCio: store file as blob, then use activerecord relations so that each "file model" has_one of the blobs
[19:47:47] smathy: DCio, you really don't want to load your main DB with all that data, your app (which depends on low-latency requests from that DB) will suffer horribly.
[19:47:55] Jon30: smathy, deploying to staging now. 5-10 mins.
[19:47:55] DCio: yeah thats what ive heard
[19:48:22] Jon30: do I need this? config.action_view.embed_authenticity_token_in_remote_forms = true
[19:48:44] smathy: DCio, you're right though, for the offline processing you'd be better off having that closer to the data store itself. You might find that it's better to use something other than heroku for that piece.
[19:50:20] DCio: unfortunately, i have no capital and can't really afford some of the more expensive options. Maybe I'll give heroku's support a call and see if they have any answers or reccomendations for what i'm doing.
[19:50:31] workmad3: has joined #RubyOnRails
[19:50:57] DCio: thanks for the help smathy
[19:51:02] tubbo: DCio: "could be" is not enough of a reason to be considering anything other than the simplest solution, IMO
[19:51:23] smathy: DCio, I don't know how much you think storing 100s of gigs of data in a heroku DB will be, but you're going to very quickly run into a clusterfuck nightmare there.
[19:51:33] tubbo: Tamal: have you considered using Amazon's VPC and using their VPN appliance that makes it so the VPC can be accessed internally?
[19:51:45] DCio: VPN are u jokes?
[19:51:47] czerasz2: has joined #RubyOnRails
[19:52:06] tubbo: DCio: i *am* jokes. you shall bow before me every time laughter ensues.
[19:52:21] DCio: tubbo: *bows*
[19:52:29] smathy: ...and the main problem is that AFAIK Heroku's DB product has an upper limit of 1TB, (which is like $2k per month btw) so you're probably going to need to totally rearchitect this anyway.
[19:52:43] DCio: christ i hate my life
[19:52:44] smathy: S3 and an EC2 for the background processing will only cost what you're using.
[19:53:00] DCio: ill see what they are doing now
[19:53:02] tubbo: if you actually are going to be taking in 100s of GBs of data at a clip, you should definitely think of using some kind of Hadoop business
[19:53:21] tubbo: because that will accumulate to the petabyte level quickly
[19:53:39] tubbo: but again, this is only if that's an actual problem...otherwise it's way too much work
[19:53:40] smathy: tubbo, these 100s of GBs of data are excel files.
[19:53:51] DCio: hmmm well probably not. the individual files are like 8-10MB, and are produced maybe like 3-4 times a month (at the current rate)
[19:53:57] baweaver: has joined #RubyOnRails
[19:54:14] DCio: the problem is that there is potential for a looot of growth with this company
[19:54:37] sargas: has joined #RubyOnRails
[19:54:43] tubbo: yeah but you're a good programmer, right DCio? so you'd be designing something that can be modified later on with relative ease. ;)
[19:55:30] smathy: Anyway DCio, my recommendation is to use AWS for your background processing and storage, leave your main web app on heroku if you want, and use paperclip/carrierwave or something to store the file and then just trigger the background processing using AWS Lambda or something.
[19:55:38] tubbo: smathy: isn't hadoop document-oriented? excel files are in "My Documents" therefore they should work with document-oriented DBs??? ;) #trololol
[19:55:44] Jon30: smathy, same thing on stating for regular form: 'ActionController::InvalidAuthenticityToken'
[19:55:51] smathy: tubbo, :)
[19:55:54] tubbo: how to integrate my documents folder w/document db
[19:55:57] robbyoconnor: has joined #RubyOnRails
[19:56:12] NodeNagant: has joined #RubyOnRails
[19:56:31] tubbo: Jon30: you're not sending CSRF in the JSON i assume?
[19:56:34] tubbo: err, the CSRF token
[19:56:34] smathy: DCio, actually, y'know, I'd also check out Azure. I bet they have some sort of Excel file processing service.
[19:56:47] smathy: Ooh, look, here it is: http://research.microsoft.com/en-us/projects/exceldatascope/
[19:57:36] Jon30: tubbo, I tried using several methods to send CSRF with the Ajax request. This time I am using a regular form but it's still not working
[19:57:41] kadoppe: has joined #RubyOnRails
[19:57:43] smathy: Jon30, ok cool, so probably your issue is related to your staging setup for secrets, your SECRET_KEY_BASE var, or something.
[19:57:57] Jon30: tubbo, but it works locally just fine when I use $.ajax ...without CSRF token
[19:57:57] smathy: Jon30, how do you have that all setup?
[19:58:05] tubbo: Jon30: you got csrf_meta_tags in the HTML, and protect_from_forgery in the app controller?
[19:58:27] smathy: Jon30, !gist - actually, just gist your code.
[19:58:27] helpa: Jon30: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[19:58:45] zuQe8: has joined #RubyOnRails
[19:59:01] n008f4g_: has joined #RubyOnRails
[19:59:04] Mendenhall: has joined #RubyOnRails
[19:59:21] smathy: IFrank00, sorry, no idea what your last comment to me was about.
[19:59:22] Jon30: tubbo, yes for both.
[19:59:45] Jon30: smathy, which files do you want to see? the secret tokens?
[20:00:18] naftilos76: has joined #RubyOnRails
[20:01:22] Jon30: odd that the $.ajax works locally
[20:02:06] smathy: Jon30, that plus your controller that failing, your application controller, the view, maybe show the HTML that's being generated (or give us the link to your staging).
[20:02:15] zpe: has joined #RubyOnRails
[20:02:25] smathy: Jon30, !gist-usage in case you're not aware how to include multiple files and make the syntax pretty
[20:02:25] helpa: Jon30: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[20:03:18] DCio: Jon: add a hidden field to your ajax form, and in your javascript give it the the same value attribute of the csrf-token
[20:04:18] polpak: has joined #RubyOnRails
[20:05:03] Hates_: has joined #RubyOnRails
[20:05:39] smathy: DCio, he's already adding the X-CSRF-Token header to his ajax request.
[20:07:06] IFrank00: smathy I'm looking which column its getting that value
[20:07:12] Jon30: smathy, https://gist.github.com/slavajacobson/32d827d41d71b6040ada
[20:07:13] benlieb: has joined #RubyOnRails
[20:07:27] IFrank00: RangeError: 55694230940 is out of range for ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Integer with limit 4? is that what you're discussing?
[20:07:56] IFrank00: smathy its say that the limit its of 4 spaces ??
[20:08:55] jxpx777: has joined #RubyOnRails
[20:10:59] jsrn_: has joined #RubyOnRails
[20:11:35] michael_mbp: has joined #RubyOnRails
[20:12:21] smathy: IFrank00, ok, so the way to work that out is to look at which line generated the exception.
[20:12:48] smathy: IFrank00, can you see the most recent place where the backtrace left your own code?
[20:13:42] IFrank00: smathy fount it
[20:14:52] IFrank00: on my database a column that was add it did not have a limit of space and rails limit it to 4 spaces only
[20:16:29] smathy: Jon30, I don't understand how javascript.coffee is (a) not raising an error (using `super` outside of an instance method) or (b) doing anything (it's just defining a function).
[20:18:02] Jon30: smathy, sorry, i removed portion of the code to clean it up a bit
[20:18:06] smathy: Jon30, also, `secret_token.rb` - what the? Which version of Rails is this?
[20:18:24] Jon30: smathy, it's 4.0.5
[20:18:36] smathy: Heh, ok, so you should lead with that next time.
[20:18:53] smathy: We assume you're running the latest version.
[20:18:54] lethjakman: has joined #RubyOnRails
[20:19:14] bronson: has joined #RubyOnRails
[20:19:15] Jon30: should I upgrade to at least 4.0.13?
[20:19:21] Jon30: would that fix it? :P
[20:20:21] smathy: I don't know, but I meant that we assume you're using 4.2
[20:20:59] smathy: Also, can you add the actual HTML that's in your browser please.
[20:21:05] neanderslob: has joined #RubyOnRails
[20:21:13] tsvenson: has joined #RubyOnRails
[20:21:53] mike___1234: has joined #RubyOnRails
[20:23:22] shinnya: has joined #RubyOnRails
[20:23:51] Trynemjoel: has joined #RubyOnRails
[20:24:15] ledestin: has joined #RubyOnRails
[20:24:33] EminenceHC: has joined #RubyOnRails
[20:24:51] mloy: http://blog.codeship.com/how-to-deploy-nginx-on-heroku/ I just found this while trying to figure out how to set up nginx on Heroku, written 07-15-15, thought y'all might find it useful/interesting.
[20:25:18] mloy: If anybody has different/better solutions, would love to hear it! Messing around with this now though.
[20:25:28] Jon30: smathy, https://gist.github.com/slavajacobson/32d827d41d71b6040ada
[20:25:32] Jon30: browser.html
[20:26:52] tsvenson_: has joined #RubyOnRails
[20:29:06] ruurd: has joined #RubyOnRails
[20:29:31] smathy: Jon30, cool, now can you update the JS with the right name and the full content please, and can you add the output of `rake routes` too please.
[20:29:41] platosha: has joined #RubyOnRails
[20:30:16] smathy: IFrank00, glad you worked it out.
[20:32:22] Trynemjoel: has joined #RubyOnRails
[20:34:37] Jon30: smathy, done
[20:35:50] hutch78: has joined #RubyOnRails
[20:36:12] alexclark: has joined #RubyOnRails
[20:36:17] hutch78: hi all, i have a remote gem on github, and i just pushed some changes to it. When i bundle update on my live server, it does not reflect the changes.. any ideas?
[20:36:52] smathy: Jon30, ok so look at your routes, this is the matching route for a POST to /private-arbitration-decisions -> authenticate POST /private-arbitration-decisions(.:format) downloads#authenticate
[20:37:02] alexclark: I'm trying to do a save in the console and its returning true without actually saving
[20:37:03] smathy: Jon30, you're not showing the DownloadsController
[20:37:14] smathy: (so I assume you didn't realize that's where your code was going)
[20:37:42] alexclark: i have logging and its not showing a sql statement, also i search the model for the words 'before' and 'after' and didnt find any callbacks
[20:37:52] alexclark: has anyone seen this?
[20:37:59] ascarter: has joined #RubyOnRails
[20:38:03] smathy: Jon30, also, if javascript.coffee is the actual name of that JS file, then it's not even being loaded.
[20:39:24] smathy: Jon30, ...which means that the form is probably just being submitted normally, and because the normal form doesn't contain an authenticity token then that'd explain why it's failing on that.
[20:40:32] smathy: hutch78, you didn't increment the version?
[20:40:36] smathy: hutch78, what's the gem?
[20:41:01] hutch78: its my first time contributing to one, i kind of just forked it and made it work for what i was trying to do
[20:41:04] hutch78: still learning
[20:41:07] Jon30: smathy, the JS is loaded just fine. I added console logs and alerts and stuff. anyway, I updated the gists
[20:41:07] smathy: alexclark, if a model isn't dirty then nothing will be done in the DB, but .save is still true.
[20:41:18] hutch78: smathy: can i PM you?
[20:41:21] bronson: has joined #RubyOnRails
[20:41:30] smathy: hutch78, yeah, np.
[20:41:47] smathy: ACTION isn't one of these weird PM hating people
[20:42:01] kham: has joined #RubyOnRails
[20:42:08] hutch78: ive gotten scolded for it lol
[20:42:24] alexclark: smathy: is there a way i can confirm if the model is dirty?
[20:42:29] Jon30: smathy, $.post('/private-arbitration-decisions', {
[20:42:29] Jon30: password: '1234',
[20:42:30] Jon30: authenticity_token: $('meta[name="csrf-token"]').attr('content')
[20:42:30] Jon30: }); is what outputs Invalid authenticity token in the log file
[20:42:39] bricker: alexclark: model.changeD?
[20:42:39] Jon30: ooops my bad. Thought it would all go in one line.
[20:42:45] alexclark: smathy: we were definitely observing a change
[20:42:57] alexclark: bricker: cool, will try thanks
[20:42:58] bricker: alexclark: how do you know it's not saving?
[20:43:39] ruurd: has joined #RubyOnRails
[20:43:41] tandroid: has joined #RubyOnRails
[20:44:12] alexclark: bricker: when we reload the model the changes vanish
[20:44:25] Jon30: smathy, I think it's strange that it works locally but not on the staging server
[20:44:41] alexclark: un moment, i will get the log into a gist
[20:44:41] bricker: alexclark: which DBMS? Something replicated?
[20:44:56] disgrntld: has joined #RubyOnRails
[20:45:25] smathy: Jon30, what's going on man? You *JUST ADDED* the <script> lines showing that file being loaded!
[20:46:01] bricker: alexclark: your database
[20:46:14] alexclark: bricker: oh ok, its mysql
[20:46:24] bricker: alexclark: gist will help \
[20:46:44] alexclark: yep, getting it from my coworker is getting it momentarily
[20:47:06] Jon30: smathy, the file is huge, i stripped down a few things to make it cleaner... I made sure to remove non vendor script files as there were at least 50
[20:47:23] Gnut: has joined #RubyOnRails
[20:47:47] broman: has joined #RubyOnRails
[20:47:49] smathy: Sorry Jon30, this journey of new discoveries is too much for me. The code you pasted into this chat is different to the JS code that you have in your gist (authenticity_token in params vs `X-CSRF-Token` header.
[20:47:58] bradleyprice: has joined #RubyOnRails
[20:48:32] Jon30: yes it is different.. it's something i am just sending out in the browser's console.. both don't work.
[20:49:38] Jon30: works locally but not on the server I mean. Same goes for the $.ajax script in the coffeescript file, it works locally but not on the staging server.
[20:50:32] _cball: has joined #RubyOnRails
[20:51:25] ruurd: has joined #RubyOnRails
[20:52:54] Jon30: smathy, I cleared the cookies and now it works. http://stackoverflow.com/questions/20221211/rails4-actioncontrollerinvalidauthenticitytoken-error
[20:53:54] Jon30: smathy, thanks for the effort
[20:54:05] netzfisch: has joined #RubyOnRails
[20:55:03] smathy: Jon30, np, well done.
[20:55:53] Trynemjoel: has joined #RubyOnRails
[20:57:08] Mweshi: has joined #RubyOnRails
[20:58:20] x-light: has joined #RubyOnRails
[20:58:49] zarubin_: has joined #RubyOnRails
[20:59:55] NodeNagant: has joined #RubyOnRails
[20:59:59] bungoman: has joined #RubyOnRails
[21:00:01] Mweshi: has joined #RubyOnRails
[21:00:47] zarubin_: has left #RubyOnRails: ()
[21:02:21] davidheward_: has joined #RubyOnRails
[21:03:26] testos123123: has joined #RubyOnRails
[21:04:09] Anubix1: has joined #RubyOnRails
[21:04:16] testo123: has joined #RubyOnRails
[21:05:38] marcoceppi: has joined #RubyOnRails
[21:05:52] ruurd: has joined #RubyOnRails
[21:06:20] lxsameer: any idea how to test generators with rspec?
[21:06:29] tsvenson__: has joined #RubyOnRails
[21:07:29] bricker: lxsameer: Look at how Rails does it
[21:07:39] bricker: Rails doesn't use rspec but the concepts are the same
[21:07:50] bricker: there are helpers for it
[21:08:14] bricker: lxsameer: here's an example with rspec: https://github.com/SCPR/secretary-rails/blob/master/spec/lib/generators/secretary/install_generator_spec.rb
[21:08:38] lxsameer: bricker: cool thanks
[21:08:39] Anubix1: I have two models Town and Major, and in show.html.erb (for towns) i am showing list of all towns and i want to add column major name
[21:09:16] doodlehaus: has joined #RubyOnRails
[21:10:48] Anubix1: How i retrieve Major name in Town show view?
[21:13:02] alexclark: has joined #RubyOnRails
[21:13:20] FernandoBasso: has joined #RubyOnRails
[21:13:46] joerosion_: has joined #RubyOnRails
[21:14:44] smathy: Anubix1, "I want to add column major name" means that you want to add that column to your Town model that doesn't have it yet? Or you have it and want to just add it to the view so it's displayed?
[21:15:24] testo123123: has joined #RubyOnRails
[21:16:54] Guest93100: has joined #RubyOnRails
[21:17:11] Anubix1: smathy: I wrote it incorrectly, i have two models Town and Monument, in models i defined Town has_many monuments and Monuments belongs_to town
[21:18:20] Anubix1: smathy: And in index.html.erb for Monument controller i have table of columns like name, size and i want to add column town
[21:18:21] smathy: Anubix1, ok, and what's your actual question?
[21:18:22] nahtnam: has joined #RubyOnRails
[21:18:45] czerasz: has joined #RubyOnRails
[21:19:55] smathy: Anubix1, !associations
[21:19:55] helpa: Anubix1: http://guides.rubyonrails.org/association_basics.html - Active Record Association Basics by Mike Gunderloy
[21:19:58] ujvaljoshi: has joined #RubyOnRails
[21:20:12] smathy: Anubix1, also, really, all the guides.
[21:20:32] gusrub: has joined #RubyOnRails
[21:20:32] smathy: Anubix1, sounds like you're just starting your Rails journey, so the guides are a very good starting point.
[21:20:50] Anubix1: smathy: <% @monuments.each do |monument| %>
[21:20:50] Anubix1: <td><%= monument.name %></td>
[21:20:50] Anubix1: <td><%= monument.size %></td>
[21:20:50] Anubix1: <td><%= @town.find(monument.town_id) %></td>
[21:21:04] Anubix1: it doesnt work
[21:21:11] jenrzzz: has joined #RubyOnRails
[21:21:14] czerasz: has joined #RubyOnRails
[21:21:22] Anubix1: smathy: ye i read all the guides on ror official but there is no solution
[21:21:24] smathy: Anubix1, please read the topic of the channel, specifically: Rules: http://goo.gl/dgSj5
[21:21:32] Guest38521: has joined #RubyOnRails
[21:21:56] tubbo: Anubix1: have you ever tried monument.town.name? :)
[21:22:00] Guest38521: has left #RubyOnRails: ()
[21:22:16] shanson: has joined #RubyOnRails
[21:22:21] smathy: (actually, the rules don't even tell you not to paste multiple lines of code, that's how fundamental that rule is in IRC)
[21:22:37] smathy: Excellent, tubbo volunteers to write Anubix1's code for him.
[21:23:42] Anubix1: tubbo: Ye i tried this but undefined method `name' for nil:NilClass
[21:23:56] baweaver: has joined #RubyOnRails
[21:24:01] tubbo: smathy: everybody gets one (line)
[21:24:34] Giddeon: has joined #RubyOnRails
[21:24:38] smathy: tubbo, look, he's back for another fish.
[21:25:01] smathy: ...the full details are trickling out of him.
[21:25:44] Giddeon: I recently saw "t.integer :user_id, required: true" in a migration file. What does the required: true do? I didin't really understand the documentation on it.
[21:26:00] smathy: Anubix1, seriously @town.find screams out "I HAVE NO IDEA WHAT I'M DOING" - you really need to go learn some more Rails before trying to do this. Get a tutorial or do an online course, or read the guides at the very least.
[21:26:09] tubbo: Anubix1: ^
[21:26:14] jenrzzz_: has joined #RubyOnRails
[21:26:31] bahar: has joined #RubyOnRails
[21:26:55] bahar: has joined #RubyOnRails
[21:27:11] chipotle: has joined #RubyOnRails
[21:28:04] Anubix1: smathy: Yes this is example what i was trying before i changed it 20 times, in console i can get it normally but it doesnt work in view
[21:28:07] smathy: Giddeon, doesn't do anything AFAIK.
[21:29:09] smathy: Giddeon, maybe the author was using a gem that added extra functionality to make a DB constraint using that.
[21:29:21] smathy: ...or maybe it was just broken code.
[21:29:30] Giddeon: smathy, it's new in Rails 4.2
[21:29:57] lala: has joined #RubyOnRails
[21:30:22] Anubix1: has left #RubyOnRails: ()
[21:30:24] Giddeon: http://raysrashmi.com/2014/09/02/new-features-in-rails-4-2/
[21:30:29] dman777_alter: how can I see the version of factory_girl_rails that is installed?
[21:30:41] DmitryM: has joined #RubyOnRails
[21:30:45] bricker: Giddeon: all it does is imply a presence validation
[21:30:58] bricker: belongs_to :user; validates_presence_of :user
[21:31:03] bricker: belongs_to :user, required: true
[21:31:04] bricker: same thing ^
[21:31:07] Giddeon: I think I see now. Looks like you set require:true on the column and then use that in a validation
[21:31:26] Giddeon: Thanks for confirming bricker.
[21:31:30] DmitryM: Hello everyone, asking this here and in #ruby -- shot in the dark. When I debug Rails 4.x with Pry (binding.pry) and I terminate the debugging session with exit, the whole ruby process seems to hang (or block somewhere). This is with Ruby 2.1.2 on OS X. Any tips on how to start debugging this?
[21:31:57] havenwood: has joined #RubyOnRails
[21:31:59] smathy: bricker, so, by "imply" you mean that it does nothing?
[21:32:15] bricker: Giddeon: in classic rails fashion, they just keeping defining unnecessary APIs that they have to support forever or deprecated in 2 versions
[21:32:28] Drewch: has joined #RubyOnRails
[21:32:35] bricker: smathy: no, imply was probably the wrong word to use. It adds the validation.
[21:33:05] smathy: bricker, `t.integer :user_id, required: true` does not add a validation.
[21:33:23] Giddeon: bricker: thanks for confirming that too. It doesn't look like that useful of a feature to me.
[21:33:26] bricker: smathy: I think he's talking about the extra option on the association definition
[21:33:29] bricker: smathy: https://github.com/sgrif/rails/blob/00f55516509770f58f9ce462d45afb80d8f649ca/activerecord/lib/active_record/associations/builder/singular_association.rb#L33-L35
[21:33:32] smathy: bricker, you might be thinking of `t.references :user, required: true`
[21:33:42] smathy: bricker, he asked about t.integer
[21:35:08] michaellippold: has joined #RubyOnRails
[21:35:26] jkamenik: has joined #RubyOnRails
[21:35:33] bricker: I don't know what that does, probably adds a not null constraint and possibly foreign key
[21:35:38] Giddeon: I'm just wondering what this feature gives me that I couldn't do by adding a null: false on the column and using a regular validates presence call
[21:36:49] bricker: Giddeon: where did you see "t.integer required: true" ?
[21:37:29] smathy: ...even in t.references it doesn't do anything, if you put it in the GENERATOR then when it generates the model class it'll null: false to your migration (and required:true to the association in your model class)
[21:37:30] havenwood: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[21:37:32] bronson: has joined #RubyOnRails
[21:37:53] smathy: *it'll add
[21:39:13] bricker: Giddeon: nothing, Rails loves to confuse noobs by providing 100 ways to do something
[21:39:29] workmad3: has joined #RubyOnRails
[21:39:37] stantonnet: has joined #RubyOnRails
[21:39:49] Radar: GOOD MORNING!!1
[21:40:02] Radar: It's Friday!
[21:40:04] smathy: Giddeon, so to re-answer your question. required:true in a migration does absolutely nothing. Adding required:true to a belongs_to association is the same as `validates :the_association_name, presence: true`
[21:40:17] Giddeon: bricker: It's on string and integer columns in some migrations I'm reviewing. Someone elseon my team added it and I had never seen it before. When I asked them, they didn't have a clear understanding. They saw a post somewhere and thought it was a good idea.
[21:40:36] smathy: Giddeon, the person who wrote that migration was either utilizing a feature added by a gem, or writing broken code.
[21:41:02] bricker: Giddeon: oh, yes it sounds like whoever wrote it didn't know what they were doing
[21:41:04] Giddeon: Cool. Thanks for clearing that up
[21:41:13] smathy: Giddeon, thanks for finally believing me.
[21:41:38] bricker: ACTION 10 brickercoins to smathy 
[21:41:47] jenrzzz: has joined #RubyOnRails
[21:42:12] rasalghul_: has joined #RubyOnRails
[21:44:23] smathy: dman777_alter, bundle list factory_girl_rails will show you not just what's installed, but what your app is using.
[21:44:29] allcentury: has joined #RubyOnRails
[21:47:19] DEA7TH: has joined #RubyOnRails
[21:47:35] robbyoconnor: has joined #RubyOnRails
[21:49:47] ur5us: has joined #RubyOnRails
[21:51:15] workmad3: has joined #RubyOnRails
[21:51:33] EminenceHC: has joined #RubyOnRails
[21:52:02] urlgrey: has joined #RubyOnRails
[21:52:33] a346: has joined #RubyOnRails
[21:56:00] jenrzzz: has joined #RubyOnRails
[21:56:42] NodeNagant: has joined #RubyOnRails
[21:58:22] annlewis: has joined #RubyOnRails
[21:58:30] yfeldblum: has joined #RubyOnRails
[22:00:37] benhuda: has joined #RubyOnRails
[22:00:48] wethu: has joined #RubyOnRails
[22:01:04] centrx: has joined #RubyOnRails
[22:01:11] adavia: has joined #RubyOnRails
[22:02:52] gentle_giant: has joined #RubyOnRails
[22:06:25] acti0nman: has joined #RubyOnRails
[22:07:37] ascarter: has joined #RubyOnRails
[22:07:39] lethjakman: has joined #RubyOnRails
[22:12:14] helpa: has joined #RubyOnRails
[22:12:18] Radar: !botsnack
[22:12:18] helpa: Nom nom. Thanks, Radar!
[22:12:23] elia: has joined #RubyOnRails
[22:12:48] asoliman: has joined #RubyOnRails
[22:13:31] s2013: hmm so i have a column (mysql db) with text.. and there are thousands of records.. but they all have the wrong price inside the message field.. whats the best way to update all those records and replace just the price
[22:15:17] fryguy: update <table> set <column> = 'blahblahblah' where ....
[22:15:28] smathy: s2013, "text" and "inside the message field" suggest to me that you have some sort of structured data in this field, JSON or YAML or something?
[22:15:39] xkickflip: has joined #RubyOnRails
[22:16:15] s2013: nah just plain text
[22:16:15] s2013: i dont need to replace the entire text
[22:16:15] s2013: just parts of it.. mysql doesnt support regex
[22:16:51] riotjones: has joined #RubyOnRails
[22:18:07] s2013: i mean i can iterate through it and use gsub but that seems inefficient
[22:18:21] smathy: s2013, this is just a one-off though right?
[22:18:47] smathy: It's just a few thousand rows, by the time you work out the SQL it'd be finished.
[22:19:10] ruurd: has joined #RubyOnRails
[22:19:40] smathy: s2013, and while you're at it, make a new field called `price` and put this price in there for next time.
[22:19:43] smathy: Chrssake man!
[22:19:52] arooni-mobile: has joined #RubyOnRails
[22:20:34] smathy: s2013, and if you're going to store blobs of data, use some structure like JSON or YAML so that you have some hope of working with it (without using string matching) later.
[22:20:38] s2013: smathy there is a field called price.. i updated that.. then i realized they hardcoded the damn message
[22:20:50] s2013: i inherited this piece of shit
[22:21:00] safeforge: has joined #RubyOnRails
[22:21:14] smathy: s2013, remove that field, and add your own `message` method that constructs the string from the price field and whatever extra thing they added.
[22:22:06] s2013: yeah i know. but this code is one of the worst ive ever seen. there are hardcoded things everywhere including primary keys
[22:22:14] s2013: homepage has about 50 if else statements
[22:23:06] smathy: I feel for you. We've all been there.
[22:23:21] smathy: In fact, I've made a career out of cleaning up crappy codebases.
[22:26:24] DEA7TH: has joined #RubyOnRails
[22:27:29] ruurd: has joined #RubyOnRails
[22:27:41] s2013: yeah ive been looking at other peoples code for 10+ years.. this is one of the worst
[22:28:12] s2013: but at this point i dont even care.. as long as it works.. the new stuff i try to do properly but the old stuff im just leaving it alone since we will hopefully rebuild everything soon
[22:29:04] arBmind: has joined #RubyOnRails
[22:30:30] smathy: s2013, cool.
[22:30:57] smathy: s2013, you might want to make a task out of this, if price can ever be updated again in the future, so you can run through and update that message text.
[22:31:39] NodeNagant: has joined #RubyOnRails
[22:32:01] Mendenhall: has joined #RubyOnRails
[22:32:04] Drewch: has joined #RubyOnRails
[22:32:07] s2013: yeah.. i mean its fine for most records..b ut certain ones, wrong price was input and it created bunch of records with the wrong price but we fixed that
[22:32:21] zorak8: has joined #RubyOnRails
[22:32:31] s2013: and i created a check to make sure the price is correct before saving it to the db
[22:32:46] doodlehaus: has joined #RubyOnRails
[22:32:59] giowong: has joined #RubyOnRails
[22:34:13] elia: has joined #RubyOnRails
[22:38:05] smathy: s2013, yeah, DRY is an important principle.
[22:41:23] baweaver: has joined #RubyOnRails
[22:42:37] htmldrum: has joined #RubyOnRails
[22:44:08] bonhoeffer: has joined #RubyOnRails
[22:46:00] Rhidian: has joined #RubyOnRails
[22:46:10] CheckYourSix: has joined #RubyOnRails
[22:49:53] zendrix: has joined #RubyOnRails
[22:50:23] Rhidian: Hey guys is anyone here>
[22:51:12] fryguy: Rhidian: yes people are here
[22:51:41] Rhidian: I'm new to Ruby on Rails, and I'm trying to connect to localhost:3000, and I'm getting an error from Google Chrome
[22:51:47] Rhidian: I was wondering if you guys could maybe help me out
[22:52:12] Lightsword_: has joined #RubyOnRails
[22:52:14] fryguy: you need to show us the error
[22:52:34] Rhidian: This webpage is not available ERR_CONNECTION_REFUSED
[22:52:47] fryguy: is rails running?
[22:52:50] Rhidian: I'm using the guide here: http://guides.rubyonrails.org/getting_started.html
[22:53:01] Rhidian: I'm using the Cloud9 ide right now
[22:53:10] naftilos76: has joined #RubyOnRails
[22:53:23] fryguy: use a pastebin site and pastebin the output of your terminal where you ran rails server
[22:54:22] noodman: has joined #RubyOnRails
[22:54:30] jonee: has joined #RubyOnRails
[22:54:51] bonhoeffer: has joined #RubyOnRails
[22:55:12] Rhidian: Here is the link:
[22:55:12] Rhidian: http://pastebin.com/9vPvWYaU
[22:55:33] fryguy: Rhidian: that output says you are running it on port 8000, not 3000
[22:55:39] fryguy: use localhost:8000 to connect
[22:56:48] Rhidian: I still get the same error
[22:56:48] Rhidian: This webpage is not available ERR_CONNECTION_REFUSED
[22:57:29] fryguy: oh sorry i mistypted
[22:57:31] fryguy: it's port 8080
[22:58:09] eggoez: has joined #RubyOnRails
[22:58:10] Rhidian: Yup, tried that too
[22:58:18] Rhidian: Still doesn't work :/
[22:58:31] fryguy: where is this code running
[22:59:01] s2013: smathy i ended up just using SELECT REPLACE directly in the mysql console
[22:59:15] Lightsword: has joined #RubyOnRails
[22:59:23] smathy: s2013, a good solution.
[23:00:22] Rhidian: It's running here: http://therails-rhidian.c9.io/
[23:00:43] fryguy: Rhidian: if it's not running on your localhost, then you don't use localhost to connect to it
[23:00:48] workmad3: has joined #RubyOnRails
[23:01:18] noodman: has joined #RubyOnRails
[23:01:33] sinkensabe: has joined #RubyOnRails
[23:01:35] Rhidian: Oh ok, but the other things that I am implementing on the guide aren't showing up on where the code is running
[23:01:56] zendrix: has joined #RubyOnRails
[23:02:05] Rhidian: I am currently on step 5 of http://guides.rubyonrails.org/getting_started.html
[23:02:17] kapowaz: has joined #RubyOnRails
[23:02:18] fryguy: you might want to consider doing this locally and trying to not mix and match multiple guides while you have no idea what you are doing
[23:02:18] Rhidian: However, I am not seeing anything that I technically 'should' see.
[23:02:33] neanderslob: has joined #RubyOnRails
[23:02:56] Rhidian: Yeah, I'm following one guide on Udemy, and one of its steps is doing the http://guides.rubyonrails.org/getting_started.html guide
[23:02:59] arBmind1: has joined #RubyOnRails
[23:03:15] NodeNagant: has joined #RubyOnRails
[23:06:36] michael_mbp: has joined #RubyOnRails
[23:08:21] Lightsword: has joined #RubyOnRails
[23:08:58] GeissT: has joined #RubyOnRails
[23:09:50] kham: has joined #RubyOnRails
[23:12:03] kies^: has joined #RubyOnRails
[23:14:33] doodlehaus: has joined #RubyOnRails
[23:15:14] smathy: Rhidian, probably they're not showing up because there's some push/deploy step to get the code out onto that server.
[23:15:34] Radar: Put code on GitHub so that we can inspect it?
[23:15:51] gentle_giant: has joined #RubyOnRails
[23:15:52] christiandsg: has joined #RubyOnRails
[23:15:58] safeforge: has joined #RubyOnRails
[23:16:04] smathy: Rhidian, why not just run it locally?
[23:16:28] Rhidian: Oh Im following a tutorial
[23:16:33] Rhidian: and it told me to use cloud9
[23:18:14] smathy: Rhidian, ok well if you wish to continue with that, you should talk to the Cloud9 customer support to find out why things aren't working the way you expect them.
[23:18:24] smathy: Rhidian, ie. this is not an issue with Rails.
[23:19:02] bricker: Isn't Cloud9 a pro gaming organization?
[23:21:05] alexclark: has joined #RubyOnRails
[23:21:39] Rhidian: Ah okay, I'll try that out
[23:21:41] Rhidian: Thanks guys
[23:21:45] Rhidian: I appreciate it.
[23:24:11] nym: has joined #RubyOnRails
[23:25:51] mike___1234: has joined #RubyOnRails
[23:27:28] ascarter: has joined #RubyOnRails
[23:27:53] dudoom: has joined #RubyOnRails
[23:28:29] alphaatom: has joined #RubyOnRails
[23:29:55] zendrix: has joined #RubyOnRails
[23:30:35] mikecmpb_: has joined #RubyOnRails
[23:30:47] robbyoconnor: has joined #RubyOnRails
[23:31:01] workmad3: has joined #RubyOnRails
[23:31:47] gloscombe: has joined #RubyOnRails
[23:33:46] p7r: has joined #RubyOnRails
[23:34:21] elaptics: has joined #RubyOnRails
[23:34:29] pipework: has joined #RubyOnRails
[23:34:32] htmldrum: has joined #RubyOnRails
[23:35:08] phikes: has joined #RubyOnRails
[23:37:45] htmldrum: has joined #RubyOnRails
[23:37:49] crdpink2: has joined #RubyOnRails
[23:38:05] 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?
[23:38:13] Radar: </nitpick>
[23:39:08] zenspider: has joined #RubyOnRails
[23:39:17] NodeNagant: has joined #RubyOnRails
[23:41:56] zenspider: hiya. I'm helping a client convert from 3 to 4 and hitting problems with assert_select. They've got a helper_test that isn't hitting a render at any point. They're passing in a nokogiri node and a selector to assert_select and that works fine on rails3 but borks on rails 4 because @rendered and @output_buffer are both ""
[23:42:10] zenspider: has testing view helpers changed from 3 to 4?
[23:42:55] Radar: Not that I am aware of. Are you positive that the controller is rendering something?
[23:43:00] htmldrum: has joined #RubyOnRails
[23:43:08] yizr: has joined #RubyOnRails
[23:43:17] k1t: has joined #RubyOnRails
[23:43:40] seansith: has left #RubyOnRails: ()
[23:43:42] zenspider: Radar: there's no controller involved at this point
[23:44:02] zenspider: they're doing HTML::Document.new(html).root and passing that in to assert_select
[23:44:25] zenspider: ala: http://pothibo.com/2013/6/testing-helpers-in-rails-3-or-how-i-wasted-a-day-learning
[23:44:27] allcentury: has joined #RubyOnRails
[23:44:32] zenspider: basically exactly what that blog entry says
[23:44:46] zenspider: now I'm wasting a day fixing it for 4 :)
[23:44:53] zenspider: but at least I'm getting paid to waste it
[23:45:19] Radar: I don't know, sorry. Can you reproduce the issue in a new app?
[23:46:36] borodin: has joined #RubyOnRails
[23:47:32] borodin: is there a variable in a running rails app that tells you what env it's running in? I tried RAILS_ENV, no go
[23:47:53] zenspider: try ENV["RAILS_ENV"]
[23:47:58] Radar: borodin: Rails.env
[23:48:05] ctooley: has joined #RubyOnRails
[23:48:12] Radar: borodin: You can also do if Rails.env.development?
[23:48:15] zenspider: shows how much I work in rails these days. I prolly knew that at one point too
[23:48:23] borodin: very cool thanks
[23:49:25] bonhoeffer: has joined #RubyOnRails
[23:50:16] grandy: has joined #RubyOnRails
[23:51:52] bronson: has joined #RubyOnRails
[23:53:39] Haydos: has joined #RubyOnRails
[23:54:23] _3dwardsharp: has joined #RubyOnRails
[23:54:33] Scripore: has joined #RubyOnRails
[23:54:39] bonhoeffer: has joined #RubyOnRails
[23:55:24] baweaver: has joined #RubyOnRails
[23:55:59] chipotle: has joined #RubyOnRails
[23:56:05] pixelhandler: has joined #RubyOnRails
[23:56:20] lethjakman: has joined #RubyOnRails
[23:59:47] NodeNagant: has joined #RubyOnRails