« Back to channel list

#RubyOnRails - 09 July 2015

« Back 1 day Forward 1 day »
[00:00:15] symbol: Can anyone vouch for these authors or their books? http://rubybookbundle.com
[00:00:30] giowong: has joined #RubyOnRails
[00:00:36] symbol: I consider myself a mid-level developer but always like to sharpen my skills and grow.
[00:00:52] symbol: Might just invest in some Martin Fowler books instead.
[00:03:22] baweaver: symbol: safari books online
[00:03:37] giowong_: has joined #RubyOnRails
[00:03:43] baweaver: 29/mo, unlimited ebook access to anything O'Reilly and co
[00:03:54] yaymukund: has joined #RubyOnRails
[00:04:03] symbol: I've used it off and on - perhaps I'll give it a look again.
[00:04:31] pontiki: it's not quite all you can eat, though, at that rate is it? limited to like 10 at a time?
[00:04:41] eggoez: has joined #RubyOnRails
[00:06:12] rhizome: giowong: i don't see a question anywhere
[00:06:54] ProLoser: has joined #RubyOnRails
[00:07:06] ProLoser: is it possible to have a .execute() return a hash instead of an array?
[00:07:12] smathy: The only thing with IRC points is that everyone keeps track of their own total, and it's pretty much on the honor system.
[00:07:22] giowong_: rhizome: ah well, anyone know a hacky way to make the hidden field cover the right side box
[00:07:41] smathy: I have so many I express the total in scientific notation now.
[00:08:01] ProLoser: how do i do this with activerecord? https://gist.github.com/ProLoser/94070199434576667ddc
[00:08:30] christiandsg: has joined #RubyOnRails
[00:08:33] smathy: ProLoser, def execute; {}; end
[00:09:00] ProLoser: gotta love this community
[00:09:47] smathy: The second 2 unions only differ by their WHERE clauses.
[00:09:51] smathy: ...could just be an `OR` there.
[00:10:47] smathy: In Rails, the first and the (now second one, with the combined OR) are from different tables, so they'd be different models.
[00:10:58] smathy: Paren fail.
[00:11:34] bricker: Radar: this lib is dumb but relevant https://github.com/andyw8/do_by
[00:11:48] Radar: bricker: neat idea :)
[00:11:53] Radar: bricker: The one that I tweeted about was from 2013.
[00:12:17] sevenseacat: has joined #RubyOnRails
[00:12:42] ProLoser: smathy: https://gist.github.com/ProLoser/94070199434576667ddc/revisions
[00:13:18] ProLoser: smathy: they're from different tables?
[00:13:23] bungoman: has joined #RubyOnRails
[00:13:40] owenjones: has joined #RubyOnRails
[00:13:41] giowong: has joined #RubyOnRails
[00:13:56] brandtam_: has joined #RubyOnRails
[00:15:21] smathy: ProLoser, they're not? `from business_user_memberships` vs `from user_connections`
[00:15:50] smathy: ProLoser, you couldn't have that as a union query in Rails because those would be two different models.
[00:16:03] ProLoser: you can't union separate models?
[00:16:17] smathy: ProLoser, in SQL? How would you do that?
[00:16:31] smathy: ProLoser, UserConnection.where ...oh...damn...
[00:16:33] ProLoser: we're doing it in that query
[00:16:45] ProLoser: as long as the values are the same
[00:16:53] smathy: ProLoser, right, and in Rails you'd be using a single model to issue the query.
[00:17:08] ProLoser: well right now we're executing the query manually
[00:17:23] ProLoser: we were just discussing 1: how to do this with activerecord and 2: how to get the results to be a hash instead of an array
[00:17:34] ProLoser: assuming #1 resolves #2
[00:17:39] smathy: ProLoser, if you're going to do that then just make that query a view, and use that for your model.
[00:17:53] giowong_: has joined #RubyOnRails
[00:18:46] bruno-: has joined #RubyOnRails
[00:18:48] quazimodo: has joined #RubyOnRails
[00:19:21] quazimod1: has joined #RubyOnRails
[00:20:18] ProLoser: interesting
[00:20:18] pontiki: using the record id field as the hash key?
[00:20:31] ProLoser: just like want all the columns in the right place
[00:20:33] crack_user: has joined #RubyOnRails
[00:20:51] pontiki: i don't know what that means
[00:21:09] ProLoser: the tl;dr is we ran that query with execute, and then want to run .as_json
[00:21:25] pontiki: what's the bit about it being a hash instead of an array?
[00:21:36] ProLoser: sorry i was being confusing (i'm a ruby noob)
[00:21:44] ProLoser: would .as_json on the result work?
[00:22:38] ProLoser: https://gist.github.com/ProLoser/94070199434576667ddc
[00:22:42] ProLoser: updated with the full method
[00:23:46] bricker: ProLoser: ActiveRecord is pretty high-level and inflexible. You may have better luck with Arel or just a plain ol' "execute"
[00:23:58] giowong__: has joined #RubyOnRails
[00:26:05] bricker: ProLoser: https://github.com/rails/arel ActiveRecord uses it
[00:26:17] bricker: it's comprehensive
[00:26:19] pontiki: arel is the bit that converts methods into SQL
[00:26:43] danman: has joined #RubyOnRails
[00:29:26] mcr-credil: has joined #RubyOnRails
[00:29:31] ProLoser: is it worth using over execute? since we already have the query?
[00:30:26] rhizome: giowong__: "hidden field" and "cover" don't make sense together
[00:30:38] giowong: has joined #RubyOnRails
[00:31:28] hotpancakes: has joined #RubyOnRails
[00:33:35] zorak8: has joined #RubyOnRails
[00:33:51] qejk: has joined #RubyOnRails
[00:34:37] nettoweb: has joined #RubyOnRails
[00:35:13] bronson: has joined #RubyOnRails
[00:36:55] WillAmes: has joined #RubyOnRails
[00:37:56] yashinbasement: has joined #RubyOnRails
[00:40:31] GPrime: has joined #RubyOnRails
[00:41:05] asheinfeld: has joined #RubyOnRails
[00:41:58] dented42: has joined #RubyOnRails
[00:45:59] jordanstorz: has joined #RubyOnRails
[00:49:07] oflannabhra: has joined #RubyOnRails
[00:49:56] j_mcnally: has joined #RubyOnRails
[00:51:12] zorak8: has joined #RubyOnRails
[00:51:28] Creeves: has joined #RubyOnRails
[00:52:55] rhizome: has joined #RubyOnRails
[00:53:08] danman: has joined #RubyOnRails
[00:53:28] bricker: ProLoser: nothing wrong with using the query as-is if it works
[00:55:07] davidbitton: has joined #RubyOnRails
[00:55:53] IvanLing_: has joined #RubyOnRails
[00:56:15] giowong_: has joined #RubyOnRails
[01:04:40] symbol: has joined #RubyOnRails
[01:05:14] simplyianm: has joined #RubyOnRails
[01:05:20] devdazed: has joined #RubyOnRails
[01:06:33] JeramyRR: has joined #RubyOnRails
[01:10:04] kil0byte: has joined #RubyOnRails
[01:13:10] x-light: has joined #RubyOnRails
[01:16:36] buffym: has joined #RubyOnRails
[01:17:54] j_mcnally: has joined #RubyOnRails
[01:19:21] one_zero: has joined #RubyOnRails
[01:19:45] giowong: has joined #RubyOnRails
[01:21:26] jesterfraud: has joined #RubyOnRails
[01:22:49] moeabdol: has joined #RubyOnRails
[01:23:26] moeabdol: anybody can suggest what is the best votting (like/dislike) gem for rails?
[01:23:59] hahuang65: has joined #RubyOnRails
[01:24:02] Scripore: has joined #RubyOnRails
[01:24:16] christiandsg: has joined #RubyOnRails
[01:24:33] cooldman224: has joined #RubyOnRails
[01:24:47] bob14: has joined #RubyOnRails
[01:25:20] yashinbasement: this can help https://github.com/ryanto/acts_as_votable
[01:26:28] x44x45x41x4E: has joined #RubyOnRails
[01:27:06] x44x45x41x4E: has left #RubyOnRails: ()
[01:27:30] moeabdol: can anyone suggest the best votting gem for rails? thanks.
[01:28:26] beauby: has joined #RubyOnRails
[01:30:03] hotpancakes: has joined #RubyOnRails
[01:30:17] siemprefresco: has joined #RubyOnRails
[01:32:35] buffym: has joined #RubyOnRails
[01:32:41] duderonomy: has joined #RubyOnRails
[01:33:01] bob14: has joined #RubyOnRails
[01:33:24] rickmasta: has joined #RubyOnRails
[01:34:17] nettoweb: has joined #RubyOnRails
[01:34:19] rezzack: has joined #RubyOnRails
[01:35:03] siemprefresco: has joined #RubyOnRails
[01:35:44] nertzy: has joined #RubyOnRails
[01:36:14] RegulationD: has joined #RubyOnRails
[01:36:36] danman: has joined #RubyOnRails
[01:45:35] mando: has joined #RubyOnRails
[01:45:45] buffym: has joined #RubyOnRails
[01:46:21] dideler: has joined #RubyOnRails
[01:48:00] beauby: has joined #RubyOnRails
[01:48:38] stoodfarback: has joined #RubyOnRails
[01:48:47] simkessy: has joined #RubyOnRails
[01:49:35] JeramyRR: has joined #RubyOnRails
[01:49:37] j4d: has joined #RubyOnRails
[01:50:11] workmad3: has joined #RubyOnRails
[01:51:02] wethu: has joined #RubyOnRails
[01:52:21] ledestin: has joined #RubyOnRails
[01:58:08] simkessy: I'm using paperclip to upload images to my model, does anyone know how to render File information in the view before it's save? I styled my Upload button but now the filename isn't showing anymore
[01:59:03] doctorly: has joined #RubyOnRails
[02:00:03] doctorly: I have a theme I bought online, and the css is flat and hard to read. Do people generally leave these alone and not modify them? I want to modify something but it looks very complicated to get involved with
[02:00:39] LarryLv: has joined #RubyOnRails
[02:01:35] sevenseacat: if it wasnt designed to be easy to modify, it likely wont be
[02:02:39] growlove: has joined #RubyOnRails
[02:03:33] mike___1234: has joined #RubyOnRails
[02:04:40] iamse7en: has joined #RubyOnRails
[02:05:55] penguinpowernz: has joined #RubyOnRails
[02:06:44] acconrad_: has joined #RubyOnRails
[02:07:07] bruno-: has joined #RubyOnRails
[02:07:28] nettoweb: has joined #RubyOnRails
[02:09:33] beauby: has joined #RubyOnRails
[02:10:09] Spami: has joined #RubyOnRails
[02:10:46] ewitchin: has joined #RubyOnRails
[02:10:53] rubyonrailed: has joined #RubyOnRails
[02:11:41] jordanstorz: has joined #RubyOnRails
[02:11:52] j_mcnally: has joined #RubyOnRails
[02:13:58] ararog: has joined #RubyOnRails
[02:14:28] ProLoser: has joined #RubyOnRails
[02:16:17] siemprefresco: has joined #RubyOnRails
[02:17:42] earthquake: has joined #RubyOnRails
[02:18:09] mary5030: has joined #RubyOnRails
[02:21:23] DoctorMonocular: has joined #RubyOnRails
[02:24:59] kil0byte: has joined #RubyOnRails
[02:25:06] christiandsg: has joined #RubyOnRails
[02:27:21] bullcitydev: has joined #RubyOnRails
[02:29:39] hahuang65: has joined #RubyOnRails
[02:31:28] givanse: has joined #RubyOnRails
[02:33:22] beauby: has joined #RubyOnRails
[02:37:45] RegulationD: has joined #RubyOnRails
[02:38:55] simplyianm: has joined #RubyOnRails
[02:39:23] buffym: has joined #RubyOnRails
[02:42:36] nahtnam: has joined #RubyOnRails
[02:42:43] siemprefresco: has joined #RubyOnRails
[02:42:48] owenjones: has joined #RubyOnRails
[02:43:18] nahtnam: Hey! I need some help. I pushed my site to heroku but for some reason the js isnt working. The css on the other hand is... https://staging.counterstrike.io/ Notice the footer is working, but not the header...
[02:43:21] nahtnam: Any ideas?
[02:43:45] mclee: has joined #RubyOnRails
[02:43:55] duderonomy: has joined #RubyOnRails
[02:43:59] LarryLv: has joined #RubyOnRails
[02:44:30] dopie: has joined #RubyOnRails
[02:44:40] Creeves: nahtnam: cool, a counterstrike app
[02:44:51] nahtnam: Creeves: Yeah. Not even close to done though.
[02:44:57] Creeves: no js errors in the console
[02:45:12] nahtnam: I was using materializecss, but google just released their own css framework so im in the middle of switching it
[02:45:33] nahtnam: Creeves: Yeah, which is really weird. Im using this gem
[02:45:35] nahtnam: https://github.com/cllns/material_design_lite-rails
[02:45:39] baweaver: has joined #RubyOnRails
[02:45:39] buffym: has joined #RubyOnRails
[02:45:44] Creeves: any chance you can not minify the JS for your app?
[02:45:54] hotpancakes: has joined #RubyOnRails
[02:46:04] nahtnam: Creeves: I think heroku does it.
[02:46:07] nahtnam: Anyone know?
[02:46:18] Creeves: if it's a build script it will be some task
[02:46:28] LeoDee: has joined #RubyOnRails
[02:46:59] darrencauthon: has joined #RubyOnRails
[02:47:21] Creeves: if i click a link there's an error in the routes
[02:47:22] nahtnam: Creeves: No build script or anything. I just push to heroku and the compile everything
[02:47:35] nahtnam: Creeves: Yeah, but that has to do with the fact that I didnt set the env variables
[02:47:42] nahtnam: and so the api key is missing
[02:47:44] nahtnam: ill fix that now
[02:48:32] Creeves: if you set config.assets.js_compressor to a class where the compress function just returns the input string
[02:48:36] Creeves: then it wont minify
[02:49:27] nahtnam: Creeves: Will do that now
[02:50:06] Creeves: i don't actually use heroku so not super knowledgable
[02:50:09] Creeves: i'm pretty good with js though
[02:50:13] sevenseacat: define 'not working'
[02:50:55] Creeves: sevenseacat: i'm guessing the 'menu' icon is supposed to show/hide the links at the top here - https://staging.counterstrike.io/
[02:51:10] bar0n: has joined #RubyOnRails
[02:51:15] sevenseacat: ok, wheres the code thats supposed to handle that?
[02:51:42] Creeves: sevenseacat: i think it's minified
[02:51:51] Creeves: so trying to get it not to minify automatically so i can look at it
[02:51:55] sevenseacat: thats okay, he can share the unminified version
[02:51:56] Creeves: nahtnam: yeah looks like you fixed that error on the status page
[02:52:01] s2013: has joined #RubyOnRails
[02:52:07] Creeves: yeah that's probably a better idea
[02:53:06] Creeves: nahtnam: do you have an example of how the menu is supposed to look?
[02:53:07] michael_mbp: has joined #RubyOnRails
[02:54:09] nahtnam: Creeves: Yes
[02:54:31] nahtnam: Pic: http://i.imgur.com/Chhkll6.png
[02:54:32] nahtnam: Demo: http://test-mdl.herokuapp.com/
[02:55:27] sevenseacat: ok, wheres the code thats supposed to handle that?
[02:56:01] s2013: has joined #RubyOnRails
[02:56:04] nahtnam: sevenseacat: The only thing I did with the gem is https://gist.github.com/nahtnam/1b5cdc96f7c2dd8d2e05
[02:56:04] Creeves: nahtnam: your css isn't working properly also i think
[02:56:10] Creeves: it could just be that, or that could be another issue
[02:56:12] j_mcnally: has joined #RubyOnRails
[02:56:31] sevenseacat: so whats magically supposed to make the menu work?
[02:56:37] Creeves: is your div with class "mdl-layout", on the demo i see a lot of css styles that don't exist on your app
[02:56:39] sevenseacat: you likely didnt follow the docs for it
[02:56:48] Creeves: in your div*
[02:57:05] sevenseacat: make sure all the HTML and classes match up
[02:57:11] sevenseacat: check if you need to call any JS to make it work
[02:57:19] sevenseacat: ie. actually implement the framework
[02:57:46] nahtnam: sevenseacat: Oh the menu. One sec
[02:57:58] nahtnam: sevenseacat: Everything is working in production
[02:58:03] nahtnam: development
[02:58:19] gambl0re: has joined #RubyOnRails
[02:58:26] nahtnam: The menu and stuff is working properly when I run a development server
[02:58:27] nahtnam: rails server
[02:59:27] sevenseacat: well, this is fun.
[02:59:50] nahtnam: http://www.getmdl.io/components/index.html#layout-section/layout Im following the code from the scrollable one
[02:59:52] sevenseacat: have you actually deployed the working code?
[03:00:05] Ropeney: nahtnam: can u just send the code you have?
[03:00:32] nahtnam: Ropeney: I dont want to give the entire project out, but if there are specific parts, I can give em...
[03:00:56] sevenseacat: dammit helpa.
[03:01:08] nahtnam: Not under nda or anything
[03:01:12] nahtnam: its a personal project
[03:01:15] sevenseacat: then why cant you share the code?
[03:01:20] sevenseacat: we cant help you without seeing it
[03:01:32] Ropeney: send the code relating to the header
[03:01:45] Ropeney: strip your proprietary stuff you dont want anyone seeing
[03:01:58] nahtnam: I can send everything that has to do with the frontend/ember
[03:02:16] nahtnam: GIve me one sec to upload it to github
[03:02:26] sevenseacat: yeah I don't care enough about this problem to fight to actually help
[03:02:47] krz: has joined #RubyOnRails
[03:03:21] nahtnam: Ropeney: https://github.com/nahtnam/counterstrike
[03:03:32] nahtnam: everything is in the javascripts folder
[03:03:45] nahtnam: more specifically the javascripts/templates folder
[03:03:53] goodcodeguy: has joined #RubyOnRails
[03:04:18] nahtnam: The only rails view there is: https://gist.github.com/nahtnam/3b237f58ee55f28284f3
[03:04:26] nahtnam: It just imports ember and the css
[03:04:33] sevenseacat: so it's an ember problem?
[03:05:35] nahtnam: sevenseacat: I dont think so. Im pretty sure it has to do with rails, and the ways the assets are imported
[03:05:44] nahtnam: if there is any sort of ember error, its in the console.
[03:07:07] Ropeney: its not an error
[03:07:10] Ropeney: its an ember problem
[03:07:26] Ropeney: meaning you have misconfigured something, but ember is creating what you want
[03:07:26] sevenseacat: i think its also related to [10:56:36] Creeves: is your div with class "mdl-layout", on the demo i see a lot of css styles that don't exist on your app
[03:07:32] Ropeney: well what you have said, not what you want
[03:07:40] goodcodeguy: I'm having some difficulties with some model associations if someone has some time to look at it for me: https://gist.github.com/goodcodeguy/5d968397c70cc7aaa220
[03:08:10] goodcodeguy: I want to be able to access the tickets associated with a user through the user model
[03:08:20] cornerman: has joined #RubyOnRails
[03:08:25] goodcodeguy: but am having a hard time figuring out the proper syntax
[03:09:05] goodcodeguy: or maybe I'm being stupid and the proper "rails way" is to access that data through the ticket model
[03:09:16] evenix: has joined #RubyOnRails
[03:09:30] evenix: is there a way to show the --tace or --verbose of rake db:seed ?
[03:09:44] hotpancakes: has joined #RubyOnRails
[03:10:08] braincrash: has joined #RubyOnRails
[03:10:36] rickmasta: has joined #RubyOnRails
[03:10:58] beauby: has joined #RubyOnRails
[03:11:23] nahtnam: Ropeney: Then why does it work in development and not in production?
[03:11:24] Ropeney: goodcodeguy, user.tickets ?
[03:11:53] Ropeney: nahtnam: asset pipeline
[03:12:38] goodcodeguy: Ropeney: user.ticket_transactions would be what I was assuming it would be but when I had that has_many it tries to look it up with 'user_id' when it should be using 'buyer_id' and 'seller_id'
[03:12:51] nahtnam: I'll try loading it after ember and see if it works
[03:13:09] goodcodeguy: so I don't know how to do a has_many :tickets (where buyer_id = user.id or seller_id = user.id)
[03:13:10] krz: has joined #RubyOnRails
[03:14:25] goodcodeguy: foreign_key: ''
[03:14:42] sevenseacat: you can't do an OR query like that for the FK in an association
[03:15:20] sevenseacat: you probably want a custom scope on the TicketTransaction model
[03:16:42] sevenseacat: something like https://gist.github.com/sevenseacat/d8ddf22947fd701b3e97
[03:16:42] shyshy: has joined #RubyOnRails
[03:17:38] sevenseacat: i think your two associations are a bit broken too
[03:17:45] symbol: has joined #RubyOnRails
[03:18:18] sevenseacat: them you do need to specify the right FK on
[03:18:26] sevenseacat: but anyway never mind you said :P
[03:20:04] christiandsg: has joined #RubyOnRails
[03:20:12] goodcodeguy: sevenseacat: yeah, I'll do that to add an option to pull all tickets, right now I just need to look at transactions that are sold, unsold or bought; so I can set the foreign key to 'seller_id' for the first and second and 'buyer_id' for bought
[03:21:44] goodcodeguy: sevenseacat: why do you suggest that the associations could be broken?
[03:22:18] sevenseacat: because you werent specifying the FK, so both would be looking for a FK of user_id
[03:24:09] bronson: has joined #RubyOnRails
[03:24:18] goodcodeguy: I updated it to this: https://gist.github.com/goodcodeguy/5d968397c70cc7aaa220
[03:24:22] goodcodeguy: and it seems to pass my tests now
[03:24:56] sevenseacat: your sold_tickets one is broken, as is your purchased_tickets one
[03:25:21] sevenseacat: purchased_tickets only works if the seller is selling to themselves
[03:25:40] sevenseacat: and the sold_tickets will never return anything because the seller cant be both the user and nil
[03:26:02] cleopatra: has joined #RubyOnRails
[03:26:21] sevenseacat: also, you don't have a seller field on your model so the sold_tickets will break there too
[03:26:25] inoter: has joined #RubyOnRails
[03:26:29] sevenseacat: what tests do you actually have? >_>
[03:27:29] Ropeney: sorry goodcodeguy, was called to a meeting
[03:28:32] goodcodeguy: sevenseacat: you are right on the sold_tickets, my tests aren't very robust right now, just testing some of the relationships and factories to make sure I had the associations correct; adding a test to make sure the data is correct now
[03:28:37] dopie: has joined #RubyOnRails
[03:29:01] goodcodeguy: and on purchased_tickets
[03:29:06] goodcodeguy: it's late here, stupid me
[03:31:22] Cache_Money: has joined #RubyOnRails
[03:32:32] jesterfraud: has joined #RubyOnRails
[03:32:51] Creeves: nahtnam: sorry i had to stop helping, my boss came over
[03:33:02] Creeves: and was a bit sus that i had a counterstrike site open lol
[03:33:18] nahtnam: Np. Dont risk it over helping me
[03:34:29] Creeves: this guy at this bank we are working with, to give us remote acces, has connected his laptop to the network, remote desktopped into the server and now we are using webx to remote into his laptop and access that rdp session
[03:34:41] kahuna_: has joined #RubyOnRails
[03:35:44] Creeves: and this is a BANK
[03:36:11] rubyonrailed: has joined #RubyOnRails
[03:36:17] cleopatra: congratulations
[03:36:39] inoter: has joined #RubyOnRails
[03:36:49] cleopatra: the pay is good?
[03:37:13] cleopatra: Do not risk your job
[03:38:49] workmad3: has joined #RubyOnRails
[03:39:21] cleopatra: I think I'll take a serious English lessons in the coming months
[03:39:32] jeanlinux: has joined #RubyOnRails
[03:40:16] mary5030: has joined #RubyOnRails
[03:40:23] simplyianm: has joined #RubyOnRails
[03:40:33] Creeves: cleopatra: i'm not risking anything, this is how they want us to deploy our control apps
[03:40:46] Creeves: haha it's the bank that has issues
[03:41:12] rhizome: has joined #RubyOnRails
[03:41:23] jenrzzz: has joined #RubyOnRails
[03:41:41] Creeves: i'd prefer to use chef or docker to deploy our rails apps and gems
[03:43:52] cleopatra: I have not come this far, I made some small test app but never deployed to the world
[03:44:28] s2013: hello folks
[03:44:59] cleopatra: I have a project now I'm in step 1, testing of all possible bad cases
[03:45:50] Creeves: that's a good thing to learn though
[03:45:54] Creeves: testing thoroughly
[03:46:57] pontiki: hello, cleopatra
[03:47:15] cleopatra: helloo pontiki how are you
[03:47:28] pontiki: doing all right, how about you?
[03:47:29] cleopatra: long time no see you friend
[03:47:46] pontiki: i know, i have been too busy with things
[03:48:40] cleopatra: i try to do good things but no time to do all :(
[03:49:42] cleopatra: Creeves yes i try to learn more about BDD, I'm also trying to learn more about ruby
[03:50:43] lily_: has joined #RubyOnRails
[03:51:07] cleopatra: but my real-job prevents me doing multiple things simultaneously
[03:51:25] cleopatra: and what new pontiki
[03:52:01] pontiki: not so much, cleopatra
[03:52:16] pontiki: rolling off one project and onto another
[03:53:02] kellytk: has joined #RubyOnRails
[03:53:07] gambl0re: anybody here use github pages
[03:53:17] cleopatra: nice so you always work
[03:53:37] cleopatra: gambl0re for blog?
[03:53:51] sevenseacat: gambl0re: just ask your question about them
[03:54:13] kellytk: I would appreciate suggestions on what path to use for a user account's resource. eg., domain.com/user
[03:54:14] gambl0re: no..i just purchased a domain name from namecheap and i want that domain nmae to redirect to github page
[03:54:16] gambl0re: how would i do that
[03:54:37] pontiki: the documentation explains that
[03:54:44] gambl0re: i created a CNAME
[03:54:56] sevenseacat: https://help.github.com/articles/setting-up-a-custom-domain-with-github-pages/
[03:55:16] sevenseacat: also, https://pages.github.com/ will get you started with actually using github pages
[03:55:20] pontiki: see, sevenseacat went all the way over there to get the link for you
[03:56:21] gambl0re: i know how to create github page
[03:56:34] sevenseacat: so whats your question then?
[03:56:51] gambl0re: no..i just purchased a domain name from namecheap and i want that domain nmae to redirect to my github page
[03:56:59] asheinfeld: has joined #RubyOnRails
[03:57:02] sevenseacat: follow the instructions on the link I gave you
[03:57:09] jesterfraud: that's sevenseacat, unfailingly helpful
[03:57:23] DoctorMonocular: so, I'm trying to use Devise's sign_in() method in a helper module. When I try to include Devise::Controllers::Helpers in the module, it raises a RoutingError (??) that reads "undefined method `helper_method' for AuthorizationHelper:Module" -- so it's obviously meant to be included in a controller. but I need it in a helper module--anyone know what I need to do to make it all play nicely?
[03:58:02] gambl0re: how do i know if my domain is a sub domain or apex domain?
[03:58:03] sevenseacat: they explicitly say that CNAME records are for subdomains, not domains
[03:58:31] sevenseacat: you click the links that explain it
[03:58:39] kellytk: has left #RubyOnRails: ("WeeChat 1.0.1")
[03:58:44] gambl0re: and who is my dns provider???
[03:58:56] gambl0re: i dont have host provider...
[03:59:04] sevenseacat: typically the org you bought the domain from.
[03:59:09] sevenseacat: so namecheap.
[03:59:21] sevenseacat: brb cat demanding attention
[03:59:36] ljen: has joined #RubyOnRails
[03:59:40] pontiki: if namecheap does not provide DNS, then you need to get that from someone else
[03:59:47] pontiki: i don't konw anything about namecheap
[04:00:10] DoctorMonocular: namecheap is a pretty well-liked registrar
[04:00:32] pontiki: gambl0re: an apex domain is like example.com
[04:00:41] gambl0re: in suprised pontiki doesnt know namecheap..
[04:00:53] pontiki: i know they're a registrar
[04:01:04] pontiki: why should i know what services they offer?
[04:01:27] fwaokda: has joined #RubyOnRails
[04:02:06] gambl0re: you're right..
[04:02:20] waseem_: pontiki: You're supposed to be omniscient if you come in this channel and answer questions.
[04:02:31] waseem_: pontiki: Hi :)
[04:02:38] sevenseacat: k, cat is now satisfied
[04:02:51] pontiki: ACTION hangs her head and crawls away to the mousehole
[04:03:03] pontiki: ((hi, wasseem))
[04:03:56] ljen: hi everyone!
[04:06:56] sevenseacat: afternoon ljen
[04:07:02] hd1: has joined #RubyOnRails
[04:07:15] hd1: are nginx proxying questions fair game here?
[04:07:18] bronson: has joined #RubyOnRails
[04:07:41] pontiki: the worst that can happen is the channel elves carry you out in the trash, go for it
[04:07:58] sevenseacat: I have no idea how to answer them, but someone might.
[04:08:25] hotpancakes: has joined #RubyOnRails
[04:09:18] simkessy_: has joined #RubyOnRails
[04:09:45] hd1: I've proxied puma behind nginx and every hit comes from 127.0.0.1, I'd like to see the remote IP that nginx forwards what's the magic incantation to do this?
[04:10:30] pontiki: that should be in an X- header added by nginx
[04:10:35] pontiki: i forget which one, tho...
[04:11:03] nahtnam: God, this is so confusing. sevenseacat and Creeves if you still want to help, here is the full rails app. https://goo.gl/2g6tPf <- Didnt put it on github cuz I dont want random bots download it...
[04:11:24] nahtnam: bundle install, rake db:create db:migrate, and then rails server
[04:11:34] nahtnam: the status page wont work cuz the env variable is missing
[04:13:02] Etriaph: Keep them away from my pantry.
[04:13:18] rhizome: has joined #RubyOnRails
[04:13:21] pontiki: hd1: X-Forwarded-For maybe?
[04:13:35] hd1: pontiki: X-Real-IP.... how do I make puma display this?
[04:13:59] charliesome: has joined #RubyOnRails
[04:14:47] Etriaph: X-Forward-For should work, I remember having to use that
[04:15:09] Etriaph: Not necessarily in your server configuration, but that's the header you're interested in.
[04:15:32] Etriaph: Err.. X-Forwarded-For
[04:16:20] hd1: Etraph: I see
[04:18:16] rhizome: has joined #RubyOnRails
[04:18:19] Etriaph: hd1: http://distinctplace.com/infrastructure/2014/04/23/story-behind-x-forwarded-for-and-x-real-ip-headers/
[04:20:39] bungoman: has joined #RubyOnRails
[04:22:12] hd1: Etriaph: thank you
[04:22:30] Etriaph: Thank pontiki too, I just confirmed her answer
[04:22:56] j4d: has joined #RubyOnRails
[04:23:56] danman: has joined #RubyOnRails
[04:26:23] RegulationD: has joined #RubyOnRails
[04:26:59] mauro1254: has joined #RubyOnRails
[04:27:39] ivanskie: has joined #RubyOnRails
[04:32:42] bungoman: has joined #RubyOnRails
[04:35:54] oflannabhra: has joined #RubyOnRails
[04:38:20] neanderslob: has joined #RubyOnRails
[04:43:54] Gate: has joined #RubyOnRails
[04:43:58] jesterfraud: has joined #RubyOnRails
[04:48:18] Spami: has joined #RubyOnRails
[04:48:22] s2013: has joined #RubyOnRails
[04:53:32] pixelhandler: has joined #RubyOnRails
[04:56:02] s2013: https://gist.github.com/ss2k/bf40e06528849a36b944 i posted this earlier.. but anyways when i submit the form.. it processes the form then redirects to a page that shows the javascript ... it only happens when i render the partial from an ajax response..
[04:58:05] asheinfeld: has joined #RubyOnRails
[04:58:27] chrissonar: has joined #RubyOnRails
[04:59:30] mcr-credil: has joined #RubyOnRails
[05:00:27] moeabdol: has joined #RubyOnRails
[05:01:29] jesterfraud: has joined #RubyOnRails
[05:02:04] chrissonar: has joined #RubyOnRails
[05:03:06] s2013: rhizome yeah its just blank white page with the javascript from the .js.erb
[05:03:48] nahtnam: Hey! Can anyone look at my program? Everything seems to be doing fine in development, but when I push it to heroku, the js and css are working properly. https://goo.gl/2g6tPf <- Zip of my program, dont want to put it on github
[05:04:13] sevenseacat: s2013: so whats the difference between correct and incorrect
[05:04:33] s2013: doesnt seem like anything.. before it was processing the incorrect one as html..but i forced the path to format as js
[05:04:55] Creeves: nahtnam: might have a chance to have a look now
[05:05:02] s2013: i think we came to the conclusion it wasnt binding the form since it was being rendered asynchronously
[05:05:07] Creeves: guy is calling me back in an hour for this horrible remote deployment
[05:05:10] nahtnam: Creeves: Awesome, thanks
[05:05:30] nahtnam: Creeves: You work at a bank that uses rails?
[05:06:14] sevenseacat: s2013: you havent exactly explained what the problem is - whats rendering wrong?
[05:06:21] siemprefresco: has joined #RubyOnRails
[05:06:45] s2013: so when you submit the form its supposed to create a new record and then show a popup.. so it does that.. but then redirects to a page with the code for the pop
[05:06:54] s2013: it renders a page with the actual javascript code
[05:07:07] sevenseacat: ok, theres no code for a popup here, nor are there any kind of logs for requests
[05:07:29] sevenseacat: so we cannot see what is happening
[05:07:37] Creeves: nahtnam: yeah but not for their internal banking stuff
[05:07:38] s2013: hold on let me try to recreate that
[05:07:49] Creeves: one of the businesses i work for does AV control
[05:07:56] sevenseacat: recreate what? if you know there's a problem, you have it right there
[05:08:00] Creeves: but all web based, so using an API written in rails
[05:08:11] rhizome: you gisted like 10% of the code
[05:08:17] nahtnam: Creeves: Ah, that makes sense. I remember reading a blog about how banks use languages like c++ instead of ruby/python
[05:08:22] Creeves: we're replacing $20k per-room AMX systems with ones that cost a few hundred per room max
[05:08:32] jeromelanteri: question about two (concurrent ?) nested helper form constructors gem projects: cocoon or actionform ? (consider i used simple_form with rails-4.2.2, jquery/coffeescript, bootstrap and i want also dynamic select/chexbox fields occurs, with ajax methods and maybe cache model)
[05:08:51] nahtnam: Creeves: AMX?
[05:08:54] s2013: i didnt want to gist irrelevant pieces.. it really has to do with the partial being rendered via the js
[05:09:12] s2013: its rails 3.2 application .. apparently its not a problem in rails 4
[05:09:21] Creeves: nahtnam: AV control systems
[05:09:23] Creeves: a big company
[05:09:33] nahtnam: Oh ok. Never heard of em
[05:09:34] sevenseacat: s2013: if you dont want to provide what I asked for, that's fine.
[05:09:44] s2013: i didnt say that. i said hold on
[05:10:02] s2013: this only happens when i have certain conditions so im recreating that
[05:10:40] Creeves: nahtnam: running bundle on your app now
[05:10:44] Creeves: it'll take a little while
[05:10:47] nahtnam: Great. Thanks
[05:10:49] nahtnam: for your help
[05:10:55] hotpancakes: has joined #RubyOnRails
[05:11:26] Creeves: np, i'm a CS player myself to fair keen
[05:11:29] Creeves: so fair keen*
[05:11:37] nahtnam: Creeves: Rank?
[05:11:47] Creeves: ehh like silver elite
[05:11:55] Creeves: i don't get a lot of time to play
[05:11:57] nahtnam: Nice. Im only a few ranks above.
[05:12:05] nahtnam: Gold Nova 3
[05:12:35] buffym: has joined #RubyOnRails
[05:12:40] Creeves: ah nice, i feel like i could get a little higher but work and uni is killing my time lately
[05:12:45] Creeves: ACTION says this as he sits on IRC
[05:13:26] nahtnam: Yeah, its summer holidays so I have plenty of time on my hands. I get off of work at 6 and from then on its either rails or csgo
[05:14:19] jaimessi: has joined #RubyOnRails
[05:14:34] jeromelanteri: Creeves: a specific question for you: wich video format would be the best for read it from rails app through tcp/ip from a files contained on server computer (who is also the recorder one), can also be linked through qt/c++ application (who is the lanbgage of the recorder application) ? is there a better video format (video inspections) ?
[05:16:21] jeromelanteri: sevenseacat: wich one you prefer between cocoon and actionform ?
[05:16:29] jeromelanteri: Creeves: ogg ?
[05:16:42] sevenseacat: never used actionform. cocoon is awesome.
[05:16:43] Creeves: or webm yeah
[05:16:49] Radar: ACTION looks at jeromelanteri's question; finds other things to do
[05:17:17] Creeves: i'd use webm over ogg
[05:17:17] jeromelanteri: sevenseacat: looks like realy clear gem project for use... for sure.
[05:17:18] hmnhf: has joined #RubyOnRails
[05:17:44] Creeves: but it's not so much about what fits best for going between rails and your other application, but more for which formats are going to be supported by the major players
[05:17:47] Creeves: apple, google, etc
[05:18:17] jeromelanteri: Creeves: webm contanier... ok, could you tell me more around this possible choice please ? or maybe provide a link talk about advantages of container video datas ?
[05:18:19] rvanlieshout: has joined #RubyOnRails
[05:18:56] Creeves: articles aren't too hard to find that talk about it - http://farukat.es/journal/2011/01/488-google-h264-and-video-web
[05:19:03] Creeves: that's a bit outdated now
[05:19:48] jeromelanteri: Creeves: yes, i understand. I would have to stream datas contents on real time... (maybe i think it will have 5 seconds decalage, for sure...)
[05:20:03] eGGsha: has joined #RubyOnRails
[05:20:22] Creeves: for us, the choice in formats are mostly based around browser (desktop and mobile) support
[05:20:35] jeromelanteri: but i would like to not loose to much details (can be low refresh images)
[05:21:08] jeromelanteri: creeves: ok. browser will have to be firefow exclusivly, on desktop/portable (no mobil)
[05:21:19] jeromelanteri: (no mobile phone, no tablet)
[05:21:28] Creeves: so it's not a public thing?
[05:21:38] LuukFRT: has joined #RubyOnRails
[05:22:01] jeromelanteri: it is a own project for my own works (data recording for underwater inspection)
[05:22:22] Creeves: wow that's cool
[05:22:23] s2013: https://gist.github.com/ss2k/bf40e06528849a36b944 updated gist sevenseacat
[05:22:40] jeromelanteri: so i construct a recorder/data-logger programm (C++/QT-5.4) linked with database for logs and stuffs...
[05:22:52] rhizome: choosing a file format is a minor decision in a livestreaming context
[05:22:56] dhjondoh: has joined #RubyOnRails
[05:23:15] eggoez: has joined #RubyOnRails
[05:23:18] jeromelanteri: then i would like the clients or supervisor to be able to check ROV videos (or divers) from browser... and also access datas and communicate through tcp/ip
[05:23:43] mcr-credil: has joined #RubyOnRails
[05:23:45] sevenseacat: s2013: there's not enough information to determine that there is a problem, let alone what it is.
[05:24:00] jeromelanteri: rhizome: i hope so... there is many different specialties/knowledge around this project, then i'm not specialist around media share on real time.
[05:24:24] s2013: what exactly do you need? i explained when the problem arises..it generally works like it supposed to..
[05:24:48] Radar: s2013: repro in a new app?
[05:25:12] jeromelanteri: sevenseacat: ok, thank you i will go with cocoon
[05:25:13] s2013: not in a new app, just this shitty old one
[05:25:15] s2013: its a rails 3.2
[05:25:26] sevenseacat: well there was something about a popup with no code for it, and a log file that shows that a js.erb file is being rendered
[05:25:33] Radar: s2013: I meant it more like that could be a great way to give us what we need?
[05:25:52] s2013: tubbo and smathy sort of figured out the issue earlier and i made some progress on it
[05:26:19] s2013: but it has to do with ujs issue or something. let me see if i can find it
[05:26:35] choke: has joined #RubyOnRails
[05:27:15] jmimi: has joined #RubyOnRails
[05:27:20] s2013: before it would process it as html then i made the default format for that route to be JS so it processes it like its supposed to but after the execution is done, it redirects to a page with the javascript code in plain text
[05:27:48] workmad3: has joined #RubyOnRails
[05:28:39] sevenseacat: where's the code for the redirect?
[05:28:53] benlieb: has joined #RubyOnRails
[05:29:02] s2013: there isnt supposed to be any redirect. let me paste the controller code. one sec but its just a standard format.js
[05:29:34] Radar: s2013: If you can make us an app which shows us the issue happening on our own machines it'll make this way easier than drip feeding us code.
[05:29:46] hotpancakes: has joined #RubyOnRails
[05:29:59] sevenseacat: this has been going on for nearly half an hour.
[05:30:32] s2013: Radar yeah i know what you mean. i am not sure if i can reproduce it in a new app but ill try. but let me just paste the controller action
[05:31:18] yfeldblum: has joined #RubyOnRails
[05:31:26] bronson: has joined #RubyOnRails
[05:32:17] owenjones: has joined #RubyOnRails
[05:32:41] s2013: https://gist.github.com/ss2k/bf40e06528849a36b944 updated it with the controller action.. i added the render layout: false but that didnt help :\
[05:33:01] Anakat: has joined #RubyOnRails
[05:33:04] jeromelanteri: s2013: maybe a method for check (if no error generate) could be to find files contained some #id and/or .class from js or coffeescript from assets (called by default) (maybe this do something you forget and try before...) and then do it from find command from your editor (give him the datas like ids/class containers and named functions...). Then you have the total list of where the problem can come from (an idea...).
[05:33:05] jeromelanteri: Now i do like that when something appens i can not undersatnd why...
[05:33:56] jeromelanteri: also use firebug and console tool can be helpfull...
[05:34:10] sevenseacat: s2013: you have a syntax error: https://gist.github.com/ss2k/bf40e06528849a36b944#file-controller-rb-L8
[05:34:12] s2013: so the flow is basically sometimes you have to submit a form and once you submit it, it renders the partial to another form.. so all that works fine.. but when you submit the second form it does everything its supposed to but then it redirects to a page
[05:34:26] sevenseacat: s2013: if you dont know where its redirecting in the code, do you have logs that show the redirect?
[05:34:30] nahtnam: Creeves: Any luck?
[05:34:56] Creeves: nahtnam: just realised i need to set up postgres to get the server to run
[05:35:13] tagrudev: has joined #RubyOnRails
[05:35:15] riotjones: has joined #RubyOnRails
[05:35:18] s2013: sevenseacat i pasted the log. the log doesnt show redirect but on the actual browser it will redirect to a page that shows the create.js.erb code
[05:36:02] s2013: ill take a screenshot
[05:36:07] sevenseacat: s2013: ok, so what's calling this create.js.erb view then
[05:37:06] sevenseacat: the create action
[05:38:48] s2013: http://imgur.com/plEkWXF
[05:38:56] nahtnam: Creeves: Ah, https://gorails.com/setup/osx/10.10-yosemite
[05:39:04] nahtnam: If you dont know how to do it
[05:39:56] sevenseacat: it wasn't a yes/no question
[05:40:56] sevenseacat: ok, so the problem is the rendering of this alloc_create.js.erb, but so far you haven't shown a single line of code referencing it
[05:41:33] s2013: thats the create action.. thats what its supposed to respond with
[05:41:45] sevenseacat: so what's this other create.js.erb then...?
[05:41:57] sevenseacat: this is confusing as fuck
[05:42:16] Creeves: nahtnam: okay got it set up and working nicely in dev, same as you're seeing right?
[05:42:17] s2013: ok so like i said.. there are 2 forms.. 2 different models
[05:42:25] s2013: the create.js.erb is when you submit the first form
[05:42:32] s2013: it renders the second form
[05:42:35] jeromelanteri: s2013: the render could also be called from an other javscript event action... this can mount on the action controller too...
[05:43:10] sevenseacat: this is the first I've heard of two forms
[05:43:39] sevenseacat: s2013: please demonstrate the problem in a new app and post it to github.
[05:43:42] Creeves: nahtnam: 'secret_key_base' is for steam API yeah?
[05:43:54] nahtnam: Creeves: ? No
[05:44:01] nahtnam: The app will run fine without the api key
[05:44:03] nahtnam: but if you want
[05:44:05] sevenseacat: because your explanations and code snippets dont make any sense.
[05:44:16] s2013: ... ? ok let me walk you through a simple example.. lets say you want to rent a book.. you go on the book page.. but it says you must enroll in the premium membership.. so you fill out the form on that book show page and submit it.. then it shows you a form to rent the book.. and you submit that and it checks out the book for you
[05:44:18] nahtnam: Go here and grab your api ket
[05:44:20] nahtnam: https://steamcommunity.com/dev/apikey
[05:44:23] s2013: youve never seen any page with multiple forms?
[05:44:28] Aeyrix: s2013: Just do it in a new app goddamn
[05:44:33] yizr: has joined #RubyOnRails
[05:44:33] Aeyrix: You've spent an hour here already
[05:44:37] Aeyrix: and been asked several times
[05:44:56] sevenseacat: more than that, given they already apparently badgered tubbo and smathy for help earlier
[05:45:01] Aeyrix: how many more hours of everyone's time (including yours) are you going to waste instead of doing what people who have been programming with Rails for years, and have written books on it, are asking you to?
[05:45:03] Creeves: nahtnam: ah okay, was just running it in prouction
[05:45:06] Creeves: production*
[05:45:19] s2013: i said im trying to reproduce it but i cant. im still trying
[05:45:21] jeromelanteri: s2013: i think you have to look at some nice helpers gem projects form constructor... like cocoon. This coiuld help you simplify the code and maybe do better quicker than we can do.
[05:45:21] Creeves: and got an error it was missing them (haven't used secrets.yml yet myself)
[05:45:28] Aeyrix: You're clearly not trying to reproduce it.
[05:45:37] Aeyrix: If you were, you wouldn't be posting snippets to Github and giving us user stories.
[05:45:47] Aeyrix: You'd be copy/pasting code into a clean rails app.
[05:45:49] chinmay_dd: has joined #RubyOnRails
[05:46:20] jeromelanteri: s2013: maybe if you have a git repo accessible for show your code, i could try to have a look (i not promise to find solution, but give you times to try it).
[05:46:30] jeromelanteri: (show all the code)
[05:48:01] Creeves: nahtnam: just gotta get this work done one sec
[05:48:04] s2013: the code is beyond fucked man.. its a 6 year old app that hasnt been updated for shit.. and what do you mean badgered? i posted it and tubbo and smathy figured out a possible reason for the problem so i went and tried fixing it. i didnt badger anyone. you arent obligated to help out and i appreciate all the help. i help out people as well when i can. anyways, let me see if i can make any progress. thanks.
[05:48:15] nahtnam: Creeves: Np. Take your time. Ill be up for another 3-4 hours
[05:48:37] s2013: jeromelanteri thanks.. but this code is way too confusing but let me see what i can do. im still going to try to reproduce it in a new app first
[05:49:00] sevenseacat: I have no doubt that tubbo and smathy would have asked to see the same pieces of code we dragged out of you over the course of an hour
[05:49:04] sevenseacat: they're smart people
[05:50:04] jeromelanteri: s2013: as you prefer, it is a choice. let's tell us what you find (again, look at javascript codes and event catch... it is typically some error i had sometimes)
[05:50:25] s2013: i think i need to remove remote: true and handle the ajax request manually
[05:52:04] s2013: http://logs.ryanbigg.com/RubyOnRails?date=2015-07-08#3577226 fyi
[05:52:51] sevenseacat: so you've said a couple of times.
[05:53:20] peady: has joined #RubyOnRails
[05:55:26] choke: has joined #RubyOnRails
[05:55:32] seank_: has joined #RubyOnRails
[05:56:47] bhuvan_aurora: has joined #RubyOnRails
[05:56:51] hmnhf_: has joined #RubyOnRails
[05:57:02] bhuvanaurora: has joined #RubyOnRails
[05:57:13] Rukeal: has joined #RubyOnRails
[05:58:02] xsoapx: has joined #RubyOnRails
[05:58:15] metus_violarium: has joined #RubyOnRails
[05:59:00] hotpancakes: has joined #RubyOnRails
[05:59:18] asheinfeld: has joined #RubyOnRails
[05:59:41] vigasdeep: has joined #RubyOnRails
[05:59:44] Creeves: nahtnam: precompiled assets and run it in production env and it's still okay
[06:00:18] Helheim: has joined #RubyOnRails
[06:01:00] nahtnam: Creeves: Everything is running fine in prod?
[06:01:09] nahtnam: Its probably an issue with heroku
[06:01:21] nahtnam: do you think you can push the code to heroku and see if it works?
[06:02:22] Creeves: yeah though i haven't done it before, do i need my own account? I assume your credentials weren't in that zip
[06:03:47] Creeves: yeah ill have to sign up, one sec
[06:03:49] ivanskie: has joined #RubyOnRails
[06:04:30] nahtnam: Creeves: Yeah, you will have to sign up. Are you familiar with git?
[06:04:41] Creeves: just reading about deploying to heroku now
[06:04:49] Creeves: all i should need is credentials then i can push it
[06:05:34] abuzze: has joined #RubyOnRails
[06:06:26] dented42: has joined #RubyOnRails
[06:07:08] nahtnam: Creeves: Yep.
[06:08:12] Creeves: 'heroku login' is taking its time
[06:08:21] Creeves: there we go
[06:08:50] Creeves: "Your account cam@quaypay.com does not have access to counterstrikeio."
[06:08:51] Creeves: i'll have to change that
[06:08:54] hotpancakes: has joined #RubyOnRails
[06:09:11] djbkd: has joined #RubyOnRails
[06:10:29] nahtnam: Creeves: Yeah
[06:10:36] nahtnam: git remote remove heroku
[06:10:45] sevenseacat: ten bucks says that after this all gets deployed, it will all just work for Creeves
[06:10:59] abuzze: has joined #RubyOnRails
[06:11:16] lxsameer: has joined #RubyOnRails
[06:11:25] jenrzzz: has joined #RubyOnRails
[06:14:04] peady_: has joined #RubyOnRails
[06:17:17] tvw: has joined #RubyOnRails
[06:17:57] Lytol: has joined #RubyOnRails
[06:18:51] eGGsha: has joined #RubyOnRails
[06:21:08] hmnhf: has joined #RubyOnRails
[06:22:04] MaDErroR123: has joined #RubyOnRails
[06:23:12] krz: has joined #RubyOnRails
[06:23:19] IanV0rn2341: has joined #RubyOnRails
[06:24:14] roolo_: has joined #RubyOnRails
[06:24:31] Cache_Money: has joined #RubyOnRails
[06:25:01] abuzze: has joined #RubyOnRails
[06:26:10] Cache_Money: has joined #RubyOnRails
[06:26:19] roolo__: has joined #RubyOnRails
[06:27:14] arup_r: has joined #RubyOnRails
[06:27:37] konsolebox: has joined #RubyOnRails
[06:28:02] solars: has joined #RubyOnRails
[06:29:37] michael_mbp: has joined #RubyOnRails
[06:29:54] Creeves: nahtnam: pushing it now - have had to do bits of work now and then but hopefully it will be okay now
[06:29:59] Creeves: pushing it to counterstrikeio2 lol
[06:30:10] nahtnam: Thanks a lot
[06:30:18] ynonp: has joined #RubyOnRails
[06:30:20] iamse7en: has joined #RubyOnRails
[06:30:30] konsolebox: has joined #RubyOnRails
[06:31:10] Creeves: no problem, though it could end up like sevenseacat said haha
[06:31:16] blokc: has joined #RubyOnRails
[06:31:17] Creeves: but at least that will be some good isolation testing
[06:31:38] baweaver: has joined #RubyOnRails
[06:32:36] rodfersou: has joined #RubyOnRails
[06:33:39] owenjones: has joined #RubyOnRails
[06:33:51] jas02: has joined #RubyOnRails
[06:33:51] blokc: has joined #RubyOnRails
[06:35:06] konsolebox: has joined #RubyOnRails
[06:38:02] nahtnam: Creeves: You pushed master to heroku
[06:38:03] User458764: has joined #RubyOnRails
[06:38:14] nahtnam: Creeves: Run this command. git push heroku develop:master --force
[06:38:33] blokc: has joined #RubyOnRails
[06:39:36] JohnBat26: has joined #RubyOnRails
[06:41:05] iamse7en: Anybody familiar with the boostrap navbar? I'm testing site on a mobile device, and when I hit the drop down, the links vertically stack on top, leaving wasted space on the right. How could I make it so they go horizontally instead of vertically?
[06:41:37] MaDErroR123: has joined #RubyOnRails
[06:41:50] iamse7en: egh. that might be a pain actually, because you want the dropdown vertical when you're not on mobile.
[06:41:53] iamse7en: maybe nevermind on that question
[06:42:47] Radar: The ol' ask the question + come up with the answer trick. I like it!
[06:43:10] choke: has joined #RubyOnRails
[06:43:24] bronson: has joined #RubyOnRails
[06:44:48] neanderslob: has joined #RubyOnRails
[06:45:40] arup_r: has joined #RubyOnRails
[06:51:22] aceRacer: has joined #RubyOnRails
[06:51:48] aceRacer: morning, I solved yestardays problem, had to pass the api_version in the params
[06:53:46] aceRacer: I have a question , if I have let!(:user) { create(:user) } let(:params) { { email: user.email } } followed by a before { post :create, params } in a context, is it possible the before block gets executed before the let! .. coz in my controller user.persisted? is returning false
[06:54:45] aganov: has joined #RubyOnRails
[06:55:29] krz: has joined #RubyOnRails
[06:57:03] sevenseacat: can you gist the test and the problem?
[06:58:36] aceRacer: https://gist.github.com/argentum47/5088b87cb5e824666438
[06:59:15] Creeves: nahtnam: okay finally finished with that damn remote bank work, I will run that now
[06:59:16] Ropeney: has joined #RubyOnRails
[06:59:29] sevenseacat: aceRacer: can you add User.send_reset_password_instructions to the gist - what does it do?
[06:59:56] aceRacer: its a devise method, I am giving the link
[07:00:07] asheinfeld: has joined #RubyOnRails
[07:00:23] krz: has joined #RubyOnRails
[07:00:28] aceRacer: http://www.rubydoc.info/github/plataformatec/devise/Devise/Models/Recoverable/ClassMethods#send_reset_password_instructions-instance_method
[07:01:41] Creeves: sevenseacat: you were right i think
[07:01:44] Creeves: https://counterstrikeio2.herokuapp.com/
[07:02:00] Creeves: nahtnam: seems okay for me
[07:02:02] sevenseacat: Creeves: I like when that happens.
[07:02:20] Creeves: i mean, i guess it shows that it's most likely a heroku issue, so still helps
[07:02:34] Creeves: okay home time for me
[07:02:56] nahtnam: cappsio: Thanks
[07:02:58] sevenseacat: ok, so the user wit hthat email doesnt exist, let's figure out why
[07:03:09] krz: has joined #RubyOnRails
[07:03:24] nahtnam: sevenseacat: You were right. Creeves got it working
[07:05:53] aceRacer: although when I do user.inspect it shows an user object with everything nil, don't know why ..
[07:06:19] ndrei: has joined #RubyOnRails
[07:06:56] sevenseacat: because the user doesnt exist. have you verified in the test that the user is being created correctly?
[07:07:14] sevenseacat: I don't know what that create is doing
[07:08:11] aceRacer: the user is not getting created , that create action is just sending an email when the user hits forgets password and also it updates the reset_password_token and password_sent_at field
[07:08:19] mhib: has joined #RubyOnRails
[07:08:27] sevenseacat: no, the create(:user) in your test
[07:08:29] sevenseacat: what is that returning
[07:08:55] aceRacer: let me check it..
[07:09:01] hotpancakes: has joined #RubyOnRails
[07:09:18] nso95: has joined #RubyOnRails
[07:09:39] aceRacer: that, is supposed to return a newly created user, so maybe there is something wrong there.
[07:10:00] sevenseacat: thats why i asked what it actually returns
[07:10:02] nso95: Running ???without production, I???m getting ???An error occurred while installing pg (0.17.1), and Bundler cannot continue.??? despite that being in :production
[07:10:15] arup_r1: has joined #RubyOnRails
[07:10:27] Creeves: has joined #RubyOnRails
[07:10:38] yashinbasement: has joined #RubyOnRails
[07:10:54] aceRacer: but when I do p user.inspect inside the "it" block, it shows a valid user record
[07:11:50] sevenseacat: okay. so. you're using something multitenanted arent you
[07:11:58] sevenseacat: are you creating the user belonging to the right tenant?
[07:11:58] comrad: has joined #RubyOnRails
[07:12:47] aceRacer: I will check that
[07:13:35] eGGsha: has joined #RubyOnRails
[07:13:59] Creeves: nahtnam: whatcha making the CS site for anyway? just to learn or you have an idea that you want to create?
[07:14:20] nahtnam: Creeves: I have an idea
[07:14:45] Creeves: ill be keen to see how it turns out
[07:14:58] dede: has joined #RubyOnRails
[07:15:06] wethu: Counter terrorists win
[07:15:09] Creeves: i was pretty into the trading scene for tf2 and csgo, and some of the webapps that have been made around those economies are just amazing
[07:15:42] darutoko: has joined #RubyOnRails
[07:15:43] Doddlin: has joined #RubyOnRails
[07:16:24] workmad3: has joined #RubyOnRails
[07:16:32] solars: has joined #RubyOnRails
[07:16:57] yardenbar: has joined #RubyOnRails
[07:17:37] DoubleMalt: has joined #RubyOnRails
[07:18:19] aceRacer: yeah account ids are same, I will post the factory
[07:18:52] dented42_: has joined #RubyOnRails
[07:19:06] wethu: https://www.youtube.com/watch?v=VqB1uoDTdKM
[07:19:23] aceRacer: https://gist.github.com/argentum47/5088b87cb5e824666438#file-user-rb
[07:20:14] sevenseacat: oh, factory girl now
[07:21:13] aceRacer: :P infact its strange inside the before block the user.inspect is the same user :D
[07:21:26] aceRacer: I think its devise black magic :D
[07:21:26] sevenseacat: the same user as what?
[07:21:42] aceRacer: as the one in let(:user) { create(:user) }
[07:21:43] sevenseacat: inside which before block?
[07:21:48] aceRacer: the last one
[07:22:10] adac: has joined #RubyOnRails
[07:22:14] nahtnam: Creeves: So its working. The exact code, no modifications?
[07:22:16] sevenseacat: you don't have a let(:user) { create(:user) } block
[07:22:26] sevenseacat: you only have one definition of a user
[07:22:37] Creeves: i can't think of anything i did
[07:22:38] aceRacer: https://gist.github.com/argentum47/5088b87cb5e824666438#file-password_controller_spec-rb-L23
[07:22:38] artto: has joined #RubyOnRails
[07:22:44] Creeves: let me just double check, have to set up my laptop at home one sec
[07:22:47] chrissonar: in my tests i find it weird to have the factories separated (means in a different file) from my tests. I'm curious if you use factories for tests at all?
[07:22:51] sevenseacat: yeah that's let! not let
[07:23:18] sevenseacat: can you post what happens when you inspect the user and the current tenant, both inside the before block and inside the controller?
[07:23:42] rvanlieshout: do we have imagemagick experts here? :) unable to create a proper thumbnail for a cmyk pdf
[07:23:44] chrissonar: or if you just define a new model object in a global subject?
[07:24:06] nahtnam: Creeves: Thats really werid
[07:24:11] nahtnam: Can you plz delete everything?
[07:24:12] krz: has joined #RubyOnRails
[07:24:17] nahtnam: Now that I know it works
[07:24:22] mrbubbles: has joined #RubyOnRails
[07:24:23] Creeves: yeah no worries
[07:25:06] Creeves: i mean, i set env to production and compiled assets, but that is done when you push to heroku, so i can't think of any changes
[07:25:09] sevenseacat: chrissonar: I use factories, yes
[07:25:20] IanV0rn2341: has joined #RubyOnRails
[07:25:38] sevenseacat: the problem with defining a new model object for every test is if the structure of the model changes, then you have to go and update every. single. test. that uses it
[07:25:49] chrissonar: sevenseacat, ah o.k. do you find yourself having trouble maintaining the factory structure?
[07:26:02] sevenseacat: plus you have to specify all of the unrelated attributes that you dont care about when you just want a persisted object
[07:26:20] sevenseacat: only trouble comes when your models start to get messy with callbacks
[07:26:28] Creeves: chrissonar: i have a bunch of factories and if i need something changed or specific in my tests then i edit or create it there
[07:26:48] chrissonar: Creeves, fair enough.
[07:27:51] Sylario: has joined #RubyOnRails
[07:28:35] chrissonar: sevenseacat, well factory structure does not change often. but I maybe have to overcome the bad feelings having the factory structure separated from my tests testing against that structure (for example validatations).
[07:28:41] skroon: has joined #RubyOnRails
[07:29:26] sevenseacat: I'm not sure why having the code separate would be a problem
[07:29:32] sevenseacat: after all, the test framework is separate, the helper methods you're using are separate
[07:29:41] chrissonar: sevenseacat, sure.
[07:30:11] Creeves: chrissonar: maybe gist an example of one of your tests and the factorie(s) it uses?
[07:30:25] aceRacer: I have updated the gist https://gist.github.com/argentum47/5088b87cb5e824666438
[07:30:38] chrissonar: Creeves, nothing special. just more abstract thoughts.
[07:30:50] Creeves: mine look something like: https://gist.github.com/anonymous/963cc9cf22b29acba04a
[07:30:55] Creeves: for model tests
[07:30:56] aceRacer: the email is not inside the params :O
[07:30:59] manuscle: has joined #RubyOnRails
[07:31:05] sevenseacat: aceRacer: I was just about to point that out
[07:31:26] sevenseacat: there we go, you need to merge your params into the {api_version: "v1"} hash
[07:31:32] chrissonar: sevenseacat, thanks for helping me to be more confident having separate factories.
[07:31:42] sevenseacat: chrissonar: np :)
[07:32:18] chrissonar: Creeves, I recently try to follow the approach brought up by Corey Haines.
[07:32:46] Creeves: http://articles.coreyhaines.com/posts/four-second-tests/ ?
[07:32:50] sevenseacat: he has some good ideas. some of them really aren't practical though.
[07:32:51] chrissonar: leaving the Rails stuff out of my tests as much as possible.
[07:33:09] chrissonar: Creeves, right :)
[07:33:15] Creeves: nice okay, i'll have a read
[07:33:17] Creeves: looks interesting
[07:33:29] nahtnam: Creeves: Thanks. I appreciated it
[07:33:33] nahtnam: *appreciate
[07:33:40] chrissonar: Creeves, yes. the only problematic stuff I still struggle with is the association stuff.
[07:33:52] Creeves: nahtnam: no problem, definitely come and let us know when you get it up and going. cs stuff is fun
[07:34:05] owenjones: has joined #RubyOnRails
[07:34:06] Creeves: chrissonar: yeah i generally set those in the before blocks in my tests
[07:34:14] Creeves: like in the gist i posted
[07:34:26] sevenseacat: I've worked on a couple apps that try to separate out rails from tests. the tests end up completely messed up
[07:34:28] aceRacer: hah!! works fine.. sometimes things are so obvious its hard to find :D
[07:34:39] sevenseacat: aceRacer: yeah I didn't notice it either :)
[07:34:40] Creeves: create your resources with factories and set their associations before saving
[07:34:40] chrissonar: sevenseacat, really? why?
[07:34:56] sevenseacat: chrissonar: because you end up writing such convoluted trickery
[07:35:06] sevenseacat: and the meaning of the tests gets completely lost
[07:35:13] CheckYourSix: has joined #RubyOnRails
[07:35:27] sevenseacat: I will sacrifice speed for simplicity and readability every day of the week
[07:35:29] chrissonar: sevenseacat, did those tests had trouble with stubbing associated objects?
[07:35:36] sevenseacat: didnt even get that far
[07:35:54] chrissonar: sevenseacat, can you post such messed up spec?
[07:36:00] sevenseacat: nah I dont have them anymore
[07:36:04] chrissonar: just to see what you mean. just curious.
[07:36:10] sevenseacat: but you just end up maintaining two test suites
[07:36:16] Creeves: that being said, all of our stuff is nosql now so it might behave a bit diffferently when it's a relational db (though i woudln't think so as rails abstracts that logic to make it not really matter)
[07:36:28] sevenseacat: and gradually people forget to run one of them (usually the complicated one)
[07:36:35] Creeves: but i wouldn't generally try and create the associations in the factory
[07:36:53] chrissonar: Creeves, no I curently tend to stub them out if possible.
[07:37:30] chrissonar: sevenseacat, two test suites? can't follow? which two test suites?
[07:37:33] Creeves: oh if it works and helps with the tests, nothing wrong with that
[07:37:41] chrissonar: Creeves, yep
[07:37:42] Creeves: i've just found it easier to do in the test files
[07:37:45] sevenseacat: chrissonar: one that doesnt use rails, and one that does
[07:37:48] Creeves: depends what the association is too
[07:37:49] sevenseacat: for the same app
[07:37:54] chrissonar: sevenseacat, ah o.k.
[07:38:28] sevenseacat: in the app I'm working on now, someone has tried to split out tests that dont require rails - those tests take longer, for some reason
[07:39:00] sevenseacat: in this case the app is slow because of the huge levels of associations in the factories
[07:39:06] sevenseacat: *the test suite is slow
[07:39:23] camilasan: has joined #RubyOnRails
[07:40:03] sevenseacat: I've worked on apps where if you create one record, you get like 30 different records created due to associations in a factory
[07:40:11] livathinos: has joined #RubyOnRails
[07:40:22] chrissonar: sevenseacat, that is really surprising me. tests without complete rails stack are slower?
[07:40:23] Creeves: yeah and then rspec does it for every test in a file
[07:40:32] chrissonar: I think Haines suggested to only include those Rails which is needed. is it really nessessary to load the complete Rails stack for any kind of test?
[07:40:46] chrissonar: and until now they are really much faster.
[07:41:05] sevenseacat: not for any kind of test, but the lengths he goes to I think are way excessive
[07:41:40] sevenseacat: I saw one example that he did where he split out his validations (or something similar) into individual modules that he then included into his model, just so he could test the module independently of the model
[07:41:49] chrissonar: sevenseacat, can you post a spec of them? I'm curous about gaps in that approach.
[07:41:51] sevenseacat: watching it I was like w...t...f...
[07:42:01] Creeves: when i start changing my logic and code for tests too much i start to rethink the tests
[07:42:34] chrissonar: sevenseacat, i think moving simple validations out into mixins is overengineering.
[07:42:48] crdpink2: has left #RubyOnRails: ()
[07:43:04] chrissonar: and that does not help testing/ maintaining the model in any way.
[07:43:18] sevenseacat: trying to find the exact exampke
[07:43:24] chrissonar: sevenseacat, nice :)
[07:43:54] Creeves: i want to get set up with travis but the cost for private projects is pretty pricey
[07:44:44] chrissonar: Creeves, do you test existence of each and every attribute?
[07:44:59] chrissonar: is this still testing behaviour?
[07:45:00] Creeves: anything that i will be accessing, but it's more of a habit
[07:45:07] sevenseacat: things like this https://github.com/coreyhaines/ShoppingCart/blob/no_rails/app/models/shopping_cart.rb and this https://github.com/coreyhaines/ShoppingCart/blob/no_rails/lib/shopping_cart_extensions/calculates_total_price.rb
[07:45:35] emilkarl: has joined #RubyOnRails
[07:45:50] sevenseacat: so he can write a test that does this https://github.com/coreyhaines/ShoppingCart/blob/no_rails/spec_no_rails/lib/shopping_cart_extensions/calculates_total_price_spec.rb
[07:47:01] Creeves: chrissonar: that list can be more than just attrs, could be testing an alias or something like that
[07:47:26] ValicekB: has joined #RubyOnRails
[07:48:36] chrissonar: Creeves, I mean even if all getter were accessed anywhere in the app, the tests there should break. so I can't see a reasin why thoses tests increase test reliability
[07:49:11] chrissonar: Creeves, what is your intention?
[07:49:38] chrissonar: sevenseacat, I can't see a messy test :)
[07:50:04] chrissonar: sevenseacat, what is your complain about that test?
[07:50:21] sevenseacat: I can see a test that cares *way* too much about the internals of how something is structured
[07:50:24] chrissonar: too much stubbing?
[07:50:28] sevenseacat: and a test that has three different levels of stubbing
[07:50:34] sevenseacat: just for a simple sum
[07:50:57] fighella: has joined #RubyOnRails
[07:51:13] sevenseacat: I can think of numerous ways that test might not reflect how the code actually works
[07:51:20] kislak: has joined #RubyOnRails
[07:51:28] Creeves: chrissonar: it's more that it's left over from the test driven dev, i will define what i need it to respond to in the tests and build it from there so that they pass
[07:51:35] sevenseacat: that code assumes that the products is an array
[07:51:43] sevenseacat: when the code works work things that are not arrays
[07:51:50] sevenseacat: in fact by default they won't be arrays
[07:51:52] chrissonar: sevenseacat, aaaaah
[07:51:59] Creeves: i mean, to some extent i mean that's kind of the point, the app has different people using using it as a module in different products we have, when it's deployed, the tests run and if for some reason the model wont respond to one of those, it's worth knowing
[07:52:00] chrissonar: i think I gotcha.
[07:52:07] mcr-credil: has joined #RubyOnRails
[07:52:44] sevenseacat: I mean, is that so much nicer than building a shopping cart object and adding two products to it (they don't have to be persisted)
[07:52:52] chrissonar: Creeves, ah o.k. this module is used in several apps?
[07:53:00] sevenseacat: anyway. i digress.
[07:53:07] nahtnam: Creeves: I figured it... It has nothing to do with my code. If you go to counterstrikeio.herokuapp.com it works
[07:53:08] chrissonar: sevenseacat, agree.
[07:53:28] nahtnam: Something to do with cloudflare i think
[07:53:31] nahtnam: but i dont know what
[07:53:56] Creeves: chrissonar: actually not this one, but we do all our tests like that and probably about 60%-70% of the projects are gems
[07:54:32] Creeves: nahtnam: at least it wasn't your code :D
[07:54:56] sevenseacat: thats freaking awesome.
[07:55:02] sevenseacat: all this time you werent even looking at the URL you were deploying to.
[07:55:22] Creeves: oh lol, i didn't realise it was just the url haha
[07:55:25] chrissonar: Creeves, for gems I totally agree to test the entire public API.
[07:55:26] Creeves: it's funny actually
[07:55:31] nahtnam: But i dont understand why
[07:55:33] Creeves: i was going to say before that it's awesome that you got the counterstrike.io url
[07:55:39] nahtnam: Yeah, thanks
[07:55:52] Creeves: chrissonar: yeah, and we just end up writing all our tests like that really
[07:56:08] chrissonar: Creeves, o.k.
[07:56:12] Creeves: i agree that for this (app that creates a RESTful payment gateway that can store and charge cards) it's not super useful
[07:57:22] nahtnam: https://staging.counterstrike.io/
[07:57:28] nahtnam: I think it has to do with the minification
[07:57:57] nahtnam: Cloudflare minification
[07:57:58] jenrzzz: has joined #RubyOnRails
[07:57:59] Creeves: i've actually run into a lot of issues with tests where you create something using a factory and then want to retreive it but the index or show methods use elasticsearch and there wasn't enough time for replication between the creation and test to retreive
[07:58:13] sevenseacat: ah hah, I don't know anything about cloudflare.
[07:58:33] Creeves: nahtnam: heh, turns out it was the minification all along
[07:58:42] Creeves: if only you turned it off like 6 hours ago aha
[07:58:50] nahtnam: If only...
[07:58:51] sevenseacat: if cloudflare tries to minify what is already minified, then there might be problems.
[07:58:54] nahtnam: I learnt my lesson
[07:59:01] nahtnam: sevenseacat: ^
[07:59:08] sevenseacat: I'd look at disabling that.
[07:59:18] Creeves: sevenseacat: wouldn't a good test for a minification algorithm be to be able to minify something twice and get the same thing
[07:59:26] sevenseacat: I have no idea.
[07:59:46] sevenseacat: but if you'd disabled the minification in your code, and then it worked, then you'd be blaming rails for the problem, and not cloudflare.
[08:00:04] christiandsg: has joined #RubyOnRails
[08:00:08] nahtnam: Creeves: cloudflare minifaction just removes all spaces
[08:00:13] nahtnam: or something
[08:00:18] nahtnam: sevenseacat: Yep, just disabled it
[08:00:19] Creeves: yeah i would be surprised that minification would break things tbh
[08:00:31] nahtnam: You guys should check out cloudflare tho. Free ssl
[08:00:32] Creeves: i feel like any good minifier could take minified code and spit out valid code
[08:00:52] asheinfeld: has joined #RubyOnRails
[08:01:04] Creeves: i mean if a minifier takes valid js and makes it valid and minified, then its output should be valid input
[08:01:18] Creeves: at least it's working :D
[08:01:54] nahtnam: Creeves: Yep. Im just double checking to make sure that was the issue
[08:02:35] Doddlin: has joined #RubyOnRails
[08:03:46] RegulationD: has joined #RubyOnRails
[08:03:50] woodson88: has joined #RubyOnRails
[08:04:08] eGGsha: has joined #RubyOnRails
[08:04:26] nahtnam: It was a problem with the minifcation of css...
[08:04:44] Creeves: yeah it was definitely a CSS issue
[08:04:58] Creeves: it's still displaying incorrectly on my mobile for some reason
[08:05:06] jsrn_: has joined #RubyOnRails
[08:05:55] nahtnam: Creeves: No, thats a property of it
[08:05:59] nahtnam: It removes the navbar
[08:06:12] Creeves: no i get that when i resize on my desktop
[08:06:14] nahtnam: The content of the page is still part of a different css framework so its not foramtted correctly
[08:06:34] Creeves: on my mobile it's doing that same bug
[08:06:40] Creeves: how do you screenshot on android?
[08:06:42] Creeves: ACTION looks up
[08:07:11] srinidhi: has joined #RubyOnRails
[08:07:47] nahtnam: Creeves: volume down plus power
[08:07:52] Creeves: yup just uploading now
[08:08:12] Creeves: someone broke into my car and stole my phone, so i have to learn to use this one now :/
[08:08:30] nahtnam: What phone do you have now?
[08:08:34] nahtnam: and before
[08:08:41] Creeves: i got an HTC desire Eye
[08:08:57] Creeves: before i had a note 3 but samsung's modified firmware had a different way to take screenshots
[08:09:24] Creeves: http://i.imgur.com/ReNwc4w.png
[08:09:40] nahtnam: Creeves: Force refresh?
[08:09:56] nahtnam: Everything is working fine
[08:09:59] nahtnam: even on my phone
[08:10:26] Creeves: yeah it must be cached, i opened in incognito and it's okay
[08:10:34] Creeves: it's strange as i didn't think i went to the site on my phone
[08:10:44] Creeves: but maybe it synced with my desktop :S
[08:11:36] Creeves: yeah there we go, cleared the cache and it's okay
[08:11:49] nahtnam: Thanks for all of your help
[08:11:49] Creeves: it must have synced from my work desktop... wow
[08:11:55] Creeves: no worries, glad it's going
[08:13:37] michael_mbp: has joined #RubyOnRails
[08:14:17] woodson88: has left #RubyOnRails: ()
[08:14:22] Trefex: has joined #RubyOnRails
[08:14:35] woodson88: has joined #RubyOnRails
[08:14:44] eyck: has joined #RubyOnRails
[08:15:01] Papierkorb: has joined #RubyOnRails
[08:16:02] Guest94314: has joined #RubyOnRails
[08:18:25] woodson88: has left #RubyOnRails: ()
[08:18:32] woodson88: has joined #RubyOnRails
[08:18:51] woodson88: Anyone here have good example or tutorial on how to use websocket with rails? I am try to make my news feeds on every users dashboard live. But unfortunately I am having trouble understanding the setup, and how it works.
[08:19:23] SteenJobs: has joined #RubyOnRails
[08:19:54] axl_: has joined #RubyOnRails
[08:19:57] nahtnam: Am i the only one thats amazed by CI?
[08:20:09] nya: has joined #RubyOnRails
[08:20:15] HamuPapu: has joined #RubyOnRails
[08:21:06] ndrei: has joined #RubyOnRails
[08:21:27] Anubix: has joined #RubyOnRails
[08:21:34] adre: has joined #RubyOnRails
[08:22:29] arup_r: has joined #RubyOnRails
[08:25:21] Creeves: nahtnam: continuous integration?
[08:25:28] nahtnam: Its a work of art
[08:25:33] Creeves: yeah the tools for it now are great
[08:25:46] srinidhi: has joined #RubyOnRails
[08:26:08] mrbubbles: has joined #RubyOnRails
[08:26:26] sandelius: has joined #RubyOnRails
[08:26:33] Creeves: tools like yeoman will give you a CI workflow ootb
[08:27:14] Creeves: out of the box
[08:27:25] Anubix1: has joined #RubyOnRails
[08:27:33] nahtnam: Somewhat same with wercker
[08:27:33] Creeves: like you set up with tools like that and they make many aspects of CI really easy
[08:27:47] nahtnam: All I have to do is push my code and its deployed to heroku
[08:28:10] Creeves: yeah, though think of how much more you would learn if you had to do it all yourself :D
[08:28:53] nahtnam: I already know how to push to heroku
[08:28:57] Anubix1: has left #RubyOnRails: ()
[08:28:58] nahtnam: and you have to configure everything
[08:29:05] nahtnam: so technically you end up learning anyways
[08:29:35] Anubix1: has joined #RubyOnRails
[08:29:58] Creeves: yeah true, getting it set up still teaches you pretty much the same amount but saves on a lot of hassle
[08:30:24] Doddlin: has joined #RubyOnRails
[08:32:05] Anubix1: has left #RubyOnRails: ()
[08:32:14] rickmasta: has joined #RubyOnRails
[08:32:43] Anubix1: has joined #RubyOnRails
[08:33:17] nahtnam: Creeves: Yep
[08:33:20] nahtnam: Well g2g guys
[08:33:24] nahtnam: 1:30 in the morning
[08:33:29] nahtnam: gotta wake up at 7
[08:35:11] owenjones: has joined #RubyOnRails
[08:36:53] WhereIsMySpoon_: has joined #RubyOnRails
[08:37:01] Anubix1: has left #RubyOnRails: ()
[08:38:06] Anubix1: has joined #RubyOnRails
[08:38:20] arBmind: has joined #RubyOnRails
[08:38:28] artto: has joined #RubyOnRails
[08:39:15] x-light: has joined #RubyOnRails
[08:39:44] yfeldblum: has joined #RubyOnRails
[08:40:06] dici: has joined #RubyOnRails
[08:40:33] yashinbasement: hey can I ask a sql question ?
[08:41:07] yashinbasement: cause sql channel is pretty quiet
[08:41:23] yashinbasement: wondering if someone can help
[08:42:17] Anubix1: has left #RubyOnRails: ()
[08:42:58] yashinbasement: ok so I want to work on a db , but it's on remote desktop
[08:43:11] yashinbasement: and it's large , i want to have local copy
[08:43:30] yashinbasement: I generated a sql script but it'
[08:43:51] puppeh: has left #RubyOnRails: ("Leaving...")
[08:44:05] rvanlieshout: so you just want to get that db locally?
[08:44:21] Anubix1: has joined #RubyOnRails
[08:44:22] hd1: why not expose it as json?
[08:44:43] rvanlieshout: ^ because that would ignore all kinds of information
[08:45:01] yashinbasement: so how do I get that into json ?
[08:45:17] rvanlieshout: get a local copy of that db if that's what you want
[08:45:19] rvanlieshout: what db engine?
[08:45:25] Ropeney: has joined #RubyOnRails
[08:45:26] hd1: rvan: it only ignores the information you don't incorporate into the output
[08:45:43] rvanlieshout: hd1: and how would you import it again with foreign keys and indexes and such?
[08:45:48] rvanlieshout: yashinbasement: and what exactly fails?
[08:46:01] rvanlieshout: exporting the db? copying to local? importing it again?
[08:46:11] rvanlieshout: alternative is that you give yourself remote access to that db not using remote desktop
[08:46:26] hd1: I only care about the DATA in the DB, not how it's stored
[08:46:47] yashinbasement: yeah but I don't wanna modify it accidently
[08:46:59] rvanlieshout: yashinbasement: create a read only user?
[08:47:15] yashinbasement: well yeah that works
[08:47:20] hd1: use a read-only view?
[08:47:24] Anubix1: has left #RubyOnRails: ()
[08:47:51] Anubix1: has joined #RubyOnRails
[08:49:47] Anubix1: When i set up only: [:index, :show] in router.rb after resources, then i dont have to use it in controller?
[08:50:12] rvanlieshout: Anubix1: you don't have to use anything
[08:50:32] andrew9184: has joined #RubyOnRails
[08:52:00] hd1: rvan: but if you care about the layout... {"colname": "id", "colvalue": 1, "colddl": "not null unique primary key int" } or whatever
[08:52:21] alexblom: has joined #RubyOnRails
[08:52:30] _3by8: has joined #RubyOnRails
[08:52:35] mhib: has joined #RubyOnRails
[08:52:36] rvanlieshout: Anubix1: The routes just set up routes. it's only used to connect an incoming request to a controller action
[08:53:00] rvanlieshout: hd1: that's an option for sure, but wouldn't really be practical if you want it in sql again locally
[08:53:13] rvanlieshout: Anubix1: or what exactly is your question? :)
[08:53:23] jamey-uk: has joined #RubyOnRails
[08:54:07] skroon: has joined #RubyOnRails
[08:54:16] Anubix1: Well, sometimes in controller you need to use only show/edit/destroy
[08:54:39] _3by8: So I'm going through a tutorial and in the routes file, we're instructed to use the resources method and pass it the symbol :users. I'm just wondering where :users came from. Was it automatically generated when I created the User model? Is there a way in the console to figure out where a symbol came from?
[08:54:39] Anubix1: so you can use before_action xxx only: xxx
[08:55:06] DEA7TH: has joined #RubyOnRails
[08:55:07] rvanlieshout: Anubix1: i can follow you so far.
[08:55:17] mikecmpbll: has joined #RubyOnRails
[08:55:37] Anubix1: but if you use in resources :this_controller show etc.. is it the same? But of course in resources you have it for full controller
[08:56:21] mikecmpbll: first person to figure out how i register an account at https://support.mozilla.org/en-US/ gets a cookie.
[08:56:23] Anubix1: no in resources, in routes.rb i wrote it incorrectly
[08:56:25] larrylv_: has joined #RubyOnRails
[08:56:28] rvanlieshout: Anubix1: that i don't follow anymore
[08:56:49] rvanlieshout: Anubix1: it's possible to create a route to an action that doesn't exist
[08:56:51] rvanlieshout: in the controller
[08:57:49] DEA7TH: has joined #RubyOnRails
[08:58:10] ValicekB: has joined #RubyOnRails
[08:58:44] DEA7TH_: has joined #RubyOnRails
[08:58:45] Anubix1: well what's difference between this in routes.rb " resources :dogs, only: [:index, :show] " and this in dogs_controller "before_action dogs_param only: [:index, :show]" ?
[08:59:12] rvanlieshout: Anubix1: they are two totally different things
[08:59:28] rvanlieshout: in routes.rb you _only_ define routes that are used to process the incoming request and find the appropiate controller and action
[08:59:37] rvanlieshout: in that controller you tell what should happen
[08:59:56] hotpancakes: has joined #RubyOnRails
[09:00:01] rvanlieshout: in a before_action you specify a method that should only happen when index or show is called
[09:00:24] Anubix1: ah, ok i get it
[09:00:32] yashinbasement: and in controller you are running the dogs_parms for the routes before they get executed
[09:00:42] rvanlieshout: for the actions
[09:00:43] _3by8: mikecmpbll: you have to have a question to ask before you can register.
[09:00:51] yashinbasement: so that you have instance of dog
[09:00:57] mikecmpbll: _3by8: really? :/ i don't wanna ask a question.
[09:01:04] mikecmpbll: I want to reply to a question already asked!
[09:01:04] _3by8: Also I'm going to repost a question I just had in regards to rails: So I'm going through a tutorial and in the routes file, we're instructed to use the resources method and pass it the symbol :users. I'm just wondering where :users came from. Was it automatically generated when I created the User model? Is there a way in the console to figure out where a symbol came from?
[09:01:23] rvanlieshout: _3by8: there is not really much auto generated
[09:01:27] rvanlieshout: unless you use scaffolding
[09:01:36] asheinfeld: has joined #RubyOnRails
[09:01:44] yashinbasement: it does for you
[09:01:45] mikecmpbll: _3by8: a symbol doesn't 'come' from somewhere
[09:01:53] mikecmpbll: _3by8: when you write it you're defining it
[09:02:14] _3by8: mikecmpbll: I don't remember ever creating a :users symbol. Would it maybe be generated when I created the User model?
[09:02:17] IanV0rn2341: has joined #RubyOnRails
[09:02:21] mikecmpbll: you created it when you typed it
[09:02:26] rvanlieshout: _3by8: how did you 'create' that model?
[09:02:29] rvanlieshout: did you use scaffolding?
[09:02:30] wildfield: has joined #RubyOnRails
[09:02:35] _3by8: rvanlieshout: yeah, rails generate
[09:02:41] mikecmpbll: _3by8: a symbol is like a string ..
[09:02:46] rvanlieshout: _3by8: rails generate what?
[09:02:51] rvanlieshout: rails generate model won't create that
[09:03:08] _3by8: rvanlieshout: let me investigate...
[09:03:14] _3by8: rvanlieshout: what WOULD have created it?
[09:03:15] mikecmpbll: won't create what?
[09:03:20] Anubix1: rvanlieshout: Thanks for help, i have 1 more question for creating admin namespaces for backend
[09:03:22] rvanlieshout: mikecmpbll: an entry in routes
[09:03:25] mikecmpbll: one of us is totally misunderstanding what he's on about
[09:03:32] _3by8: rvanlieshout: all I know is that if I pass it to resources in routes, it works and I don't remember making it.
[09:03:39] mikecmpbll: ok, it's you
[09:03:45] rvanlieshout: _3by8: rails generate scaffold
[09:03:50] rvanlieshout: != rails generate model
[09:03:59] mikecmpbll: rvanlieshout: he wrote the line in the routes, he wants to know where the "symbol" came from
[09:04:39] rvanlieshout: _3by8: did you write that line yourself?
[09:04:41] rvanlieshout: (just checking now)
[09:04:52] _3by8: rvanlieshout: I also ran rails generate controller Users new
[09:05:04] _3by8: I'm following a tutorial, rvanlieshout.
[09:05:06] yashinbasement: the symbol does not come when you crate model
[09:05:10] rvanlieshout: _3by8: now i understand
[09:05:22] bhuvan_aurora: has joined #RubyOnRails
[09:05:28] rvanlieshout: _3by8: would you understand it when it would be: resources "users"
[09:05:30] workmad3: has joined #RubyOnRails
[09:05:38] bhuvanaurora: has joined #RubyOnRails
[09:06:03] jenrzzz: has joined #RubyOnRails
[09:06:13] _3by8: rvanlieshout: not entirely but I think that makes a little more sense. Let me guess, passing it "users" like that makes it use that view or no?
[09:06:26] rvanlieshout: _3by8: it would create routes for your controller
[09:06:41] rvanlieshout: _3by8: http://guides.rubyonrails.org/routing.html#resource-routing-the-rails-default
[09:06:51] rvanlieshout: _3by8: and know that "users" is in some way similar to :users
[09:06:57] rvanlieshout: "users" is a mutable string
[09:07:11] rvanlieshout: :users is a symbol (inmutable string-ish)
[09:07:34] rvanlieshout: so resources("users") == resources "users" == resources :users
[09:07:37] _3by8: What does the string refer to? Seems like an obvious question but I'm having difficulty understanding the magic of rails here.
[09:07:37] mcr-credil: has joined #RubyOnRails
[09:07:53] rvanlieshout: read that part of the guide
[09:08:11] rvanlieshout: calling that method with :users will generate a default set of routes that assumes you have a UsersController
[09:08:20] rvanlieshout: and it's common to have a controller to match the name of the model
[09:08:27] rvanlieshout: but resources and controllers are not realted to models
[09:08:53] Anubix1: When i use in routes.rb namespace :admin do resources :dogs end then url will be localhost:3000/admin/dogs where should i have my admin dog view file? views/admin/ folder or views/admin/dogs/ folder?
[09:08:59] gremax: has joined #RubyOnRails
[09:09:03] _3by8: I see... I don't get how that symbol is a reference to that controller though... I guess that resources takes a string that uses the name of a controller for its parameter?
[09:09:07] rvanlieshout: Anubix1: routes match controller actions
[09:09:16] rvanlieshout: Anubix1: your controller action determines what view to render
[09:09:26] woodson88: Hey guys I asked earlier but no one answered hope someone could help me. I have an app where each user have a dashboard and within the dashboard they can post news pretty just a news feed but I want it to be live so that every users that are logged in can see it each new post. Should i use private_pub or websocket_rails?
[09:09:29] rvanlieshout: Anubix1: with that route you would have a Admin::DogsController with action index
[09:09:35] arup_r: has joined #RubyOnRails
[09:09:42] rvanlieshout: Anubix1: with optionally a views/admin/dogs/index.something
[09:09:42] Anubix1: yes i have
[09:09:54] rvanlieshout: _3by8: no. you can pass in anything
[09:09:55] Anubix1: just dont know folder structure of views file
[09:10:03] rvanlieshout: it _assumes_ something exists
[09:10:16] rvanlieshout: if you create resources :foobar and run 'rake routes' you'll see routes being created
[09:10:26] rvanlieshout: it'll throw an error when you actually use them
[09:10:27] _3by8: rvanlieshout: something (a controller) named Users?
[09:10:44] rvanlieshout: _3by8: see the output of rake routes. it shows you wnat url is matched to what controller and action
[09:11:52] mhib_: has joined #RubyOnRails
[09:12:05] Anubix1: Thanks for help rvanlieshout ;-)
[09:12:14] bin_005: has joined #RubyOnRails
[09:12:25] _3by8: Same, thanks rvanlieshout.
[09:13:29] _3by8: rvanlieshout: let me ask you this: what is the point of using a symbol over a string for the resources method?
[09:13:41] rvanlieshout: exactly the same result
[09:14:05] rvanlieshout: there are some minor differences between 'foo', "foo" and :foo
[09:14:09] rvanlieshout: but none relevant
[09:14:37] tvw: has joined #RubyOnRails
[09:14:40] noodman: has joined #RubyOnRails
[09:15:47] _3by8: Thanks some more.
[09:16:29] keernel: has joined #RubyOnRails
[09:16:33] jeanlinux: has joined #RubyOnRails
[09:16:34] rvanlieshout: 'foo', 'foo'.freeze, "foo", "foo".freeze and :foo even
[09:16:36] rvanlieshout: http://www.reactive.io/tips/2009/01/11/the-difference-between-ruby-symbols-and-strings/
[09:17:16] mikecmpbll: what about :"foobar" ? :p
[09:17:24] eGGsha: has joined #RubyOnRails
[09:17:31] rvanlieshout: that's when created similar to :foobar
[09:17:38] rvanlieshout: but interpolated first
[09:17:40] mikecmpbll: ok, :"foo-bar"
[09:18:23] rvanlieshout: that one is tricky. it's a symbol, but you cannot create it as one
[09:18:26] _3by8: rvanlieshout: so then it's like what you guys were saying earlier, :users was never created, it's basically just a string. I thought it was something like a variable name. That's why I was confused. Basic misunderstanding of Ruby, I guess.
[09:18:32] mikecmpbll: yeah, i saw them in code once
[09:18:40] mikecmpbll: what a mess.
[09:18:43] _3by8: More aptly put, it was a misunderstand of a Ruby basic.
[09:18:45] Lytol: has joined #RubyOnRails
[09:18:50] mikecmpbll: _3by8: indeed.
[09:18:57] rvanlieshout: _3by8: that happens. but ^
[09:19:29] TheCuroiusGuy: has joined #RubyOnRails
[09:19:32] _3by8: I'm reading it now.
[09:19:34] abuzze: has joined #RubyOnRails
[09:19:51] rvanlieshout: eheh.. it's fun to know, but you will live without
[09:19:58] rvanlieshout: so only if you're really intrested in this
[09:21:01] Anubix1: has left #RubyOnRails: ()
[09:21:41] mikecmpbll: the main difference really is that any identical symbol referenced anywhere in a ruby program (process?) is the same object in memory, whereas everytime you have "foo" it's defining a new object
[09:22:04] mikecmpbll: 5.times { puts :foo.object_id } vs 5.times { puts "foo".object_id }
[09:22:37] mikecmpbll: but i don't really know the specifics of how that's changed now symbols are garbage collected, mind you.
[09:22:50] abuzze: has joined #RubyOnRails
[09:23:01] _3by8: rvanlieshout: I am attempting to become a web developer.
[09:23:08] _3by8: rvanlieshout: I need to know :)
[09:23:18] abuzze: has joined #RubyOnRails
[09:24:28] Ergo: has joined #RubyOnRails
[09:26:02] roadpanda_: has joined #RubyOnRails
[09:30:20] workmad3: has joined #RubyOnRails
[09:32:06] matcouto: has joined #RubyOnRails
[09:32:19] maloik: Is it a common usecase to user PORO objects as "presenters" or serializers - simple classes that just implement #to_h somehow - and then use that to render json in an api? What are some common ways to cache these objects?
[09:32:59] maloik: s/to user/to use
[09:35:59] owenjones: has joined #RubyOnRails
[09:36:28] x-light: has joined #RubyOnRails
[09:37:28] DEA7TH_: has joined #RubyOnRails
[09:41:24] bhuvanaurora: has joined #RubyOnRails
[09:41:48] TheCuriousGuy: has joined #RubyOnRails
[09:42:33] mrbubbles: has joined #RubyOnRails
[09:43:00] DylanJ: common? dunno. do people do it? yeah. do i? sometimes.
[09:43:42] TheCuriousGuy: When I join a new project, it takes some while to understand what is going on there
[09:44:05] TheCuriousGuy: Does anyone have any tips on how to understand other people's code quicker?
[09:44:24] hotpancakes: has joined #RubyOnRails
[09:46:57] ProLoser: has joined #RubyOnRails
[09:48:37] User458764: has joined #RubyOnRails
[09:48:41] ynonp: has joined #RubyOnRails
[09:48:46] christiandsg: has joined #RubyOnRails
[09:50:43] Creeves: has joined #RubyOnRails
[09:50:49] eGGsha: has joined #RubyOnRails
[09:51:36] artto: has joined #RubyOnRails
[09:51:53] sandelius: has joined #RubyOnRails
[09:52:48] universa1: TheCuriousGuy: tests.
[09:54:09] mclee: has joined #RubyOnRails
[10:00:29] User458764: has joined #RubyOnRails
[10:00:37] iamse7en: has joined #RubyOnRails
[10:02:27] asheinfeld: has joined #RubyOnRails
[10:04:11] maloik: DylanJ: mostly asking about the caching, as I don't really know if there are best practices
[10:04:17] zly: Is there a way to prevent form_tag from sending 'commit' withing the request?
[10:04:25] zly: within*
[10:05:55] rvanlieshout: zly: don't give your submit button a name
[10:07:16] iamse7en: what is the rails parameter for a full date? e.g. I know I can do games/:year to pass in the year, but what symbol passes in the full date (day, month, year)
[10:07:27] universa1: iamse7en: ?
[10:08:43] iamse7en: e.g. defining my action method as model.find_by(year: :year) would pull my data that fits that year.
[10:08:52] iamse7en: what about pulling data that fits year, month, and day?
[10:09:03] universa1: iamse7en: does you model have a year column?
[10:09:26] iamse7en: tbh, it only has a datetime column
[10:09:40] universa1: iamse7en: than where(year: some_year) does not work.
[10:09:47] hotpancakes: has joined #RubyOnRails
[10:10:04] iamse7en: whats the syntax to pass in the datetime?
[10:10:51] universa1: iamse7en: the general syntax is always: where(some_column: some_value), or where("some sql fragment", some_value, other_value) for example
[10:10:54] helpa: http://guides.rubyonrails.org/active_record_querying.html - ActiveRecord Querying Guide by Ryan Bigg
[10:11:08] universa1: iamse7en: ^^
[10:12:18] iamse7en: okay. perhaps where(created_at: Date.today)
[10:13:48] iamse7en: can ruby do like Date.today - 1.day or something like that?
[10:14:20] universa1: iamse7en: !try
[10:14:20] helpa: iamse7en: Why don't you try it and find out for yourself?
[10:14:47] universa1: iamse7en: there is also stuff like 1.day.ago 3.weeks.from_now and so on.
[10:15:11] iamse7en: rad. that worked in rails console.
[10:19:18] kil0byte: has joined #RubyOnRails
[10:20:25] rickmasta: has joined #RubyOnRails
[10:21:14] nandx64: has joined #RubyOnRails
[10:22:00] DEA7TH_: has joined #RubyOnRails
[10:26:39] Pupeno: has joined #RubyOnRails
[10:27:31] creature: has joined #RubyOnRails
[10:29:04] iamse7en: universa1: do you know how I would use something like bootstrap datepicker my AR Querying? e.g. the date I pick plugs into (created_at: DatePicker)
[10:36:24] dhjondoh: has joined #RubyOnRails
[10:36:41] owenjones: has joined #RubyOnRails
[10:37:45] quazimodo: has joined #RubyOnRails
[10:37:48] quazimod1: has joined #RubyOnRails
[10:37:54] oflannabhra: has joined #RubyOnRails
[10:42:08] fgo: has joined #RubyOnRails
[10:43:32] kil0byte: has joined #RubyOnRails
[10:47:00] nfk: has joined #RubyOnRails
[10:47:28] mostlybadfly: has joined #RubyOnRails
[10:48:34] Trefex: has joined #RubyOnRails
[10:58:46] eGGsha: has joined #RubyOnRails
[11:01:13] hotpancakes: has joined #RubyOnRails
[11:02:42] nya: has joined #RubyOnRails
[11:03:11] asheinfeld: has joined #RubyOnRails
[11:04:55] wethu: has joined #RubyOnRails
[11:06:48] czerasz: has joined #RubyOnRails
[11:12:48] LudicrousMango: has joined #RubyOnRails
[11:15:02] hotpancakes: has joined #RubyOnRails
[11:16:10] mcr-credil: has joined #RubyOnRails
[11:16:58] krokuz_: has joined #RubyOnRails
[11:18:27] starfox_sf: has joined #RubyOnRails
[11:21:28] blackhuey: has joined #RubyOnRails
[11:22:41] Hates_: has joined #RubyOnRails
[11:24:48] arup_r1: has joined #RubyOnRails
[11:26:00] bonhoeffer: has joined #RubyOnRails
[11:27:44] krokuz_: has joined #RubyOnRails
[11:32:31] jeanlinux: has joined #RubyOnRails
[11:33:01] yashinbasement: has joined #RubyOnRails
[11:33:14] ProLoser: has joined #RubyOnRails
[11:33:15] GreatDanton: has joined #RubyOnRails
[11:34:57] dhoelzer: has joined #RubyOnRails
[11:35:55] solars: has joined #RubyOnRails
[11:37:10] owenjones: has joined #RubyOnRails
[11:37:32] christiandsg: has joined #RubyOnRails
[11:37:55] jeanlinux: has joined #RubyOnRails
[11:38:56] jordanstorz: has joined #RubyOnRails
[11:39:11] rubyonrails061: has joined #RubyOnRails
[11:41:30] RegulationD: has joined #RubyOnRails
[11:41:46] jeanlinux: has joined #RubyOnRails
[11:43:13] k4nd4lf: has joined #RubyOnRails
[11:43:48] Coldblackice_: has joined #RubyOnRails
[11:43:53] ldnunes: has joined #RubyOnRails
[11:45:41] bronson: has joined #RubyOnRails
[11:45:50] Trefex1: has joined #RubyOnRails
[11:48:12] wethu: has joined #RubyOnRails
[11:48:25] lupine: DateTime.now - Time.now => TypeError: expected numeric
[11:48:35] lupine: DateTime.now.to_time.class => DateTime
[11:48:43] lupine: what is this I can't even
[11:48:49] universa1: DateTime.now.class
[11:48:57] universa1: ohh nm, misread.
[11:49:08] universa1: convert your time to a datetime
[11:50:01] lupine: oh, obviously. I'm just raging
[11:50:21] lupine: ('though it'll probably be a matter of converting the DateTime to a time)
[11:50:24] universa1: why? because you can't subtract apples from oranges? ;)
[11:50:30] lupine: because the distinction is moot
[11:50:35] lupine: they're both a box around an int
[11:51:05] lupine: this will be the justification for having #to_time return a DateTime rather than a Time
[11:51:57] Papierkorb: I want to cache ruby objects for a specific model in the applications memory. They're instantiated object, parsed from XML, so I can't cache them in, say, redis without reparsing them (Which would nullify the benefit). How do I do this? I'd be fine with having the cache to invalidate entries after a certain time, or if it has a maximum 'length' and throws out old entries if the max is reached
[11:52:15] jeanlinux: has joined #RubyOnRails
[11:53:26] solars: has joined #RubyOnRails
[11:53:51] universa1: Papierkorb: you probably want some cache which is shared across processes. if not: class level / thread.local variables should do the trick. though that'll most likely only works properly in production, since in development, classes are reloaded constantly.
[11:54:57] Papierkorb: universa1: it's a single machine only and is running through passenger. Afaik passenger uses threads and not processes, so that'd be fine I guess?
[11:55:12] jeanlinux: has joined #RubyOnRails
[11:55:17] universa1: class variables have threading implications.
[11:55:43] universa1: passenger afaik uses a mixed model of processes and threads.
[11:55:49] krz: has joined #RubyOnRails
[11:55:53] universa1: anyway: have a look at memcached.
[11:56:40] Papierkorb: I already use redis for memory caching and things, works great, but I really need to keep the ruby objects alive, as their main cost is the (de-)serialization
[11:57:13] apeiros: lupine: their #- differs, though. one is days, the other seconds.
[11:57:32] lupine: if only there were a way to introspect the difference
[11:58:30] Papierkorb: universa1: thanks, currently reading the caching guide, maybe I'll do something with a Thread to clean things up. That's what the mini-rack-profiler uses by default and it seems to work for them
[11:58:35] bonhoeffer: has joined #RubyOnRails
[11:58:36] buffym: has joined #RubyOnRails
[12:00:03] apeiros: lupine: you're not being serious, right?
[12:00:36] lupine: apeiros, if #to_time is going to lie, it should not lie in a way that breaks typing
[12:00:42] lupine: personally, I think it should not lie
[12:01:01] apeiros: lupine: oh, I missed `DateTime.now.to_time.class => DateTime`
[12:01:05] apeiros: that's terrible???
[12:01:17] lupine: literal insanity
[12:01:24] apeiros: but that's rails
[12:01:28] apeiros: ruby does it right
[12:01:36] apeiros: DateTime.now.to_time.class # => Time
[12:01:37] lupine: this is why I'm ranting here, not #ruby :p
[12:02:18] apeiros: literal insanity. yeah. I agree.
[12:02:37] apeiros: and probably a change will break stuff for many. I hope they change it in rails 5, though.
[12:02:42] lupine: mind you, this code path isn't tested, so it's my predecessor's fault
[12:02:43] Papierkorb: lupine: What about using Time.zone.to_time.now instead?
[12:03:23] ekain: has joined #RubyOnRails
[12:03:29] jamiely: has joined #RubyOnRails
[12:03:58] asheinfeld: has joined #RubyOnRails
[12:04:00] lupine: as far as I can tell, the original type was Time
[12:04:22] Papierkorb: erm I meant Time.zone.now.to_time
[12:04:27] lupine: ACTION has moved from YAML serialisation in files to JSON serialisation in a DB, so the type info is being lost in that
[12:04:28] Papierkorb: which gives a Time
[12:04:56] lupine: that's not too surprising
[12:05:15] lupine: and yeah, I've got Time.parse( x ) if x.is_a?(String) now
[12:05:18] Papierkorb: I hope so looking at your troubles above ;)
[12:05:21] CanTonic: has joined #RubyOnRails
[12:05:24] lupine: previously it was DateTime
[12:05:47] Papierkorb: It's weird though to have DateTime and Time classes if Time actually also stores the date
[12:05:57] zeeraw: has joined #RubyOnRails
[12:06:09] lupine: it's all just interpretation around an int64
[12:06:19] lupine: y'all need data driven design
[12:06:45] Aswebb_: has joined #RubyOnRails
[12:07:12] lupine: and I need tests
[12:09:01] jeanlinux: has joined #RubyOnRails
[12:09:45] nzst: has joined #RubyOnRails
[12:10:58] leonardoajim: has joined #RubyOnRails
[12:11:55] jeanlinux: has joined #RubyOnRails
[12:12:18] zeeraw: has joined #RubyOnRails
[12:12:25] arup_r: has joined #RubyOnRails
[12:14:46] pedrosnk: has joined #RubyOnRails
[12:15:31] jeanlinux: has joined #RubyOnRails
[12:16:17] Lightsword: has joined #RubyOnRails
[12:16:53] CanTonic: has joined #RubyOnRails
[12:20:03] jeanlinux: has joined #RubyOnRails
[12:21:13] jkamenik: has joined #RubyOnRails
[12:22:06] shyshy: has joined #RubyOnRails
[12:22:11] jeanlinux: has joined #RubyOnRails
[12:22:34] Lightsword: has joined #RubyOnRails
[12:23:03] skroon: has joined #RubyOnRails
[12:23:50] jeanlinux: has joined #RubyOnRails
[12:25:40] Papierkorb: Where should I put rspec tests for app/lib files?
[12:26:56] Macaveli: has joined #RubyOnRails
[12:27:37] elaptics: typically files in lib/ would be in spec/lib
[12:28:02] eGGsha: has joined #RubyOnRails
[12:28:54] jeanlinux: has joined #RubyOnRails
[12:30:15] wazery: has joined #RubyOnRails
[12:32:15] strcmp1: has joined #RubyOnRails
[12:32:35] roadpanda_: has joined #RubyOnRails
[12:34:30] Papierkorb: my app dir had one, so I thought I'd put the stuff in there elaptics. Maybe I created that one myself though. Can't remember. Thanks
[12:34:34] jeanlinux: has joined #RubyOnRails
[12:34:39] crack_user: has joined #RubyOnRails
[12:36:30] wethu: has joined #RubyOnRails
[12:37:19] jeanlinux: has joined #RubyOnRails
[12:37:36] DEA7TH_: has joined #RubyOnRails
[12:37:54] owenjones: has joined #RubyOnRails
[12:39:15] kil0byte: has joined #RubyOnRails
[12:41:02] jamey-uk: has joined #RubyOnRails
[12:42:13] RegulationD: has joined #RubyOnRails
[12:42:13] jeanlinux: has joined #RubyOnRails
[12:43:52] jonathanwallace: has joined #RubyOnRails
[12:44:23] goodcodeguy: has joined #RubyOnRails
[12:45:10] stantonnet: has joined #RubyOnRails
[12:45:23] jenrzzz: has joined #RubyOnRails
[12:45:35] wazery: has joined #RubyOnRails
[12:46:24] skroon: has joined #RubyOnRails
[12:48:18] iwazery: has joined #RubyOnRails
[12:49:50] noodman: has joined #RubyOnRails
[12:50:26] intuxicated: has joined #RubyOnRails
[12:50:26] intuxicated: has joined #RubyOnRails
[12:51:45] mhib: has joined #RubyOnRails
[12:52:46] zorak8: has joined #RubyOnRails
[12:53:44] viiralvx: has joined #RubyOnRails
[12:54:21] victortyau: has joined #RubyOnRails
[12:54:53] bruno-: has joined #RubyOnRails
[12:56:42] MaDErroR123: has joined #RubyOnRails
[12:57:17] broman: has joined #RubyOnRails
[12:59:40] qejk: has joined #RubyOnRails
[12:59:41] sce_: has joined #RubyOnRails
[13:00:00] broman: I am getting a route error on No route matches {:controller=>"reitoria/correcao", :data=>{:questao_id=>"4090"}} ... my routes.rb: get "/correcao/:questao_id", :action => :indexcorrecao .... what am I doing wrong??
[13:00:04] broman: rails 3.2
[13:00:44] broman: and this is my link href <%= link_to pergunta.nomeevento, :controller => "correcao", :data => {:questao_id=> "#{pergunta.questao_id}"} %>
[13:02:48] DylanJ: broman: full route please ....
[13:04:38] DylanJ: link_to pergunta.nomeevento, {:controller => 'correcao', :action => 'indexcorrecao', :questao_id => perfunta.questao_id}
[13:04:47] DylanJ: but even then your routes seem really weird.
[13:05:24] DylanJ: broman: if i were you i'd read this http://guides.rubyonrails.org/routing.html once or twice.
[13:05:26] broman: i need to call the controller correcao passing a parameter
[13:05:42] broman: ok.. going to read it DylanJ ! thanks
[13:07:12] starfox_sf: has joined #RubyOnRails
[13:07:57] bungoman: has joined #RubyOnRails
[13:08:41] hotpancakes: has joined #RubyOnRails
[13:09:05] Miesco: has joined #RubyOnRails
[13:09:27] Miesco: Hi. How beneficial is it to have vendor/bundle on the remote git repository?
[13:13:16] roadpanda_: has left #RubyOnRails: ("Leaving")
[13:13:31] futilegames: has joined #RubyOnRails
[13:17:02] eGGsha: has joined #RubyOnRails
[13:17:13] hotpancakes: has joined #RubyOnRails
[13:17:39] hotpancakes: has joined #RubyOnRails
[13:18:49] jordanstorz: has joined #RubyOnRails
[13:18:51] bratsche: has joined #RubyOnRails
[13:19:27] futilegames_: has joined #RubyOnRails
[13:21:17] n1x: has joined #RubyOnRails
[13:22:02] kies^: has joined #RubyOnRails
[13:22:16] Macaveli: has joined #RubyOnRails
[13:22:43] bungoman: has joined #RubyOnRails
[13:23:39] DoctorMonocular: has joined #RubyOnRails
[13:24:49] Trefex: has joined #RubyOnRails
[13:25:42] livathinos: has joined #RubyOnRails
[13:26:17] christiandsg: has joined #RubyOnRails
[13:26:38] Hates_: Miesco: not sure if it would be
[13:27:15] devdazed: has joined #RubyOnRails
[13:27:30] Scripore: has joined #RubyOnRails
[13:27:31] xcesariox: has joined #RubyOnRails
[13:28:02] jdcauley: has joined #RubyOnRails
[13:29:26] garrypolley: has joined #RubyOnRails
[13:29:55] cfurrow: has joined #RubyOnRails
[13:31:36] jkamenik1: has joined #RubyOnRails
[13:32:05] Trefex1: has joined #RubyOnRails
[13:32:06] jeanlinux: has joined #RubyOnRails
[13:32:30] fatephd: has joined #RubyOnRails
[13:32:51] [H]unt3r: has joined #RubyOnRails
[13:33:32] ferr: has joined #RubyOnRails
[13:33:51] DoubleMalt: has joined #RubyOnRails
[13:34:35] jeanlinux: has joined #RubyOnRails
[13:34:49] jonathanwallace: has joined #RubyOnRails
[13:35:07] mary5030: has joined #RubyOnRails
[13:35:18] aaronr: has joined #RubyOnRails
[13:35:27] malcolmva: has joined #RubyOnRails
[13:36:24] oflannabhra: has joined #RubyOnRails
[13:37:38] hmnhf_: has joined #RubyOnRails
[13:39:00] owenjones: has joined #RubyOnRails
[13:40:23] ndrei: has joined #RubyOnRails
[13:41:16] JoshL: has joined #RubyOnRails
[13:41:56] asheinfeld: has joined #RubyOnRails
[13:42:34] oflannabhra: has joined #RubyOnRails
[13:44:53] arup_r: has joined #RubyOnRails
[13:45:18] bmurt: has joined #RubyOnRails
[13:45:30] sevenseacat: has joined #RubyOnRails
[13:46:01] brunno: has joined #RubyOnRails
[13:47:50] nixmaniack: has joined #RubyOnRails
[13:48:32] Trefex: has joined #RubyOnRails
[13:51:32] rubyonrailed: has joined #RubyOnRails
[13:51:56] livathinos: has joined #RubyOnRails
[13:54:27] nixmaniack: has joined #RubyOnRails
[13:54:29] earthquake: has joined #RubyOnRails
[13:55:00] paulcsmith: has joined #RubyOnRails
[13:58:51] n1x: has joined #RubyOnRails
[14:04:53] cmisenas: has joined #RubyOnRails
[14:05:16] sshuff: has joined #RubyOnRails
[14:07:27] surrealanalysis: has joined #RubyOnRails
[14:09:09] ivanskie: has joined #RubyOnRails
[14:10:23] Aswebb_: has joined #RubyOnRails
[14:12:35] garrypolley: has joined #RubyOnRails
[14:15:27] givanse: has joined #RubyOnRails
[14:16:32] IanV0rn2341: has joined #RubyOnRails
[14:16:39] fgo: has joined #RubyOnRails
[14:17:09] fxn: has joined #RubyOnRails
[14:17:17] werelivinginthef: has joined #RubyOnRails
[14:18:42] kostyay_: has joined #RubyOnRails
[14:18:59] fwaokda: has joined #RubyOnRails
[14:20:00] bungoman: has joined #RubyOnRails
[14:20:43] Scripore: has joined #RubyOnRails
[14:21:21] kostyay_: hi. i need to store a counter for a specific action that can happen very frequently. at the moment im using mongodb to store such counters, but not i need to move this data to postgresql. as far as i understand doing UPDATE table X = x +1 many times per second is very inefficient.
[14:21:31] kostyay_: whats the best way to have this data in postgresql?
[14:21:31] yashinbasement: has joined #RubyOnRails
[14:21:46] cmisenas: has joined #RubyOnRails
[14:23:17] xcesariox: has joined #RubyOnRails
[14:24:05] gambl0re: has joined #RubyOnRails
[14:24:30] solars: has joined #RubyOnRails
[14:24:37] elaptics: kostyay_: not that I am a huge fan of mongodb but why are you moving? Are you trying to remove a dependency?
[14:25:17] kostyay_: at the moment we have some data in posgres and the counters are stored in mongo. its impossible to do joined selects on the data
[14:25:39] nettoweb: has joined #RubyOnRails
[14:25:43] kostyay_: sorting/pagination has to be done on server side and it sucks
[14:25:48] nettoweb: guys, Im using devise but when the user is recoverng his password, the validation runs and he stay stuck in a page with just a password fiels to fill.
[14:25:49] mando: has joined #RubyOnRails
[14:25:51] kostyay_: so we decided to have eveyrthing in posgres
[14:25:53] nettoweb: so I look this solution but dont know how to use in my code: https://github.com/plataformatec/devise/blob/master/lib/devise/models/recoverable.rb#L29
[14:25:54] dopie: has joined #RubyOnRails
[14:26:04] crack_user: has joined #RubyOnRails
[14:30:17] mrbubbles: has joined #RubyOnRails
[14:30:37] umgrosscol: has joined #RubyOnRails
[14:33:42] fxn: kostyay_: looks like a question for #postgres
[14:35:10] jgpawletko: has joined #RubyOnRails
[14:35:36] darrencauthon: has joined #RubyOnRails
[14:35:39] FCser: has joined #RubyOnRails
[14:35:53] Papierkorb: kostyay_: No redis instance at hand?
[14:35:58] jobewan: has joined #RubyOnRails
[14:36:58] jshultz: has joined #RubyOnRails
[14:37:16] broman: i have an object... when i do a object.inspect it returns: "[#<Evento id: 78, grupo_estudo_id: nil, tipo_evento_id: 2, fase_do_evento_id: 2, tipo_questao_id: 2, coordenador_id: 21043, nome: "SIMULADO SUBJETIVO TESTE PERGUNTAS", apresentacao: "<p>SIMULADO DE TESTE</p>\r\n", slug: "simulado-subjetivo-teste-perguntas", situacao: true, inicio: "2015-05-10 03:00:00", fim: "2015-08-10 03:00:00", duracao: 3, ponto_acerto: 0.0, ponto_erro: 0.0, ponto_nulo: 0.0,
[14:37:16] broman: ponto_aprovacao: 0.0, media_pontuacao: nil, numero_participantes: nil, exibir_gabarito: true, exibir_forum: false, exibir_estatistica_individual: true>] " .... when i do a evento.id it says undefined method `nome' for #<Evento::FriendlyIdActiveRecordRelation:0x00000008290448>
[14:37:22] Papierkorb: That's at least where my visitor counter pushes its data first.
[14:38:09] tubbo: has joined #RubyOnRails
[14:38:23] mary5030: has joined #RubyOnRails
[14:38:36] axl__: has joined #RubyOnRails
[14:39:16] mary5030: has joined #RubyOnRails
[14:39:45] kaldrenon: has joined #RubyOnRails
[14:39:49] owenjones: has joined #RubyOnRails
[14:40:01] RegulationD: has joined #RubyOnRails
[14:40:20] srinidhi: has joined #RubyOnRails
[14:40:32] rezzack: has joined #RubyOnRails
[14:40:39] kostyay_: we have redis
[14:40:41] j_mcnally: has joined #RubyOnRails
[14:40:49] kostyay_: does it work better for counters?
[14:41:17] fxn: broman: looks like Evento::FriendlyIdActiveRecordRelation is acting as if it was Evento on #inspect, you need to understand that proxy
[14:42:07] fxn: broman: that is, object is not really an instance of Evento
[14:42:47] givanse: has joined #RubyOnRails
[14:43:05] broman: fxn, ty! i made a .first on the model and it worked
[14:43:26] tandroid: has joined #RubyOnRails
[14:43:28] fxn: broman: another option is that the #id method is being redefined by someone that calls #name on something else
[14:43:57] DEA7TH_: has joined #RubyOnRails
[14:44:43] j_mcnally: has joined #RubyOnRails
[14:45:50] bruno-: has joined #RubyOnRails
[14:46:36] ValicekB: has joined #RubyOnRails
[14:52:30] skroon: has joined #RubyOnRails
[14:53:49] bruno-: has joined #RubyOnRails
[14:54:19] hmnhf__: has joined #RubyOnRails
[14:55:59] starfox_sf: has joined #RubyOnRails
[14:57:49] paulcsmith: has joined #RubyOnRails
[14:58:54] thelastinuit: has joined #RubyOnRails
[15:01:01] tandroid: has joined #RubyOnRails
[15:01:10] MaDErroR123: has joined #RubyOnRails
[15:01:43] moeabdol: has joined #RubyOnRails
[15:02:42] ramortegui: has joined #RubyOnRails
[15:04:36] jeanlinux: has joined #RubyOnRails
[15:04:40] Lytol: has joined #RubyOnRails
[15:05:42] vale_tudo: has joined #RubyOnRails
[15:05:47] jtdoncas: has joined #RubyOnRails
[15:05:47] valetudo: has joined #RubyOnRails
[15:06:02] Cache_Money: has joined #RubyOnRails
[15:06:43] s2013: has joined #RubyOnRails
[15:06:45] jhack: has joined #RubyOnRails
[15:08:25] chipotles: has joined #RubyOnRails
[15:13:33] AzaToth: has joined #RubyOnRails
[15:14:20] volk_: has joined #RubyOnRails
[15:14:34] volk_: hey has anybody here used the connection_pool gem?
[15:14:49] dopie: s2013, sup !
[15:15:42] tandroid: has joined #RubyOnRails
[15:16:51] lindii_: has joined #RubyOnRails
[15:16:56] bronson: has joined #RubyOnRails
[15:17:33] chipotles: Hey, I'm building a project for a class and it's the boardgame risk. I have most of my planning done but I'm having difficulty in the frontend part of the project. Could you guys recommend something for interactive maps that aren't the actual world.
[15:17:43] fgo: has joined #RubyOnRails
[15:17:59] bungoman: has joined #RubyOnRails
[15:19:19] IrishGringo: has joined #RubyOnRails
[15:19:51] ProLoser: has joined #RubyOnRails
[15:19:52] tubbo: has joined #RubyOnRails
[15:19:59] crack_user: has joined #RubyOnRails
[15:20:53] mr_rich101: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[15:21:41] s2013: sup dopie
[15:22:20] LarryLv: has joined #RubyOnRails
[15:22:33] charliesome: has joined #RubyOnRails
[15:23:46] joelataylor: has joined #RubyOnRails
[15:26:32] mrbubbles: has joined #RubyOnRails
[15:27:26] s2013: any reason why a form with remote: true wouldnt be processed as xhr?
[15:29:27] yardenbar: has joined #RubyOnRails
[15:30:39] sarink: has joined #RubyOnRails
[15:31:28] fmcgeough: has joined #RubyOnRails
[15:32:01] joelataylor: has joined #RubyOnRails
[15:32:35] aderium: has joined #RubyOnRails
[15:32:53] DylanJ: s2013: is your js working?
[15:33:00] ratmav: has joined #RubyOnRails
[15:33:05] riotjones: has joined #RubyOnRails
[15:33:27] iamse7en: has joined #RubyOnRails
[15:33:32] s2013: DylanJ so the problem is (i tried to fix it yesterday and mentioned it here) that it only happens when i load the form after an ajax request
[15:33:45] s2013: if i load up the form normally, the js works fine
[15:33:51] ratmav: has joined #RubyOnRails
[15:33:55] DylanJ: whatchu mean normally?
[15:34:08] s2013: like just render the partial when you load up the page
[15:34:21] a346: has joined #RubyOnRails
[15:34:22] s2013: instead of rendering the partial from a .js.erb file
[15:34:37] s2013: https://gist.github.com/ss2k/bf40e06528849a36b944 dont know how much this helps..
[15:34:51] DylanJ: rails js is likely not binding to your forms submit event
[15:34:56] Sehryn: has joined #RubyOnRails
[15:34:58] DylanJ: so it's just doing a regular post
[15:35:02] s2013: yeah im pretty sure thats exactly whats happening
[15:35:12] eggoez: has joined #RubyOnRails
[15:35:21] s2013: so what would be the easiest solution to that (its rails3.2 btw)
[15:35:55] Surt_Q: has joined #RubyOnRails
[15:35:56] cryptocronus: has joined #RubyOnRails
[15:37:03] DylanJ: hmm, in your html are you getting a data-remote= attribute?
[15:37:40] s2013: http://blog.revathskumar.com/2013/10/jquery-on-avoid-losing-event-binding-for-ajaxed-contents.html i wonder if this helps
[15:37:56] s2013: in the gist the incorrect.html is the actual html being output
[15:38:01] Haegin: has joined #RubyOnRails
[15:38:17] gregf_: has joined #RubyOnRails
[15:38:51] DylanJ: i'm really not sure. i try avoid data-remote and do things myself :(
[15:38:56] Cache_Money: has joined #RubyOnRails
[15:38:57] DylanJ: hopefully someone else can help
[15:38:57] cryptocronus: will accepts_nested_attributes_for in a belongs_to relationship issue a find_or_create based on the nested primary key?
[15:39:15] bar0n: has joined #RubyOnRails
[15:39:15] Haegin: hey everyone, I'm upgrading an app from Rails 3.2 to 4.0 and I've got a has_one relation with validations on the related model. Previously when the related model changed validations on that model were run, but now they're not. Does anyone know where I might be able to find out more about this change?
[15:39:28] s2013: hmm alright. thanks.
[15:39:36] Haegin: I need to get the validations running again, or at least the callbacks that would run before the validations
[15:39:53] disgrntld: has joined #RubyOnRails
[15:40:01] Aswebb_: has joined #RubyOnRails
[15:40:16] volk_: has joined #RubyOnRails
[15:40:31] owenjones: has joined #RubyOnRails
[15:42:06] jeanjack: has left #RubyOnRails: ()
[15:42:31] s2013: DylanJ if i removed remote: true how would i do it? i mean i know ajax but submitting the form and everything ..
[15:42:34] ynonp: has joined #RubyOnRails
[15:43:31] dopie: s2013, how goes there :)
[15:43:40] dopie: s2013, was wondering if you have any cool projects you have worked on
[15:43:45] DylanJ: s2013: https://api.jquery.com/serialize/
[15:43:49] DylanJ: have a look at that example
[15:43:50] peady_: has joined #RubyOnRails
[15:44:05] DylanJ: i've never done that specifically.
[15:44:06] s2013: yeah i know serialize.. im trying to make it as rails friendly as possible.. hold on
[15:44:15] DylanJ: the other option is..
[15:44:39] asheinfeld: has joined #RubyOnRails
[15:45:17] sonOfRa: has joined #RubyOnRails
[15:45:33] DylanJ: https://developer.mozilla.org/en-US/docs/Web/API/FormData/Using_FormData_Objects
[15:45:35] s2013: i tried doing on('submit'.. preventdefault and then just an alert
[15:45:44] DylanJ: you can use a FormData object for your data.
[15:45:52] s2013: but it still redirects .. gah
[15:46:03] bruno-: has joined #RubyOnRails
[15:46:04] hakunin: has joined #RubyOnRails
[15:46:11] DylanJ: return false i think
[15:46:21] DylanJ: (in your event)
[15:46:35] s2013: e.preventDefault() does that tood oesent it
[15:47:29] s2013: oh hmm.. ok it didnt redirect now.. ok a bit better
[15:48:22] DylanJ: so then, pass new FormData(document.getElementById('myForm')) as your data in ajax
[15:48:26] DylanJ: *should* work.
[15:48:39] snockerton: has joined #RubyOnRails
[15:48:49] DylanJ: i'll be back in 15 minutes or so to check up on you.
[15:49:17] choke: has joined #RubyOnRails
[15:50:21] momomomomo: has joined #RubyOnRails
[15:50:58] syngress: has joined #RubyOnRails
[15:51:21] syngress: has left #RubyOnRails: ()
[15:54:19] ynonp: has joined #RubyOnRails
[15:54:24] bungoman: has joined #RubyOnRails
[15:56:15] srinidhi: has joined #RubyOnRails
[15:57:57] eggoez: has joined #RubyOnRails
[15:58:47] jkamenik: has joined #RubyOnRails
[16:00:20] rubyonrailed: I'm currently requiring my tree in application.js. How can I exclude one js file, and only run it for one view? I wan't to leave `require_tree .` in my application.js
[16:00:35] oflannabhra: has joined #RubyOnRails
[16:02:14] cornerma1: has joined #RubyOnRails
[16:05:39] towski_: has joined #RubyOnRails
[16:06:29] blun7: has joined #RubyOnRails
[16:07:24] __butch__: has joined #RubyOnRails
[16:08:36] shinnya: has joined #RubyOnRails
[16:08:49] blun7: Hi guys, I'm trying to wrap my head around how unicorn works, you want to use before_fork/after_fork to disconnect/reconnect to your db/session store. Does that mean that the rails process stays up an running forever? If so is rails smart enough to reconnect if the db/session store timeout the connection?
[16:10:10] bricker: has joined #RubyOnRails
[16:11:59] momomomomo: has joined #RubyOnRails
[16:12:16] Anakat: has joined #RubyOnRails
[16:12:41] broman: has joined #RubyOnRails
[16:13:15] clintb: has joined #RubyOnRails
[16:14:23] Spami: has joined #RubyOnRails
[16:15:32] MaDErroR123: has joined #RubyOnRails
[16:16:03] linoespinoza: has joined #RubyOnRails
[16:16:05] ynonp: has joined #RubyOnRails
[16:16:30] symbol: has joined #RubyOnRails
[16:16:31] Surt_Q: has joined #RubyOnRails
[16:17:16] smathy: has joined #RubyOnRails
[16:17:32] User458764: has joined #RubyOnRails
[16:18:27] gambl0re: has joined #RubyOnRails
[16:19:27] dhoelzer: has joined #RubyOnRails
[16:21:38] momomomomo_: has joined #RubyOnRails
[16:23:24] bruno-: has joined #RubyOnRails
[16:24:15] higuys: has joined #RubyOnRails
[16:27:36] pixelhandler: has joined #RubyOnRails
[16:29:20] tubbo: blun7: yeah, but they won't timeout the connection because the drivers all connect persistently
[16:29:32] tubbo: it all depends on the active_record driver
[16:29:39] rickmasta: has joined #RubyOnRails
[16:31:16] gambl0re: has joined #RubyOnRails
[16:34:04] starfox_sf: has joined #RubyOnRails
[16:34:11] canmor: has joined #RubyOnRails
[16:35:21] s2013: has joined #RubyOnRails
[16:35:47] s2013: tubbo you around?
[16:35:49] yizr: has joined #RubyOnRails
[16:36:06] tubbo: yeah for a sec
[16:36:10] tubbo: about to head out to lunch
[16:36:36] s2013: k remember the issue i had yesterday.. so i took off the data-remote and tried to submit form via ajax.. still issues. let me paste the code quickly
[16:37:23] ararog: has joined #RubyOnRails
[16:37:35] s2013: https://gist.github.com/ss2k/3b840388331d7be35d7a tubbo but it still does that.. even though i took off remote: true :\ the request isnt coming in as ajax
[16:37:37] garrypolley: has joined #RubyOnRails
[16:37:46] bronson: has joined #RubyOnRails
[16:38:29] nandx64: has joined #RubyOnRails
[16:38:51] jonathanwallace: has joined #RubyOnRails
[16:39:47] tubbo: s2013: if that form is being added to the page after ready() has been fired (e.g., initial page load), then that event won't be bound
[16:40:03] s2013: so what do i need to do
[16:40:18] s2013: i thought the .on would take care of that
[16:40:27] tubbo: s2013: instead of binding to an object that's already expected to exist, bind to a selector that will exist in the future. http://api.jquery.com/on/ has a weird syntax for it
[16:40:40] tubbo: $(document).on('submit', '#the_form', function() { ... });
[16:41:03] tubbo: s2013: it used to be $('#the_form').live()
[16:41:12] tubbo: but that made the $() object a little less predictable and error-prone
[16:41:13] s2013: ok ill try. thanks
[16:41:19] owenjones: has joined #RubyOnRails
[16:41:21] bruno-: has joined #RubyOnRails
[16:41:25] s2013: now my form isnt even loading at all. lol problem after problem
[16:41:35] tubbo: now, every time you do $() it will return [] if that object doesn't exist, no matter what.
[16:41:53] neanderslob: has joined #RubyOnRails
[16:42:09] s2013: does the $(document).on... have to be inside a document.ready function?
[16:42:21] Lytol: has joined #RubyOnRails
[16:42:30] paulcsmith: has joined #RubyOnRails
[16:42:43] tubbo: s2013: nope
[16:43:43] s2013: i also need to take out remote: true right
[16:44:53] oflannabhra: has joined #RubyOnRails
[16:45:40] nandx64_: has joined #RubyOnRails
[16:46:18] kil0byte: has joined #RubyOnRails
[16:46:23] chipotles: has joined #RubyOnRails
[16:47:07] LuukFRT: has joined #RubyOnRails
[16:47:32] jenrzzz: has joined #RubyOnRails
[16:51:17] yizr: has joined #RubyOnRails
[16:52:45] baweaver: has joined #RubyOnRails
[16:53:45] choke: has joined #RubyOnRails
[16:54:21] djbkd: has joined #RubyOnRails
[16:54:51] yaymukund: has joined #RubyOnRails
[16:55:39] asheinfeld: has joined #RubyOnRails
[16:55:45] larrylv_: has joined #RubyOnRails
[16:57:26] dented42: has joined #RubyOnRails
[16:58:06] jarr0dsz: has joined #RubyOnRails
[16:58:17] jtdoncas: has joined #RubyOnRails
[16:58:42] crack_user: has joined #RubyOnRails
[16:58:44] Limix: has joined #RubyOnRails
[16:59:08] jarr0dsz: has left #RubyOnRails: ()
[17:00:10] s2013: gah $(document).on('submit', ... dont work either tubbo :\
[17:00:26] larrylv_: has left #RubyOnRails: ()
[17:00:33] DEA7TH_: has joined #RubyOnRails
[17:00:37] christiandsg: has joined #RubyOnRails
[17:01:12] jarrodszt: has joined #RubyOnRails
[17:01:59] jarrodszt: hi everyone, is there a way to check relations with ActiveRecord? something like user = user.where(user.account.account_type = "basic" ) for example?
[17:02:10] jarrodszt: i could not find any references in the the documentation on how to approach this
[17:02:31] ledestin: has joined #RubyOnRails
[17:04:51] bricker: jarrodszt: http://guides.rubyonrails.org/active_record_querying.html#specifying-conditions-on-eager-loaded-associations
[17:05:29] jsrn_: has joined #RubyOnRails
[17:05:36] jarrodszt: ah thank you bricker
[17:07:08] kil0byte: has joined #RubyOnRails
[17:07:34] oflannabhra: has joined #RubyOnRails
[17:08:02] nzst: has joined #RubyOnRails
[17:09:00] Miesco: has joined #RubyOnRails
[17:11:46] Rylee: has joined #RubyOnRails
[17:12:12] yizr: has joined #RubyOnRails
[17:13:07] Anakat: has joined #RubyOnRails
[17:13:49] cmisenas: has joined #RubyOnRails
[17:13:57] Sylario_: has joined #RubyOnRails
[17:14:15] fwm: has joined #RubyOnRails
[17:15:02] smathy: Hmm, gone now, I think s2013 just has to fire `rails:attachBindings` and jquery_ujs will do what it needs to do.
[17:15:36] x1337807x: has joined #RubyOnRails
[17:18:08] DEA7TH_: has joined #RubyOnRails
[17:18:14] oflannabhra: has joined #RubyOnRails
[17:18:45] ellisTAA: has joined #RubyOnRails
[17:20:13] ellisTAA: i just installed rspec into my rails app, but when i run be rspec it doesn???t run the tests in my test > controllers folder, where should i put my rspec tests?
[17:21:27] XCMer: has joined #RubyOnRails
[17:21:41] eGGsha: has joined #RubyOnRails
[17:22:08] hakunin: has joined #RubyOnRails
[17:22:20] maletor_: has joined #RubyOnRails
[17:23:30] tandroid: has joined #RubyOnRails
[17:24:47] bricker: EllisTAA: rspec looks in spec/
[17:24:51] bricker: by default
[17:24:54] ellisTAA: cool thanks
[17:25:08] ellisTAA: i appreciate it
[17:25:23] Spami: has joined #RubyOnRails
[17:26:06] tandroid: Hey guys, I'm not a rails dev but I'm trying to get an old radiant cms site set up. I'm stuck at a super generic error: "Application Error, Rails application failed to start properly". Does anyone have any ideas on where logs might be for this?
[17:26:20] ashemark: has joined #RubyOnRails
[17:26:20] ProLoser: has joined #RubyOnRails
[17:26:24] dopie: has joined #RubyOnRails
[17:27:24] cryptocronus: is there an easy option with active_model_serializers to not include a has_one association in the json if it???s nil?
[17:27:32] ashemark: I've installed the latest ruby/rails on my arch linux machine, but it takes a long(~3 minutes) time to create a new project with rails new demo-project
[17:27:40] workmad3: tandroid: logs are located in '<app_root>/logs' by standard, unless you've configured them to go elsewhere
[17:27:41] cnk: has joined #RubyOnRails
[17:28:00] ashemark: can it be sped up?
[17:28:18] bricker: dat ain't no rails error message I eva hoid of!
[17:28:48] bricker: ashemark: what's taking a long time, bundler? Maybe you have a slow internet connection
[17:29:11] ashemark: bricker: I have 8Mbps download speed, is that slow for rails?
[17:29:18] workmad3: cryptocronus: if you're on am:s 0.8, you can use `def include_<attr_name>?` to determine whether an attribute is included: https://github.com/rails-api/active_model_serializers/tree/0-8-stable#attributes
[17:29:26] bricker: ashemark: lol no
[17:29:32] cryptocronus: thanks workmad3
[17:29:59] oflannabhra: has joined #RubyOnRails
[17:30:12] ashemark: bricker: :/
[17:32:15] surrealanalysis: has joined #RubyOnRails
[17:32:19] yfeldblum: has joined #RubyOnRails
[17:32:39] jonathanwallace: has joined #RubyOnRails
[17:33:23] eggoez: has joined #RubyOnRails
[17:34:28] lindii_: i have a remote form where i add items in a container using ajax. Im wondering why i get Routing Error No route matches [PATCH] "/items/16" when i try to add a second item without reloading the page
[17:34:31] hanss: has joined #RubyOnRails
[17:34:44] jkamenik: has joined #RubyOnRails
[17:35:47] ashemark: also, how to deal with connection timeout during bundle install?
[17:38:46] simplyianm: has joined #RubyOnRails
[17:39:21] towski_: has joined #RubyOnRails
[17:40:05] yairgo: has joined #RubyOnRails
[17:41:31] rickmasta: has joined #RubyOnRails
[17:42:06] owenjones: has joined #RubyOnRails
[17:42:20] chipotle: has joined #RubyOnRails
[17:43:09] oflannabhra: has joined #RubyOnRails
[17:43:12] cnk: lindii_: That sounds like your form url is getting set to try updating something rather than makin a new item
[17:43:13] hahuang65: has joined #RubyOnRails
[17:43:30] lindii_: cnk: definitely
[17:43:57] lindii_: cnk: but then i only have <%= form_for(@item, remote: true) do |f| %>
[17:44:07] acovrig: has joined #RubyOnRails
[17:44:30] acovrig: Is it possible to see what attributes are throwing an ActiveModel::ForbiddenAttributesError?
[17:44:42] cnk: form_for creates the form tag based on the value of @item
[17:44:55] cnk: if @Item is a saved resource - it makes the url for updating it
[17:45:15] lindii_: cnk: i only have to routes. create and destroy
[17:45:46] cnk: form_for will build urls based on Rails model of restful resources
[17:46:03] cnk: so form_for doesn't know you have no update route
[17:46:30] zorak8: has joined #RubyOnRails
[17:46:36] jonathanwallace: has joined #RubyOnRails
[17:46:38] cnk: Instead of definining @item in the controller that rendered the form, you may need to do Item.new in the form itself
[17:46:41] lindii_: should i point to that specific url?
[17:46:45] cnk: where you have @Item
[17:47:06] cnk: you could tell it specifically you want the create route
[17:47:28] dici: has joined #RubyOnRails
[17:47:29] cnk: For that you may want to switch to form_tag - though that changes all the syntax for your form fields.
[17:47:39] bricker: I'm trying to debug an endpoint that accepts a JSON body. Trying to see the JSON coming in - how would you guys debug that?
[17:47:45] syntax_Error: has joined #RubyOnRails
[17:47:46] cnk: Check the API docs for form_for and see if you can give it a url rather than a model instance
[17:47:49] choke: has joined #RubyOnRails
[17:47:53] bricker: wrong channel sorryz
[17:48:03] lindii_: ill check on that
[17:48:16] asheinfeld: has joined #RubyOnRails
[17:49:05] yardenbar: has joined #RubyOnRails
[17:49:45] eggoez: has joined #RubyOnRails
[17:52:20] RegulationD: has joined #RubyOnRails
[17:53:31] acovrig: I???m getting a ForbiddenAttributesError and I???m not sure why...
[17:53:45] oflannabhra: has joined #RubyOnRails
[17:55:01] gambl0re: has joined #RubyOnRails
[17:55:31] ashemark: has left #RubyOnRails: ()
[17:57:59] workmad3: acovrig: that means you're passing `params[:something]` straight to a create or update on a model, without filtering it with strong parameters first
[17:58:37] acovrig: workmad3: filtering with strong parameters?
[17:59:52] acovrig: workmad3: something like this: params.require(:request).permit(:column_a, :column_b) ?
[18:01:21] bruno-: has joined #RubyOnRails
[18:01:31] christiandsg: has joined #RubyOnRails
[18:01:51] Limix: has joined #RubyOnRails
[18:02:55] duderonomy: has joined #RubyOnRails
[18:03:02] chouhoul_: has joined #RubyOnRails
[18:03:26] asheinfeld: has joined #RubyOnRails
[18:03:57] alphaatom: has joined #RubyOnRails
[18:05:41] hahuang65: has joined #RubyOnRails
[18:05:42] jonathanwallace: has joined #RubyOnRails
[18:07:02] andrew9184: has joined #RubyOnRails
[18:07:24] patrick_star: has joined #RubyOnRails
[18:07:44] patrick_star: ??????, ?????????? ???????????? - ?????? ????????????.
[18:08:03] oflannabhra: has joined #RubyOnRails
[18:09:10] victortyau: has joined #RubyOnRails
[18:10:26] syntax_Error: has joined #RubyOnRails
[18:12:13] bin_005: has joined #RubyOnRails
[18:13:34] asheinfeld: has joined #RubyOnRails
[18:13:42] Daernac: has joined #RubyOnRails
[18:13:47] Anakat: has joined #RubyOnRails
[18:15:15] Silox|: Hello there! I have a model Club with a method: `def export(members)`. From a controller I call `@club.export(members)`, but Rails complains that ArgumentError (wrong number of arguments (2 for 0..1))
[18:15:22] Fire-Dragon-DoL: has joined #RubyOnRails
[18:17:01] podman: has joined #RubyOnRails
[18:17:35] ynonp: has joined #RubyOnRails
[18:18:07] pehlert: has joined #RubyOnRails
[18:18:10] crack_user: has joined #RubyOnRails
[18:18:43] wviana: has joined #RubyOnRails
[18:18:49] pehlert: Hey all.. I am getting a lot of "circular dependency" errors when Rails tries to load a constant in a multi-threaded environment. What's the recommended way to preload it to avoid that?
[18:19:05] LuukFRT: has joined #RubyOnRails
[18:21:33] starfox_sf: has joined #RubyOnRails
[18:21:49] tubbo: Silox|: can you verify @club is an instance of Club? try using a debugger statement right before the offending line
[18:22:30] Rixius: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[18:23:14] toretore: has joined #RubyOnRails
[18:27:34] jamiely: has joined #RubyOnRails
[18:29:03] bruno-: has joined #RubyOnRails
[18:30:52] srinidhi: has joined #RubyOnRails
[18:31:24] x1337807x: has joined #RubyOnRails
[18:32:17] Silox|: tubbo: I found it
[18:32:32] Silox|: tubbo: The method is an asynch one with delayed_job
[18:32:36] Silox|: the members is a Relation
[18:32:43] Silox|: delayed_job doesn't seem to act nice with relations
[18:32:47] bungoman: has joined #RubyOnRails
[18:33:36] Silox|: Turns out I have to add `.all` after the query
[18:34:47] baweaver: has joined #RubyOnRails
[18:36:07] werelivinginthef: has joined #RubyOnRails
[18:36:21] garrypolley_: has joined #RubyOnRails
[18:36:35] ynonp: has joined #RubyOnRails
[18:36:50] DoubleMalt: has joined #RubyOnRails
[18:37:00] arup_r: has joined #RubyOnRails
[18:37:03] momomomomo: has joined #RubyOnRails
[18:38:28] arup_r: I want to create bootstrap 3 button <button type="submit" class="btn btn-info">Submit</button> .. I tried <%= f.submit 'Proceed To Booking', class: "btn btn-info" %> .. But it is not giving what I am looking for
[18:40:20] oflannabhra: has joined #RubyOnRails
[18:40:22] tubbo: arup_r: what does that <%= f.submit.. %> code generate?
[18:40:33] tubbo: arup_r: f.submit always creates an <input> tag fwiw
[18:41:02] arup_r: Yes.. I saw it in doco
[18:41:13] arup_r: But how can I create like the one I am expecting
[18:41:25] cfurrow: has joined #RubyOnRails
[18:41:37] tubbo: arup_r: i don't think f.submit supports that
[18:41:56] tubbo: you could just write the <button> stuff directly into your view
[18:42:09] acovrig: Is it possible to see which attribute is throwing a ForbiddenAttributesError?
[18:42:28] tbuehlmann: acovrig, it should appear in your server terminal
[18:42:43] asheinfeld: has joined #RubyOnRails
[18:42:47] owenjones: has joined #RubyOnRails
[18:43:12] acovrig: tbuehlmann: I see the filename and def, but not attribute.
[18:44:00] arup_r: tubbo: <%= f.button 'Proceed To Booking', class: "btn btn-info" %> did work
[18:44:10] tubbo: arup_r: oh cool
[18:44:16] simplyianm: has joined #RubyOnRails
[18:44:24] tbuehlmann: acovrig, pretty sure it should appear in the server terminal
[18:44:28] arup_r: http://apidock.com/rails/v4.2.1/ActionView/Helpers/FormBuilder/button
[18:44:34] tbuehlmann: as in: https://github.com/rails/strong_parameters/blob/42397cc023b78a671580e35ba6013b6f4a8fe54a/lib/strong_parameters/log_subscriber.rb#L5
[18:44:36] acovrig: tbuehlmann: in the output of rails s?
[18:45:21] acovrig: tbuehlmann: this is all I get: ActiveModel::ForbiddenAttributesError (ActiveModel::ForbiddenAttributesError): app/controllers/request_controller.rb:64:in `create'
[18:45:34] tbuehlmann: oh, that's a different one, isn't it?
[18:45:55] tbuehlmann: acovrig, can you paste the controller and corresponding model code?
[18:46:10] garrypolley: has joined #RubyOnRails
[18:47:38] tbuehlmann: looks like it doesn't puts for that error: https://github.com/rails/strong_parameters/blob/42397cc023b78a671580e35ba6013b6f4a8fe54a/lib/active_model/forbidden_attributes_protection.rb#L11
[18:47:41] wviana: Hello, Why this rbenv installing is not working on yosemite https://gist.github.com/wviana/4f5f8119c0f9d44cf02a ?
[18:47:56] tbuehlmann: then let's see if you use params without permitting them before
[18:49:28] cmisenas: has joined #RubyOnRails
[18:50:44] eGGsha: has joined #RubyOnRails
[18:51:12] acovrig: tbuehlmann: https://gist.github.com/acovrig/24e3593cbb9dd811c0b6
[18:51:38] ararog: has joined #RubyOnRails
[18:52:12] tbuehlmann: acovrig, yeah, there we go, you don't permit the params you want to allow
[18:52:34] kartouch: has joined #RubyOnRails
[18:52:36] acovrig: tbuehlmann: Isn???t that at the end of the file?
[18:52:46] tbuehlmann: that's a method you define but never use
[18:53:16] loocash: has joined #RubyOnRails
[18:53:20] acovrig: then how do I use it?
[18:53:29] acovrig: or is there a better way of doing it?
[18:53:32] asheinfeld: has joined #RubyOnRails
[18:53:39] tbuehlmann: I'll gist something, one sec
[18:53:56] kadoppe: has joined #RubyOnRails
[18:54:20] Encapsulation: has joined #RubyOnRails
[18:54:53] tbuehlmann: let's start with this: https://gist.github.com/tbuehlmann/1b4951f3c70ace68d7d3
[18:55:10] ynonp: has joined #RubyOnRails
[18:55:13] SeanLazer: has joined #RubyOnRails
[18:56:29] lxsameer: has joined #RubyOnRails
[18:57:04] tbuehlmann: the params object looks like `{controller: ???, action: ???, request: {employee: ???, supervisor: ???, ???}}`, right?
[18:57:35] tbuehlmann: but you only want to allow: 1) the :request part and 2) only some key pairs
[18:58:34] tbuehlmann: by calling #require on params you get a hash with just the key value pairs left in it. by calling #permit on that you get a hash with just the allowed key value pairs
[18:59:03] tbuehlmann: the result is what is returned by the request_params method, which is used as input for the request
[18:59:09] jmignault: has joined #RubyOnRails
[18:59:14] joshaidan: has joined #RubyOnRails
[19:00:04] acovrig: tbuehlmann: OK, what is supposed to go in params.require(:here)? I???m getting ???param is missing or the value is empty: request???
[19:00:07] joshaidan: has joined #RubyOnRails
[19:00:36] tbuehlmann: params.require(:request).permit(???) is correct. if you get an error for that, then maybe the params aren't okay
[19:00:37] SeanLazer: has joined #RubyOnRails
[19:01:10] tbuehlmann: I assume you're sending from a form, can you paste the code for that form? and the server log for the POST request?
[19:02:17] christiandsg: has joined #RubyOnRails
[19:03:21] dopie: has joined #RubyOnRails
[19:03:45] Lytol: has joined #RubyOnRails
[19:03:54] lala: has joined #RubyOnRails
[19:04:36] imkmf: has joined #RubyOnRails
[19:06:16] acovrig: tbuehlmann: gist updated (https://gist.github.com/acovrig/24e3593cbb9dd811c0b6)
[19:07:22] tbuehlmann: okay, so you use form_tag. with that the request params won't be under the :request key, they will be at the top. is there a reason why you don't use form_for?
[19:08:12] acovrig: tbuehlmann: none other than I???m new to rails so didn???t know about it.
[19:08:43] acovrig: tbuehlmann: is that where people get something like f.button?
[19:08:52] blun7: has joined #RubyOnRails
[19:08:53] tbuehlmann: yeah, we're coming to that one
[19:08:58] tbuehlmann: let's start with the url you're POSTing to. I can see it's /new/timeoff
[19:09:13] SeanLazer: has joined #RubyOnRails
[19:09:24] tbuehlmann: convention is using RESTful routes
[19:09:51] tbuehlmann: like these: http://guides.rubyonrails.org/routing.html#crud-verbs-and-actions
[19:10:16] tbuehlmann: you declare `resources :requests` in config/routes.rb and get 7 routes for the request resource
[19:10:41] DLSteve: has joined #RubyOnRails
[19:10:51] ynonp: has joined #RubyOnRails
[19:11:05] tbuehlmann: as in GET /requests/new for the new action with the form and as in POST /requests for the create action where the saving happens
[19:11:05] asheinfeld: has joined #RubyOnRails
[19:11:45] valetudo: has joined #RubyOnRails
[19:12:01] [H]unt3r: has joined #RubyOnRails
[19:12:46] tbuehlmann: you'd need to rename your controller to "RequestsController" (plural Requests) if you want to follow that scheme (highly recommended)
[19:13:39] melonstorm: has joined #RubyOnRails
[19:14:31] sloggerkhan: has joined #RubyOnRails
[19:14:33] acovrig: tbuehlmann: can I just mv the _controller and views/request and edit those files or do I need to do more?
[19:14:37] Anakat: has joined #RubyOnRails
[19:14:56] tbuehlmann: you can move and edit the files
[19:15:03] tbuehlmann: I'm preparing a gist right now
[19:15:52] momomomomo: has joined #RubyOnRails
[19:18:32] Lakkthereof: has joined #RubyOnRails
[19:18:37] tbuehlmann: starting simple, try something around this: https://gist.github.com/tbuehlmann/1b4951f3c70ace68d7d3
[19:19:53] tbuehlmann: calling `form_for @request` will create a form that targets /requests using the POST verb
[19:20:46] acovrig: tbuehlmann: how do I determine which form/request_type to create the form_for for
[19:21:23] momomomomo: has joined #RubyOnRails
[19:22:02] tbuehlmann: so there's more than one? what types of requests do you have?
[19:22:10] jonathanwallace: has joined #RubyOnRails
[19:22:10] RegulationD: has joined #RubyOnRails
[19:22:58] eggoez: has joined #RubyOnRails
[19:23:04] acovrig: https://gist.github.com/acovrig/24e3593cbb9dd811c0b6#file-request_controller-rb-L8
[19:25:39] sandelius: has joined #RubyOnRails
[19:25:53] acovrig: tbuehlmann: RequestsController was RequestController because: [WARNING] The model name ???Requests??? was recognized as a plural, using the singular ???Request??? instead. Override with --force-plural or setup custom inflection rules for this noun before running the generator.
[19:26:22] a346: has joined #RubyOnRails
[19:26:33] tbuehlmann: you made a mistake earlier then. have you model singular and your controller plural
[19:26:37] sandelius: is it possible ti disable file logger in development and just use stdout?
[19:27:20] smathy: acovrig, you're not counting lines properly, if 64 is the `def create` line then 69 is the commented line 7 in your gist.
[19:27:32] blun7: has joined #RubyOnRails
[19:27:40] tbuehlmann: acovrig, are the requests very similar or very different? maybe it's okay to have just one controller
[19:27:52] mando: has joined #RubyOnRails
[19:28:05] acovrig: tbuehlmann: about half the fields are shared, there are a few fields that are form specific
[19:29:10] tbuehlmann: maybe it's the easiest for you to just have one controller and decide what to submit in the view?
[19:29:20] tbuehlmann: like, depending on the type hiding/showing certain fields?
[19:29:36] asheinfeld: has joined #RubyOnRails
[19:31:13] gremax: has joined #RubyOnRails
[19:31:18] tbuehlmann: another option is to have one controller for each request type. but I guess that's overengineered for your usecase
[19:31:47] hashrocket: has joined #RubyOnRails
[19:33:00] lindii_: any idea why even if i do <%= form_for(@items, url: { controller: "items", action: "create" }, remote: true) do |f| %> after the first submit i get No route matches [PATCH] "/items"
[19:34:31] acovrig: tbuehlmann: I like the idea of a single controller, but how do I determine which form the user has selected?
[19:34:32] jenrzzz: has joined #RubyOnRails
[19:35:38] Silox|: I have a very confusing SQL/scope problem: http://pastebin.com/t6k9b42h
[19:36:15] Silox|: Pastie mirror: http://pastie.org/10282875
[19:36:39] tbuehlmann: acovrig, one very simple approach, have it in the url: /requests/new?type=travel
[19:36:53] tbuehlmann: in your form you could then depend on params[:type]
[19:37:08] acovrig: tbuehlmann: would /requests/new/travel work?
[19:37:47] tbuehlmann: it's possible, but not relying on standard restful routes
[19:38:22] acovrig: that???s true, I think I???ll stick with ?type=travel then
[19:38:35] tbuehlmann: great. it's also not that hard to change afterwards
[19:40:11] bruno-: has joined #RubyOnRails
[19:40:20] Silox|: Oh, I have to join instead of include.
[19:40:21] nikhgupta: has joined #RubyOnRails
[19:41:09] tbuehlmann: lindii_, maybe no route available for update? what class is @items of? (why is it plural, btw?)
[19:41:47] smathy: lindii_, because form_for infers the method from the state of @items - if they're an existing record then it automatically adds a hidden `_method` field to your form with a value of `patch`
[19:41:58] lindii_: tbuehlmann: sorry i type that wrong its @item
[19:42:27] lindii_: i need that form only to create items
[19:42:33] smathy: lindii_, if you want to do what you seem to then maybe don't use @item, just use :item
[19:43:01] lindii_: smathy: will try that out
[19:43:05] smathy: lindii_, if you only need it to create items then your real problem here is - why are you setting `@item` in your controller?
[19:43:06] krz: has joined #RubyOnRails
[19:43:15] owenjones: has joined #RubyOnRails
[19:43:16] smathy: (or why are you setting it to something other than Item.new)
[19:43:49] smathy: lindii_, if you set `@item = Item.new` in whatever controller code is rendering that view, then you would only ever need `form_for @item, remote: true`
[19:44:15] smathy: (but yeah, :item will also work)
[19:44:48] lindii_: smathy: i would nee in this case @item = current_user.item.build(item_params)
[19:45:00] smathy: lindii_, ok.
[19:45:22] smathy: lindii_, point is that if it's a `.new_record?` then the `form_for` will do the right thing to ensure the form is sent to `create`
[19:45:40] lindii_: yeah make sense
[19:45:54] jwaldrip: has joined #RubyOnRails
[19:46:05] cfurrow: has joined #RubyOnRails
[19:47:07] cfurrow: has joined #RubyOnRails
[19:47:43] asheinfeld: has joined #RubyOnRails
[19:48:22] bronson: has joined #RubyOnRails
[19:49:02] marcoceppi: has joined #RubyOnRails
[19:49:16] baweaver: has joined #RubyOnRails
[19:50:19] lindii_: smathy: why i get action="/" when doing :item ?
[19:50:41] smathy: lindii_, sorry, if you use :item then you still need to specify the url: { action: :create }
[19:50:49] smathy: lindii_, there's no way for form_for to know what you want otherwise.
[19:50:55] rickmasta: has joined #RubyOnRails
[19:51:51] lindii_: smathy: also the controller
[19:52:15] arcanez: has joined #RubyOnRails
[19:52:30] arcanez: rails runs _every_ file within config/initializers, correct?
[19:52:46] smathy: lindii_, or you can use: form_for :item, url: item_path
[19:52:51] Limix: has joined #RubyOnRails
[19:53:03] lindii_: thats better i guess
[19:53:20] smathy: lindii_, I think form_for can infer the controller.
[19:53:31] AwareWolf: has joined #RubyOnRails
[19:53:44] smathy: I think the named path helper is nicer, yes.
[19:53:47] crack_user: has joined #RubyOnRails
[19:55:06] Papierkorb: has joined #RubyOnRails
[19:55:23] tbuehlmann: arcanez, correct
[19:55:32] lindii_: No route matches {:action=>"destroy", :controller=>"items"}
[19:55:50] netzfisch: has joined #RubyOnRails
[19:56:22] asheinfeld: has joined #RubyOnRails
[19:56:32] stantona: has joined #RubyOnRails
[19:56:38] DEA7TH_: has joined #RubyOnRails
[19:56:46] baweaver: Does Rails 4 have an EXPLAIN option for SQL? I saw it referenced in Rails 3 edge guides, but it's suspiciously missing from any content on 4 unless I straight missed it.
[19:56:58] baweaver: (which is more likely than I care to admit)
[19:57:15] AwareWolf: has left #RubyOnRails: ()
[19:57:16] AwareWolf: has joined #RubyOnRails
[19:57:52] AwareWolf: has left #RubyOnRails: ()
[19:57:53] AwareWolf: has joined #RubyOnRails
[19:58:20] smathy: baweaver, just add .explain to the end of any AR query.
[19:58:22] baweaver: http://guides.rubyonrails.org/active_record_querying.html#running-explain
[19:58:23] tbuehlmann: baweaver, you should be able to just call #explain on any active record relation
[19:58:27] baweaver: Yeah, I'd think so.
[19:58:35] baweaver: maybe I just typed it wrong
[19:58:38] simplyianm: has joined #RubyOnRails
[19:58:58] baweaver: NoMethodError: undefined method `explain' for #<ActiveRecord::ConnectionAdapters::MysqlAdapter:0x0000010d3f0698>
[19:59:13] asheinfeld: has joined #RubyOnRails
[19:59:16] baweaver: Model.group(:fields).explain
[19:59:22] baweaver: I'll try a where for sanity
[19:59:37] smathy: That works for me.
[19:59:40] arcanez: tbuehlmann: thanks.
[19:59:46] LuukFRT: has joined #RubyOnRails
[19:59:46] smathy: Did you override group or something baweaver ?
[19:59:48] arcanez: are initializers run by rake tasks?
[19:59:55] baweaver: looking about
[19:59:56] smathy: You shouldn't be getting the adapter back.
[20:00:02] baweaver: restarting rails c
[20:00:08] stantona: Is there a callback in ActiveRecord for when a connection is a established with the database?
[20:00:11] smathy: That's usually what you get from Model.connection
[20:00:21] AwareWolf: has joined #RubyOnRails
[20:00:55] tbuehlmann: arcanez, only if you depend on the "environment" task
[20:01:29] baweaver: yeah, not working for anything
[20:01:33] AwareWolf: has joined #RubyOnRails
[20:01:40] smathy: stantona, not that I've ever seen/heard-of. You might just need to override establish_connection
[20:01:47] baweaver: just a sec on an exact piece
[20:01:53] chouhoulis: has joined #RubyOnRails
[20:02:01] smathy: baweaver, which rails version?
[20:02:12] smathy: Yeah, what's x
[20:02:15] baweaver: double checking
[20:02:20] gelinas260: has joined #RubyOnRails
[20:02:28] stantona: smathy, a callback would be handy for debugging purposes. I'll try overriding.
[20:02:38] smathy: baweaver, ok, maybe just update that to the latest.
[20:02:47] baweaver: yeah, let's see if that does it.
[20:02:59] smathy: stantona, sure, but that's about all it's good for - and only small edge cases.
[20:03:06] stantona: smathy, agreed
[20:03:22] smathy: stantona, I assume you know about connection pooling etc?
[20:03:53] jonathanwallace: has joined #RubyOnRails
[20:03:59] fluchtreflex: has joined #RubyOnRails
[20:03:59] fluchtreflex: has joined #RubyOnRails
[20:04:03] smathy: stantona, FWIW, if it's just some weird glitch, you might find using byebug in your local gem simpler.
[20:04:05] stantona: smathy, I do.
[20:05:29] baweaver: DeployedContent.where(environment_id: 10).class # => DeployedContent::ActiveRecord_Relation < ActiveRecord::Relation
[20:05:31] stantona: smathy, good idea, I will try that first.
[20:05:53] baweaver: DeployedContent.where(environment_id: 10).explain # => NoMethodError: undefined method `explain' for #<ActiveRecord::ConnectionAdapters::MysqlAdapter:0x007fd97ddde3d0>
[20:05:55] hahuang65: has joined #RubyOnRails
[20:06:07] baweaver: worst case I can't use explain and I just use an sql console.
[20:07:26] baweaver: http://stackoverflow.com/a/9058156/2872906
[20:07:30] stantona: baweaver, what does the supports_explain? method return on the adapter?
[20:07:36] baweaver: well that's idiotic
[20:07:40] baweaver: mysql gem doesn't
[20:07:43] baweaver: mysql2 does
[20:08:11] Lytol: has joined #RubyOnRails
[20:08:39] baweaver: bizarre, but at least I found the little devil.
[20:08:52] tbuehlmann: mysql2 is adviced anyway, right?
[20:09:08] baweaver: last I remember
[20:09:13] baweaver: I just hadn't checked it honestly.
[20:09:35] hd1: mysql is never advised
[20:09:54] hd1: postgresql is better
[20:09:57] baweaver: remember some people don't have that luxury of choice
[20:09:59] hd1: a LOT better
[20:10:08] hd1: baweaver: true
[20:10:14] jonahR: has joined #RubyOnRails
[20:10:20] baweaver: I'm normally inclined to agree
[20:10:36] hd1: if said people know what's good for their sanity, they'd quit when they found out
[20:10:39] hd1: like I have
[20:10:40] baweaver: but I don't particularly want to migrate an RDS of 10+Gb to Postgresql unless dead necessary
[20:10:51] Pumukel: has joined #RubyOnRails
[20:10:58] tbuehlmann: acovrig, you're making progress?
[20:11:04] hd1: RDS supports postgres and seamless migration
[20:11:05] baweaver: there are worse things for sanity than mysql
[20:11:18] hd1: like talking to me, baweaver? :)
[20:11:23] acovrig: tbuehlmann: First argument in form cannot contain nil or be empty (<%= form_for @requests do |f| %>)
[20:11:52] acovrig: tbuehlmann: I???m wondering if it would be better if I started over and tried to get some of these basics working???
[20:12:08] edektor: has joined #RubyOnRails
[20:12:08] johnkpaul_: has left #RubyOnRails: ()
[20:12:22] edektor: Can someone explain what I'm doing wrong here? https://gist.github.com/anonymous/1dad37a79cc123d87b3f
[20:12:30] willywos: has joined #RubyOnRails
[20:12:30] baweaver: ACTION shrugs
[20:12:37] gambl0re: has joined #RubyOnRails
[20:12:55] sandelius: has joined #RubyOnRails
[20:13:22] asheinfeld: has joined #RubyOnRails
[20:13:29] Lightsword_: has joined #RubyOnRails
[20:13:37] smathy: Poor mysql gets so much hate, there's really not that much wrong with it as long as you're using innodb. And there are several things that it does very well, like custom collations, and per-column collations.
[20:13:43] baweaver: So anyone have a good list offhand that explains what's different between mysql and mysql2 gems? Looking around myself.
[20:13:44] mando: has joined #RubyOnRails
[20:14:03] tbuehlmann: acovrig, I tend to agree, but nothing simpler than that: $ bin/rails generate scaffold_controller requests
[20:14:18] tbuehlmann: that will generate a kind of standard restful controller named RequestsController
[20:14:30] bricker: smathy: people just hate it because it
[20:14:35] bricker: it's older
[20:14:39] bricker: and because Oracle owns it
[20:14:57] baweaver: But MariaDB!
[20:15:06] acovrig: and phpMyAdmin :D
[20:15:20] Anakat: has joined #RubyOnRails
[20:15:32] hd1: http://stackoverflow.com/questions/5411551/what-the-difference-between-mysql-and-mysql2-gem baweaver
[20:15:45] smathy: bricker, I think most people hate it because of MyISAM's problems that people incorrectly associate with MySQL.
[20:15:45] baweaver: yeah, starting to find some of these too.
[20:16:09] baweaver: normally you're fine if you run that perl benchmark against it and fix accordingly.
[20:16:23] smathy: (because the hate predated the Oracle purchase by over a decade)
[20:16:27] baweaver: Honestly I just hadn't noticed that it was using the mysql gem instead of the mysql2 one
[20:16:38] hd1: smothy: the fact that they neeed multiple storage engines is a problem
[20:16:47] bricker: smathy: even MyISAM has its place in production
[20:16:59] hd1: bricker: yes, FAR away from me
[20:17:27] bricker: smathy: whenever I see a new database engine introduced that claims it's better than MySQL for this and that reason, it makes me think of this: http://lotusrb.org/
[20:17:37] bricker: Lotus RB is a ruby framework that's just like Rails
[20:18:03] bricker: except it's missing the 10+ years of commits that make Rails the framework it is today
[20:18:03] smathy: hd1, that's like saying that the fact that nginx needs to be recompiled to add new modules is a problem. It's just a different architecture, and it has pros and cons.
[20:18:11] acovrig: when I scaffold, should it be singular or plural?
[20:18:31] marcoceppi: has joined #RubyOnRails
[20:18:33] baweaver: 1. New Language announced. 2. New Framework announced in Language, just like Rails!
[20:18:45] marcoceppi: has joined #RubyOnRails
[20:18:50] hd1: no, smathy
[20:18:51] tbuehlmann: acovrig, I think both will do. for scaffold_controller I just tried the plural version and it worked as expected
[20:19:09] baweaver: ACTION grabs popcorn
[20:19:17] smathy: acovrig, run `rails g scaffold` to see the docs.
[20:19:20] tubbo: baweaver: huh?
[20:19:27] hd1: nginx will work fine with a default set of modules, they just add functionality to it, they don't replace core functionality
[20:19:35] baweaver: tubbo: which part?
[20:19:38] AnoHito: has joined #RubyOnRails
[20:19:44] tubbo: baweaver: talking about a new language/framework haha
[20:19:54] tbuehlmann: acovrig, use the scaffold generator if you really want to start over. if you just want to redo the controller and views part, use the scaffold_controller generator
[20:19:57] tubbo: oh about lotus
[20:20:00] hd1: ie, there aren't 2 http plugins for nginx
[20:20:07] tbuehlmann: scaffold will also create a model, scaffold_controller won't
[20:20:11] tubbo: bricker: (on Lotus) is that a GOOD thing? :D
[20:20:20] bricker: tubbo: no, it's dumb
[20:20:25] baweaver: It's happened for Elixir, Go, and several other languages so far.
[20:20:28] bricker: tubbo: it's a developer (or team of developers) wasting their time
[20:20:29] smathy: hd1, you've still not explained why having multiple storage engines is a problem.
[20:20:55] smathy: hd1, attacking an obviously limited analogy is a fool's game.
[20:21:00] baweaver: Though Elixir was from Valim being a Rails core guy iirc and wanting more streaming features among other things.
[20:21:03] tubbo: baweaver: there's no rails-like web framework for Go, i believe the guy who made Sinatra basically ported Sinatra into Go, that's why it's like that. Elixir was created by Jose Valim, a Rails core contributor...although he did not develop Phoenix
[20:21:10] acovrig: tbuehlmann: I did a tar of my cwd and am starting over (but will probably copy&paste alot back given I just got GoogleOAuth working)
[20:21:13] Anakat: has joined #RubyOnRails
[20:21:16] tubbo: Phoenix's Channels are like what ActionCable stole :)
[20:21:33] tubbo: baweaver: yeah, IIRC Jose also contributed a lot to ActionController::Live
[20:21:35] bricker: tubbo: there are plenty of rails-like options for Go
[20:21:38] hd1: smathy: fragmentation of expertise
[20:21:40] baweaver: not a surprise
[20:21:47] tubbo: bricker: really? that's interesting
[20:21:53] tbuehlmann: acovrig, okay. then this is the way to go: bin/rails generate scaffold request type:integer supervisot:string reason:text ???
[20:22:07] bricker: tubbo: yes, and they all claim to be better than the rest!
[20:22:09] tubbo: i wouldn't imagine Go to be the kind of language that would suit a "big" framework like Rails. Go is really fun but i feel like it would suck if you had a shit ton of Go code in a big monolithic app
[20:22:11] hd1: mysql (any storage engine) still doesn't allow more than one timestamp column in a table
[20:22:15] gambl0re: has joined #RubyOnRails
[20:22:20] acovrig: tbuehlmann: request or Request (does the case matter?)
[20:22:21] baweaver: bricker: but it's written in go
[20:22:24] tubbo: i love Go for creating small interoperating components
[20:22:27] tbuehlmann: right, doesn't matter
[20:22:33] baweaver: bricker: so obviously superior in all ways
[20:22:36] tbuehlmann: the last part is for creating columns on the database having the mentioned types, handy
[20:22:41] bricker: tubbo: if you keep it organized it wouldn't be any worse than a huge rails app
[20:23:21] smathy: hd1, heh, right. And PG doesn't allow custom collations, or per-column collations. Was your point that there are pros and cons to each, and people should choose which ones of those are important to their project?
[20:23:23] smathy: I agree with that.
[20:23:35] acovrig: tbuehlmann: to make sure I don???t forget any columns, cat db/migrate/* should give me all of them, right?
[20:23:47] tubbo: bricker: can you show me any examples of these Rails-like web frameworks for Go?
[20:23:59] tbuehlmann: acovrig, you could also have a look at db/schema.rb
[20:24:19] hd1: smathy: i'd say multiple timestamp columns are FAR more critical than custom collations, but YMMV,
[20:24:35] smathy: hd1, and if fragmentation of expertise is the problem of having multiple storage engines, then I don't think you know much about where innodb came from.
[20:25:07] baweaver: Geolocation and calculated fields are handy in PG
[20:25:10] acovrig: tbuehlmann: can I just copy that from the old version?
[20:25:31] hd1: smathy: no, but I still know it's a toy
[20:25:44] bricker: tubbo: Martini (the sinatra one you mentioned), Gin, and Gorilla are small (read: minimal) but similar; Revel is a more fully-featured web framework, still in development though. There's also beego which I haven't used.
[20:26:41] tubbo: bricker: thanks, looking up Revel now. Martini is what i was thinking of...looks great :)
[20:26:50] hd1: smathy: in reality, I join a team and don't dictate what database is used, but often cringe at mysql
[20:26:52] tbuehlmann: acovrig, running the scaffold generator will create one migration for you. you can paste the old stuff in it
[20:26:54] existensil: has joined #RubyOnRails
[20:27:15] bricker: tubbo: Martini considered harmful though, it's slow and even its developer recommends not using it
[20:27:18] hd1: and swear at it when i get home
[20:27:30] smathy: hd1, right, because of "knowledge" that you won't back up with evidence, and abstract claims of expertise fragmentation.
[20:27:43] tubbo: bricker: i remember when it came out people were lamenting it because it's definitely not how Go is supposed to work
[20:27:45] smathy: hd1, biases are fine, not knowing you have them is limiting. Good luck.
[20:27:47] bricker: tubbo: the Martini dev is rewriting it better as https://github.com/codegangsta/negroni
[20:27:55] bricker: tubbo: which, incidentally, is the WORST NAME EVER for anything
[20:28:06] tubbo: bricker: racist
[20:28:14] bricker: tubbo: yeah it's poor usage of Go plus it's apparently very slow
[20:28:21] hd1: smothy: if you have choices in basic functionality, that is stupid
[20:28:29] tubbo: bricker: let's fork it to bricker/jabroni
[20:28:29] baweaver: negroni is a drink
[20:28:31] bricker: Gin claims to be "Up to 40x faster" than Martini, it's what I use but I've never benchmarked the difference
[20:28:37] nikhgupt: has joined #RubyOnRails
[20:28:38] bricker: tubbo: lol
[20:28:40] hd1: and that's not an "abstract claim", it's quite a solid one
[20:29:03] baweaver: not a particularly good drink, but made with gin so hence the name
[20:29:25] bricker: "Negroni" one part gin one part vermouth........... I SEE WHAT U DID THAR
[20:29:26] baweaver: ACTION still sticks by scotch and japanese whisky
[20:29:36] hd1: i know enough about mysql and its idiot tradeoffs that I won't touch it with a 10-ft pole
[20:29:47] Eminence_: has joined #RubyOnRails
[20:29:53] artto: has joined #RubyOnRails
[20:30:12] sshuff: has joined #RubyOnRails
[20:30:30] joelataylor: has joined #RubyOnRails
[20:31:34] theery: has joined #RubyOnRails
[20:32:53] existensil: has joined #RubyOnRails
[20:33:21] x-light: has joined #RubyOnRails
[20:34:18] nahtnam: has joined #RubyOnRails
[20:34:27] asheinfeld: has joined #RubyOnRails
[20:34:29] fxn: has joined #RubyOnRails
[20:34:54] yizr: has joined #RubyOnRails
[20:35:28] arcanez: has left #RubyOnRails: ()
[20:36:17] Eminence_: has left #RubyOnRails: ()
[20:36:20] simplyia_: has joined #RubyOnRails
[20:36:28] eminencehc_: has joined #RubyOnRails
[20:37:54] eminencehc_: I am collecting a signature at the end of a form. I only want the user to be able to enter a signature if all other fields are valid. What is the best way to require additional fields after validation?
[20:40:00] Lytol: has joined #RubyOnRails
[20:40:30] moeabdol: has joined #RubyOnRails
[20:40:57] Etriaph: has joined #RubyOnRails
[20:40:59] doodlehaus: has joined #RubyOnRails
[20:41:02] bruno-: has joined #RubyOnRails
[20:41:05] pwnd_nfsw: has joined #RubyOnRails
[20:41:23] czerasz: has joined #RubyOnRails
[20:44:03] owenjones: has joined #RubyOnRails
[20:44:36] pwnd_nfsw: I'm having an issue where rake tasks load a table in my database, and this is preventing me from deploying to heroku because the database doesn't exist yet. This is somewhat abnormal to what I usually experience creating apps, and I can't quite figure out how to word it for google. http://pastebin.com/ZpbfcAdg
[20:44:50] pwnd_nfsw: hah.. alright
[20:46:00] gambl0re: has joined #RubyOnRails
[20:46:13] asheinfeld: has joined #RubyOnRails
[20:47:04] clintb: has joined #RubyOnRails
[20:48:52] ararog: has joined #RubyOnRails
[20:49:08] tubbo: pwnd_nfsw: what does "irb: warn: can't alias context from irb_context." mean? that doesn't have anything to do with the error you described
[20:50:03] Lightsword: has joined #RubyOnRails
[20:50:07] surrealanalysis: has joined #RubyOnRails
[20:50:27] pwnd_nfsw: The only thing I can find upon googling is that it is an issue with rspec, but after removing everything rspec related. tubbo, it goes away when I comment out all of the rspec stuff
[20:50:45] pwnd_nfsw: However "ProductCategory Load .................." still remains, and that's the main thing holding me back
[20:50:54] a346: has joined #RubyOnRails
[20:51:02] christiandsg: has joined #RubyOnRails
[20:51:11] pwnd_nfsw: by rspec stuff, I meant in the gem.
[20:52:44] pwnd_nfsw: I tried changing the model name to see if it would persist, and it very much that.
[20:53:53] asheinfeld: has joined #RubyOnRails
[20:54:30] tubbo: pwnd_nfsw: i'm still not sure what your issue is
[20:54:38] [Butch]: has joined #RubyOnRails
[20:54:42] bob14: has joined #RubyOnRails
[20:54:57] tubbo: pwnd_nfsw: if your DB really didn't exist, that call would have thrown an error. it didn't, so your DB must exist.
[20:55:16] buffym: has joined #RubyOnRails
[20:55:18] pwnd_nfsw: It throws an error when deploying to heroku
[20:55:25] Frem: has joined #RubyOnRails
[20:56:21] bruno-: has joined #RubyOnRails
[20:57:32] smathy: eminencehc_, you only want a user to *be able to enter a signature* - or you only want to save a signature into your DB - if all other fields are valid?
[20:59:01] smathy: eminencehc_, and you want to do it on the same page? Or you're happy for them to have a server-round trip to submit the other details, then do a final check and add their signature as a confirmation or something?
[20:59:03] edwinvdgraaf: has joined #RubyOnRails
[20:59:40] pwnd_nfsw: tubbo, found out where it's doint this.. In activeadmin I have a filter. Disabling it got rid of it. Thanks for your help
[21:00:31] eminencehc_: smathy: I am thinking round trip, like showing the signature field only if errors.signature.present? and the only way the signature validation would run is if there are no other validation errors.
[21:00:43] eminencehc_: smathy: I would like to have it on the same page, but I am not sure how that is possible.
[21:01:16] victortyau: has joined #RubyOnRails
[21:03:47] Pupeno_: has joined #RubyOnRails
[21:04:36] dopie: has joined #RubyOnRails
[21:04:54] tubbo: pwnd_nfsw: no worries, you probably could have been helped faster if you showed me the *actual* error you were having though
[21:05:37] smathy: eminencehc_, you could do some basic checks in JS, but the only way to do full validations would be to use ajax as they're filling in the forms.
[21:05:43] choke: has joined #RubyOnRails
[21:06:06] smathy: eminencehc_, there are probably gems that do that, but for the complexity I'd probably go for a "confirmation screen" type thing where they enter their signature.
[21:06:43] czerasz: has joined #RubyOnRails
[21:07:20] victortyau: has joined #RubyOnRails
[21:07:40] jonathanwallace: has joined #RubyOnRails
[21:07:43] smathy: eminencehc_, and then basically your validation becomes a simple matter of allowing a NULL signature for a new record or something like that.
[21:08:02] jhack: has joined #RubyOnRails
[21:08:02] jhack: has joined #RubyOnRails
[21:08:17] pharserror: has joined #RubyOnRails
[21:09:31] eminencehc_: smathy: Without hitting the update action?
[21:11:12] smathy: eminencehc_, well, the first screen would come into the create action, the confirmation screen with the signature would use update.
[21:11:39] Scriptonaut: shouldn't adding an error to a model make it not valid?
[21:11:50] skyjumper: what are some tricks to speed up load times of an app with 230 assets?
[21:11:55] smathy: You could make a separate one for it if you wanted to prevent them from changing any of the values (hacking the form) but I wouldn't bother, I'd let them do that if they wanted.
[21:12:00] enroxorz: has joined #RubyOnRails
[21:12:02] smathy: Scriptonaut, only if you do it in a validation.
[21:12:17] smathy: Scriptonaut, .valid? clears the errors and runs all the validations, and then checks .errors
[21:12:19] skyjumper: it takes 5 to 15 seconds until the dom is ready
[21:12:31] gambl0re: has joined #RubyOnRails
[21:12:38] smathy: skyjumper, asset pipeline / browser caching.
[21:12:54] blackmesa: has joined #RubyOnRails
[21:13:16] enroxorz: howdy howdy. im writing a selenium test for an app with turbolinks. how do i know when turbolinks is done processing what it needs to process? i know it isnt an ajax call, like jquery would be (we use driver.execute_script 'return jQuery.active == 0' to wait for those calls...) Anyone know how to do this?
[21:13:18] skyjumper: smathy: all are cached. i can turn off javascript debugging in the pipeline, causing them to combine...
[21:13:41] stantona: Is it fair to say that ActiveRecord::Base.establish_connection only sets up the connection pool for a given database adapter, but doesn't *actually* create a connection to the db until the #connection method is called?
[21:14:19] bungoman: has joined #RubyOnRails
[21:15:05] Coldblackice_: has joined #RubyOnRails
[21:16:32] roolo: has joined #RubyOnRails
[21:17:42] FernandoBasso: has joined #RubyOnRails
[21:17:52] victortyau: has joined #RubyOnRails
[21:18:29] skyjumper: dramatically better with config.assets.debug = false ... wish there were a better way
[21:20:06] cryptocronus: has joined #RubyOnRails
[21:21:32] marcoceppi: has joined #RubyOnRails
[21:22:03] pharserror: @skyjumper honestly I would implement some JS or load all assets on the root route
[21:22:42] smathy: enroxorz, there's an event, read the turbolinks README.
[21:22:49] pharserror: @skyjumper the thing that is "slow" is that Rails is lazy-loading the assets for you so it's not using up a lot of client-side memory initially but then the client needs to load assets as they are encountered
[21:23:13] pharserror: @skyjumper if you want to speed up their experience you have to force their client to load stuff before it is encountered
[21:23:59] skyjumper: these assets are javascript - bootstrap scripts
[21:24:31] skyjumper: it's just too many
[21:24:39] skyjumper: er.. backbone, not bootstrap.
[21:25:03] eggoez: has joined #RubyOnRails
[21:25:41] pharserror: @skyjumper the best thing to do, IMO, would be to create a manifest that loads on the root route
[21:26:02] simplyianm: has joined #RubyOnRails
[21:26:03] Godel108: has joined #RubyOnRails
[21:26:04] enroxorz: smathy: i see. i just need to figure out how to use this now. Thanks.
[21:26:07] pharserror: @skyjumper it will have to load all that stuff when the client initially loads your app but then they won't have to load anything else for the rest of their usage
[21:26:39] canmor: has joined #RubyOnRails
[21:26:59] pharserror: @skyjumper although, since they are JS I would say that, if they don't need all those scripts right off the bat, to precompile them in smaller manifests and serve them on the pages that need them
[21:27:08] yardenbar: has joined #RubyOnRails
[21:27:14] netzfisch: has joined #RubyOnRails
[21:27:28] skyjumper: this isn't for production users, it's for me on dev
[21:27:33] skyjumper: when cold-loading the page
[21:27:36] choke: has joined #RubyOnRails
[21:27:50] skyjumper: production is fine, all js is one minified file
[21:28:28] smathy: enroxorz, you're welcome.
[21:29:02] j_mcnally: has joined #RubyOnRails
[21:29:52] kb: has joined #RubyOnRails
[21:30:02] pharserror: @skyjumper dev is going to to be slow because the caching is handled differently and if you have a manifest with 250 files...I would split it up TBH
[21:30:45] yardenbar: has joined #RubyOnRails
[21:31:18] rhizome: 250 seems like a lot
[21:31:45] Coldblackice: has joined #RubyOnRails
[21:31:55] jenrzzz: has joined #RubyOnRails
[21:34:23] surrealanalysis: has joined #RubyOnRails
[21:37:25] SteenJobs: has joined #RubyOnRails
[21:37:30] nahtnam: Hey. What do you guys think of a coffee-tipping bot? I could make one if you guys think it would be useful/interesting
[21:38:20] bruno-: has joined #RubyOnRails
[21:38:33] bricker: what's that
[21:38:39] bricker: it tips me with coffee?
[21:38:42] benhuda: has joined #RubyOnRails
[21:38:51] bricker: virtual coffee?
[21:39:07] artto: has joined #RubyOnRails
[21:39:30] nahtnam: bricker: Well, if someone helps you, you can tip some change in starbucks gift card
[21:39:36] nahtnam: Like 25cents or 1dollar
[21:39:58] nahtnam: Using a couple of apis
[21:40:19] bricker: I'll take free coffee sure
[21:40:25] baweaver: has joined #RubyOnRails
[21:40:57] nahtnam: Anyone else interested?
[21:41:06] artto_: has joined #RubyOnRails
[21:42:34] cnk: ahhh I thought you were planning to build something to spill coffee. Very confused
[21:42:55] cnk: I think it would be fun to build a coffee gift card bot. How do we go about it?
[21:42:56] bricker: cnk: yeah like, after an hour dump the coffee out and make a new pot :D
[21:43:25] cnk: Or the original webcam on the coffee bot in Cambridge
[21:43:38] nahtnam: cnk: If enough people are interested, ill start a repo.
[21:45:18] bricker: nahtnam: just do it
[21:45:18] owenjones: has joined #RubyOnRails
[21:45:27] cnk: has joined #RubyOnRails
[21:45:36] bricker: nahtnam: better check freenode terms of use, I'm not sure it's allowed, I've never seen any tip bots on freenode
[21:45:47] nahtnam: bricker: Right. Ill ask now
[21:45:52] nahtnam: On #freenode
[21:46:00] bricker: nahtnam: please report back
[21:46:13] nahtnam: bricker: Will do!
[21:46:35] DoubleMalt: has joined #RubyOnRails
[21:47:15] czerasz2: has joined #RubyOnRails
[21:47:44] bricker: also maybe check with Radar
[21:47:46] enroxorz: smathy: my solution: http://pastie.org/10283046
[21:47:57] bricker: nahtnam: ^
[21:48:21] jwaldrip: has joined #RubyOnRails
[21:48:23] nahtnam: Ill ask as soon as I confirm its allowed
[21:49:03] skkeeper: has joined #RubyOnRails
[21:50:26] rezzack: has joined #RubyOnRails
[21:51:30] bronson: has joined #RubyOnRails
[21:52:09] simplyianm: has joined #RubyOnRails
[21:52:40] pixelhandler: has joined #RubyOnRails
[21:52:45] Silox|: <%= tag :div %> doesn't seems to close decently?
[21:52:51] nickenchuggets: has joined #RubyOnRails
[21:52:51] nickenchuggets: has joined #RubyOnRails
[21:53:00] victortyau: has joined #RubyOnRails
[21:53:53] alphaatom: has joined #RubyOnRails
[21:53:59] rezzack: has joined #RubyOnRails
[21:54:46] nahtnam: bricker: rhizome cnk Good news. Freenode doesnt have any rules against it
[21:54:53] nahtnam: All thats left is convincing Radar
[21:55:22] charliesome: has joined #RubyOnRails
[21:56:29] cnk: I am largely interested to know more about bots. Though I still owe someone from #git a load of karma for having fixed my repo about 5 years ago when I first started using git
[21:56:33] yfeldblum: has joined #RubyOnRails
[21:57:31] bricker: cnk: here's helpa if you want, bots aren't too complicated: https://github.com/radar/railsbot
[21:57:34] cnk: having an immediate, tangible thanks in this channel would be great
[21:58:02] cnk: I'll take a look. I totally wanted some of the stock helpa things in a different channel the other day
[21:58:03] bricker: login to IRC, read the messages, do things if the messages match something
[21:58:16] cnk: mainly the one for 'can't help w/o seeing code'
[21:58:47] DoctorMonocular: has joined #RubyOnRails
[21:59:11] aderium: ruby 2.2.2 from source will not compile on Solaris 11.2 32 or 64 bit
[21:59:14] aderium: same error
[21:59:19] aderium: who can help ?
[21:59:19] tubbo: cnk: what do you mean?
[21:59:35] rhizome: Aderium: help with what?
[21:59:49] tubbo: Aderium: !gist the error
[21:59:49] helpa: Aderium: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[21:59:53] rhizome: we don't have any Solaris committers in channel afaik
[21:59:58] cnk: I was wishing one of the other channels had helpa stuff so I could just type a few letters and get the stock msg about needing to see code to help
[22:00:21] cnk: like that ^
[22:00:39] it_tard: has joined #RubyOnRails
[22:00:41] tubbo: cnk: ah ok
[22:01:01] aderium: https://gist.github.com/CirrusThink/9f25011511a8cef5241d
[22:01:18] aderium: are there any Solaris commiters anywhere ?
[22:01:29] tubbo: oh yeah they all work at Sun Microsy...oh wait ;)
[22:01:29] wethu: has joined #RubyOnRails
[22:01:37] cnk: Aderium: this may or may not be the best channel - perhaps #ruby
[22:01:48] rhizome: yes, at Oracle ;)
[22:02:01] tubbo: shit, never seen that before Aderium...sorry
[22:02:09] rhizome: do you need 2.2.2? 2.1.5 is perfectly fine and you might be able to find a package for it
[22:02:36] mcr-credil: has joined #RubyOnRails
[22:02:40] tubbo: Aderium: i see you posted https://github.com/rvm/rvm/issues/3346 and that's the only other thing i can see on the matter..
[22:02:58] bob14: has joined #RubyOnRails
[22:03:13] fwaokda: has joined #RubyOnRails
[22:03:15] rhizome: Aderium: are you on sparc or x86?
[22:03:22] aderium: 2.2.x has some changes in garbage collection that may be what can help us with a huge eventmachine ( we think ) memory leak
[22:03:26] aderium: I am on x86
[22:04:05] Silox|: How on earth can this happen; I render a partial in a controller and pass that HTML to a js.erb callback which replaces a div with that HTML. Everything goes well (it renders a <div> with some content), but when I place another div in that partial, it returns a full HTML page?
[22:04:56] aderium: ERROR -- : failed to allocate memory
[22:04:57] aderium: ERROR -- : /xxxxxxx/xxxx/shared/bundle/ruby/1.9.1/gems/eventmachine-1.0.7/lib/em/protocols/object_protocol.rb:42:in `pack'
[22:04:58] leonardoajim: has joined #RubyOnRails
[22:05:04] x1337807x: has joined #RubyOnRails
[22:05:04] bruno-: has joined #RubyOnRails
[22:05:30] Detch: has joined #RubyOnRails
[22:05:42] tubbo: Aderium: you can control some aspects of GC in 2.1.x by learning more about how generational GC works and how you can trigger it at certaint imes
[22:05:48] tubbo: which might be a workaround to your issue
[22:06:05] x1337807x: has joined #RubyOnRails
[22:06:46] christiandsg: has joined #RubyOnRails
[22:07:21] pharserror: has joined #RubyOnRails
[22:07:27] jokke: has joined #RubyOnRails
[22:07:37] alexirys: has joined #RubyOnRails
[22:07:42] aderium: I believe we are triggering every so often but does not seem to help. Either way it seems to be a bit of an issue
[22:09:51] zorak8: has joined #RubyOnRails
[22:10:05] sillypog: has joined #RubyOnRails
[22:11:17] leonardoajim: has joined #RubyOnRails
[22:15:38] leonardoajim: has joined #RubyOnRails
[22:15:45] zenspider: has joined #RubyOnRails
[22:16:20] acconrad: has joined #RubyOnRails
[22:16:20] xicreative: has joined #RubyOnRails
[22:16:28] CheckYourSix: This isn't Rails specific, but how do software development companies prevent their employees from stealing and/or sabotaging code and running off to create their own service using the same or similar code? I know they use NDA and No-Competes, but I'm sure not everyone complies with them...
[22:16:52] sillypog: has joined #RubyOnRails
[22:17:05] j_mcnally: has joined #RubyOnRails
[22:17:07] riotjones: has joined #RubyOnRails
[22:17:07] CheckYourSix: And the endless legal battles on top of that makes me think people wouldn't be that afraid
[22:17:09] alexirys: has left #RubyOnRails: ()
[22:17:13] zenspider: ARGH. stuck. upgrading rails 3 to 4. 3 code is using serialize w/ ActiveRecord::Coders::Hstore. they switched them to store_accessor (which I've just removed), but instead of getting {} back by default (on nil), they're getting nils.
[22:17:23] xota: has joined #RubyOnRails
[22:17:27] xota: hello! I have 2 models: Product and Subproduct. The Subproduct belong_to Product. When I create a Subproduct I need the description from Product. Something like: product.subproducts.create(subproduct_params) should already associate the product with the subrproduct. Shouldn't it? My problem is that from Subproduct I can not write "product" to access to my parent (belongs_to), it's always nil. If by hand
[22:17:29] zenspider: Is there a clean way to set up one of these accessors to return {} instead of nil?
[22:17:34] xota: I set the product_id I can do it
[22:18:21] gremax: has joined #RubyOnRails
[22:18:27] zenspider: CheckYourSix: you're right. that has nothing to do with rails.
[22:18:42] zenspider: what's the Hstore migration strategy?
[22:18:56] rhizome: zenspider: can you not do something like foo = {} if foo.nil?
[22:19:04] CheckYourSix: zenspider: No, but it has a lot to do with software development, and I know that people in here deal with software development.
[22:19:51] rhizome: CheckYourSix: sounds like you're thinking of hiring someone and are paranoid
[22:20:26] zenspider: CheckYourSix: nearly every channel in this IRC server has to do with software development. Doesn't make your question relevant to this one
[22:20:32] CheckYourSix: rhizome: No. I don't have a project to hire anyone for. I was just randomly thinking about it with all these startups that keep appearing. People jump ship a lot.
[22:20:46] zenspider: rhizome: in every single place they call this column accessor? no
[22:21:03] iamse7en: has joined #RubyOnRails
[22:21:46] sloggerkhan: CheckYourSix: I think you risk a lot more be preventing employee from being able to display their portfolio when switching jobs than trying to stop them from taking code. Particularly if the work environment is good and they have some sort of stake in the company/project.
[22:21:51] sloggerkhan: *by preventing
[22:22:03] DylanJ: CheckYourSix: talk to a lawyer about ip.
[22:22:17] fgo: has joined #RubyOnRails
[22:22:32] pharserror: has joined #RubyOnRails
[22:22:35] rhizome: zenspider: oh, attrs. no idea.
[22:22:52] CheckYourSix: SloggerKhan: I'm in agreement with you. I was just asking out of curiosity really.
[22:22:55] DylanJ: maybe where you live by default an employer own all products an /employee/ writes. maybe you don't. maybe you need a contract that explicitly give you the rights to the ip being developed by your employees/contractors
[22:22:59] mando: has joined #RubyOnRails
[22:23:06] owenjones: has joined #RubyOnRails
[22:23:18] CheckYourSix: DylanJ: Makes sense.
[22:23:22] DylanJ: so its something you should talk to a lawyer about if you're have a real concern about
[22:23:25] pharserror: has left #RubyOnRails: ()
[22:23:30] Miesco: has joined #RubyOnRails
[22:23:32] hd1: has left #RubyOnRails: ()
[22:23:33] sloggerkhan: In jurisdictions where they're legal I've seen/had noncompetes.
[22:23:47] CheckYourSix: DylanJ: Just a random curiosity really.
[22:24:05] pharserror: has joined #RubyOnRails
[22:24:27] pharserror: @xota dunno if someone already answered your question but, you can use an after_save hook to do what you want
[22:24:27] pharserr1r: has joined #RubyOnRails
[22:24:47] DylanJ: I worked for one company who had a IP clause in the contract I signed. I can't remember it word for word but I remember all code I wrote was property of them or something.
[22:25:13] pharserror: @xota you should also make sure to add a presence validation to the child to ensure that it gets created with a product id
[22:25:34] CheckYourSix: DylanJ: I would pretty much expect companies to have something like that.
[22:25:57] pharserror: @DylanJ gotta agree with CheckYourSix I've never worked anywhere that wasn't the case
[22:26:17] DylanJ: The company I work at has nothing about that specifically in the contract I signed.
[22:26:23] pharserror: it ensures that if you have a copy of their source you can redistribute it for profit
[22:26:40] pharserror: @DylanJ did you sign an NDA?
[22:26:43] DylanJ: But then again they're not so much a /tech/ company.
[22:26:59] DylanJ: pharserror: nah, not to work @ my current company.
[22:26:59] Scripore: has joined #RubyOnRails
[22:27:09] pharserror: if you didn't sign an NDA either then you can pretty much use their source for whatever you want
[22:27:15] FrankD_: has joined #RubyOnRails
[22:27:19] DylanJ: Yeah. But I'm not a douche.
[22:27:30] DylanJ: They paid me to write it. It's theirs as far as I'm concerned.
[22:27:45] CheckYourSix: DylanJ: Not everyone has morals like that
[22:27:49] pharserror: @DylanJ the law isn't going to say you're a douche
[22:28:41] FrankD_: hi, I have a Ruby app I'm having problems with when switching to 'mysql2' from sqlite3 .. the database fails to create properly: https://gist.github.com/fdimitri/1716120b681876b24e9c
[22:29:17] pharserror: @FrankD_ if you have your db config yaml setup properly all your migrations should run just fine
[22:29:36] noodman: has joined #RubyOnRails
[22:29:51] FrankD_: pharserr1r, did you look at the gist?
[22:29:58] pharserror: looking at it
[22:30:54] bricker: has joined #RubyOnRails
[22:31:19] DEA7TH: has joined #RubyOnRails
[22:31:25] DylanJ: FrankD_: did you create the database with rake db:create or manually?
[22:31:41] FrankD_: DylanJ, the gist shows me creating it
[22:31:48] FrankD_: its not really a Rails app, but they wouldnt help me in #ruby
[22:31:58] FrankD_: ActiveRecord::Migrator.migrate('db/migrate/', ENV["VERSION"] ? ENV["VERSION"].to_i : nil)
[22:32:05] choke: has joined #RubyOnRails
[22:32:11] FrankD_: so you can see it goes through the Users table just fine
[22:32:30] FrankD_: and it creates the directroy_entries table, but fails when adding fk constraint
[22:32:41] pharserror: @FrankD_ does the owners table exist?
[22:32:54] DylanJ: oh that's a good point
[22:32:57] pharserror: @FrankD_ and are you unable to run rake db:migrate?
[22:33:07] FrankD_: pharserror, there is no owners table
[22:33:09] FrankD_: im not sure why its foreign_key (`owner_id`) references `owners` (`id`) .. shouldnt it be more like "foreign_key (`owner_id`) references (`id`) ??
[22:33:14] FrankD_: look at the model down below
[22:33:23] FrankD_: belongs_to :owner, class_name: "DirectoryEntry", foreign_key: "id"
[22:33:30] mcr-credil: has joined #RubyOnRails
[22:33:56] FrankD_: pharserror, as I said it's not a rails app, no Rakefile, but that's basically what db:migrate would do (ActiveRecord::Migrator.migrate('db/migrate/', ENV["VERSION"] ? ENV["VERSION"].to_i : nil))
[22:33:57] rubyonrailed: has joined #RubyOnRails
[22:34:10] FrankD_: #ruby apparently doesnt use activerecord
[22:34:29] xicreative: has joined #RubyOnRails
[22:34:29] pharserror: @FrankD_ I would get rid of the foreign key and index
[22:34:47] pharserror: @FrankD_ these are columns on the table itself, you're not making a join table
[22:35:00] zenspider: has left #RubyOnRails: ("ERC Version 5.3 (IRC client for Emacs)")
[22:35:27] FrankD_: well don't I kind of need foreign_key for it to be self-referencing?
[22:35:38] FrankD_: and for it to create the right associations?
[22:35:54] bricker: if Rails wasn't already blurring the lines of MVC badly enough, now Rails 5 will have a built-in way to render a template from anywhere in your app!
[22:36:13] pharserror: @FrankD_ instead of using "t.references" just use "t.integer"
[22:36:33] FrankD_: pharserror, is there a reason it's different between sqlite and mysql?
[22:36:57] pharserror: @FrankD_ I'm not too sure I haven't dealt with anything this complex in sqlite
[22:36:59] FrankD_: and i want it to setup the foreign key assoc, dont i?
[22:37:18] iamse7en: has joined #RubyOnRails
[22:37:21] bar0n: has joined #RubyOnRails
[22:37:41] pharserror: if you want the foreign key stuff I would take a more manual approach where you setup the associations on the model and just use t.integer for the id fields
[22:38:12] pharserror: @FrankD_ you probably want to use "through" on your associations in the model
[22:38:25] pharserror: @FrankD_ you can even tell it the column name and stuff
[22:38:43] pharserror: @FrankD_ also "inverse_of" and all that stuff
[22:38:45] leonardoajim: has joined #RubyOnRails
[22:38:57] clintb_: has joined #RubyOnRails
[22:39:16] xicreative: has left #RubyOnRails: ()
[22:39:18] FrankD_: pharserror, hmm do you have any examples? why through?
[22:39:22] FrankD_: its a reference to itself
[22:39:37] clintb: has joined #RubyOnRails
[22:40:22] Anakat_: has joined #RubyOnRails
[22:40:32] canmor: has joined #RubyOnRails
[22:41:00] pharserror: @FrankD_ not that then. I'm not too sure tbh
[22:41:14] Voxxit: has joined #RubyOnRails
[22:42:04] artto: has joined #RubyOnRails
[22:42:35] werelivinginthef: has joined #RubyOnRails
[22:42:41] yashinbasement: has joined #RubyOnRails
[22:42:45] pharserror: @FrankD_ the way I've done it in the past is to make a join table to an object that refers back to the other object
[22:42:49] canmor: has joined #RubyOnRails
[22:43:14] FrankD_: a join table just for self-referencing types?
[22:43:19] pharserror: like parent and child are the same object and in the same table but their child_id or owner_id goes through a join table that refers to the other thing
[22:43:19] FrankD_: i mean i could, but it seems like a waste :P
[22:43:44] FrankD_: ALTER TABLE `directory_entries` ADD CONSTRAINT `fk_rails_026bdd426e` FOREIGN KEY (`owner_id`) REFERENCES `directory_entries` (`id`); <-- works fine
[22:43:50] FrankD_: not sure why its going `owners` (`id`)
[22:43:57] pharserror: I guess check this out http://railscasts.com/episodes/163-self-referential-association
[22:44:06] FrankD_: its like its ignoring class_name
[22:44:27] xicreative: has joined #RubyOnRails
[22:45:09] pharserror: here's another thing http://stackoverflow.com/questions/6097288/how-can-i-do-self-reference-with-ruby-on-rails
[22:45:58] zorak8: has joined #RubyOnRails
[22:46:58] FrankD_: well to me it makes more sense to have owner_id in the table if there can be only one owner
[22:47:11] FrankD_: so i can get owner information from a simple select, instead of going through two tables
[22:47:21] FrankD_: (find the association in the join table, then find the parent)
[22:47:29] hd1: has joined #RubyOnRails
[22:47:36] hd1: http://notes.d8u.us/welcome/index any idea why the icons at the bottom are cut off?
[22:48:06] xicreative: Hey, does anyone have any idea why my view fragments are being stored as empty strings in memcached? The HTML renders correctly on first load, but isn't getting saved. :-\
[22:48:22] patrick_star: has joined #RubyOnRails
[22:48:26] hd1: xicreative: code?
[22:48:40] DoctorMonocular: has joined #RubyOnRails
[22:53:59] xicreative: hd1: https://gist.github.com/anonymous/821d64a23ba003587712
[22:55:44] eggoez: has joined #RubyOnRails
[22:56:12] hahuang65: has joined #RubyOnRails
[22:56:21] sar1nk: has joined #RubyOnRails
[22:57:07] sar1nk: has joined #RubyOnRails
[22:57:18] LuukFRT: has joined #RubyOnRails
[22:57:49] xicreative: hd1: For your icons, looks like you have them in a bootstrap .row, which should be in a .container or .container-fluid to work properly
[22:58:09] hd1: xicreative: will try that
[23:05:33] bricker: xicreative: how do you know it's not getting saved into your cache? Is cache enabled for your environment?
[23:05:59] davidbitton: has joined #RubyOnRails
[23:07:02] buffym: has joined #RubyOnRails
[23:08:38] tvw: has joined #RubyOnRails
[23:09:10] baweaver: has joined #RubyOnRails
[23:11:01] Spami: has joined #RubyOnRails
[23:11:39] xicreative: bricker: Yeah, I've enable caching in dev and can connect directly to the memcached server to check. Same in our staging environment
[23:12:03] xicreative: bricker: Thinking it might have something to do with the templates being HAML
[23:12:06] yizr: has joined #RubyOnRails
[23:12:17] hotpancakes: has joined #RubyOnRails
[23:13:18] bricker: xicreative: what are you typing to check? Do you know that the cache helper adds stuff to the key name?
[23:15:35] x1337807x: has joined #RubyOnRails
[23:15:52] xicreative: bricker: getting the keys directly out of memcached (I cleared it so I only have keys from this page load to deal with) then calling get <key> from the memcached command line to check.
[23:17:28] mary5030: has joined #RubyOnRails
[23:18:18] canmor: has joined #RubyOnRails
[23:18:22] bricker: not sure then
[23:20:04] adavia: how can i access form errors with a form defined like <%= form_for(:post, url: posts_path) do |f| %>
[23:20:33] nickenchuggets: has joined #RubyOnRails
[23:20:33] nickenchuggets: has joined #RubyOnRails
[23:20:35] pharserror: @adavia @post.errors
[23:20:55] simplyia_: has joined #RubyOnRails
[23:21:22] adavia: pharserror: is not rendering the errors
[23:21:46] bricker: adavia: show the code please
[23:21:48] pharserror: @adavia are you adding the errors to the object?
[23:23:11] adavia: pharserror: well as i am using bootstrap_form_for it adds the errors automatically in each field. Maybe the problem is that
[23:23:20] fgo: has joined #RubyOnRails
[23:25:03] bricker: *shakes head*
[23:25:17] cooldman224: has joined #RubyOnRails
[23:27:16] n1x: has joined #RubyOnRails
[23:27:50] zorak8: has joined #RubyOnRails
[23:28:11] SteenJobs: has joined #RubyOnRails
[23:29:16] kies^: has joined #RubyOnRails
[23:29:26] ProLoser: has joined #RubyOnRails
[23:31:16] simplyianm: has joined #RubyOnRails
[23:32:02] dan0034001: has joined #RubyOnRails
[23:32:26] hotpancakes: has joined #RubyOnRails
[23:33:14] dcunit3d: has joined #RubyOnRails
[23:34:02] crack_user: has joined #RubyOnRails
[23:34:18] dcunit3d: hey, has anyone built an API using devise_token_auth that interacts with both Angular and mobile clients (iOS/Android)
[23:34:54] dcunit3d: my angular client has no problem remaining connected to the API, but both my mobile clients have their tokens invalidated after about 60 seconds.
[23:35:27] bricker: woa that's a lot of buzz words
[23:36:08] bricker: I don't know I've never used most of that stuff
[23:36:19] dcunit3d: lol, my clients keep getting 401's after making a few successful requests
[23:37:10] dcunit3d: i thought it was a problem i was experiencing in iOS, but i remember having it with android as well. it has something to do with my configuration of devise_token_auth in Rails, but I'm not getting these problems in Angular at all.
[23:37:23] yfeldblum: has joined #RubyOnRails
[23:37:52] dcunit3d: i don't think i have to configure CORS with mobile do I? in any case, i have CORS wide open in development.
[23:37:53] sarink: has joined #RubyOnRails
[23:37:56] j_mcnally: has joined #RubyOnRails
[23:40:21] jenrzzz: has joined #RubyOnRails
[23:41:29] bungoman_: has joined #RubyOnRails
[23:42:09] crdpink2: has joined #RubyOnRails
[23:43:41] hotpancakes: has joined #RubyOnRails
[23:44:17] zorak8: has joined #RubyOnRails
[23:45:05] RegulationD: has joined #RubyOnRails
[23:47:17] dcunit3d: github issue with my problem: github.com/lynndylanhurley/devise_token_auth/issues/299
[23:47:17] jesterfraud: has joined #RubyOnRails
[23:47:53] Lytol: has joined #RubyOnRails
[23:47:54] dcunit3d: i copied the request headers i'm sending with both Angular and iOS there. not sure why my auth token is being accepted at first, then invalidated after like 60 seconds.
[23:49:06] dcunit3d: has anyone configured a Rails API for mobile use using token authentication?
[23:50:26] jordanstorz: has joined #RubyOnRails
[23:51:00] Miesco: has joined #RubyOnRails
[23:51:04] 16WABGS0F: has joined #RubyOnRails
[23:51:04] 92AABMI76: has joined #RubyOnRails
[23:52:38] simplyianm: has joined #RubyOnRails
[23:53:22] alphaatom: has joined #RubyOnRails
[23:55:05] leonardoajim: has joined #RubyOnRails
[23:55:30] christiandsg: has joined #RubyOnRails
[23:56:25] leonardoajim: has joined #RubyOnRails
[23:58:45] leonardoajim: has joined #RubyOnRails
[23:59:18] zorak8: has joined #RubyOnRails