« Back to channel list

#RubyOnRails - 13 November 2015

« Back 1 day Forward 1 day »
[00:00:12] Radar: It removes the match call w/ via options, and condenses the controller + action options into a single one in `to`
[00:00:21] kitsuneyo: ah, that sounds good :)
[00:00:36] kitsuneyo: so it becomes my location_path then
[00:00:57] Radar: or location_url if you want the full URL
[00:01:06] kitsuneyo: do i need to get rid of :show in resources :locations?
[00:01:23] Radar: if you're not using it, sure.
[00:01:31] kitsuneyo: thanks Radar :D
[00:01:42] lemur: has joined #RubyOnRails
[00:02:29] Moeh: Radar: Jeah, that is also what I found weird. I now use http://www.rubydoc.info/gems/pg/PG/Connection%3Acopy_data and get quite decent speeds (1M rows in 10 min)
[00:02:41] Radar: Moeh: Glad you found a solution
[00:02:50] Moeh: Jep, thanks for your help :)
[00:02:59] annlewis: has joined #RubyOnRails
[00:03:17] kitsuneyo: Radar, now i get "ArgumentError: Invalid route name, already in use: 'location'"
[00:03:29] kitsuneyo: i guess a clash with resources?
[00:03:30] Radar: kitsuneyo: Did you remove the one from resources :locations?
[00:03:35] dikaio: has joined #RubyOnRails
[00:03:47] kitsuneyo: yeah, well i have resources :locations, only: [:index, :create, :destroy]
[00:03:59] kitsuneyo: i need those
[00:04:01] Radar: kitsuneyo: gist entire routes file pleas
[00:04:36] kitsuneyo: Radar: https://gist.github.com/kitsuneyo/313e90bca42e403b6803
[00:04:39] pwnd_nsfw: has joined #RubyOnRails
[00:05:11] IrishGringo: has joined #RubyOnRails
[00:06:29] krramos: has joined #RubyOnRails
[00:06:47] supercodepoet: has joined #RubyOnRails
[00:06:53] kitsuneyo: i guess the clash is with destroy?
[00:07:04] kitsuneyo: since that is also location_path
[00:08:04] supercodepoet: I am having an issue with Rails in production mode on Heroku not using ActionDispatch::PublicExceptions and the default exceptions_app. Has anyone else run into this?
[00:08:10] kitsuneyo: yeah if i remove destroy the problem is solved
[00:08:23] crystalneth: has joined #RubyOnRails
[00:09:16] supercodepoet: I have a public/404.html file that does not get served on a missing route and the error bubbles to Puma
[00:09:27] kitsuneyo: have to go, if you think of something Radar i can check the logs later, thanks for your help :)
[00:09:56] Radar: supercodepoet: !ncnh
[00:09:56] helpa: supercodepoet: If you don't provide any code, it becomes really difficult for us to help you. Providing code to reproduce the problem increases your chances of getting great, accurate help immensely.
[00:10:02] Radar: Steps to reproduce the issue, plzkthx
[00:12:45] axl_: has joined #RubyOnRails
[00:13:58] romdi: has joined #RubyOnRails
[00:17:58] rubyonrailed: has joined #RubyOnRails
[00:20:31] kies: has joined #RubyOnRails
[00:20:49] LateralOctober: has joined #RubyOnRails
[00:22:23] aaronseibert_: has joined #RubyOnRails
[00:23:02] StaticVoid: I have a partial view that is rendered both by 'edit' and 'new': can I use conditional formatting based on 'edit'or 'new'? I searched but could not find docs on it
[00:23:15] mices: has joined #RubyOnRails
[00:23:25] StaticVoid: so basically can I test if it was rendered from 'new' or 'edit
[00:23:45] quazimodo: has joined #RubyOnRails
[00:23:56] mices: it seems mysql2 0.3.20 is the only one that works, 0.4.1 doesn't work, i have both gems installed
[00:25:01] applegrain: has joined #RubyOnRails
[00:25:58] StaticVoid: nvm - I can just check if the fields have data
[00:26:49] aaronseibert_: has joined #RubyOnRails
[00:28:39] Radar: StaticVoid: !xy
[00:28:39] helpa: StaticVoid: It seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[00:28:51] Radar: StaticVoid: Explain the why, please.
[00:29:27] StaticVoid: Radar: I have an ID field that is autopopulated on 'new' - should not show it, but on 'edit' I want to show it as read only
[00:29:46] Radar: StaticVoid: @model.persisted?
[00:30:56] StaticVoid: Radar: much nicer solution. thx!
[00:31:15] rubyonrailed: has joined #RubyOnRails
[00:32:07] VeryBewitching: @model.new_record?
[00:32:08] bobbobbins: has joined #RubyOnRails
[00:32:37] safety_cut: has joined #RubyOnRails
[00:33:45] stannard: has joined #RubyOnRails
[00:34:25] StaticVoid: VeryBewitching: that would work too. thx!
[00:35:01] Radar: Yup, new_record? is persisted?'s antithesis
[00:35:40] krramos: has left #RubyOnRails: ()
[00:35:55] K_r3aPeR: has joined #RubyOnRails
[00:36:26] VeryBewitching: Radar: Would you provide me with word help? Trying to find a word that describes the object who deprecated another object. Deprecator isn't a word.
[00:36:34] sevenseacat: has joined #RubyOnRails
[00:37:02] Radar: Yes it is.
[00:37:23] Radar: I don't know which dictionary you're looking at.
[00:38:10] simplyianm: has joined #RubyOnRails
[00:38:14] matthewd: It may not mean what you want, though
[00:38:17] VeryBewitching: Oh, you know what, I typed "deprecater" the first time into Google. Brain sludging.
[00:38:25] doodlehaus: has joined #RubyOnRails
[00:38:27] matthewd: replacement?
[00:38:32] quazimodo: I have the weirdest bug *EVER
[00:38:39] VeryBewitching: Not a replacement, a better definition of in my case.
[00:38:53] Radar: Radar kicked quazimodo: with the leading statements without code. Thanks.
[00:39:00] VeryBewitching: The deprecated version must continue to exist.
[00:39:10] Radar: I guess we'll never know.
[00:39:18] quazimodo: has joined #RubyOnRails
[00:39:28] quazimodo: feeling a little cranky there Radar ?
[00:39:37] Radar: quazimodo: Bored of this game that we play each time you ask a questioon.
[00:39:44] Radar: quazimodo: You have to follow the rules just like everyone else.
[00:40:03] centrx: I have this ITCH on my back that I just can't SCRATCH!
[00:40:14] VeryBewitching: Thanks matthewd and Radar
[00:40:22] quazimodo: you need a nap man
[00:41:58] centrx: quazimodo, Shouldn't you be ringing a bell in a cathedral somewhere?
[00:43:11] rickmasta: has joined #RubyOnRails
[00:44:24] ur5us: has joined #RubyOnRails
[00:44:56] rubyonrailed: has joined #RubyOnRails
[00:46:38] baweaver: has joined #RubyOnRails
[00:47:57] a346: has joined #RubyOnRails
[00:48:05] FailBit: my applicationcontroller takes 23ms to run through
[00:48:10] FailBit: I think I know what ima focus on
[00:48:46] Maletor: quazimodo: well, are you gonna ask it or just feign?
[00:48:59] Radar: might need another kick
[00:49:05] mices: i have multiple no longer wanted git username and email addresses how do i remove them
[00:49:06] Radar: Radar kicked quazimodo: thanks
[00:49:08] colleenmcguckin: has joined #RubyOnRails
[00:49:15] Radar: Let's see if that fixes it.
[00:49:21] Maletor: Radar: didn't realize he was a nuisicane. didn't mean to encourage it.
[00:49:23] FailBit: https://github.com/heroku/rack-timing
[00:49:29] Radar: maletor: Continuously.
[00:49:56] Radar: maletor: he always does this
[00:50:03] Radar: then takes > 15m to show his code
[00:50:10] mices: when i run `git config --global --list` i see multiple accounts
[00:50:17] Radar: and then it's either a) too complex to even begin debugging or b) an easy mistake
[00:50:19] FailBit: #triggered
[00:50:50] Radar: mices: git config --help will show you options for that.
[00:50:52] Maletor: ya, forget it
[00:51:11] Tref: has joined #RubyOnRails
[00:51:29] quazimodo: has joined #RubyOnRails
[00:51:59] dtordable: has joined #RubyOnRails
[00:52:17] rubyonrailed: has joined #RubyOnRails
[00:52:52] Radar: quazimodo: wb
[00:53:36] pyemkey: has joined #RubyOnRails
[00:55:12] scmx: has joined #RubyOnRails
[00:58:11] nya: has joined #RubyOnRails
[00:58:19] colleenmcguckin: has joined #RubyOnRails
[00:59:08] rgrmatt: has joined #RubyOnRails
[01:02:19] lemur: has joined #RubyOnRails
[01:03:48] annlewis: has joined #RubyOnRails
[01:04:09] darrencauthon: has joined #RubyOnRails
[01:06:13] rubyonrailed: has joined #RubyOnRails
[01:06:16] flashpoint9: has joined #RubyOnRails
[01:06:27] blackmes1: has joined #RubyOnRails
[01:06:34] bruno-: has joined #RubyOnRails
[01:07:09] chipotle: has joined #RubyOnRails
[01:07:37] rgrmatt: has joined #RubyOnRails
[01:08:29] podman: has joined #RubyOnRails
[01:08:41] ahills: has joined #RubyOnRails
[01:09:05] joshkovach: has joined #RubyOnRails
[01:09:31] ahills: Hey, in an erb template using form_for, my labels keep getting title-cased. How do I make that stop?
[01:10:53] Ropeney: ahills: en.yml or pass it a custom label?
[01:10:58] Axsuul: has joined #RubyOnRails
[01:11:08] ahills: Custom label meaning a custom helper?
[01:11:34] ahills: Ropeney: I'd rather use the locale, but will I be able to use e.g. link_to there?
[01:11:43] Ropeney: <% f.label :this, 'that' %>
[01:11:54] ahills: Right, in that case, "that" is getting title-cased
[01:11:57] ahills: I want that to stop
[01:13:09] Ropeney: i haven't ever looked at that, but would using css work for you?
[01:13:28] ahills: Using CSS in what way?
[01:13:31] axl_: has joined #RubyOnRails
[01:13:40] Ropeney: text-transform: lowercase;
[01:13:55] honestemu: has joined #RubyOnRails
[01:14:02] ahills: Oh, probably not. I need the exact casing I provide to be preserved.
[01:14:49] Axsuul: has joined #RubyOnRails
[01:16:33] LateralOctober: has joined #RubyOnRails
[01:17:00] Ropeney: ahills: `<%= f.label :this, 'that' %>` doesnt downcase 'that' for me
[01:17:08] Ropeney: i mean capitalise*
[01:17:27] ahills: Hmm, I'm using ActionView 4.1.13
[01:17:31] ahills: Maybe this is configurable
[01:17:47] Ropeney: ` <%= owner.label :email, 'eMaIl' %>` comes formatted exactly
[01:18:02] bruce_lee: has joined #RubyOnRails
[01:18:16] ahills: Is `owner` in that case the argument to the `form_for` block?
[01:18:33] Ropeney: yeah form_for do |owner| instead of |f|
[01:18:50] Fire-Dragon-DoL: has joined #RubyOnRails
[01:19:04] ahills: Weird; must be something wrong with my configuration then
[01:19:05] Ropeney: check your css isn't applying text-transform: capitalize
[01:19:12] ahills: Oh, good call
[01:19:34] ahills: Hah! That was it. Thanks Ropeney!
[01:19:41] Ropeney: ahills: np's :D
[01:22:38] applegrain: has joined #RubyOnRails
[01:22:53] owenjones: has joined #RubyOnRails
[01:24:19] owenjones: has joined #RubyOnRails
[01:27:31] northfurr: has joined #RubyOnRails
[01:29:20] willharrison: has joined #RubyOnRails
[01:30:07] twilling: has joined #RubyOnRails
[01:30:40] Scripore: has joined #RubyOnRails
[01:30:47] goodcodeguy: has joined #RubyOnRails
[01:31:37] Glenny: has joined #RubyOnRails
[01:35:14] gusrub: has joined #RubyOnRails
[01:42:38] htmldrum: has joined #RubyOnRails
[01:42:40] RegulationD: has joined #RubyOnRails
[01:43:24] uri: has joined #RubyOnRails
[01:46:26] colleenmcguckin: has joined #RubyOnRails
[01:48:02] rgrmatt: has joined #RubyOnRails
[01:48:54] Antoine59: has joined #RubyOnRails
[01:51:56] bobbobbins: has joined #RubyOnRails
[01:53:07] mices: options such as :confirmable and :registerable should be passed to `rails g devise:install` but not `rails g devise Model` ?
[01:53:57] wldcordeiro: has joined #RubyOnRails
[01:54:36] rgrmatt: has joined #RubyOnRails
[01:54:52] mices: no which?
[01:55:28] sevenseacat: you don't pass the strategies to rails g devise:install.
[01:55:38] sevenseacat: the docs do not say you can do this.
[01:55:45] sevenseacat: and it doesnt make sense to do this.
[01:56:36] colleenmcguckin: has joined #RubyOnRails
[01:56:52] njero: has joined #RubyOnRails
[01:57:22] mices: so then neither, these methods should just be manually placed in my models?
[01:57:56] sevenseacat: you dont need to 'place' then anywhere - they're already in your devise-generated models
[01:58:16] mices: confirmable wouldn't be by default
[01:58:38] sevenseacat: did you look in the model?
[01:58:46] sevenseacat: they're all listed. some are commented out.
[01:59:48] mices: what about when i run `rails generate devise:views`
[02:00:54] sevenseacat: what about it?
[02:03:09] lemur: has joined #RubyOnRails
[02:03:12] foucist: has joined #RubyOnRails
[02:04:32] annlewis: has joined #RubyOnRails
[02:04:42] iamse7en: has joined #RubyOnRails
[02:05:54] mices: how does rails know to generate the views that are for my options like :registerable
[02:06:00] flip_digits: has joined #RubyOnRails
[02:06:12] sevenseacat: it generates them all.
[02:06:28] FailBit: mmm delicious
[02:06:30] FailBit: https://i.imgur.com/aSBupQw.png
[02:06:56] FailBit: this is what happens when I remove a transaction that executes on every pageload, and swap it out for one that is cached by minute
[02:07:07] mices: sevenseacat: ty
[02:07:18] sevenseacat: mices: which would have been immediately obvious if you'd just tried it.
[02:08:18] mices: i thought i had the experience where views were missing because i failed to pass the options to the generator
[02:08:35] bruno-: has joined #RubyOnRails
[02:10:38] FailBit: well since you're using VCS you can easily back out any change you make
[02:11:16] nickenchuggets: has joined #RubyOnRails
[02:11:16] nickenchuggets: has joined #RubyOnRails
[02:11:36] tlarevo: has joined #RubyOnRails
[02:13:06] mghaig: has joined #RubyOnRails
[02:13:40] smathy: has joined #RubyOnRails
[02:14:04] axl_: has joined #RubyOnRails
[02:14:24] dtordable: that Ruby on Rails seem powerful...
[02:14:33] roxtrongo: has joined #RubyOnRails
[02:14:42] chrisarcand: Anyone have some experience with the internals of the intridea/omniauth gem?
[02:14:57] helpa: Nope. No one. Ever. In the history of the world.
[02:15:05] map7: has joined #RubyOnRails
[02:15:16] chrisarcand: Thanks, I guess I'll look elsewhere... ;)
[02:15:43] chrisarcand: I'm trying to figure out where exactly the /auth/:provider route(s) are added by it
[02:16:22] sevenseacat: I don't think it does
[02:16:34] sevenseacat: but I'm looking
[02:17:21] chrisarcand: It surely does... https://github.com/intridea/omniauth/wiki "By default, OmniAuth will configure the path /auth/:provider. It is created by OmniAuth automatically for you, and you will start the auth process by going to that path."
[02:17:22] DanielN: has joined #RubyOnRails
[02:17:44] chrisarcand: I just can't figure out where :/
[02:20:07] sevenseacat: https://github.com/intridea/omniauth/blob/master/lib/omniauth/strategy.rb#L379-L395 seems relevant
[02:20:48] dtordable: a question: what options are about authentication in Rails?
[02:21:56] sevenseacat: dtordable: devise is the standard that a lot of apps use.
[02:22:48] spastorino: has joined #RubyOnRails
[02:22:54] null__: has joined #RubyOnRails
[02:22:55] levifig: has joined #RubyOnRails
[02:23:04] chrisarcand: sevenseacat: Seems right to me. Thanks!
[02:23:11] purplexed-: has joined #RubyOnRails
[02:23:42] sevenseacat: chrisarcand: I'm not sure how that gets translated into actually accepting requests on those paths, but that seems like where the paths are generated :)
[02:24:20] mhenrixon_: has joined #RubyOnRails
[02:24:33] rgrmatt: has joined #RubyOnRails
[02:24:40] chrisarcand: It's a lot closer than I was before. With this I should be able to just get a trace and go from there. Thanks again
[02:26:22] iamdevnul: has joined #RubyOnRails
[02:27:17] rickmasta: has joined #RubyOnRails
[02:27:31] barttenbrinke: has joined #RubyOnRails
[02:27:31] nomadicoder: has joined #RubyOnRails
[02:27:42] vdmo_: has joined #RubyOnRails
[02:27:46] fedexo: has joined #RubyOnRails
[02:27:52] crystalneth: has joined #RubyOnRails
[02:28:06] cjk101010: has joined #RubyOnRails
[02:28:19] MuffinPimp: has joined #RubyOnRails
[02:28:22] leeky: has joined #RubyOnRails
[02:29:26] yaewa: has joined #RubyOnRails
[02:29:44] twilling: has joined #RubyOnRails
[02:29:50] Trynemjoel: has joined #RubyOnRails
[02:32:35] bmalum: has joined #RubyOnRails
[02:33:53] Radar: I have had lunch. All is right with the world.
[02:33:54] null__: has joined #RubyOnRails
[02:33:57] banister: has joined #RubyOnRails
[02:34:12] Radar: Surprised that quazimodo didn't share his bug yet. Must still be Gisting his code.
[02:34:42] bobbobbi_: has joined #RubyOnRails
[02:34:51] sevenseacat: but it was the weirdest bug *ever*
[02:35:23] exadeci: has joined #RubyOnRails
[02:35:53] null__: has joined #RubyOnRails
[02:36:13] Sirecote: has joined #RubyOnRails
[02:36:19] ja: has joined #RubyOnRails
[02:36:47] htmldrum: has joined #RubyOnRails
[02:37:05] sunya7a_1: has joined #RubyOnRails
[02:37:42] funnel: has joined #RubyOnRails
[02:38:21] sparr: has joined #RubyOnRails
[02:41:06] pydave6367: has joined #RubyOnRails
[02:42:17] zly: has joined #RubyOnRails
[02:42:17] wwalker: has joined #RubyOnRails
[02:42:30] slash_ni1k: has joined #RubyOnRails
[02:42:36] dtordabl1: has joined #RubyOnRails
[02:43:20] Grag_Harker: has joined #RubyOnRails
[02:44:21] null__: has joined #RubyOnRails
[02:44:21] dtordable: has joined #RubyOnRails
[02:44:21] rromanchuk: has joined #RubyOnRails
[02:44:21] solars: has joined #RubyOnRails
[02:44:21] slash_nick: has joined #RubyOnRails
[02:44:21] GragHarker: has joined #RubyOnRails
[02:44:21] fluchtreflex: has joined #RubyOnRails
[02:44:22] ivanyk_: has joined #RubyOnRails
[02:44:22] bl0m1: has joined #RubyOnRails
[02:44:22] OmegaA: has joined #RubyOnRails
[02:44:22] mcr-credil: has joined #RubyOnRails
[02:44:22] rhizome: has joined #RubyOnRails
[02:44:22] adamholt: has joined #RubyOnRails
[02:44:22] IceBear: has joined #RubyOnRails
[02:44:22] insu: has joined #RubyOnRails
[02:44:22] cookiez: has joined #RubyOnRails
[02:44:22] ciree: has joined #RubyOnRails
[02:44:22] cookiez: has joined #RubyOnRails
[02:44:40] cjk101010: has joined #RubyOnRails
[02:44:49] owenjones: has joined #RubyOnRails
[02:45:02] null__: has joined #RubyOnRails
[02:46:19] adamholt: has joined #RubyOnRails
[02:47:02] sikachu: has joined #RubyOnRails
[02:47:16] sdwrage: has joined #RubyOnRails
[02:47:39] hardtail: has joined #RubyOnRails
[02:48:00] ElSif: has joined #RubyOnRails
[02:48:05] koprom: has joined #RubyOnRails
[02:48:40] nibbo: has joined #RubyOnRails
[02:51:03] StevePotayTeo: has joined #RubyOnRails
[02:51:23] blackmes1: has joined #RubyOnRails
[02:51:48] hardtail: has joined #RubyOnRails
[02:53:05] srinidhi: has joined #RubyOnRails
[02:53:23] thecyclone: has joined #RubyOnRails
[02:56:16] sankaber: has joined #RubyOnRails
[02:56:24] pyemkey: has joined #RubyOnRails
[02:57:23] StevePotayTeo: has joined #RubyOnRails
[03:02:37] sadaf2606: has joined #RubyOnRails
[03:04:41] wa_r_ch_i__ld1: has joined #RubyOnRails
[03:05:09] A124: has joined #RubyOnRails
[03:05:27] annlewis: has joined #RubyOnRails
[03:06:58] et09: has joined #RubyOnRails
[03:07:07] makenoise: has joined #RubyOnRails
[03:07:16] wa_r_ch_i__ld1: hey, anyone know how to submit browser based authentication popups with mechanize or another gems?
[03:08:35] wa_r_ch_i__ld1: it seems it can be done with capybara
[03:08:39] wa_r_ch_i__ld1: so i'd expect theres a way
[03:08:43] Maletor: has joined #RubyOnRails
[03:09:29] Senjai: has joined #RubyOnRails
[03:09:35] bruno-: has joined #RubyOnRails
[03:11:28] Aeyrix: wa_r_ch_i__ld1: Honestly, no.
[03:11:51] Aeyrix: What you're trying to do is a flagrant ignorance of general browser and web application security mechanisms.
[03:12:15] Aeyrix: If whoever you're building this for is too incompetent or lazy to enter their credentials then they don't need something that caters to that, they need a slap.
[03:12:42] wa_r_ch_i__ld1: @Aeyrix I think i need to set up my own reverse proxy or something to do this
[03:12:53] tlarevo: has left #RubyOnRails: ()
[03:13:49] wa_r_ch_i__ld1: unfortunately i have no idea how to do that :)
[03:14:00] Coldblackice: has joined #RubyOnRails
[03:14:51] axl_: has joined #RubyOnRails
[03:16:00] DLSteve: has joined #RubyOnRails
[03:16:16] noah256: has joined #RubyOnRails
[03:17:58] MartinElvar: has joined #RubyOnRails
[03:21:21] EminenceHC: has joined #RubyOnRails
[03:22:00] iateadonut: has joined #RubyOnRails
[03:23:17] LambdaSource: has joined #RubyOnRails
[03:25:02] northfurr: has joined #RubyOnRails
[03:28:03] dented42: has joined #RubyOnRails
[03:33:23] makenoise: has joined #RubyOnRails
[03:35:24] makenoise: has joined #RubyOnRails
[03:36:47] foucist: has joined #RubyOnRails
[03:37:31] wa_r_ch_i__ld1: has joined #RubyOnRails
[03:39:07] wa_r_ch_i__ld1: I'm trying to click this link with mechanize that creates a new tab temporarily, that turns into a file download. How can I "catch" the download?
[03:39:07] wa_r_ch_i__ld1: a = agent.page.links.last.click
[03:39:07] wa_r_ch_i__ld1: Mechanize::ResponseCodeError: 500 => Net::HTTPInternalServerError for http://ryeweb1.cblpath.local/Reports/Pages/Report.aspx# -- unhandled response
[03:39:51] waka: has joined #RubyOnRails
[03:40:35] wa_r_ch_i__ld1: might have found something http://stackoverflow.com/questions/4360043/using-wwwmechanize-to-download-a-file-to-disk-without-loading-it-all-in-memory
[03:42:50] IrishGringo: has joined #RubyOnRails
[03:44:05] RegulationD: has joined #RubyOnRails
[03:45:43] owenjones: has joined #RubyOnRails
[03:50:19] pawnbox_: has joined #RubyOnRails
[03:50:21] owenjones: has joined #RubyOnRails
[03:52:08] sankaber: has joined #RubyOnRails
[03:53:42] crystalneth: has joined #RubyOnRails
[03:55:47] northfurr: has joined #RubyOnRails
[03:55:55] baweaver: has joined #RubyOnRails
[03:57:17] threeminutemonta: has joined #RubyOnRails
[03:57:58] gambl0re: has joined #RubyOnRails
[03:59:44] quazimodo: Radar: actually, it was a problem with the ruby that was installed on the machine. in fact there was no source code to to share, a defined constant was being 'undefined' on each request to the server
[03:59:54] quazimodo: so we rebuilt the ruby and all is fine
[04:03:38] rhizome: that's no fun
[04:05:31] wa_r_ch_i__ld1: is there a way to append NTLM credentials to a url? for basic auth you can do (username:password@url)
[04:06:04] annlewis: has joined #RubyOnRails
[04:07:38] Guest20058: has joined #RubyOnRails
[04:07:44] rhizome: you mean like http
[04:07:47] quazimodo: rhizome: i knew it was something super weird the second i saw what it was doing
[04:08:00] quazimodo: oh, you're talking to wa_r_ch_i__ld1
[04:08:10] rhizome: the no fun was to you
[04:08:19] quazimodo: oh. nah it didn't take long to fix
[04:08:23] twilling: has joined #RubyOnRails
[04:08:55] wa_r_ch_i__ld1: @rhizome yeah, for ntlm not basic http though
[04:09:04] rhizome: random weirdness you only fix once
[04:09:13] rhizome: wa_r_ch_i__ld1: just use a gem
[04:09:26] wa_r_ch_i__ld1: @rhizome which one?
[04:09:30] Maletor: has joined #RubyOnRails
[04:09:31] rhizome: i don't care
[04:10:19] bruno-: has joined #RubyOnRails
[04:11:42] braincrash: has joined #RubyOnRails
[04:11:53] quazimodo: rhizome: yeah
[04:12:02] quazimodo: rhizome: except that i get 2 of those a day here
[04:12:42] rhizome: why is ruby always broken there
[04:13:43] quazimodo: not ruby, but we have so many clients and so many environments and so many workers
[04:13:52] quazimodo: i always get dragged into stuff
[04:15:50] axl_: has joined #RubyOnRails
[04:17:16] ratmav: has joined #RubyOnRails
[04:19:48] LudicrousMango: has joined #RubyOnRails
[04:20:02] smoitra: has joined #RubyOnRails
[04:20:57] sankaber: has joined #RubyOnRails
[04:23:58] northfurr: has joined #RubyOnRails
[04:25:45] djbkd: has joined #RubyOnRails
[04:31:19] bruce_lee: has joined #RubyOnRails
[04:35:40] qwertyqwerty: has joined #RubyOnRails
[04:35:50] qwertyqwerty: Hi, I have a InvalidAuthenticityToken problem, in my RoR 4 application, can anyone help me?
[04:36:33] Radar: qwertyqwerty: !ncnh
[04:36:33] helpa: qwertyqwerty: If you don't provide any code, it becomes really difficult for us to help you. Providing code to reproduce the problem increases your chances of getting great, accurate help immensely.
[04:37:50] foucist: has joined #RubyOnRails
[04:38:43] quazimodo: qwertyqwerty: doing any ajax?
[04:38:49] quazimodo: or api requests
[04:40:10] Tokenizer: has joined #RubyOnRails
[04:40:17] ciree: has joined #RubyOnRails
[04:42:00] qwertyqwerty: so, my problem is that I am trying to set up my ruby on rails app so that payments can be made via paypal. I can do most of this (redirects from my site to sandbox.paypal, accepts money), but when I try to get it to redirect back to my site, it has an InvalidAuthenticityToken problem
[04:42:06] qwertyqwerty: I have tried putting a few things in my controller
[04:42:20] qwertyqwerty: # protect_from_forgery except: [:hook]
[04:42:20] qwertyqwerty: #protect_from_forgery with: :null_session
[04:42:20] qwertyqwerty: skip_before_filter :verify_authenticity_token, only: [:hook]
[04:42:27] qwertyqwerty: but none work
[04:42:40] qwertyqwerty: there is discussion on this point on various pages on stackoverflow
[04:43:00] qwertyqwerty: but I think some of these only work for earlier versions of RoR
[04:43:06] qwertyqwerty: I am using Rails 4
[04:43:11] solars: has joined #RubyOnRails
[04:43:21] qwertyqwerty: 4.0.7, to be precise
[04:43:25] blackmes1: has joined #RubyOnRails
[04:43:29] wa_r_ch_i__ld1: has joined #RubyOnRails
[04:46:04] tlarevo_: has joined #RubyOnRails
[04:46:23] Radar: qwertyqwerty: Have you considered using Braintree's v.zero interface instead?
[04:46:36] Radar: It allows for payments through to Braintree and is much easier to setup.
[04:46:41] Radar: qwertyqwerty: This is hard to debug without some code from you.
[04:51:23] rickmasta: has joined #RubyOnRails
[04:51:31] Tokenizer: has joined #RubyOnRails
[04:51:35] x-light: has joined #RubyOnRails
[04:51:51] qwertyqwerty: hmm, I didn't know about braintree's v.zero interface
[04:51:58] qwertyqwerty: although, that won't solve my problem
[04:52:20] qwertyqwerty: as I still don't know how to stop checking my authenticity token from a foreign site back to my site
[04:52:36] qwertyqwerty: Radar, which code did you want?
[04:52:46] Radar: qwertyqwerty: Anything to reproduce the issue.
[04:53:06] Radar: qwertyqwerty: Braintree's v.zero submits to Braintree in an iframe, which then submits a payment_method_nonce to your application
[04:53:22] Radar: So it's not submitting anything back from their site to yours. It all gives a pretty good illusion that you're on the same application.
[04:54:52] qwertyqwerty: ok....does braintree do stripe as well?
[04:55:31] Radar: Braintree offers a very comparable solution to Stripe.
[04:55:39] Radar: And I think because it supports PayPal too it just edges out Stripe.
[04:56:16] qwertyqwerty: i am reading more about braintree
[04:56:41] shinenelson: has joined #RubyOnRails
[04:58:09] Aeyrix: Why not just use Paypal?
[04:58:26] Aeyrix: You can support both credit card payments and Paypal payments with it.
[04:58:29] pyemkey: has joined #RubyOnRails
[04:58:36] qwertyqwerty: good question, aeyrix. I don't know the answer.
[05:00:03] qwertyqwerty: perhaps it is that braintree gives the illusion of not leaving your site. but paypal, definitely you are leaving your site.
[05:00:27] Aeyrix: I don't want people thinking I store their payment details, ever.
[05:00:33] Aeyrix: I don't handle it and I don't want to.
[05:00:42] qwertyqwerty: good point, aeyrix
[05:01:05] wa_r_ch_i__ld1: does Ruby have the equivalent of Java's KeyEvent (i.e to generate a keyboard input)?
[05:01:23] qwertyqwerty: do you use paypal in a ruby on rails application, aeyrix?
[05:01:29] qwertyqwerty: warchild1, i don't know
[05:01:56] qwertyqwerty: aeyrix, when you redirect from paypal back to your own site, how do you ignore your authenticity token?
[05:02:02] qwertyqwerty: and, which version of rails do you use?
[05:02:10] Aeyrix: qwertyqwerty: Why would you want to ignore the auth token?
[05:02:41] Aeyrix: qwertyqwerty: https://github.com/paypal/PayPal-Ruby-SDK
[05:02:46] Aeyrix: Paypal make it super easy.
[05:03:06] qwertyqwerty: because.... paypal is sending a message "payment success" or "payment failure", and apparently we need to leave a hole to let this data through
[05:03:31] qwertyqwerty: *shrugs* i'm still learning about this topic
[05:03:31] Aeyrix: https://github.com/paypal/PayPal-Ruby-SDK#execute-payment
[05:03:43] Aeyrix: Whoever is telling you whatever they're telling you needs to read the docs.
[05:04:29] dionysus69: has joined #RubyOnRails
[05:05:20] dionysus69: has joined #RubyOnRails
[05:05:29] smathy: has joined #RubyOnRails
[05:05:41] qwertyqwerty: thanks for that link, aeyrix. maybe that is a better tutorial to follow.
[05:06:28] qwertyqwerty: i have been avoiding adding paypal (or other payment method) to my app for some time, so that i can get as much information as possible, so that i don't let nasty security problems in to my app
[05:06:50] annlewis: has joined #RubyOnRails
[05:07:09] rhizome: money is so overrated
[05:10:13] erbse: has joined #RubyOnRails
[05:10:17] Maletor: has joined #RubyOnRails
[05:11:22] bruno-: has joined #RubyOnRails
[05:12:30] qwertyqwerty: i gotta go. thanks for your help radar, aeyrix, rhizome for your single random comment
[05:12:48] Tokenizer: has joined #RubyOnRails
[05:13:41] sadaf2605: has joined #RubyOnRails
[05:14:33] Aeyrix: >rhizome for your single random comment
[05:15:25] Radar: Braintree is definitely what he could use to process those payments
[05:15:31] Radar: their v.zero stuff is so slick
[05:15:39] Radar: Coming soon to a Marketplacer checkout near you, too.
[05:15:47] Radar: #spoilers
[05:15:51] smathy: Tough day for rhizome, got caught up in antoine__gate earlier too.
[05:15:58] Aeyrix: smathy: ??
[05:16:41] axl_: has joined #RubyOnRails
[05:16:53] smathy: [2015-11-12T14:04:50-0700] <tubbo> antoine__: correct. matthewd, smathy, rhizome, and arup_r are entirely without honor. #klingons
[05:17:53] smathy: http://logs.ryanbigg.com/RubyOnRails?date=2015-11-12#4546364
[05:18:00] Radar: hilarity.
[05:18:08] smathy: Just one of those hilarious moments.
[05:21:10] Radar: To set up an akick for furtherr hilarity, or to not setup an akick.
[05:21:13] Aeyrix: HONOR IN TEACHING
[05:21:31] Aeyrix: akicks are always hilarity
[05:21:39] Rodya_: has joined #RubyOnRails
[05:21:47] Radar: My tests might be passing very soonl
[05:21:53] Radar: Time to nominate someone else on my team to review it
[05:21:57] Tref: has joined #RubyOnRails
[05:21:58] Radar: then we ship at 4:30pm on a Friday
[05:21:59] Radar: Then go to the pub
[05:22:02] smathy: Potatoes have skin. I have skin. Therefore, I am a potato.
[05:22:15] smathy: An actual single random comment ^
[05:22:49] mary5030: has joined #RubyOnRails
[05:24:51] Rodya_: has joined #RubyOnRails
[05:25:43] Cache_Money: has joined #RubyOnRails
[05:27:05] Maletor: has joined #RubyOnRails
[05:27:27] crystalneth: has joined #RubyOnRails
[05:29:50] johnflux: has joined #RubyOnRails
[05:29:51] johnflux: has joined #RubyOnRails
[05:30:22] yfeldblum: has joined #RubyOnRails
[05:31:17] Nuck: I hate my boss so much. So, I'm stuck engineering some Rails disaster with engines and crap to share models because my boss promised a client a specific architecture
[05:31:41] Nuck: He had originally planned to copy+paste his PHP app multiple times but decided to have me do it in Rails instead... with the same architecture
[05:32:08] Nuck: Fun fact: half the goddamn gems in this world break when you use them in a Rails Engine
[05:32:23] smathy: Fun fact, there are other jobs out there.
[05:32:46] Nuck: I'm so close to ditching out
[05:33:26] Nuck: Just telling him it's either (1) give me better pay and complete control of the architecture or (2) I'll find a better job
[05:33:43] smathy: Find a better job first.
[05:33:43] xardion: has joined #RubyOnRails
[05:33:50] Nuck: Probably a good plan
[05:34:40] Rodya_: has joined #RubyOnRails
[05:36:59] simplyianm: has joined #RubyOnRails
[05:37:55] dopie: I need some help with something that is happening I am uploading videos using carrierwave-aws and playing them with the video.js ... My problem is that the sound is playing but the video isn't
[05:38:04] dopie: how can i debug this?
[05:40:20] pydave6367: has joined #RubyOnRails
[05:41:57] sdwrage: has joined #RubyOnRails
[05:42:26] Rodya_: has joined #RubyOnRails
[05:44:12] blackmes1: has joined #RubyOnRails
[05:44:54] RegulationD: has joined #RubyOnRails
[05:45:31] Rodya_: has joined #RubyOnRails
[05:49:30] DanielN: has joined #RubyOnRails
[05:50:01] rromanch_: has joined #RubyOnRails
[05:51:59] simkessy: Hi, looking for some advice on a good way to track searches (params, date/time, etc) on my site? I was considering creating a model for it and whenever someone makes a request, saving relevant data to that search_table. Would this be a decent solution or should I look into using logs instead or anything else I may not have considered?
[05:53:31] rickmasta: has joined #RubyOnRails
[05:59:08] smathy: simkessy, using a model/table is a decent solution, make it an ActiveJob if you're concerned about performance.
[06:00:11] simplyianm: has joined #RubyOnRails
[06:00:59] rvanlieshout: has joined #RubyOnRails
[06:01:08] krramos: has joined #RubyOnRails
[06:01:18] simkessy: Well I have sidekiq setup now so I guess that shouldn't be too challenging to setup
[06:01:31] nickenchuggets: has joined #RubyOnRails
[06:01:34] djbkd: has joined #RubyOnRails
[06:03:01] tubbo: not at all `rails g job TrackSearches` :)
[06:05:14] skyjumper: is it possible to read/write the session hash in a request spec?
[06:05:30] pimpin: has joined #RubyOnRails
[06:05:41] tubbo: skyjumper: yes. `get your_route, { param: true }, { session_user_id: 'some-value' }
[06:05:41] skyjumper: i'm converting a controller spec to request, and it uses the session
[06:05:54] simkessy: sounds good, thanks lads
[06:05:58] tubbo: oh that's ok, i'm pretty sure it's the same DSL skyjumper
[06:06:13] beast_: has joined #RubyOnRails
[06:06:17] skyjumper: this spec uses 'session' directly
[06:06:22] dopie: Anyone want to help me debug this video problem I am having on a pair?? I will pay
[06:06:22] skyjumper: but that's definitely better
[06:06:37] trosborn: has joined #RubyOnRails
[06:07:09] smathy: dopie, it really didn't sound like a Rails problem, maybe you should seek help in the video.js realm.
[06:07:36] annlewis: has joined #RubyOnRails
[06:09:35] chrissonar: has joined #RubyOnRails
[06:12:20] maletor_: has joined #RubyOnRails
[06:12:21] bruno-: has joined #RubyOnRails
[06:15:21] ur5us: has joined #RubyOnRails
[06:16:45] skyjumper: tubbo: are you sure that 3rd argument is for the session? looks like it sets http headers
[06:17:16] dhjondoh: has joined #RubyOnRails
[06:17:22] axl_: has joined #RubyOnRails
[06:18:05] x-light: has joined #RubyOnRails
[06:19:12] dopie: smathy, someone with the experience in video and was might be of help.... I will actually for this help
[06:19:32] framling: has joined #RubyOnRails
[06:21:12] rvanlieshout: dopie: you could also just try to explain the problem you're having here?
[06:21:37] tvw: has joined #RubyOnRails
[06:22:09] smathy: skyjumper, I think tubbo thought you were using controller specs, request specs are just a thin wrapper around integration tests, so yes third arg is headers, here's your docs: http://devdocs.io/rails/actiondispatch/integration/requesthelpers#method-i-post
[06:22:46] kerunaru: has joined #RubyOnRails
[06:22:57] skyjumper: yeah i'm looking at that. doesn't seem like you can (or should) mess with the controller's session from the test
[06:23:03] skyjumper: though that worked in controller tests
[06:25:36] smathy: skyjumper, correct, for an integration test you will set up the session by loading the pages that set up the session, not via a direct interface from the test.
[06:25:53] sadaf2606: has joined #RubyOnRails
[06:25:59] smathy: skyjumper, controller tests are different because they don't load the routing engine, so you can interact directly with the session.
[06:27:40] smathy: ...but, eg. you can't interact with the headers in a controller test.
[06:30:05] arup_r: has joined #RubyOnRails
[06:30:31] rickmasta: has joined #RubyOnRails
[06:31:20] mozzarella: has joined #RubyOnRails
[06:31:26] pimpin: has joined #RubyOnRails
[06:31:57] jessemcgilallen: has joined #RubyOnRails
[06:33:31] pydave6367: has joined #RubyOnRails
[06:34:11] dopie: smathy, you're right
[06:34:16] dopie: its an encoding issue
[06:34:53] tenderlo_: has joined #RubyOnRails
[06:36:04] pydave6367: shangxiao: Must have missed it!
[06:36:36] pydave6367: has joined #RubyOnRails
[06:38:19] krramos: has left #RubyOnRails: ()
[06:38:28] K_r3aPeR: has joined #RubyOnRails
[06:38:46] mary5030: has joined #RubyOnRails
[06:40:27] dtordable: has joined #RubyOnRails
[06:42:33] dtordable: hello, anyone!
[06:42:51] aganov: has joined #RubyOnRails
[06:43:25] Axsuul: has joined #RubyOnRails
[06:44:26] dtordable: a little question: do Devise is the best for authentication?
[06:45:13] mary5030: has joined #RubyOnRails
[06:45:14] dopie: dtordable, no
[06:45:35] smathy: dtordable, like everything, it depends.
[06:45:52] dtordable: probably...
[06:45:53] ghanima: has joined #RubyOnRails
[06:45:58] dopie: https://github.com/NoamB/sorcery
[06:46:05] dopie: dtordable, why did you lave?
[06:46:45] dtordable: in securing things
[06:47:09] dtordable: there's a good premise
[06:47:15] Paradox: has joined #RubyOnRails
[06:47:49] dtordable: anything secure is insecure
[06:47:59] dtordable: or whatever
[06:48:42] AnoHito: has joined #RubyOnRails
[06:52:44] Spami: has joined #RubyOnRails
[06:56:06] dionysus69: has joined #RubyOnRails
[06:59:14] cesario: has joined #RubyOnRails
[06:59:30] dionysus69: has joined #RubyOnRails
[07:00:03] roxtrongo: has joined #RubyOnRails
[07:00:10] xcesariox: has joined #RubyOnRails
[07:00:18] pyemkey: has joined #RubyOnRails
[07:00:49] ibouvousaime_: has joined #RubyOnRails
[07:01:30] xcesariox: please kindly update the topic
[07:01:39] xcesariox: Rails 4.2.5 is out.
[07:02:47] dtordable: dopie: I'll follow you blindly :)
[07:03:02] sevenseacat: oh really? cool
[07:03:19] xcesariox: sevenseacat : update the topic?
[07:03:29] xcesariox: sevenseacat : do you enough access to update the chan topic?
[07:03:32] sevenseacat: yeah give me more than one second
[07:03:40] xcesariox: sevenseacat : okay great. (:
[07:04:37] sevenseacat: I'll wait until there's a blog post about the release, to link to
[07:04:39] xcesariox: quazimodo : update your gem buddy.
[07:04:50] xcesariox: sevenseacat : Aye!
[07:05:21] beast__: has joined #RubyOnRails
[07:05:24] xcesariox: sevenseacat : http://weblog.rubyonrails.org/2015/11/6/Rails-4-2-5-rc2-and-4-1-14-rc2-have-been-released/ ?
[07:06:05] arup_r: has joined #RubyOnRails
[07:06:15] xcesariox: sevenseacat : oh ya!
[07:06:29] xcesariox: sevenseacat : they haven't update it to the final on the blog.
[07:06:44] sevenseacat: hence why i said i'll wait.
[07:06:52] Pazician: has joined #RubyOnRails
[07:07:38] xcesariox: sevenseacat : alright, brb going out for lunch.
[07:08:23] annlewis: has joined #RubyOnRails
[07:08:48] beast: has joined #RubyOnRails
[07:09:25] foucist: has joined #RubyOnRails
[07:10:36] dopie: dtordable, what?
[07:13:02] maletor_: has joined #RubyOnRails
[07:13:08] bruno-: has joined #RubyOnRails
[07:14:14] kerunaru: has joined #RubyOnRails
[07:15:12] pimpin: has joined #RubyOnRails
[07:17:56] axl_: has joined #RubyOnRails
[07:18:00] dtordable: dopie: tha I'll use that method for auth :)
[07:23:06] Cervajz_: has joined #RubyOnRails
[07:24:21] x-light: has joined #RubyOnRails
[07:24:58] rgtk: has joined #RubyOnRails
[07:26:33] wa_r_ch_i__ld1: how to check if "Authentication Required" (from browser) popup is open?
[07:27:03] ruurd: has joined #RubyOnRails
[07:28:34] BrisketBronson: has joined #RubyOnRails
[07:31:02] Radar: wa_r_ch_i__ld1: nobody has an answer for you :(
[07:31:06] Radar: wa_r_ch_i__ld1: !rule11
[07:31:06] helpa: wa_r_ch_i__ld1: Do not repeat your question every 5 minutes expecting somebody to answer it. If you do not get a reply after the first time perhaps posting your question on StackOverflow (http://stackoverflow.com) would help you. Linking to the question in the channel after you've posted it is OK.
[07:31:17] wa_r_ch_i__ld1: this is a different question now
[07:31:44] wa_r_ch_i__ld1: im trying to implement an event listener for that window in Rails/Bash
[07:31:50] pimpin: has joined #RubyOnRails
[07:34:29] Radar: It isn't a Rails specific question
[07:35:22] framling: has joined #RubyOnRails
[07:36:07] beast_: has joined #RubyOnRails
[07:36:12] krz: has joined #RubyOnRails
[07:38:13] rickmasta: has joined #RubyOnRails
[07:38:28] Axsuul: has joined #RubyOnRails
[07:38:39] wa_r_ch_i__ld1: @Radar well how could I poll for the window in Rails?
[07:38:42] wa_r_ch_i__ld1: i am making gist now
[07:38:44] Radar: You don't.
[07:38:51] Radar: Rails does nothing with windows.
[07:39:06] Radar: This is so off the beaten track of Rails that I'd almost consider telling you to ask in #ruby instead of in here.
[07:39:13] sinkensabe: has joined #RubyOnRails
[07:39:21] Radar: What you're trying to do seems really damn hard and I really recommend that you hire a consultant to help you with this.
[07:39:39] Radar: You're stumbling around in the dark. It's been all day (for me) that you've been asking these questions and it doesn't look like you've gotten anywhere.
[07:40:13] sevenseacat: oh no, it was yesterday too.
[07:40:28] wa_r_ch_i__ld1: i got somewhere tonight kind of
[07:40:31] wa_r_ch_i__ld1: here is the gist
[07:40:32] wa_r_ch_i__ld1: https://gist.github.com/anonymous/928f1671c4e6597cbf73
[07:41:00] wa_r_ch_i__ld1: that "Thread" is after the javascript render
[07:41:21] sevenseacat: no seriously what is that
[07:41:42] sevenseacat: theres a lot of shell code, a lot of debug code, and nothing to do with rails
[07:41:44] wa_r_ch_i__ld1: the 2nd line is checking if a window exists entitled "Authentication Reruired"
[07:41:59] wa_r_ch_i__ld1: im trying to have Rails poll for a window of a certain name
[07:42:16] sevenseacat: Rails is a server-side framework.
[07:42:26] sevenseacat: it knows nothing about windows on the client side.
[07:42:45] wa_r_ch_i__ld1: it renders before the DOM so neither does JS :)
[07:42:59] freezevee: has joined #RubyOnRails
[07:43:20] sevenseacat: yeah I'm going back to reading my book now.
[07:43:24] stamina: has joined #RubyOnRails
[07:43:25] VeryBewitching: sevenseacat: He's trying to know when the HTTP_AUTH prompt has been displayed.
[07:43:41] sevenseacat: VeryBewitching: and what does this have to do with Rails?
[07:43:45] agoldboi: has left #RubyOnRails: ()
[07:43:51] VeryBewitching: sevenseacat: Oh, nothing, I was clarifying :D
[07:44:09] sevenseacat: VeryBewitching: I've been watching this conversation for two full days. I'm well aware of what they're trying to do.
[07:44:14] wa_r_ch_i__ld1: if request.headers.include?('HTTP_AUTHORIZATION') ?
[07:45:01] blackmes1: has joined #RubyOnRails
[07:45:40] RegulationD: has joined #RubyOnRails
[07:46:10] User458764: has joined #RubyOnRails
[07:46:31] arBmind: has joined #RubyOnRails
[07:46:57] Cervajz_: has joined #RubyOnRails
[07:47:14] VeryBewitching: sevenseacat: I clarified because he was having this discussion in #ruby earlier; wasn't aware there was legacy.
[07:47:24] AzaToth: has joined #RubyOnRails
[07:48:24] VeryBewitching: wa_r_ch_i__ld1: I could probably figure out a way to help you, but I don't know what you're using the information for and am wary considering the topic.
[07:48:49] VeryBewitching: But not in this channel.
[07:49:04] wa_r_ch_i__ld1: @VeryBewitching its nothing special, there is this ancient microsoft website Im trying to embed in an iframe, on the caveat that the user doesnt have to enter their creds manually
[07:49:26] wa_r_ch_i__ld1: so since its NTLM its annoying to deal with
[07:49:31] neanderslob: has joined #RubyOnRails
[07:49:43] pyemkey: has joined #RubyOnRails
[07:49:51] Cervajz__: has joined #RubyOnRails
[07:50:01] makenoise: has joined #RubyOnRails
[07:52:22] pimpin: has joined #RubyOnRails
[07:53:07] Pumukel: has joined #RubyOnRails
[07:53:38] ruurd: has joined #RubyOnRails
[07:53:48] neanderslob: hi everyone, I'm attempting to upload a bunch of files to an amazon s3 server by using a rake task and the paperclip gem but each time I run it, I get the error "ArgumentError: invalid configuration option `:storage'"
[07:54:15] neanderslob: the process works just fine outside of a rake task; more info here if anyone's interested: http://stackoverflow.com/questions/33684333/rake-task-using-s3-and-paperclip-runs-into-argumenterror
[07:55:13] beast: has joined #RubyOnRails
[07:55:32] scmx: has joined #RubyOnRails
[07:55:50] mary5030: has joined #RubyOnRails
[07:57:40] mikecmpbll: has joined #RubyOnRails
[07:58:38] srinidhi: has joined #RubyOnRails
[08:00:31] LudicrousMango: has joined #RubyOnRails
[08:00:36] riotjones: has joined #RubyOnRails
[08:01:15] naftilos76: has joined #RubyOnRails
[08:01:24] darutoko: has joined #RubyOnRails
[08:02:15] arBmind: has joined #RubyOnRails
[08:03:20] lubekpl: has joined #RubyOnRails
[08:04:08] shibabu: has joined #RubyOnRails
[08:05:11] trosborn: has joined #RubyOnRails
[08:07:02] Axsuul: has joined #RubyOnRails
[08:08:45] hahuang65: has joined #RubyOnRails
[08:09:09] annlewis: has joined #RubyOnRails
[08:13:49] maletor_: has joined #RubyOnRails
[08:13:53] bruno-: has joined #RubyOnRails
[08:17:40] moeabdol: has joined #RubyOnRails
[08:18:32] zpe: has joined #RubyOnRails
[08:18:45] axl_: has joined #RubyOnRails
[08:19:02] duncannz: has joined #RubyOnRails
[08:22:33] dionysus69: has joined #RubyOnRails
[08:24:33] comrad: has joined #RubyOnRails
[08:24:48] norc: has joined #RubyOnRails
[08:25:25] DoubleMalt: has joined #RubyOnRails
[08:25:58] trosborn: has joined #RubyOnRails
[08:28:00] moeabdol: has joined #RubyOnRails
[08:31:15] norc: http://pastie.org/10554244 How can I extend simple_form to get some custom input handlers?
[08:31:46] norc: My approach just ends up in a "No input found for vertical_buttons" on the view, but I have a feeling Im doing this completely wrong.
[08:32:32] qejk: has joined #RubyOnRails
[08:33:18] sevenseacat: norc: so where did you define the vertical_buttons input type
[08:33:21] freezevee: has joined #RubyOnRails
[08:33:35] norc: sevenseacat: Truth be told, I have no idea what Im doing.
[08:33:44] sevenseacat: that much is clear.
[08:33:58] sevenseacat: you have a vertical_radio wrapper, but you're trying to set a vertical_buttons input_type
[08:34:11] sevenseacat: you probably want wrapper: :vertical_radio instead of as: :vertical_buttons
[08:34:48] norc: sevenseacat: I have a feeling that this wont work with a collection all too well.
[08:34:52] norc: But yeah I get it now.
[08:34:57] sevenseacat: try it and see.
[08:35:21] norc: sevenseacat: I just did. It only wraps the first of the collection.
[08:35:46] norc: Or not even that woah this seems weird.
[08:35:52] norc: sevenseacat: Anyway thanks for the pointer
[08:36:19] sevenseacat: who on earth added `radio_boxes` ? there's no such thing as a radio box
[08:37:16] rvanlieshout: it's the source of our music
[08:37:16] bmalum: has joined #RubyOnRails
[08:38:34] norc: Can we please not focus on my random naming scheme? :P
[08:39:29] Tref: anyone used ember-cli-rails with a rails-api back end?
[08:40:08] rvanlieshout: norc: you've got no idea how important correct naming is
[08:40:51] norc: Just relax please.
[08:41:20] rvanlieshout: i'm relaxed, but if we all could focus on naming more it would solve like 80% of the issues
[08:42:19] norc: I think my issue is that I need to create a custom input class that derives from SimpleForm::Inputs::CollectionRadioButtonsInput
[08:42:23] zpe_: has joined #RubyOnRails
[08:42:39] norc: Just cannot figure out how to change the wrapper used for collection items
[08:43:45] lxsameer: has joined #RubyOnRails
[08:44:28] SteenJobs: has joined #RubyOnRails
[08:44:43] mark3: has joined #RubyOnRails
[08:45:01] pimpin: has joined #RubyOnRails
[08:45:18] pawnbox_: has joined #RubyOnRails
[08:45:28] sevenseacat: 'hey i want your help, but when you try to help me i'll demean you and tell you to just relax'
[08:46:28] smoitra: has joined #RubyOnRails
[08:46:34] artto: has joined #RubyOnRails
[08:49:09] norc: sevenseacat: I'm unsure how making fun and breaking my balls about the name of a wrapper or input relates in any way to solving my issue.
[08:49:27] norc: I dont mind constructive criticism, but a line that goes "who on earth" is hardly constructive.
[08:50:05] rvanlieshout: then you didn't help enough people yet
[08:50:13] advorak: has joined #RubyOnRails
[08:51:14] Fery: has joined #RubyOnRails
[08:51:25] arBmind1: has joined #RubyOnRails
[08:54:04] Scripore: has joined #RubyOnRails
[08:57:29] norc: rvanlieshout: Perhaps.
[08:58:02] marr: has joined #RubyOnRails
[08:58:39] nfk|laptop: has joined #RubyOnRails
[08:59:10] jensljungblad: has joined #RubyOnRails
[09:01:02] theod: has joined #RubyOnRails
[09:01:37] moeabdol: has joined #RubyOnRails
[09:02:04] xploshioon: has joined #RubyOnRails
[09:04:12] jsrn_: has joined #RubyOnRails
[09:04:57] Linuus: has joined #RubyOnRails
[09:05:45] xploshioon: hi people, I am trying to user a has_many with a different name, but it gives me an "uninitialized constant" error
[09:05:54] erich__: has joined #RubyOnRails
[09:06:05] Linuus: We just released our new admin framework. Check it out! https://www.varvet.se/blog/update/2015/11/13/introducing-godmin-1-0.html
[09:06:12] sevenseacat: xploshioon: !debug
[09:06:12] helpa: xploshioon: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[09:06:38] xploshioon: yeah, i am writing the whole thing
[09:06:40] sevenseacat: another admin panel. yay :)
[09:07:44] ruurd: has joined #RubyOnRails
[09:08:18] xploshioon: this is my code
[09:08:19] xploshioon: https://gist.github.com/xploshioOn/73f5706e263b7f9a1b23
[09:08:39] rvanlieshout: xploshioon: your class is called ServiceCharacteristic
[09:08:40] sevenseacat: xploshioon: your class name isnt service_characteristics
[09:08:43] rvanlieshout: not service_characteristics
[09:09:07] rodfersou: has joined #RubyOnRails
[09:09:21] JulienITARD: has joined #RubyOnRails
[09:09:54] annlewis: has joined #RubyOnRails
[09:10:48] xploshioon: yes, that was the problem, thanks :)
[09:13:48] moeabdol: has joined #RubyOnRails
[09:14:17] xploshioon: @sevenseacat, that was sarcasm? or you like the idea?
[09:14:34] sevenseacat: sarcasm. another one to tell newbies not to use.
[09:14:36] roxtrongo: has joined #RubyOnRails
[09:14:36] maletor_: has joined #RubyOnRails
[09:15:22] bruno-: has joined #RubyOnRails
[09:15:24] Sylario: has joined #RubyOnRails
[09:15:25] sevenseacat: because you dont learn how to use Rails by using one of these things, but newbies gravitate to them because you get so much functionality for free
[09:15:37] rvanlieshout: and in the end you're hacking around the framework to get your stuff done
[09:15:38] sevenseacat: and as soon as they want to customize them, kerboom
[09:16:25] xploshioon: but if you are not a newbie is a good idea to use it?
[09:16:38] moeabdol: has joined #RubyOnRails
[09:16:47] sevenseacat: if you're not a newbie then you know that you design admin panels for workflows, not just to manage data
[09:18:13] blackmes1: has joined #RubyOnRails
[09:18:50] xploshioon: well, you learn something new everyday, thanks for the opinion, what do you use to create those panels? things like cancancan and those or just you do all your code and not use gems?
[09:18:56] erbse: Linuus: yo man it's cool, it supports mobile which activeadmin doesn't
[09:18:57] SteenJobs: has joined #RubyOnRails
[09:19:04] moeabdol1: has joined #RubyOnRails
[09:19:15] sevenseacat: using such an admin panel doesnt prevent you from needing things like authorization
[09:19:27] axl_: has joined #RubyOnRails
[09:20:01] xploshioon: yeah, you need authorization, filters, and more...
[09:20:17] xploshioon: ransack is very easy to use for filters
[09:20:27] xploshioon: but in your opinion is better to create everything?
[09:20:36] xploshioon: or use some gems
[09:20:38] sevenseacat: its better to build an admin panel that does what you need it to do.
[09:20:51] sevenseacat: i wouldnt re-invent the wheel for things like auth, no.
[09:22:03] xploshioon: thanks for your time :)
[09:22:14] xploshioon: have a good day/night
[09:22:52] goldbug: has joined #RubyOnRails
[09:24:37] Linuus: sevenseacat: Well, we are consultants and we create a lot of these for our clients. We have extracted some basic functionality which we always have to implement from scratch otherwise. Also, we've tried to not mess with standard rails stuff. If you want to override a view, just do it. Not much magic..just standard rails stuff.
[09:24:53] ibouvousaime: has joined #RubyOnRails
[09:25:10] sevenseacat: I'm glad you find your tool useful :)
[09:25:26] Linuus: sevenseacat: Godmin has authorization and authentication built in. But they are opt-in. If you don't want to use them, just don't include them :)
[09:25:57] sevenseacat: cool. what do you use for authentication and authorization?
[09:25:58] erbse: it's supergood, I hope there more tool for doing, hey I want the admin panel and article and calendar! generate them to me
[09:26:12] yoongkang: has joined #RubyOnRails
[09:26:21] Linuus: sevenseacat: I do agree though that admin panels are not fit for ALL projects. Just like Rails is not fit for all projects :)
[09:26:21] moei: has joined #RubyOnRails
[09:26:24] sevenseacat: and can you swap those out for other libraries if necessary?
[09:26:38] K_r3aPeR: has joined #RubyOnRails
[09:27:35] Linuus: sevenseacat: We use rails has_secure password for authentication. The authorization is created by us. It's heavily inspired by Pundit though. Just simple, plain Ruby classes.
[09:27:50] rvanlieshout: and why not just use pundit then?
[09:28:03] Palsson_: has joined #RubyOnRails
[09:28:22] Linuus: sevenseacat: Yes, you can use Devise or whatever you want. Auth isn't even included by default so you have to make that choice yourself.
[09:29:22] Linuus: rvanlieshout: We tried that first, but some things didn't work well with our app. It was a long time ago so perhaps it would work today. We have tried to keep the API's similar so we can switch easily in the future if we want to.
[09:29:35] Ergo: has joined #RubyOnRails
[09:31:32] Linuus: I think it is nice to have something simpler, more flexble and not so magic like ActiveAdmin.
[09:31:50] rvanlieshout: and that's the same reason as why it's not likely that such a admin panel is not going to fit in every app
[09:32:12] vigintas: has joined #RubyOnRails
[09:32:26] Linuus: rvanlieshout: You should definitly not use it in _every_ app :)
[09:32:39] Linuus: rvanlieshout: Only in apps where it is appropriate.
[09:33:25] goldbug: How can I pass a form object (f) from a webpage to jQuery?
[09:33:31] rvanlieshout: goldbug: you can't
[09:33:49] rvanlieshout: read about the difference between running things server and client side
[09:34:08] rvanlieshout: you can, however, put some kind of representation of the object in the dom and use that from jquery
[09:35:16] goldbug: rvanlieshout: All I'm trying to do is get some partial form fields to render within the f form on a javascript change event.
[09:35:18] build22: has joined #RubyOnRails
[09:35:49] Megamos: has joined #RubyOnRails
[09:35:52] rvanlieshout: goldbug: that's not how it works
[09:36:27] hahuang65: has joined #RubyOnRails
[09:36:31] goldbug: rvanlieshout: I've seen it working!
[09:36:48] goldbug: rvanlieshout: Correction: no I haven't!
[09:37:06] rvanlieshout: but not in the way how you describe it
[09:37:20] rvanlieshout: you render server side and present that to the browser
[09:37:23] rvanlieshout: it runs stuff client side
[09:37:53] goldbug: Including javascript stuff?
[09:38:03] rvanlieshout: if you want to manipulate the stuff client side you'll either have to include all data in the original render and hide stuff you don't need in the beginning or render partials using separate requests
[09:38:23] goldbug: The latter is what I'm trying to do.
[09:38:35] pimpin: has joined #RubyOnRails
[09:38:41] dionysus69: ok so I pulled for production and launched the site but page was blank, only the pages that had model passed didn't load at all. Where can I check logs to troubleshoot?
[09:38:46] rvanlieshout: then split that down in several steps
[09:38:55] rvanlieshout: 1) trigger js on the desired event
[09:38:55] goldbug: My javascript in theory deletes a partial and then asks it to be re-rendered with a different variable.
[09:39:01] rvanlieshout: 2) perform an xhr at that moment
[09:39:05] rvanlieshout: 3) render the right results in the xhr
[09:39:12] rvanlieshout: 4) process the xhr response in your js
[09:39:15] SteenJobs: has joined #RubyOnRails
[09:39:49] njero: has joined #RubyOnRails
[09:40:35] goldbug: Yes, I think that's what I've got going on. But the partial appears within a form, and references that form, so jQuery needs to pass that information to it.
[09:40:48] sevenseacat: dionysus69: !debug
[09:40:48] helpa: dionysus69: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[09:41:01] rvanlieshout: goldbug: there is no way back from render -> jquery
[09:41:28] rodferso1: has joined #RubyOnRails
[09:42:04] goldbug: rvanlieshout: Really? Because I have seen this work: .append("<%= escape_javascript(render(:partial => @cities)) %>")
[09:42:49] rvanlieshout: even then it's render on server -> use on client
[09:42:54] rvanlieshout: or you need something like actioncable
[09:43:10] rvanlieshout: but i think it's better if you really try to understand the difference between server and client side
[09:43:11] sevenseacat: probably something ajaxy, yeah.
[09:43:14] rvanlieshout: then it all makes sense
[09:43:23] sevenseacat: mixing up js and erb like that is horrible
[09:43:35] erbesharat: has joined #RubyOnRails
[09:43:35] sevenseacat: really, really horrible
[09:44:00] goldbug: sevenseacat: Yes it is Ajax. I'm copying the workflow from the only resource I could find describing how to update form fields based on a dropdown selection.
[09:44:10] sevenseacat: well this is the first time you've mentioned ajax
[09:44:21] sevenseacat: have you shown any of your code yet?
[09:44:30] goldbug: If there is an easier and/or more sensible way to do it I would be very glad to learn!
[09:44:43] goldbug: Uhm, let me put it in a Gist. Hang on. It's bitty.
[09:45:35] Spami: has joined #RubyOnRails
[09:45:50] rvanlieshout: goldbug: i don't say your approach is wrong, but you're having a hard time here cause the concept isnot clear
[09:46:11] goldbug: https://gist.github.com/classicgoldbug/dd0f0250d2900b9d84a8
[09:46:27] RegulationD: has joined #RubyOnRails
[09:46:52] AzaToth: has joined #RubyOnRails
[09:47:15] Antoine59: has joined #RubyOnRails
[09:47:27] pawnbox_: has joined #RubyOnRails
[09:47:28] quazimodo: has joined #RubyOnRails
[09:47:36] goldbug: rvanlieshout: Well, it's all new to me. Trying to get my head around partials, JavaScript, jQuery, CoffeeScript, Ajax and erb all at the same time.
[09:48:00] sevenseacat: why do you need to pass f in the ajax request?
[09:48:14] sevenseacat: and thats one of the reasons why we say dont mix all that stuff up
[09:48:20] sevenseacat: learn one thing at a time
[09:48:28] goldbug: sevenseacat: I'm not sure that I do.
[09:48:34] sevenseacat: ok, so dont do it
[09:49:05] goldbug: "Learning Rails" and "Learning One Thing at a Time" are mutually exclusive exercises (:
[09:49:14] sevenseacat: what is this supposed to do, anyway? there's no variables being used in that name_fields partial
[09:49:15] Cervajz_: has joined #RubyOnRails
[09:50:14] goldbug: No, I haven't made it dynamic yet. I just want to get the bloody thing to reload. What it's supposed to do is reload with a different I18n.with_locale()
[09:50:18] sevenseacat: goldbug: well no, not if you learn all the individual things like ajax before you learn rails
[09:50:41] sevenseacat: knowing ajax and knowing js is not a requirement for knowing rails
[09:50:54] sevenseacat: and definitely not coffeescript, that shit can die in a fire
[09:51:28] TPBallbag: has joined #RubyOnRails
[09:51:32] goldbug: I don't know what I need to know until I delve deeper in. And I only have so much time.
[09:51:50] sevenseacat: ok so again, what is this form supposed to do?
[09:52:13] sevenseacat: what do you hope to achieve by 'reloading the fields'?
[09:52:36] dionysus69: ok I found the following error in production.rb UndefinedColumn: ERROR: column products.discount does not exist, I ran migration using rake db:migrate, should I have used RAILS_ENV=production rake db:migrate instead? because I definitely migrated and that error doesn't make sense
[09:52:47] sevenseacat: dionysus69: !debug
[09:52:47] helpa: dionysus69: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[09:53:03] dionysus69: why whats wrong this time ? :D
[09:53:27] sevenseacat: dionysus69: please follow all lighted signs and crew member directions.
[09:54:26] goldbug: sevenseacat: Okay, so I'm trying to build a front-end to a database I've already built. The database is multilingual. In Rails, I'm implementing that through the globalize gem, which allows me to store values for fields in different languages just by switching locales. This form is to allow different people to have different names in different languages (for instance en: Tchaikovsky, de:
[09:54:26] goldbug: Tschaikowsky).
[09:55:08] goldbug: sevenseacat: What I want is a dropdown that lets me easily switch languages and see/edit the name fields in those different languages.
[09:55:49] goldbug: sevenseacat: So I have a partial which has the name fields and an I18n.with_locale wrapper, which needs to reload on dropdown select with a different locale.
[09:56:34] Linuus: has joined #RubyOnRails
[09:56:49] sevenseacat: ok so you don't really want to replace anything - you want to add more translations
[09:57:08] goldbug: sevenseacat: Maybe. Or edit an existing translation.
[09:57:19] sevenseacat: otherwise, if you changed the locale to de, your en translations would be deleted
[09:58:45] goldbug: Globalize stores everything in virtual translation tables.
[09:59:18] sevenseacat: I'm not familiar with globalize so I don't know how this is supposed to be handled
[10:00:20] njero: can anyone help me making this thread safe? https://gist.github.com/NeoElit/0c3c5fc2a39e0ec02e65
[10:00:48] goldbug: To use it is simple enough - if I get the value of surname, it just pulls the surname for the current locale from the virtual translation table.
[10:01:09] teclator: has joined #RubyOnRails
[10:01:17] rvanlieshout: n_e_o: wrap it in a db transaction?
[10:01:32] rvanlieshout: it doesn't really matter if it's ruby thread safe if the locking problem is within the db :)
[10:02:43] erbse: it's better to use lock, otherwise you need retry if transaction commit error
[10:03:40] Cervajz: has joined #RubyOnRails
[10:04:14] Tref: has joined #RubyOnRails
[10:04:31] njero: Ya.. yesterday radar suggested same to use with Model.with_lock do ..
[10:04:49] shibabu: has joined #RubyOnRails
[10:04:55] njero: but Model class doesn't seem to have with_lock
[10:05:34] roxtrongo: has joined #RubyOnRails
[10:06:24] nfk|laptop: has joined #RubyOnRails
[10:07:03] njero: rvanlieshout: erbse will this do the trick https://gist.github.com/NeoElit/0c3c5fc2a39e0ec02e65 ?
[10:07:28] rvanlieshout: n_e_o: could do, you should check the sql output for that method
[10:08:04] rodfersou: has joined #RubyOnRails
[10:08:05] njero: rvanlieshout: which one? Model.lock ?
[10:08:07] vigintas: has joined #RubyOnRails
[10:08:34] defsdoor: has joined #RubyOnRails
[10:08:55] rvanlieshout: n_e_o: tail -f log/development.log
[10:09:26] njero: rvanlieshout: u mean with lock or without lock
[10:09:27] erbse: just try, if you worry about add a sleep for testing
[10:09:37] rvanlieshout: n_e_o: with lock, but verify what it does
[10:09:48] goldbug: sevenseacat: At any rate at this point I just need to know how to get that partial to reload when the dropdown has changed (:
[10:10:40] annlewis: has joined #RubyOnRails
[10:11:05] pimpin: has joined #RubyOnRails
[10:14:59] Peg-leg: has joined #RubyOnRails
[10:15:20] maletor_: has joined #RubyOnRails
[10:15:34] bruno-: has joined #RubyOnRails
[10:16:43] pimpin: has joined #RubyOnRails
[10:17:13] dionysus69: https://gist.github.com/webzorg/aa69923a3b292cdd5245 so heres the log and index.html.erb files, It gives me 2 errors which are worth noting, undefined method and column doesn't exist. both of which doesn't make sense because all that works in development environment. any hints appreciated :)
[10:17:47] rvanlieshout: dionysus69: why would you expect your product to have a discount method?
[10:18:02] rvanlieshout: did you edit an existing migration for that?
[10:18:13] dionysus69: it has a discount column and it returns true or false since its a boolean type
[10:18:22] rvanlieshout: prove that it has a discount column
[10:18:32] dionysus69: well ye I migrated and it added columns as expected :s
[10:18:48] dionysus69: schema had discount column
[10:18:58] rvanlieshout: edited migration file or created a new one?
[10:19:04] rvanlieshout: restarted your rails server instance(s)?
[10:19:04] dionysus69: I used same migration on development environment and it worked, isn't that proof :)
[10:19:30] dionysus69: yes of course, I just pulled migration files which I pushed from dev
[10:19:51] rvanlieshout: but you did edit a migration file you already executed on production before?
[10:20:34] axl_: has joined #RubyOnRails
[10:22:08] dionysus69: nope it had enough info, migration is following: https://gist.github.com/webzorg/aa69923a3b292cdd5245
[10:22:26] rvanlieshout: so now back to proving that it has that attribute
[10:22:32] rvanlieshout: and did you restart your rails server instance(s)?
[10:22:53] shinenelson: has joined #RubyOnRails
[10:23:12] dionysus69: yes i am running passenger/nginx and I restarted nginx service
[10:23:19] pimpin: has joined #RubyOnRails
[10:24:05] rvanlieshout: ok. one thing left to do for now
[10:25:11] dionysus69: do you think it might be the question sign at the end of product.discount? it works without question sign in development mode
[10:25:50] rvanlieshout: and don't make assumptions. did you check your db?
[10:26:28] Megamos: has joined #RubyOnRails
[10:27:39] norc: rvanlieshout: Either way, I gave up with my approach - the whole input/wrapper thing for collections are not very customisable. :(
[10:27:50] norc: Plain old radio buttons it is. :)
[10:28:11] moeabdol: has joined #RubyOnRails
[10:29:35] Cervajz: has joined #RubyOnRails
[10:29:38] dhjondoh: has joined #RubyOnRails
[10:29:46] sdwrage: has joined #RubyOnRails
[10:29:51] dionysus69: I reverted with git to make production work but I just checked and table doesnt have needed columns which I will figure out later since I can't test production site atm.
[10:30:26] dionysus69: does it make a difference to run migration specifically for production or just db:migrate is enough? for example I precompile assets specifically for production
[10:30:39] rvanlieshout: it all depends on your env variables
[10:30:42] yoongkang: has joined #RubyOnRails
[10:30:50] rvanlieshout: which might be set correctly when using something like capistrano to deploy
[10:31:00] rvanlieshout: and if you have other environments defined in your database.yml
[10:31:17] futilegames: has joined #RubyOnRails
[10:31:42] annlewis: has joined #RubyOnRails
[10:33:06] dionysus69: ye maybe its time to investigate capistrano, thanks rvanlieshout
[10:34:16] erbesharat: has joined #RubyOnRails
[10:35:08] pimpin: has joined #RubyOnRails
[10:39:33] dhjondoh: has joined #RubyOnRails
[10:40:08] ldnunes: has joined #RubyOnRails
[10:41:20] roxtrongo: has joined #RubyOnRails
[10:42:45] pimpin: has joined #RubyOnRails
[10:43:21] kimegede: has joined #RubyOnRails
[10:46:08] roxtrongo: has joined #RubyOnRails
[10:47:54] njero: rvanlieshout: 'Model.lock do block' not executing codes inside. :(
[10:48:23] rvanlieshout: ok. and where did you find this .lock syntax?
[10:50:08] njero: rvanlieshout: my bad.. no syntax like that :(
[10:50:08] njero: http://api.rubyonrails.org/classes/ActiveRecord/Locking/Pessimistic.html#method-i-with_lock
[10:51:01] freezevee: has joined #RubyOnRails
[10:51:56] rvanlieshout: a transaction would be sufficient i guess
[10:52:16] dented42_: has joined #RubyOnRails
[10:52:42] njero: rvanlieshout: thanks..
[10:53:32] apofis: has joined #RubyOnRails
[10:54:22] corehook: has joined #RubyOnRails
[10:54:34] rubyonra_: has joined #RubyOnRails
[10:54:36] ArTiSTiX: has joined #RubyOnRails
[10:55:31] corehook: what about auto building mongoid's embedded fields ?
[10:56:01] corehook: now i use after_initialize in parent model for building embedded fields
[10:56:18] corehook: i want automatically build embedded fields with default parametrs
[10:56:39] bmalum: has joined #RubyOnRails
[11:00:20] ksw: has joined #RubyOnRails
[11:00:30] bruno-: has joined #RubyOnRails
[11:00:42] Antoine59: anyone with sunspot experience ?
[11:03:36] helpa: Nope. No one. Ever. In the history of the world.
[11:03:46] n1ck7: has joined #RubyOnRails
[11:04:20] krz: has joined #RubyOnRails
[11:06:23] LambdaSource: has joined #RubyOnRails
[11:07:29] corehook: has joined #RubyOnRails
[11:10:14] stamina: has joined #RubyOnRails
[11:13:19] Cervajz: has joined #RubyOnRails
[11:15:31] nettoweb: has joined #RubyOnRails
[11:16:07] maletor_: has joined #RubyOnRails
[11:16:56] roxtrongo: has joined #RubyOnRails
[11:18:46] AzaToth: has joined #RubyOnRails
[11:20:03] zpe: has joined #RubyOnRails
[11:20:17] sdwrage: has joined #RubyOnRails
[11:20:28] rickmasta: has joined #RubyOnRails
[11:21:18] axl_: has joined #RubyOnRails
[11:24:22] goldbug: Argh, I hate you, f.
[11:26:11] goldbug: sevenseacat, I tried this instead (following another suggestion): https://gist.github.com/classicgoldbug/6a6a594d17e471d9d8ad
[11:26:44] goldbug: And I still get undefined local variable or method `f`. Which makes NO SENSE.
[11:28:05] c355E3B: has joined #RubyOnRails
[11:32:21] artto: has joined #RubyOnRails
[11:34:26] waka: has joined #RubyOnRails
[11:34:42] htmldrum: has joined #RubyOnRails
[11:35:03] Pazician: has joined #RubyOnRails
[11:35:16] Megamosaren: has joined #RubyOnRails
[11:37:10] AnoHito: has joined #RubyOnRails
[11:37:16] annlewis: has joined #RubyOnRails
[11:38:57] bbrowning_away: has joined #RubyOnRails
[11:44:11] Jasaka: has joined #RubyOnRails
[11:44:17] FailBit: print out local_assigns in the partial
[11:45:13] Pazician: has joined #RubyOnRails
[11:46:14] smoitra: has joined #RubyOnRails
[11:46:22] rvanlieshout: FailBit: you could access 'methods'
[11:47:16] RegulationD: has joined #RubyOnRails
[11:48:26] Grundell: has joined #RubyOnRails
[11:48:42] sevenseacat: err, you're writing ruby in a coffee file?
[11:49:02] FailBit: I just noticed that, lol
[11:51:23] goldbug: Yeah. I dunno what I'm doing, do I? (;
[11:51:32] rvanlieshout: goldbug: no :)
[11:51:38] goldbug: I believe that was actually supposed to go in a rjs file.
[11:51:48] goldbug: But I also believe that rjs isn't really a thing anymore, correct?
[11:51:54] rvanlieshout: most people stopped using rjs since rails 2
[11:52:08] goldbug: This is the problem with the Internet as a source for learning.
[11:52:21] rvanlieshout: it is if you don't filter outdated documents
[11:52:40] rvanlieshout: but imo the best approach is still to learn about the server / client workflow
[11:52:49] rvanlieshout: that's not related to rails or to jquery
[11:52:57] sevenseacat: rjs hasn't been used in a looooong time
[11:53:45] Megamos: has joined #RubyOnRails
[11:53:57] goldbug: Any (short) resources you'd recommend, rvanlieshout?
[11:54:33] Pazician: has joined #RubyOnRails
[11:54:37] pusewicz: has joined #RubyOnRails
[11:54:59] njero: has joined #RubyOnRails
[11:55:09] rvanlieshout: nope.. it's been a long time since i've had to learn those concepts
[11:55:17] rvanlieshout: so no nice and shiny explanation ready
[11:55:24] rvanlieshout: lemme try to find something
[11:55:39] roxtrongo: has joined #RubyOnRails
[11:55:47] goldbug: [And, seriously, if anyone can just tell me how I can reload my name_fields partial after a dropdown change, I wouldn't mind.]
[11:56:17] goldbug: [Not very 'teach a man to fish'-y, I know, but I've been stuck on this for three days now and I'd quite like to move on!]
[11:56:42] rvanlieshout: can you gist the things again? or post the link again?
[11:57:20] rvanlieshout: and you would already be done with this if you used your first day to study it
[11:57:52] build22: has joined #RubyOnRails
[11:58:23] exadeci: has joined #RubyOnRails
[11:59:39] iateadonut: has joined #RubyOnRails
[12:01:33] youngbaks: has joined #RubyOnRails
[12:03:17] FailBit: so, I have an interesting architectural problem now
[12:03:33] goldbug: rvanlieshout: https://gist.github.com/classicgoldbug/dd0f0250d2900b9d84a8
[12:04:04] FailBit: I need to store the last 90 days of a data source, and it needs to "roll over" (ie, push out the earliest entries for new days).
[12:04:13] FailBit: how can I approach this?
[12:04:15] rvanlieshout: goldbug: ok. you've still got that list of 4 or 5 things you needed to do i wrote earlier?
[12:04:29] rvanlieshout: FailBit: what kind of data?
[12:04:38] rvanlieshout: goldbug: let's start with 1 then :)
[12:05:01] rvanlieshout: when should something happen?
[12:05:12] Gargron: has joined #RubyOnRails
[12:05:16] FailBit: rvanlieshout: just an int
[12:05:41] rvanlieshout: FailBit: updated how often? daily?
[12:05:52] FailBit: updated arbitrarily
[12:06:05] FailBit: far more frequently than daily, for the most part
[12:06:13] rvanlieshout: considered just a table and a delete where created_at > 90.days.ago?
[12:06:24] Scripore: has joined #RubyOnRails
[12:06:31] goldbug: <rvanlieshout> 1) trigger js on the desired event
[12:06:41] goldbug: I think that bit I've got sorted.
[12:06:43] rvanlieshout: that's the update_language right?
[12:06:51] frzn: has joined #RubyOnRails
[12:06:57] FailBit: rvanlieshout: I have, but that doesn't seem the most elegant way to do it
[12:07:02] rvanlieshout: ok, so 1 and 2 are somewhat covered
[12:07:11] rvanlieshout: what data should be rendered?
[12:07:39] shibabu: has joined #RubyOnRails
[12:07:46] rvanlieshout: FailBit: well.. they are kinda designed for such tasks. You could use Redis with an expires_in, but it might be quite some data to store in an in-memory db
[12:08:00] FailBit: correct :)
[12:08:20] FailBit: so I guess I'll work on this, then
[12:09:05] goldbug: The _name_fields partial needs to be re-rendered with a new language_id from $('#language_select').val()
[12:09:37] rvanlieshout: goldbug: ok, and what's the url to this form?
[12:11:05] AimlessRAven: has joined #RubyOnRails
[12:11:25] goldbug: The containing form is /people/_form.html.erb and it has its own partial, /people/_name_fields.html.erb
[12:11:27] frzn: has left #RubyOnRails: ("http://quassel-irc.org - Chat comfortably. Anywhere.")
[12:11:39] rvanlieshout: goldbug: the url, not the file
[12:12:00] rvanlieshout: or /people/12/edit for that matter
[12:12:45] goldbug: Oh, sorry. Should be /people/12/edit, yes
[12:12:46] xcesariox: has joined #RubyOnRails
[12:13:17] rvanlieshout: goldbug: and are we able to generate that partial without knowing for what user? (e.g. only based on language_id)
[12:14:16] njero: has joined #RubyOnRails
[12:14:21] goldbug: By user you mean Person? No, we will need to know who that is too. That should be being set in the controller.
[12:14:37] rvanlieshout: ok. and this is also available for the new action?
[12:14:47] Megamos: has joined #RubyOnRails
[12:14:57] goldbug: Yes, it should be.
[12:15:10] rvanlieshout: can you add your routes file to the gist?
[12:15:14] rvanlieshout: and the controller
[12:15:24] goldbug: Yes - was just going to ask if you wanted to see them (;
[12:16:29] goldbug: Okay updated.
[12:16:57] maletor_: has joined #RubyOnRails
[12:17:20] rvanlieshout: let's also rename update_name_fields to just name_fields, cause it's not actually updating something
[12:17:37] rvanlieshout: hang on for a sec while i prepare some stuff
[12:18:54] rvanlieshout: meanwhile, how should the selected language affect it?
[12:19:07] rvanlieshout: is that the <% I18n.with_locale(:en) do %> ?
[12:20:23] goldbug: That's right. :en should be replaced with language_id.
[12:20:44] goldbug: (Though at the moment, language_id is coming through in the format EN)
[12:21:45] rvanlieshout: and @person.language returns what?
[12:22:04] axl_: has joined #RubyOnRails
[12:23:35] goldbug: I don't think it will return anything.
[12:23:53] rvanlieshout: what could it return? a string? a language object?
[12:25:17] jmaradin: has joined #RubyOnRails
[12:25:27] goldbug: Person itself doesn't have a language. It has fields like surname and middle_name_1 which have languages (like surname_en and surname_de) that return a string.
[12:25:46] goldbug: (Using globalize and globalize_accessors)
[12:26:21] goldbug: Person.surname will also return (potentially) different results if I18n.locale = :en or if it is :de
[12:27:16] rvanlieshout: but you have an input called :language
[12:27:36] goldbug: Not a real one. It's a fake!
[12:27:48] goldbug: It's just to allow me to have a dropdown for language in a simple_form.
[12:28:07] goldbug: (Which is why it's a standard form_helper wrapped in a simple_form).
[12:28:20] rvanlieshout: so the initial is always english?
[12:28:25] norc: https://gist.github.com/norc/85e34bef08fa9ae39ffd
[12:28:36] jkamenik: has joined #RubyOnRails
[12:28:37] norc: Am I using enum wrong here?
[12:28:46] goldbug: And :de and :fr etc will default to :en if they are Nil.
[12:29:02] doodlehaus: has joined #RubyOnRails
[12:29:04] norc: (Rails is trying to call each_with_index on whatever I pass along to _prefix or _suffix.
[12:30:14] norc: Oh damn nevermind. I was accidentally consulting edge docs.
[12:30:34] badeball: has joined #RubyOnRails
[12:35:03] MartinElvar: has joined #RubyOnRails
[12:35:10] wethu: has joined #RubyOnRails
[12:35:46] MartinElvar: has joined #RubyOnRails
[12:36:30] artto: has joined #RubyOnRails
[12:37:06] rvanlieshout: goldbug: added a comment, you might want to try something like that
[12:38:01] annlewis: has joined #RubyOnRails
[12:39:27] yoongkang: has joined #RubyOnRails
[12:40:23] goldbug: rvanlieshout: Thank you! Very kind. I need to go grab lunch now but I will have a thorough read through your solution when I get back. I really appreciate your help!
[12:43:29] corehook: has joined #RubyOnRails
[12:44:50] corehook: has joined #RubyOnRails
[12:45:31] nickenchuggets: has joined #RubyOnRails
[12:46:19] scmx: has joined #RubyOnRails
[12:47:13] krz: has joined #RubyOnRails
[12:47:19] blackmes1: has joined #RubyOnRails
[12:47:29] badeball: has joined #RubyOnRails
[12:48:10] Scripore: has joined #RubyOnRails
[12:49:12] bbrowning: has joined #RubyOnRails
[12:54:24] erbse: hi, can I parse a erb template and modify it? or is there any xml like template system can use instead?
[12:54:35] rvanlieshout: parse it where?
[12:54:43] badeball: has joined #RubyOnRails
[12:55:28] erbse: like I want to insert some html code to #body > .nav by program not manually
[12:55:33] Palsson_: has joined #RubyOnRails
[12:55:39] erbse: but I can't load the erb just like the html
[12:56:00] corehook: has joined #RubyOnRails
[12:56:18] rvanlieshout: why then not just edit the file?
[12:56:40] cswelin: has joined #RubyOnRails
[12:57:55] erbse: I want to modify or build views by program
[12:58:27] rvanlieshout: and why would you want to create erb files for that?
[13:00:40] badeball: has joined #RubyOnRails
[13:01:56] badeball: has joined #RubyOnRails
[13:02:35] mghaig: has joined #RubyOnRails
[13:02:40] theod: has joined #RubyOnRails
[13:04:42] doodlehaus: has joined #RubyOnRails
[13:07:14] onebree: has joined #RubyOnRails
[13:07:56] onebree: has joined #RubyOnRails
[13:08:01] annlewis: has joined #RubyOnRails
[13:08:09] RegulationD: has joined #RubyOnRails
[13:08:32] hackeron: has joined #RubyOnRails
[13:12:08] nzst: has joined #RubyOnRails
[13:12:41] Scripore: has joined #RubyOnRails
[13:12:44] hardtail: has joined #RubyOnRails
[13:12:48] krz: has joined #RubyOnRails
[13:13:54] quazimodo: has joined #RubyOnRails
[13:14:07] onebree: hello everyone
[13:15:09] onebree: I am having difficultry understanding how to do nested forms/attributes with `belongs_to` associations.
[13:16:47] onebree: Are my messages going through?
[13:17:42] maletor_: has joined #RubyOnRails
[13:18:42] trosborn: has joined #RubyOnRails
[13:18:47] onebree: I take that as a yes. :-)
[13:18:48] supercodepoet: has joined #RubyOnRails
[13:19:12] onebree: But yeah, I need help doing a nested form for belongs_to association for a feature for work.
[13:19:19] elaptics: yep, what's the specific problem?
[13:19:32] onebree: Okay, give me one second to explain
[13:20:22] doodlehaus: has joined #RubyOnRails
[13:20:28] nonmadden: has joined #RubyOnRails
[13:21:02] onebree: I have a form for a proposal object. A proposal belongs_to a company. Within the form for proposal, I want the user to either (a) select company names already in the DB from the dropdown, OR (b) click "other" and manually enter the company name.
[13:21:50] onebree: What I am not grasping is how to do nested associations and forms when the main object (proposal) is in a belongs_to relationship. I am used to doing things like "Queue has_many members", then adding the members on the form for a queue.
[13:22:34] axl_: has joined #RubyOnRails
[13:22:38] onebree: I know I will need a find_or_initialize_by method since I am letting the end user choose OR enter the company name manually. I just don't know how to implement this. Anything on StackOverflow is from 2013 or prior
[13:27:14] nya: has joined #RubyOnRails
[13:27:53] onebree: If you have any ideas, blog posts, or resources, do let me know. Like I said, this is for work, and there is currently no precedent in the app (or our others) right now
[13:27:59] rgtk: has joined #RubyOnRails
[13:28:04] vdmo_: has joined #RubyOnRails
[13:29:29] futilegames: has joined #RubyOnRails
[13:29:47] foucist: has joined #RubyOnRails
[13:30:31] mostlybadfly: has joined #RubyOnRails
[13:31:45] maxz: has joined #RubyOnRails
[13:33:54] teclator: has joined #RubyOnRails
[13:34:07] darrencauthon: has joined #RubyOnRails
[13:36:17] stannard: has joined #RubyOnRails
[13:38:48] suchness: has joined #RubyOnRails
[13:39:50] _inz: has joined #RubyOnRails
[13:41:18] onebree: has left #RubyOnRails: ()
[13:41:20] _inz: has joined #RubyOnRails
[13:41:30] njero: has joined #RubyOnRails
[13:43:39] bdnelson: has joined #RubyOnRails
[13:51:26] flip_digits: has joined #RubyOnRails
[13:52:01] ramortegui: has joined #RubyOnRails
[13:53:48] surrealanalysis: has joined #RubyOnRails
[13:53:49] goodcodeguy: has joined #RubyOnRails
[13:56:05] joshkovach: has joined #RubyOnRails
[13:59:39] njero: hey... why do rails parse time column from db to 2000-01-01 x:x:x UTC and Time.parse("time utc(without date)") to "currentdate and parsed time"?
[14:00:51] RegulationD: has joined #RubyOnRails
[14:01:06] njero: will 2000-01-01 date part will be unchanged for ever..?
[14:01:55] rvanlieshout: is it a time column?
[14:02:05] njero: ya.. time without date
[14:02:50] rvanlieshout: :) rails tries to convert from local to utc when saving
[14:02:56] rvanlieshout: but date information is lost in a time column
[14:02:59] rvanlieshout: so getting it back fails
[14:03:17] rickmasta: has joined #RubyOnRails
[14:04:33] njero: rvanlieshout: so can i write logic hopping 2000-01-01 will be appended normally?
[14:04:48] rvanlieshout: imo you have 2 options
[14:04:52] njero: rvanlieshout: or will they change randomnly?
[14:05:05] rvanlieshout: 1) convert it to time.utc + time.utc_offset
[14:05:08] rvanlieshout: 2) stop using time columns
[14:06:13] njero: rvanlieshout: can you elaborate first method?
[14:06:34] rvanlieshout: @foo.time = Time.zone.now would result in 15 CET
[14:06:44] rvanlieshout: saved as 14:06 UTC
[14:06:56] rvanlieshout: @foo.reload.time would then result in 14, cause it's missing TZ info
[14:07:38] rvanlieshout: Time.zone.now.utc + Time.zone.now.utc_offset = 14:06 + 1h = 15:06 in utc, 15:06 saved to db, 15:06 fetched
[14:07:54] youngbaks: has joined #RubyOnRails
[14:08:34] ubersapiens: has joined #RubyOnRails
[14:08:50] njero: k.. but timezone info is not the issue.. I need default date got from database to be same always.. it shouldn't change
[14:08:52] jcandan: has joined #RubyOnRails
[14:09:05] rvanlieshout: and tz is causing that
[14:09:15] atomical: has joined #RubyOnRails
[14:10:06] sankaber: has joined #RubyOnRails
[14:10:18] njero: rvanlieshout: but my utc_offset is 0
[14:10:33] rvanlieshout: then i would go for option 2 :)
[14:10:35] shibabu: has joined #RubyOnRails
[14:11:10] dionysus69: has joined #RubyOnRails
[14:12:07] njero: rvanlieshout: no my problem will still exist there.. What i'm doing is comparing open hours and merging if needed. So even if i use datetime date part will vary. I need date part retrieved from db on time column parsing to be same.
[14:12:29] rvanlieshout: but you don't store a date part
[14:12:32] rvanlieshout: so it can't be the same
[14:13:39] njero: rvanlieshout: :( i'm confused.. how is rails arriving default date 2000-01-01?
[14:13:51] wildlander: has joined #RubyOnRails
[14:13:59] rvanlieshout: there is no date info
[14:14:03] njero: rvanlieshout: if it won't change in time .. I'm all good
[14:14:13] rvanlieshout: and in ruby there is no time only object
[14:14:15] rvanlieshout: only time with date
[14:14:20] rvanlieshout: so that's conflicting
[14:14:36] rvanlieshout: so then either create a new time class that supports time without date
[14:14:41] rvanlieshout: or just add a date in the db
[14:15:18] njero: rvanlieshout: so how it gets 2000-01-01 . is it hard coded? in ruby to return that if not date part?
[14:15:36] rvanlieshout: not relevant, you're using something without date information as something with date information
[14:15:40] rvanlieshout: and don't know :)
[14:16:15] njero: rvanlieshout: :(
[14:16:28] rvanlieshout: what's the problem in adding date info in your db?
[14:18:00] njero: rvanlieshout: hm.. I'm curious .. think i'll end up doing that.
[14:18:41] maletor_: has joined #RubyOnRails
[14:19:04] njero: rvanlieshout: even if i use datetime it'll need me to save on some fixed datepart.. Thought rails could do something better :)
[14:19:18] rvanlieshout: it's not rails to blame here
[14:19:21] Tref: has joined #RubyOnRails
[14:19:30] rvanlieshout: and it doesn't really matter what date it uses
[14:19:35] rvanlieshout: as long as it gets the date back from the db
[14:20:09] njero: rvanlieshout: i'm not blaming.. One can't do what everyone needs :)
[14:21:32] IrishGringo: has joined #RubyOnRails
[14:22:07] jgpawletko: has joined #RubyOnRails
[14:23:38] axl_: has joined #RubyOnRails
[14:24:53] youngbaks: has joined #RubyOnRails
[14:25:43] a346: has joined #RubyOnRails
[14:29:35] alfie_max15: has joined #RubyOnRails
[14:29:50] alfie_max15: from the rubydoc for devise i see that
[14:29:56] alfie_max15: Finally, notice that Devise also queries for users in other scenarios besides authentication, for example when retrieving an user to send an e-mail for password reset. In such cases, find_for_authentication is not called.
[14:30:01] alfie_max15: so what should i do to query the right user when sending out reset password mail ?
[14:30:47] rvanlieshout: why wouldn't that be correct?
[14:31:05] rvanlieshout: you're not finding a user for authentication when sending a password reset mail
[14:31:27] alfie_max15: yes it find a user
[14:31:32] alfie_max15: but not the one i want
[14:31:49] alfie_max15: you see i've got an application where there are alot of accounts
[14:32:08] erbse: has left #RubyOnRails: ()
[14:32:18] alfie_max15: and uniqueness of user email is only checked under an account
[14:32:58] rvanlieshout: so define a different unique key in the devise config
[14:32:59] alfie_max15: all accounts have different subdomains, so i would like to query user using the subdomain
[14:33:02] theblang: has joined #RubyOnRails
[14:33:17] solars: what's the nicest way to get an average value of decimals that are stored in a string field?
[14:33:27] alfie_max15: that's what i've done in `find_for_authentication` for login
[14:33:47] rvanlieshout: solars: have your db calculate that
[14:34:04] rvanlieshout: .pluck('avg(cast(field))') read cast doc for your db engine
[14:34:12] njero: alfie_max15: hello dude..
[14:34:53] rromanch_: has joined #RubyOnRails
[14:36:06] solars: rvanlieshout, ah .pluck is nice
[14:36:07] alfie_max15: rvanlieshout, i cant change the unique key, it has to be the email
[14:36:33] alfie_max15: i just need to overide whatever serves @resource in the mailer
[14:38:12] rvanlieshout: alfie_max15: then add a key
[14:38:16] rvanlieshout: cause email alone isn't unique
[14:38:43] alfie_max15: this is what i have now
[14:38:43] alfie_max15: config.authentication_keys = [ :email ]
[14:39:06] alfie_max15: what do i do now?
[14:39:12] rvanlieshout: and you've just told me email alone isn't unique
[14:39:28] rvanlieshout: so that's wrong then, right?
[14:39:36] yran: has joined #RubyOnRails
[14:39:39] daivyk: has joined #RubyOnRails
[14:39:41] krramos: has joined #RubyOnRails
[14:39:46] alfie_max15: but i need it to be unique along with account_id
[14:39:58] rvanlieshout: so how should somebody request a new password?
[14:40:00] alfie_max15: but how would i let devise know that
[14:41:47] goldbug: Right. Let's have a look at rvanlieshout's handywork.
[14:42:32] alfie_max15: rvanlieshout, already did that, but that's not what i'm looking for
[14:42:45] goldbug: rvanlieshout: Are you around at the moment? I would like to try and understand what's going on in these files before I copy/paste them. Which will mean All The Questions.
[14:43:00] rvanlieshout: alfie_max15: then what are you looking for?
[14:44:14] doodlehaus: has joined #RubyOnRails
[14:44:24] riotjones: has joined #RubyOnRails
[14:44:40] goldbug: Okay, so: starting with routes.rb. Why :name_fields, on: :collection?
[14:44:54] rvanlieshout: because member creates /people/123/name_fields
[14:45:01] rvanlieshout: but what for the /people/new? what url should that one use
[14:45:02] goldbug: I suppose so we can display them en masse?
[14:45:19] riotjones: has joined #RubyOnRails
[14:45:21] goldbug: Okay, got it.
[14:45:22] rvanlieshout: so /people/name_fields createa a form for a new user and renders the partial
[14:45:30] rvanlieshout: you'll see that in the action
[14:45:38] rvanlieshout: where the @person is defined
[14:46:12] goldbug: Hmm. Okay.
[14:46:14] simplyianm: has joined #RubyOnRails
[14:46:20] urbanmonk: has joined #RubyOnRails
[14:46:32] tlarevo: has joined #RubyOnRails
[14:46:36] futilegames: has joined #RubyOnRails
[14:46:49] goldbug: So, we have name_fields.html.erb and _name_fields.html.erb. But no _form.html.erb?
[14:47:04] rvanlieshout: you don't have to remove fields
[14:47:10] rvanlieshout: this comment contains only differences
[14:47:14] sankaber: has joined #RubyOnRails
[14:47:15] bmalum: has joined #RubyOnRails
[14:47:17] rvanlieshout: you use your form for your new and edit actions
[14:47:18] simplyianm: has joined #RubyOnRails
[14:47:33] slash_ni1k: has left #RubyOnRails: ()
[14:47:36] yran: has joined #RubyOnRails
[14:47:40] slash_nick: has joined #RubyOnRails
[14:47:46] goldbug: Okay. Let me read through again.
[14:47:52] goldbug: See if I understand it.
[14:47:53] honestemu: has joined #RubyOnRails
[14:48:59] goldbug: This ? || notation is if then else, right?
[14:49:40] rvanlieshout: use whatever you prefer
[14:49:56] goldbug: No, that's fine. As long as I understand it (;
[14:50:17] Yomero3: has joined #RubyOnRails
[14:50:51] RegulationD: has joined #RubyOnRails
[14:51:25] goldbug: So the controller is defining an action(?) called name_fields and passing @person and @language to it. What does this 'respond_to do |format| format.html end' business do? It seems to be standard in most controller actions.
[14:51:57] Megamos: has joined #RubyOnRails
[14:52:39] rvanlieshout: it tells rails to respond when somebody requests html
[14:52:46] rvanlieshout: and cause there is nothing more, respond in the default way
[14:52:50] rvanlieshout: rendering the view
[14:53:07] FailBit: that's mostly right
[14:53:29] FailBit: respond_to{|format|} defines actions that can be taken for different formats
[14:53:45] FailBit: if you allow format.html, and don't pass it a block, you tell it to do nothing
[14:53:50] FailBit: that triggeres rails' implicit_render
[14:54:04] sdwrage: has joined #RubyOnRails
[14:54:14] FailBit: (if you don't call render or redirect in an action, rails will automatically render for you, which is nice)
[14:54:42] polishdub: has joined #RubyOnRails
[14:55:26] goldbug: I have seen format.js also, so presumably this is a way of gating what various actions can and cannot do? What happens if there is no respond_to section?
[14:55:37] rvanlieshout: it'll use the implicit_render
[14:55:48] rvanlieshout: so nothing really different
[14:55:51] doodlehaus: has joined #RubyOnRails
[14:56:40] RegulationD: has joined #RubyOnRails
[14:57:09] goldbug: Right. So that's. . . kind of redundant but maybe useful for coders to see the formats explicated?
[14:57:27] rvanlieshout: yeah, i mostly don't include them by default
[14:57:31] rvanlieshout: but your other actions had them
[14:57:58] Sigfrid: has joined #RubyOnRails
[14:58:29] goldbug: Fair enough!
[14:58:43] rvanlieshout: i'm signing off for the weekend in 10 min
[14:58:53] rvanlieshout: and will be back monday morning CET
[14:59:06] goldbug: Right. Maybe you'd better just talk me through this high-level then q:
[14:59:08] FailBit: goldbug: if you have an API
[14:59:15] FailBit: you can use respond_to
[14:59:24] FailBit: to render json and HTML from the same endpoint
[14:59:30] rvanlieshout: goldbug: exactly
[14:59:42] FailBit: I'll be here all weekend
[15:00:02] qejk: has joined #RubyOnRails
[15:00:13] FailBit: also, holy shit, pg_dump is fucking _fast_
[15:01:20] riotjones: has joined #RubyOnRails
[15:01:30] goldbug: rvanlieshout: Okay, so why name_fields? It is just creating a new version of the simple_form right?
[15:02:22] rvanlieshout: yeah, because we need to have a form in order to render the fields
[15:02:33] foucist: has joined #RubyOnRails
[15:02:43] goldbug: Got it. Think this is what I was trying to do with my dodgy rjs/coffescript nonsense.
[15:03:10] rvanlieshout: the coffeescript later on will only use the content of the partial
[15:03:43] goldbug: This? $.get $('#name_fields').data('path'),
[15:04:09] moeabdol: has joined #RubyOnRails
[15:04:13] goldbug: What does data('path') do - retrieve data passed in the URL?
[15:04:45] rvanlieshout: how should the js know what url to use for the ajax requeest?
[15:04:55] rvanlieshout: we've added that to the div with a data-attribute
[15:04:55] raunicolae: has joined #RubyOnRails
[15:05:12] HalcyonicStorm: has joined #RubyOnRails
[15:05:53] goldbug: Why isn't that done through routes.rb?
[15:05:54] evanessence: has joined #RubyOnRails
[15:06:07] rvanlieshout: the js only has access to the rendered view
[15:06:13] rvanlieshout: that's the only thing given
[15:07:56] goldbug: What will the URL look like with that data attribute?
[15:08:09] rvanlieshout: view the html source of the page
[15:08:18] rvanlieshout: it'll be something like /people/123/name_fields
[15:08:21] rvanlieshout: or /people/name_fields
[15:09:34] adavia: has joined #RubyOnRails
[15:10:03] rvanlieshout: already applied this? there might be some typos in there
[15:10:04] atomical: has joined #RubyOnRails
[15:10:15] goldbug: No. Let me do it.
[15:11:10] lacrymology: has joined #RubyOnRails
[15:11:40] rvanlieshout: ok. so i'm signing off. good luck :)
[15:13:32] goldbug: Thanks again! See you Monday no doubt (;
[15:15:17] goldbug: ACTION looks meaningfully at FailBit.
[15:15:39] FailBit: just a tad busy, managing a big migration
[15:15:47] htmldrum: has joined #RubyOnRails
[15:16:23] goldbug: Okay, I'll do my best to solve stuff myself but no guarantees I won't ask some stupid questions (:
[15:16:28] Antoine59: has joined #RubyOnRails
[15:17:13] pawnbox: has joined #RubyOnRails
[15:19:18] maletor_: has joined #RubyOnRails
[15:22:20] tianyi: has joined #RubyOnRails
[15:23:09] jobewan: has joined #RubyOnRails
[15:23:23] axl_: has joined #RubyOnRails
[15:23:27] atomical: has joined #RubyOnRails
[15:23:46] theod: has joined #RubyOnRails
[15:23:56] nettoweb: has joined #RubyOnRails
[15:26:04] rubyonrailed: has joined #RubyOnRails
[15:27:09] kerunaru: has joined #RubyOnRails
[15:28:35] MartinElvar: has joined #RubyOnRails
[15:28:50] dopie: has joined #RubyOnRails
[15:28:57] chouhoulis: has joined #RubyOnRails
[15:29:55] chadhs: has joined #RubyOnRails
[15:29:57] erbesharat: has joined #RubyOnRails
[15:29:58] bruno-_: has joined #RubyOnRails
[15:30:16] isjaylee: has joined #RubyOnRails
[15:30:26] LudicrousMango: has joined #RubyOnRails
[15:32:34] nettoweb: has joined #RubyOnRails
[15:33:15] darkxploit: has joined #RubyOnRails
[15:33:18] dionysus69: has joined #RubyOnRails
[15:33:29] Quintasan: has joined #RubyOnRails
[15:33:35] Quintasan: has joined #RubyOnRails
[15:33:54] teclator: has joined #RubyOnRails
[15:34:15] The_Phoenix: has joined #RubyOnRails
[15:34:19] treehug88: has joined #RubyOnRails
[15:34:19] atomical: has joined #RubyOnRails
[15:34:37] RockLee: has joined #RubyOnRails
[15:38:51] beauby: has joined #RubyOnRails
[15:41:25] Rodya_: has joined #RubyOnRails
[15:42:02] arup_r: has joined #RubyOnRails
[15:44:06] FailBit: love how our urt goes down when our throughput goes up https://i.imgur.com/UXkRmju.png
[15:44:28] tubbo: FailBit: i got your apdex right heeeeere
[15:44:44] tubbo: what's URT btw?
[15:44:52] FailBit: mean response time
[15:45:05] FailBit: what I really meant was
[15:45:41] nettoweb: has joined #RubyOnRails
[15:45:52] yran: has joined #RubyOnRails
[15:46:01] tubbo: i've never seen anyone refer to 'mean' with the micro symbol
[15:46:05] Antoine59: has joined #RubyOnRails
[15:46:10] tubbo: but i'm now going to call uTorrent "mean-torrent"
[15:46:19] FailBit: it's a common statistical symbol
[15:46:24] FailBit: means population mean
[15:46:43] FailBit: from google: Population mean is represented by the Greek letter ?? (pronounced mu) while sample mean is represented by x?? (pronounced x bar).
[15:46:47] alfie_max15: has left #RubyOnRails: ("Ex-Chat")
[15:47:10] mag42c: has joined #RubyOnRails
[15:47:45] corioliss: has joined #RubyOnRails
[15:47:48] tubbo: oh population mean ok
[15:48:14] tubbo: FailBit: also known as "the atlassian logo"
[15:48:25] tubbo: or "mr. burning man"
[15:49:05] lacrymology: has joined #RubyOnRails
[15:51:19] Guest53: has joined #RubyOnRails
[15:53:55] FailBit: goldbug: migration done
[15:53:58] FailBit: https://i.imgur.com/z3YciGM.png yay
[15:54:34] tubbo: FailBit: dude how did you get that awesome performance between 10-11am
[15:54:37] tubbo: err, 10:30
[15:54:46] tubbo: GOTTA GO FAST
[15:55:03] FailBit: tubbo: architectural change
[15:55:11] FailBit: swapped out postgres json for actual rows
[15:55:31] FailBit: that massively killed off GC/parsing time in ruby
[15:55:32] yoongkang: has joined #RubyOnRails
[15:55:44] tubbo: FailBit: interesting. did you try JSONB?
[15:56:21] FailBit: it wouldn't have been worth my time to try it
[15:56:32] acti0nman: has joined #RubyOnRails
[15:56:35] FailBit: jsonb is for when postgres is slow
[15:56:41] FailBit: well, postgres wasn't slow, the app was slow
[15:56:56] tubbo: FailBit: well, why was the JSON type causing GC issues?
[15:57:02] FailBit: I mean just look at the graph, 60ms GC
[15:57:19] FailBit: because, uh, it's a lot of json
[15:57:37] tubbo: FailBit: yeah i wasn't sure how deep your fields went.
[15:57:39] mary5030: has joined #RubyOnRails
[15:57:47] FailBit: 2 levels, but a shitton of entires
[15:57:49] tubbo: because i'm trying to do this myself (pg models with json types)
[15:58:02] tubbo: yeah and your scale is gonna be different than mine :P
[15:58:13] ruurd: has joined #RubyOnRails
[15:58:40] mary5030: has joined #RubyOnRails
[16:01:15] riotjones: has joined #RubyOnRails
[16:02:37] flip_digits: is there a standard way to skip the first line of a csv file without using fastercsv?
[16:02:50] shibabu_: has joined #RubyOnRails
[16:03:17] goldbug: Question. How is it I am creating an array from a hash here? Is it the sort? @languages = I18nData.languages.sort_by{|key, value| value}
[16:03:49] qejk: has joined #RubyOnRails
[16:05:17] jkamenik1: has joined #RubyOnRails
[16:05:38] safety_cut: has joined #RubyOnRails
[16:06:16] arup_r: flip_digits: Yes, header: true will do that
[16:06:38] matthewd: goldbug: Yes; that's a method on Enumerable, which returns an array
[16:06:57] arup_r: flip_digits: Read the options here: http://ruby-doc.org/stdlib-2.0.0/libdoc/csv/rdoc/CSV.html#method-c-new
[16:07:15] Fire-Dragon-DoL: has joined #RubyOnRails
[16:07:35] goldbug: matthewd: Thought that might be the case.
[16:07:52] urbanmonk: has joined #RubyOnRails
[16:08:00] darrencauthon: has joined #RubyOnRails
[16:08:10] RegulationD: has joined #RubyOnRails
[16:08:22] noodman: has joined #RubyOnRails
[16:08:56] zpe: has joined #RubyOnRails
[16:09:53] pimpin: has joined #RubyOnRails
[16:10:11] momomomomo: has joined #RubyOnRails
[16:10:24] beauby: has joined #RubyOnRails
[16:12:00] tuelz: has joined #RubyOnRails
[16:12:24] iveroooo: has joined #RubyOnRails
[16:14:00] jahbrewski: has joined #RubyOnRails
[16:14:11] stannard: has joined #RubyOnRails
[16:14:58] FCser: has joined #RubyOnRails
[16:16:02] urbanmonk: has joined #RubyOnRails
[16:16:34] umgrosscol: has joined #RubyOnRails
[16:17:01] kies: has joined #RubyOnRails
[16:17:15] kerunaru: has joined #RubyOnRails
[16:17:55] Zarathu: has joined #RubyOnRails
[16:18:28] Zarathu: has left #RubyOnRails: ()
[16:18:31] Zarathu: has joined #RubyOnRails
[16:18:34] chouhoulis: has joined #RubyOnRails
[16:19:47] Pazician: has joined #RubyOnRails
[16:19:59] maletor_: has joined #RubyOnRails
[16:22:33] shinnya: has joined #RubyOnRails
[16:23:21] Antoine59: has joined #RubyOnRails
[16:24:02] northfurr: has joined #RubyOnRails
[16:24:54] unreal: has joined #RubyOnRails
[16:25:25] annlewis: has joined #RubyOnRails
[16:27:09] Maletor: has joined #RubyOnRails
[16:31:49] redondo: has joined #RubyOnRails
[16:32:14] tuelz: has joined #RubyOnRails
[16:32:15] arup_: has joined #RubyOnRails
[16:33:18] sloggerkhan: has joined #RubyOnRails
[16:34:13] yran: has joined #RubyOnRails
[16:34:37] atomical: has joined #RubyOnRails
[16:34:44] Cache_Money: has joined #RubyOnRails
[16:35:05] EminenceHC: has joined #RubyOnRails
[16:36:48] arup_r: has joined #RubyOnRails
[16:37:01] uri: has joined #RubyOnRails
[16:38:47] SteenJobs: has joined #RubyOnRails
[16:38:52] MartinElvar: has joined #RubyOnRails
[16:41:35] apotry: has joined #RubyOnRails
[16:41:45] erbesharat: has joined #RubyOnRails
[16:41:52] hahuang65: has joined #RubyOnRails
[16:42:02] pimpin: has joined #RubyOnRails
[16:42:39] srinidhi: has joined #RubyOnRails
[16:44:21] MartinElvar: has joined #RubyOnRails
[16:45:03] ruurd: has joined #RubyOnRails
[16:47:06] maxz: has joined #RubyOnRails
[16:47:43] mdel: has joined #RubyOnRails
[16:48:08] [Butch]: has joined #RubyOnRails
[16:50:42] dionysus69: has joined #RubyOnRails
[16:52:07] smathy: has joined #RubyOnRails
[16:54:34] doodlehaus: has joined #RubyOnRails
[16:54:52] isjaylee: has left #RubyOnRails: ()
[16:55:03] Spami: has joined #RubyOnRails
[16:55:22] darrencauthon: has joined #RubyOnRails
[16:58:36] barhum2013: has joined #RubyOnRails
[16:58:41] njero: has joined #RubyOnRails
[17:02:01] riotjones: has joined #RubyOnRails
[17:05:04] sloggerkhan: has joined #RubyOnRails
[17:05:38] Fire-Dragon-DoL: has joined #RubyOnRails
[17:07:44] nya: has joined #RubyOnRails
[17:10:43] maxz: has joined #RubyOnRails
[17:11:33] kimegede: has joined #RubyOnRails
[17:12:42] fedexo: has joined #RubyOnRails
[17:14:44] safety_cut: has joined #RubyOnRails
[17:15:02] Maxz_: has joined #RubyOnRails
[17:15:25] rgtk: has joined #RubyOnRails
[17:16:05] mices: has joined #RubyOnRails
[17:16:12] trosborn: has joined #RubyOnRails
[17:16:32] gusrub: has joined #RubyOnRails
[17:16:33] mices: <%= user_signed_in? link_to 'Sign out', user_sign_out_path : link_to 'Sign in', user_sign_in_path %>
[17:16:44] mices: ^ syntax error
[17:19:03] smathy: mices, definitely.
[17:19:23] smathy: Actually, syntax *errors* plural.
[17:19:24] mices: i tried adding parentheses didn't help
[17:19:28] zpe_: has joined #RubyOnRails
[17:20:01] mices: whats the first syntax error?
[17:20:09] FailBit: I mean like
[17:20:10] smathy: mices, probably you're not reading the syntax error properly.
[17:20:11] FailBit: the character ?
[17:20:36] mices: the colon
[17:20:39] smathy: ...or someone can just feed you the answer.
[17:20:46] maletor_: has joined #RubyOnRails
[17:20:49] FailBit: <%= user_signed_in? ? link_to('Sign out', user_sign_out_path) : link_to('Sign in', user_sign_in_path) # for those who prefer immediate gratification %>
[17:20:56] smathy: There we go.
[17:21:16] mices: heh yikes ty
[17:21:38] mices: put my parentheses for the expression not the link_to
[17:22:28] smathy: Sadly, still no clue as to the actual problem.
[17:23:05] pimpin: has joined #RubyOnRails
[17:24:23] safety_cut: has joined #RubyOnRails
[17:24:50] rubyonrailed: has joined #RubyOnRails
[17:27:50] EminenceHC: has joined #RubyOnRails
[17:28:26] rromanch_: has joined #RubyOnRails
[17:29:36] Lorn_: has left #RubyOnRails: ()
[17:29:53] lorn: has joined #RubyOnRails
[17:31:16] slash_nick: has joined #RubyOnRails
[17:31:19] slash_nick: mices: try writing a simpler ternary... when it's working, paste in the actual code to execute in the if/else construct
[17:31:41] slash_nick: mices: FailBit was _not_ suggesting you add parenthesis
[17:32:00] nertzy: has joined #RubyOnRails
[17:32:35] doodlehaus: has joined #RubyOnRails
[17:32:52] JonasOSDever: has joined #RubyOnRails
[17:34:05] tubbo: mices: yeah that line of code is still kinda shitty
[17:34:06] mary5030_: has joined #RubyOnRails
[17:34:26] tubbo: but you're using ERb, it's kind-of annoying to write conditionals in ERb
[17:34:34] mices: i was saying i had previously put my parentheses in the wrong place, around the ternary expression and also i see i was missing a ?
[17:34:51] mices: FailBit: ty
[17:35:14] mices: tubbo: you try not to use inlines?
[17:35:32] mices: smathy: ty
[17:35:36] mices: slash_nick: ty
[17:37:04] slash_nick: mices: i imagine that's in your layout... i'd rather see an if/else in the application view helper than a ternary in the view
[17:38:52] mary5030: has joined #RubyOnRails
[17:41:33] pixelhandler: has joined #RubyOnRails
[17:41:34] momomomomo_: has joined #RubyOnRails
[17:42:16] JonasOSDever: has joined #RubyOnRails
[17:43:01] codelahoma: has joined #RubyOnRails
[17:43:55] mices: FailBit: actually that code causes a syntax error unexpected ',' expecting ')'
[17:44:19] yoongkang: has joined #RubyOnRails
[17:44:21] mices: <td><%= admin_signed_in? ? link_to('Sign out', destroy_admin_session_path) : link_to ('Sign in', new_admin_session_path) %>
[17:46:21] tbuehlmann: remove that space betweet link_to and ('Sign???
[17:46:47] AndroidLoverInSF: has joined #RubyOnRails
[17:47:47] lemur: has joined #RubyOnRails
[17:47:58] flip_digits: has joined #RubyOnRails
[17:49:30] dopie: has joined #RubyOnRails
[17:52:45] mrtomme: has joined #RubyOnRails
[17:52:46] JonasOSDever: has joined #RubyOnRails
[17:53:10] crankharder: does anyone know a way to set up a factory such that an attribute is actually built by a function -- and i'm allowed to somehow pass a param to that funtion when building/creating?
[17:53:33] mices: well it's all there, looks i finally got a grip on devise ha ha
[17:53:57] youngbaks: has joined #RubyOnRails
[17:57:05] yran: has joined #RubyOnRails
[17:58:14] RegulationD: has joined #RubyOnRails
[17:58:36] Tref: has joined #RubyOnRails
[17:58:46] slash_nick: crankharder: do they not document that?
[17:59:00] slash_nick: only asking because to answer your question, i'd go straight to the docs
[17:59:10] crankharder: yea, not seeing much
[18:00:37] slash_nick: crankharder: something like http://www.rubydoc.info/gems/factory_girl/file/GETTING_STARTED.md#Transient_Attributes?
[18:01:09] crankharder: that just lets you define something within the factory
[18:01:13] AndroidLoverInSF: has joined #RubyOnRails
[18:01:25] crankharder: I'm not sure the create/build api would even support this
[18:01:28] matthewd: crankharder: That's what you want
[18:01:46] acti0nman: has joined #RubyOnRails
[18:02:11] slash_nick: http://www.rubydoc.info/gems/factory_girl/file/GETTING_STARTED.md#Dependent_Attributes
[18:02:26] crankharder: nah, I need something def count(n) ; n + 1 ; end -- build(:thing, count: 1) -- obj.count == 2
[18:02:26] joshsmith: has joined #RubyOnRails
[18:02:29] slash_nick: both of those look like tehy let you pass junk in
[18:02:40] slash_nick: crankharder: sequences then?
[18:03:10] corehook: has joined #RubyOnRails
[18:03:21] crankharder: sequences just care about multiple objects being built
[18:03:26] crankharder: they dnot let you pass anythign in
[18:03:42] slash_nick: can you not combine a few of those features?
[18:04:01] crankharder: none of those features allow things to be passed in and modified
[18:04:02] slash_nick: crankharder: what does that even mean? your code sample
[18:04:04] matthewd: crankharder: Wait what? You want a method on your object, that's not an attribute, to be set/manipulated by a factory?
[18:04:25] flashpoint9: has joined #RubyOnRails
[18:04:29] crankharder: no, I want my factory to define a method, which takes an arg passed to it -- and then sets the attribute
[18:04:57] slash_nick: i have no idea what you're trying to do....
[18:05:05] matthewd: Okay.. actual code please
[18:06:32] matthewd: (your intended/hoped-for spec, and the relevant parts of the model it's talking to)
[18:06:58] slash_nick: what you've just said, "Takes an arg" "sets the attribute"... unless i'm misunderstanding you, that's exactly what's being done in the "Dependent Attributes" example... don't get distracted by the interpolation in "email" field, notice "Blow" is overrided as "Doe"
[18:07:09] crankharder: so, AR class, has a int column "count". when I create/build that obj using a factory, I want the inputted value to be modified. So just using "n+1" as a simple function... if I were to create(:thing, count: 1) -- then the value would be 2
[18:07:27] slash_nick: perfect usecase for "sequences" by the way
[18:07:32] kerunaru: has joined #RubyOnRails
[18:07:54] lemur: has joined #RubyOnRails
[18:07:59] crankharder: not really. you're thinking too narrowly. the function is arbitrary
[18:08:09] slash_nick: i think i'm seeing now
[18:08:24] AndroidLoverInSF: has joined #RubyOnRails
[18:08:46] crankharder: sequences don't look at the value passed in. they just increment n and pass that to the block if you create multiple things
[18:09:19] slash_nick: crankharder: right.
[18:09:46] slash_nick: crankharder: would you be okay with create(:thing, n: 1)... then inside the block, `count "#{n + 1}"`?
[18:09:51] matthewd: factory(:user) { transient { c 0 }; count { c + 1 } }
[18:10:51] _3dwardsharp: has joined #RubyOnRails
[18:12:04] tianyi: has left #RubyOnRails: ()
[18:12:08] Jon30: has joined #RubyOnRails
[18:12:30] momomomomo_: has joined #RubyOnRails
[18:12:35] rakm: has joined #RubyOnRails
[18:12:56] barhum2013: has left #RubyOnRails: ()
[18:13:13] slash_nick: ... there's so many ways to do it... in the docs... linked above...
[18:13:50] kerunaru: has joined #RubyOnRails
[18:15:07] Jon30: hey guys, about a week ago I was trying to find a solution to a problem here, and I still can't find it. I am using RedHat server, Rails.cache.fetch is writing to the CORRECT tmp directory using the WRONG username permissions. It happens randomly, and the Linux username is different. I have Rails/Passenger/Apache running, and I have different rails apps running on different Linux usernames/home directories.
[18:16:16] honestemu: has left #RubyOnRails: ()
[18:16:25] darrencauthon: has joined #RubyOnRails
[18:17:40] cihad: has joined #RubyOnRails
[18:18:30] corehook_: has joined #RubyOnRails
[18:19:18] crankharder: slash_nick: inside which block
[18:19:41] djbkd: has joined #RubyOnRails
[18:19:42] slash_nick: factory foobar { }
[18:20:06] crankharder: count "#{n + 1}"
[18:20:09] crankharder: doesn't work. what is n?
[18:20:16] ruurd: has joined #RubyOnRails
[18:20:20] stannard: has joined #RubyOnRails
[18:20:22] slash_nick: supplied when you call build/create
[18:20:38] slash_nick: create(:foobar, n: 0)
[18:21:55] iliketurtles: has joined #RubyOnRails
[18:22:25] matthewd: crankharder: See the example I gave, which is implementing exactly what slash_nick is describing
[18:22:31] matthewd: (only I used 'c' instead of 'n')
[18:24:08] FailBit: are you that one guy that got kickb& last night?
[18:25:01] FailBit: doesn't look like it
[18:25:18] matthewd: Jon30: That doesn't sound like enough information to really diagnose
[18:25:53] matthewd: Are you sure it's in the right directory with the wrong username, and not the wrong directory with the right username? (i.e., have you inspected the file and confirmed which app it belongs to?)
[18:29:25] raunicolae: has joined #RubyOnRails
[18:30:41] flip_digits: has joined #RubyOnRails
[18:31:13] slash_nick: crankharder: if it's not working, please supply the code you are running in a gist for further help, please
[18:32:21] mices: let's say somebody bids for something on a popular auction site where does the bid go into the bids table in the database? aren't there too many listings to put all those bids into one table
[18:32:22] EminenceHC: has joined #RubyOnRails
[18:32:32] lacrymology: has joined #RubyOnRails
[18:33:04] FailBit: mices: won't they just get deleted after the sale is over?
[18:33:11] slash_nick: mices: who says they're using tables?
[18:33:33] ProLoser: has joined #RubyOnRails
[18:33:37] FailBit: and, maybe you aren't understanding how well databases can scale
[18:34:00] htmldrum: has joined #RubyOnRails
[18:34:01] FailBit: my app's copy of postgres currently stores around 135 million rows, from all tables
[18:34:26] Pazician: has joined #RubyOnRails
[18:34:55] FailBit: one of the tables alone has
[18:34:57] FailBit: 108439231 rows
[18:35:33] mices: i dunno how many listings there are ending at the same time with people putting in bids with 2 seconds to go
[18:35:47] mices: seems amazing
[18:36:01] FailBit: because they aren't at the same time
[18:36:07] FailBit: locks are important
[18:36:32] Meow-J: has joined #RubyOnRails
[18:37:46] arthurix: has joined #RubyOnRails
[18:37:55] riotjones: has joined #RubyOnRails
[18:38:01] justin_herrick: has joined #RubyOnRails
[18:38:29] mices: devise doesn't add all fields like confirmed_at by default, options have to be passed to the generator
[18:39:20] safety_cut: has joined #RubyOnRails
[18:39:31] FailBit: >implying devise isn't pure 100% perfection
[18:39:35] FailBit: THE HORROR
[18:39:46] FailBit: especially for just a generator
[18:40:42] darkxploit: has joined #RubyOnRails
[18:43:09] robbyoconnor: has joined #RubyOnRails
[18:43:21] theblang: has joined #RubyOnRails
[18:44:04] Fire-Dragon-DoL: has joined #RubyOnRails
[18:44:54] darrencauthon: has joined #RubyOnRails
[18:45:21] yfeldblum: has joined #RubyOnRails
[18:45:59] platzhirsch: has joined #RubyOnRails
[18:46:41] platzhirsch: When doing query interpolation with like SELECT :column FROM table WHERE :column IS NOT NULL; then :column in the select statement gets inserted as a STRING, but I want the concrete value
[18:46:44] AndroidLoverInSF: has joined #RubyOnRails
[18:46:56] platzhirsch: any ideas how to circumvent that except pre-populating that one with %s and using Ruby?
[18:47:39] DoubleMalt: has joined #RubyOnRails
[18:48:07] maxz: has joined #RubyOnRails
[18:48:22] baweaver: Table.where.not(column: nil).select(:column)
[18:48:35] platzhirsch: Rails 2.3 here, sorry
[18:48:40] baweaver: also, don't use string interpolation
[18:48:48] blackmes1: has joined #RubyOnRails
[18:48:53] smathy: "too many listings to put all those bids into one table" LOL :)
[18:48:53] raunicolae: has joined #RubyOnRails
[18:49:33] baweaver: Not familiar enough with it, and I'm fairly sure telling you to upgrade isn't going anywhere, so I'm out.
[18:49:41] MartinElvar: has joined #RubyOnRails
[18:50:34] LambdaSource: has joined #RubyOnRails
[18:50:48] shmambo: has joined #RubyOnRails
[18:51:40] tuelz: has joined #RubyOnRails
[18:51:52] Grundell: has joined #RubyOnRails
[18:54:07] hardtail: has joined #RubyOnRails
[18:54:35] Maxz_: has joined #RubyOnRails
[18:55:16] Pazician: has joined #RubyOnRails
[18:56:36] doodleha_: has joined #RubyOnRails
[18:57:07] ProLoser_: has joined #RubyOnRails
[18:57:13] doodlehaus: has joined #RubyOnRails
[18:57:14] roxtrongo: has joined #RubyOnRails
[18:57:57] roxtrongo: has joined #RubyOnRails
[18:58:16] platzhirsch: has left #RubyOnRails: ()
[18:58:20] smathy: platzhirsch, it's 2.3, so obviously security / SQL bugs are not a concern, so just do the string interpolation or %s
[18:58:27] smathy: Aww, gone.
[18:58:31] htmldrum: has joined #RubyOnRails
[18:58:58] Tref: has joined #RubyOnRails
[18:59:00] slash_nick: but pass it through a case statement or something instead of just conveying user's input directly
[18:59:11] safety_cut: has joined #RubyOnRails
[18:59:28] smathy: 2.3 - may as well just do: Table.find_by_sql params[:sql]
[18:59:55] smathy: Doesn't even CSRF
[19:00:33] dented42: has joined #RubyOnRails
[19:00:41] maxz: has joined #RubyOnRails
[19:00:56] joshsmith_: has joined #RubyOnRails
[19:03:27] roxtrongo: has joined #RubyOnRails
[19:04:33] RegulationD: has joined #RubyOnRails
[19:07:10] `based_pdev`: has joined #RubyOnRails
[19:07:39] annlewis: has joined #RubyOnRails
[19:07:59] unreal_: has joined #RubyOnRails
[19:15:56] dmarr: Radar: I don't suppose you were able to repro that issue I was having on the localpic repo I sent yOU?
[19:16:09] rgtk: has joined #RubyOnRails
[19:18:24] shinnya: has joined #RubyOnRails
[19:18:56] dici: has joined #RubyOnRails
[19:19:45] rgrmatt: has joined #RubyOnRails
[19:21:05] _lazarevsky: has joined #RubyOnRails
[19:22:07] dwt_dev: has joined #RubyOnRails
[19:22:30] _lazarevsky: this is not a ruby/rails specific question, but I am busy preparing for an interview and came across
[19:22:42] _lazarevsky: the answer is not obvious to me so I wanted to run it by you
[19:22:48] _lazarevsky: Describe a program that could detect whether a chunk of text in a document is a list or not. There are no obvious indicators like "1." or "-" or "*" however each list entry is on a new line. An example list would be:
[19:23:04] _lazarevsky: Third like fsdf
[19:23:28] _lazarevsky: I was thinking that since this string will be encoded, each new line will be denoted as \n in the DB no?
[19:23:59] _lazarevsky: so I'd just do a regex search for \n
[19:24:30] Megamos: has joined #RubyOnRails
[19:25:08] Megamos: has joined #RubyOnRails
[19:25:37] SteenJobs: has joined #RubyOnRails
[19:26:47] smathy: _lazarevsky, how will that differentiate those lines from any other lines?
[19:26:59] Zarathu: has left #RubyOnRails: ()
[19:27:08] _lazarevsky: well \n denotes the end of a line
[19:27:14] slash_nick: why involve a DB at all?
[19:27:21] _lazarevsky: or rather the beginning of a new one
[19:27:31] MartinElvar: has joined #RubyOnRails
[19:28:06] momomomomo: has joined #RubyOnRails
[19:28:23] slash_nick: _lazarevsky: one may not expect empty list items...so you could compare the line count to the non-empty line count...
[19:28:47] kadoppe: has joined #RubyOnRails
[19:28:49] _lazarevsky: slash_nick: line count?
[19:28:55] _lazarevsky: dude you're given a string.. I presume
[19:29:04] slash_nick: _lazarevsky: you said "document" dude
[19:29:06] Megamos: has joined #RubyOnRails
[19:29:22] slash_nick: ACTION abides
[19:29:48] slash_nick: hence the question, why is a DB involved at all?
[19:30:27] _lazarevsky: slash_nick: fair enough
[19:30:37] _lazarevsky: what if there's a empty line between the list items
[19:31:56] _lazarevsky: slash_nick: btw I am not quite sure I understood what you meant by "... so you could compare the line count to the non-empty line count...|
[19:31:57] slash_nick: then my method would guess wrong
[19:33:10] youngbaks: has joined #RubyOnRails
[19:33:37] FailBit: https://www.elastic.co/404
[19:33:43] gusrub: has joined #RubyOnRails
[19:34:00] slash_nick: "each list entry is on a new line"... taking that to mean the record separator is newline, and there are no empty records, then a file whose overall line count matches the line count of all it's non-empty lines... it'd appear to be a list
[19:35:46] slash_nick: there may not be one correct answer here... someone who asks this question just wants to see how you think... do you get bogged down on a detail, too narrow a focus, or do you see the problem and reason about it...
[19:35:50] alb12: has joined #RubyOnRails
[19:35:55] rgrmatt: has joined #RubyOnRails
[19:36:14] SteveC: has joined #RubyOnRails
[19:36:44] [Butch]: has joined #RubyOnRails
[19:37:37] rdavila: has joined #RubyOnRails
[19:37:53] iamse7en: has joined #RubyOnRails
[19:38:08] Nuck: tbh I'd iterate through all the lines, storing everything past the last empty line
[19:38:16] Nuck: Super simple, dump it out every time you hit an empty line
[19:38:34] Nuck: Sometimes iterative approaches are simpler than regexes :P
[19:38:44] slash_nick: nuck: so how do you output "list" or "not list"?
[19:38:58] manfrin: has joined #RubyOnRails
[19:39:02] Nuck: > that could detect whether a chunk of text in a document is a list or not
[19:39:23] Nuck: This would output any lists in the text
[19:39:29] mwlang: has joined #RubyOnRails
[19:39:32] slash_nick: nuck: it would output text...
[19:39:35] slash_nick: were they lists?
[19:39:46] Nuck: If you wanted to just identify, go through and `return true` at the first empty line
[19:39:56] slash_nick: how do you decide what a list is? how do you evaluate whether that criteria is met?
[19:40:16] Nuck: If you need a truly detailed approach, train a neural network :^)
[19:41:14] Nuck: But in my experience you rarely need that level of accuracy
[19:41:16] slash_nick: why does having an empty line mean it's a list? what if the first line (and only line) is an empty one?
[19:41:38] Nuck: slash_nick: I'm basing it on a few assumptions. First and foremost, that paragraphs are not hard wrapped
[19:41:45] Nuck: Second, that there's an empty line between paragraphs
[19:41:55] slash_nick: i think you're in left field
[19:41:59] Nuck: And third, that a list will be a set of consecutive lines without a separating empty line
[19:42:08] raunicolae: has left #RubyOnRails: ("Once you know what it is you want to be true, instinct is a very useful device for enabling you to know that it is")
[19:42:39] Nuck: I can't think of any real world situation where you need to do that
[19:43:13] Nuck: So why not make up contrived constraints for input data to match the contrived question
[19:43:24] slash_nick: you have to :)
[19:43:53] Nuck: Hence my list of three constraints on input data formatting
[19:44:16] Nuck: And a simple iterative approach to finding all lists in a document
[19:45:04] baweaver: has joined #RubyOnRails
[19:45:10] slash_nick: ah... i read the question as "determine whether a document is a list"... that is _not_ what was asked :)
[19:45:29] allcentury: has joined #RubyOnRails
[19:45:37] Nuck: In that case, iterating and bailing at the first instance where you see an empty line would work within my constraints ;)
[19:46:17] Nuck: And despite being O(n) like your counting concept, it allocates no memory
[19:46:35] Nuck: And when false will usually return 50% faster than yours
[19:46:47] riotjones: has joined #RubyOnRails
[19:46:59] matthewd: true # what is a string, but a list of characters?
[19:47:23] tubbo: matthewd: *mindblown.gif*
[19:47:23] Nuck: matthewd: A length and an encoding
[19:48:03] tubbo: slash_nick: considering that is exactly what _lazarevsky said, you'd be correct in assuming that.
[19:48:05] tubbo: _lazarevsky | Describe a program that could detect whether a chunk of text in a document is a list or not.
[19:48:32] slash_nick: tubbo: close, but i did misinterpret... chunk of text is list (chunk is in document)
[19:48:36] slash_nick: not document is list
[19:48:41] Nuck: Honestly the prompt is kind of vague on that front
[19:48:57] Nuck: What's your input exactly?
[19:49:05] Megamos: has joined #RubyOnRails
[19:49:34] slash_nick: thing is, no one says the list has to make sense... i think matthewd nailed it
[19:49:53] Nuck: Definitely
[19:49:59] slash_nick: we're all unhired, btw.
[19:50:00] matthewd: It depends whether it means a given chunk, or an arbitrary chunk. But seriously, without a negative example, I'm really not sure what this is asking for, short of !str.match(/\n/)
[19:50:03] slash_nick: except matthewd
[19:50:27] Nuck: Reminds me of when I solved a glorified fizzbuzz in a class using a horrifying series of `goto` statements in C++
[19:50:32] cornerma1: has joined #RubyOnRails
[19:50:53] Nuck: I should solve interview questions using only heavily obfuscated code
[19:51:20] MEATCHICKEN: I have a database dump .sql file - how do I find out which database it was dumped from?
[19:51:30] Nuck: Probably a comment at the top
[19:51:42] Nuck: Then I think you're fucked
[19:51:42] MEATCHICKEN: I tried reading it into sqlite3 - fail
[19:51:47] rhizome: ask the person who dumped it
[19:51:56] Nuck: Or wait do you mean database *system*?
[19:52:11] Nuck: Because that's easy with trial and error
[19:52:21] acti0nman: has joined #RubyOnRails
[19:52:43] Nuck: Start at the most common DBMSes (Postgres, MySQL) and work your way down to stuff like Oracle
[19:52:49] erbesharat: has joined #RubyOnRails
[19:53:08] rhizome: or just ask
[19:53:20] Nuck: Asking means getting out of your chair sometimes
[19:53:22] adac: has joined #RubyOnRails
[19:53:29] Nuck: Clearly more convenient to spend an hour trying it in different DBMSes
[19:53:43] rhizome: right, because everybody has oracle sitting around
[19:53:43] Nuck: Ugh wtf why is the rolify method loaded but not scopify
[19:53:56] Nuck: rhizome: Well if he doesn't, I assume he can just cross that one off
[19:54:08] rhizome: unless the dump came from somewhere else
[19:54:29] Nuck: That's when you sharpen your blade and prepare for war
[19:54:31] JonasOSDever: has joined #RubyOnRails
[19:54:47] kshah: has joined #RubyOnRails
[19:54:48] rhizome: seems like a pretty extreme workaround for picking up a phone
[19:55:17] havenwood: has joined #RubyOnRails
[19:55:20] AndroidLoverInSF: has joined #RubyOnRails
[19:55:25] EminenceHC: has joined #RubyOnRails
[19:55:48] Nuck: You mean your workplace doesn't involve torture to get documentation written?
[19:56:17] AndroidLoverInSF: has joined #RubyOnRails
[19:56:19] strgbrew: has joined #RubyOnRails
[19:57:01] tubbo: nuck: story of my life
[19:57:35] chipotle: has joined #RubyOnRails
[19:57:40] Megamos: has joined #RubyOnRails
[19:58:06] kshah: Hi, i???m trying to see if I can override AC render to change the name of the template being rendered by convention if it exists. For example if ???index.some_site.haml??? exists render that instead of ???index.haml??? which would have been rendered by default by the index action
[19:58:17] tubbo: kshah: nope
[19:58:18] helpa: Next question, please!
[19:58:28] tubbo: kshah: i mean technically you can, but it's a bad idea
[19:59:03] Nuck: I did something similar by appending a folder with the site name to the list of search paths for views
[19:59:14] tubbo: kshah: the way rails views override each other, you should just be able to replace the view file in your host app (assuming this is some kind of gem or library) and rails will override it for you
[19:59:17] goodcodeguy: has joined #RubyOnRails
[19:59:30] tubbo: kshah: but the way you want to do it with the dot syntax won't work
[19:59:38] Nuck: Probably better to use search paths for it
[19:59:44] kshah: tubbo: it doesn???t have to be dot syntax
[19:59:47] matthewd: Are you XYing localization?
[19:59:50] kshah: I can go with nucks route for instance
[20:00:08] kshah: not for localization, we host two sites with the same code base, different views though
[20:00:11] tubbo: kshah: that's probably better
[20:00:35] rhizome: how is the view going to distinguish between index.some_site.haml and index.other_site.haml
[20:00:43] matthewd: Not just different layouts?
[20:00:53] Pazician: has joined #RubyOnRails
[20:00:54] kshah: different layouts as well, same controllers and models
[20:00:56] dtordable: has joined #RubyOnRails
[20:00:57] Nuck: Basically I have a before_action with prepend_view_path "app/views/#{@site.template_dir}"
[20:01:05] Nuck: And it works pretty great
[20:01:15] Nuck: Downside is that apparently layouts don't follow the view search paths
[20:01:29] Nuck: Which honestly seems kind of weird
[20:01:31] kshah: nuck: I???ll roll with that, that???s a good convention.. layouts not a problem for me
[20:01:38] colleenmcguckin: has joined #RubyOnRails
[20:01:40] rhizome: sounds like convention vs configuration
[20:01:40] momomomomo: has joined #RubyOnRails
[20:02:35] Megamos: has joined #RubyOnRails
[20:02:57] Nuck: I had the exact same problem, running 20 sites with the same basic layout and only minor CSS changes but different content
[20:03:17] Nuck: This client has some weird ideas about marketing
[20:03:53] njero: has joined #RubyOnRails
[20:04:45] doodlehaus: has joined #RubyOnRails
[20:04:50] kshah: nuck: I???m pretty much in exactly the same situation??? they do well with their setup.. prevents google from seeing the content as a duplicate but it essentially is
[20:05:33] _lazarevsky: thanks for the input okes
[20:05:37] _lazarevsky: really appreciate it
[20:05:38] tubbo: nuck: sounds like a scam
[20:05:45] _lazarevsky: I was busy going through other interview questions
[20:05:58] Nuck: tubbo: lol how
[20:06:04] Nuck: He doesn't hide their relationship
[20:06:13] Nuck: He just tries to target the marketing to specific subsets
[20:06:38] tubbo: nuck: people are stupid, but i worked for a very similar company who didn't try to hide it either
[20:06:44] tubbo: yet they still were sorta scamming
[20:06:47] tubbo: it's gray hat really
[20:08:11] Nuck: He's genuinely not scamming, he's just marketing to old conservative dudes who have a general disdain for the other markets
[20:08:20] Nuck: Like, one subset likely has a feud with 3-4 of the other subsets
[20:08:25] Nuck: It's sports stuff
[20:11:01] duncannz: has joined #RubyOnRails
[20:11:07] x-light: has joined #RubyOnRails
[20:11:18] SteveC: Hey guys. I'm new to Ruby/RoR and I'm wondering what your thoughts are on RubyMine. Is it worth using?
[20:11:39] melonstorm: has joined #RubyOnRails
[20:11:48] rhizome: SteveC: some think so, some don't. like all text editors, it's a matter of personal preference.
[20:12:01] Nuck: vim forever!
[20:12:31] Nuck: rhizome: s/personal preference/endless feuds and long arguments/
[20:12:37] SteveC: It was a bit of a PITA to setup, hence why I'm asking the more seasoned rubyist crowd :)
[20:12:37] tubbo: SteveC: i've never met any respectable developer who's used RubyMine ;)
[20:12:54] tubbo: not sure if that's anything to do with RubyMine or whatever
[20:13:01] tubbo: think it has more to do with how that person picks their tools.
[20:13:18] Nuck: I think scripting language communities in general tend towards very lightweight general editors
[20:13:53] Nuck: TextMate, Sublime, Vim, etc.
[20:14:12] Nuck: Atom isn't exactly lightweight
[20:14:23] Nuck: There's a reason I also didn't list emacs
[20:14:25] tubbo: atom's pretty cool
[20:14:36] Nuck: Atom is an interesting experiment
[20:14:38] tubbo: nuck: because you're a vim user and you're butthurt at how much better emacs is?
[20:14:52] SteveC: I usually prefer Vim for JS/HTML/Perl, but RoR is a bit of a different duck for me.
[20:14:56] njero: nuck: emacs is not bad
[20:15:03] Nuck: tubbo: Nah, I just prefer my editor to edit things instead of being an irc client
[20:15:23] Nuck: emacs is a wonderful OS lacking only in a proper text editor
[20:16:04] Nuck: Note to self: stop forgetting to require dependencies in engine.rb you fucking idiot nuck
[20:16:24] Nuck: Literally spent 4 hours debugging something I debugged two weeks ago
[20:16:28] Nuck: Because I forgot :u
[20:16:56] colleenmcguckin: has joined #RubyOnRails
[20:17:10] rhizome: missing test
[20:17:16] SteveC: hey it's a friday ;)
[20:17:20] crystalneth: has joined #RubyOnRails
[20:17:27] Nuck: rhizome: Problem is tests won't run
[20:17:47] Nuck: The initialization process went boom because I forgot to `require 'rolify'`
[20:18:00] tubbo: SteveC: why is rails so different for you?
[20:18:11] justin_herrick: has joined #RubyOnRails
[20:18:15] srinidhi1: has joined #RubyOnRails
[20:18:23] momomomomo_: has joined #RubyOnRails
[20:20:36] SteveC: tubbo: it really isn't. just thought it would speed up my workflow if I went back to using an IDE.
[20:21:07] Nuck: I just have a million vim plugins to speed up my workflow
[20:21:29] Nuck: My favorite right now is still the one which autoinserts "end" in Ruby code
[20:21:33] jsrn_: has joined #RubyOnRails
[20:21:35] tubbo: SteveC: ah ok. i was just wondering if the amount of files/folders were a problem, because they certainly were for me. solved it by using VimR, a graphical implementation of Vim with a project folder drawer.
[20:21:53] lacrymology: don't models have references to non-relational fields?
[20:21:54] dsimon: CtrlP is great for that too
[20:22:07] Nuck: I use NERDTree
[20:22:08] tubbo: nuck: big fan of vim-easydir as well
[20:22:09] dragonkh: has joined #RubyOnRails
[20:22:19] tubbo: always hated NERDtree. prefer to just use `ls`. :)
[20:22:31] tubbo: but now that i'm better at hjkl movement, NERDTree might work out more often
[20:22:33] ProLoser: has joined #RubyOnRails
[20:22:38] Nuck: I like the ability to expand and collapse things
[20:22:55] Nuck: Gundo has saved my life a number of times too
[20:23:04] simkessy: is ruby on rails MVC?
[20:23:09] tubbo: nuck: Gundo?
[20:23:11] tubbo: simkessy: "yes".
[20:23:21] simkessy: cool thanks :)
[20:23:22] Nuck: tubbo: It shows a graphical representation of the undo-tree in vim
[20:23:25] SteveC: tubbo: yeah I'm actually just starting a project that will be Rails based, so # of files isn't really a problem just yet, but I find it more useful to see the structure visually instead of having to hop around on the command line.
[20:23:29] Nuck: If you undo some changes, make more changes
[20:23:35] Nuck: You can still get back to the other branch
[20:23:48] tubbo: simkessy: MVC is kind-of open ended.
[20:23:49] blackmes1: has joined #RubyOnRails
[20:23:56] tubbo: that's nice
[20:23:58] dviola: has joined #RubyOnRails
[20:24:02] Nuck: Also vim protip: just install everything by tpope
[20:24:08] Nuck: You won't regret it
[20:24:13] simkessy: tubbo that's fine just for my resume, people will get what I mean
[20:24:24] SteveC: vimdiff is a nightmare
[20:24:29] SteveC: at least for me it is
[20:24:41] dviola: I have a ping pong app where I keep track of users and their games, I also save store and opponent_score on the user model, I need to find out how to calculate the "games played" and "ranking", any advice please?
[20:24:45] dviola: I'm a little lost on that
[20:25:23] Nuck: Isn't there a chess ranking algorithm that works for 1v1 matchups
[20:25:30] petricore: has joined #RubyOnRails
[20:25:46] jessemcgilallen: has joined #RubyOnRails
[20:25:53] Nuck: I remember seeing this in a certain movie about a certain social network
[20:26:51] rhizome: https://en.wikipedia.org/wiki/Elo_rating_system#Use_outside_of_chess
[20:27:20] Nuck: I love their music
[20:27:40] tubbo: i have way too many vim plguins https://github.com/tubbo/home/blob/master/.vimrc#L12-L49
[20:28:01] adam12: I just switched to neovim after vim netrw busted on me and dumped a ton of plugins.
[20:28:04] lacrymology: is there an easy way for me to know what are all the fields in one of my models?
[20:28:06] smathy: ...but emacs is so much better.
[20:28:16] rhizome: it really is. they both are.
[20:28:37] Nuck: emacs was all about extensibility, and vim was all about composability
[20:28:42] Nuck: But now vim has extensibility
[20:28:48] Nuck: emacs still hasn't gotten composability
[20:28:50] tubbo: debatable
[20:28:52] tubbo: VimL sucks
[20:28:59] rhizome: lacrymology: rails c; ModelName<CR>
[20:29:02] duncannz: has joined #RubyOnRails
[20:29:04] Nuck: Yeah but you can extend in Python or Ruby
[20:29:09] SteveC: is emacs retina compatible? lol
[20:29:14] Nuck: And there's that one compile-to-VimL language
[20:29:14] smathy: Hmm, that joke fell flat.
[20:29:26] tubbo: smathy: lol was that a joke? ;)
[20:29:36] Nuck: You opened a scary can of worms smathy
[20:29:45] smathy: nuck, tubbo, dviola adam12 SteveC - take your edit chat elsewhere please.
[20:31:54] palidanx: has joined #RubyOnRails
[20:32:51] lacrymology: rhizome: thanks
[20:33:23] rhizome: you're welcome
[20:35:24] dikaio: has joined #RubyOnRails
[20:35:59] VeryBewitching: has joined #RubyOnRails
[20:36:39] palidanx: It has been a while since i have deployed a new rails app, are there any new deployment ops other than docker, puppet, and chef as of late?
[20:37:55] safety_cut: has joined #RubyOnRails
[20:39:06] FailBit: nobody uses cap/mina?
[20:39:28] Nuck: I've heard a lot of people diss on cap
[20:39:40] arBmind: has joined #RubyOnRails
[20:39:42] hahuang65: has joined #RubyOnRails
[20:39:50] Nuck: Which I kind of understand, it's glorified shell scripting and it has a lot of downsides it shares with shell scripting
[20:40:48] smathy: Works for me.
[20:40:54] rhizome: ACTION still cap2
[20:41:01] Nuck: ansible is one of my favorites
[20:41:13] glennfu: has joined #RubyOnRails
[20:41:14] Nuck: It's exactly how I always modeled my servers
[20:41:17] tubbo: FailBit: literally everyone uses it
[20:41:20] tubbo: litereally
[20:41:22] tubbo: every single person
[20:41:25] tubbo: in the world
[20:41:25] Nuck: Kind of true
[20:41:26] EminenceHC: has joined #RubyOnRails
[20:41:35] tubbo: capistrano is nice
[20:41:59] Nuck: I hope docker grows to further maturity
[20:42:02] Nuck: It shows great promise
[20:42:12] rhizome: rump kernels are where it's at
[20:42:18] Nuck: The be-all end-all of deployment
[20:42:45] glennfu: Anyone use rails-engines within their apps to separate sections of code like mini-apps? I'm seeing some guides but everyone that talks about adding specs talks about `--dummy-path=spec/test_app` for the specs to connect to. Since I'm only ever going to use it on my 1 real app, is there a better way to handle this?
[20:42:59] tubbo: glennfu: yeah it's such a bad fucking idea and you're an asshole if you do this
[20:43:17] Nuck: wow tubbo
[20:43:17] glennfu: tubbo: WOW! I see that you have some opinions
[20:43:21] djbkd: has joined #RubyOnRails
[20:43:31] tubbo: here are all the fucks i give:
[20:43:40] Nuck: fuck, fuck, fuck
[20:43:42] Nuck: Three whole fucks
[20:43:48] tubbo: /mode nuck +q
[20:43:49] Nuck: ACTION completes your sentence for you
[20:44:12] rhizome: glennfu: i'm not a spec'er but the engine should do its own test thing. is that what you mean?
[20:44:18] tubbo: glennfu: it generally causes more problems than it solves. have you ever heard of the trailblazer architecture style?
[20:44:19] htmldrum: has joined #RubyOnRails
[20:44:28] kshah: nuck: unfortunately the prepend_view_path solution causes a weird code organization thing, depending on perspective. like I can???t easily do /app/views/model/site/template it???s more like /app/views/site/model/template e.g.
[20:44:57] Nuck: Yeah but Convention???
[20:45:03] glennfu: rhizome: yeah I guess I'm battling with that philosophically. This isn't its "own thing" although I know the code basically won't interact with the main app.
[20:45:41] glennfu: tubbo: I'll go google that now!
[20:46:14] tubbo: glennfu: sorry i'm a little butthurt by that. the apps i deal with at work were built using a self-made collection of engines (think spree, but more complex).
[20:46:45] glennfu: tubbo: no problem, I'm happy to hear opinions from someone with real experience. I just came across it as I was trying to figure out how to architect what I was building.
[20:46:48] tubbo: they cause a lot of problems, most notably because a rails app is not designed to be implemented with only engines. you're supposed to have some "app code".
[20:46:57] tubbo: it's "the wrong tool for the job"
[20:47:13] maletor_: has joined #RubyOnRails
[20:47:16] Nuck: Rails engines seem like they can lead to quite a disaster if not used properly
[20:47:24] Nuck: As with any freeform encapsulation
[20:47:25] SteenJobs: has joined #RubyOnRails
[20:47:26] glennfu: My first instinct was "oh this is obviously a new rails app", but then the more I thought about it, I realized it's completely independent of the other, from the consumer side, it should be accessed at the same root url by the same people doing the same job
[20:47:40] yoongkang: has joined #RubyOnRails
[20:47:47] glennfu: Like, it won't even share any models
[20:47:47] Papierkorb: And they're not really flexible either. they can only be mounted once, not with different settings for different paths, etc.
[20:47:51] drewdfw: has joined #RubyOnRails
[20:48:10] baweaver: has joined #RubyOnRails
[20:48:20] matthewd: +1 engines are not designed for that
[20:48:22] tubbo: nuck: quite
[20:48:33] tubbo: matthewd: thank you
[20:48:43] glennfu: ok good to know, thanks all :)
[20:48:49] Papierkorb: The biggest issue I had when I tried them out was that I wanted to use them as plugins. They're not designed for that as far I can tell.
[20:49:07] glennfu: is Trailblazer a better solution to this problem considering I know the models/controllers/routes will not talk to each other?
[20:49:11] tubbo: there are really three things i hate in the rails community more than anything
[20:49:12] matthewd: I'm pretty sure DHH has shown sentiment not dissimilar to tubbo's above on the matter, actually :)
[20:49:15] baweaver: has joined #RubyOnRails
[20:49:19] tubbo: glennfu: i'm not even sure
[20:49:27] glennfu: I don't want to double the # of files in my /app/models folder if they're logically completely isolated
[20:49:28] tubbo: 2.) Spree-style Engines-as-a-rails-app
[20:49:30] tubbo: 3.) default_scope
[20:49:33] tbuehlmann: turbolinks? *whisper*
[20:49:42] tubbo: turbolinks isn't bad if you know how to use it
[20:49:47] glennfu: tbuehlmann: whatever I do, it'll have Turbolinks 5 ALL OVER IT
[20:49:50] sdwrage: has joined #RubyOnRails
[20:49:57] glennfu: that's the one thing I know I'm doing right :)
[20:50:01] Nuck: STI has its place, but I hear a lot of people jump to it way too easily
[20:50:05] tbuehlmann: I also like turbolinks :)
[20:50:23] Nuck: I'd say default_scope has a place, but I only ever use it for eager loading
[20:50:30] tubbo: nuck: i disagree, if you use a proper database that allows you to store unstructured data of some kind into a structured table, you don't need it and it adds a ton of technical debt.
[20:50:37] glennfu: STI implies they share something at the core. They don't here.
[20:50:41] tubbo: nuck: default_scope is a huge anti-pattern and causes problems if you don't know exist
[20:50:57] tubbo: STI couples your data design to your object design, which is totally retarded.
[20:51:07] Nuck: tubbo: I use Postgres and used STI for some stuff wrapping an hstore
[20:51:15] Nuck: The hstore would have different content we didn't query into
[20:51:26] glennfu: They're really only common on the business level. Separate rake tasks importing models, separate controller endpoints feeding data out to the mobile app.
[20:51:33] Nuck: But the rest of the columns (about 6 of them) were shared amongst different objects with very different behaviors
[20:51:42] tubbo: nuck: see if i were implementing that i'd have just instantiated regular classes with the data in the hstore.
[20:52:23] Nuck: tubbo: STI made it extremely simple and kept our surface area low
[20:52:32] tubbo: nuck: how old is this app?
[20:52:56] rgtk: has joined #RubyOnRails
[20:52:56] tbuehlmann: STI is admittedly tempting
[20:52:58] Nuck: This was a refactor from a giant behemoth of a model I did about 6 months ago
[20:53:07] tubbo: ah ok, so it was already poorly designed.
[20:53:08] rgrmatt: has joined #RubyOnRails
[20:53:13] Nuck: Yeah this was a huge boost
[20:53:14] tubbo: and you just incrementally made it better
[20:53:25] tubbo: that kinda makes sense but it's still fucked up :P
[20:53:31] Papierkorb: I basically couple STI with a 'metadata' JSONB column. Without this feature of PSQL, STI would be worthless to me
[20:53:43] Nuck: I think STI is tolerable when wrapping an hstore or json column
[20:53:56] Nuck: But if you try and use it with a bunch of empty fields, go fuck yourself
[20:53:59] tubbo: yeah see i don't understand how/why you people are using STI if you're already using hstore
[20:54:13] tubbo: you shouldn't need it
[20:54:18] Nuck: It was extremely useful in my case because we had extremely different behavior per-type
[20:54:33] Papierkorb: tubbo: I define accessors for this 'metadata' in the sub-classes
[20:54:35] glennfu: tubbo: so STI is definitely out. default_scope again assumes same models. Now I'm back to thinking engines makes sense. Today, this code exists inside of app A. I want to take this code out, and put it into app B. However, knowing that it completely works outside of app B, it doesn't make sense to merge the model/controller/view folders.
[20:55:10] Nuck: Like, this was a feed system like Facebook's or Tumblr's
[20:55:28] Nuck: We had different types of "stories" for the feed, which could then contain a set of "substories"
[20:55:38] tubbo: nuck: yeah, that's what we originally did on Diaspora
[20:55:42] Nuck: Some stories behaved differently, etc.
[20:55:55] glennfu: I kind of wanted to create app C with it, but realized the people working in app B all day are going to want to hit this app for the same job they're doing
[20:55:57] tubbo: Papierkorb: so that's not STI :P
[20:56:10] tubbo: Papierkorb: it's actually way better, and certainly what i use: https://gist.github.com/tubbo/283ae2f6e14b84515859
[20:56:31] Nuck: STI was a huge net improvement by allowing us to validate specific types differently and handle behaviors separately
[20:56:38] Nuck: In the end, I scrapped hte refactor
[20:56:44] Nuck: We're now paring down and outsourcing our feeds
[20:57:05] tbuehlmann: tubbo, any reason you didn't use serialize/composed_of?
[20:57:26] Nuck: Fuck serialize it still uses YAML
[20:57:40] _lazarevsky: slash_nick: you there?
[20:57:46] _lazarevsky: slash_nick: I think I found a problem with your solution
[20:57:48] tbuehlmann: nuck, you can define the object that loads and dumps, so, no
[20:57:59] Nuck: News to me
[20:58:19] tbuehlmann: see http://api.rubyonrails.org/classes/ActiveRecord/AttributeMethods/Serialization/ClassMethods.html#method-i-serialize
[20:58:36] Papierkorb: tubbo: https://gist.github.com/Papierkorb/aa3e41564ee73f885f41
[20:58:45] tubbo: tbuehlmann: i've never used composed_of, but figured i didn't need serialize because the data is already a hash?
[20:58:49] matthewd: glennfu: I'm not following where they need to be part of the same app, if they're not sharing anything... do you just need single sign-on?
[20:58:50] hahuang65: has joined #RubyOnRails
[20:58:55] tubbo: Papierkorb: 'Metadataable'? ugh
[20:58:57] tubbo: i hate you
[20:59:08] Papierkorb: tubbo: I couldn't come up with a better name! I swear I tried!
[20:59:08] Nuck: ahahahahaha
[20:59:09] tbuehlmann: tubbo, ah, okay
[20:59:14] Nuck: That is the best name ever holy shit
[20:59:18] tubbo: Papierkorb: you don't *have* to end your concerns in 'able' you know :P
[20:59:34] tubbo: that was never a thing and i'm not sure why the fuck people started doing it lol
[20:59:39] Nuck: Is it weird that I screamed the "aa" portion
[20:59:46] Nuck: Metadataaaaaaaaaaaaable
[20:59:49] tubbo: Papierkorb: i can just see someone typo'ing that all the time
[21:00:03] Papierkorb: tubbo: I'm pretty sure I copied that scheme from Devise
[21:00:04] matthewd: tubbo: At least people have stopped calling everything acts_as_ :|
[21:00:10] glennfu: matthewd: I want them to share the same layout and header and session, yes
[21:00:11] Papierkorb: tubbo: Where everything is Stuffable
[21:00:20] Nuck: matthewd: acts_as_metadataable
[21:00:26] tubbo: Papierkorb: you definitely did. :) can you show the source to Metadataable?
[21:00:30] tubbo: seems interesting
[21:00:37] tubbo: matthewd: oldschool lol
[21:00:46] tubbo: matthewd: acts_as_commentable *barf*
[21:00:49] glennfu: matthewd: so in the Nav with items X, Y, I want to add item Z to the end and it reach this new thing
[21:00:49] Nuck: There's still so many acts_as things
[21:00:59] Papierkorb: tubbo: it's actually pretty complex, can do verification, serialization, et al, as the same code runs on the client (Again, Opal <3)
[21:01:02] Coldblackice: has joined #RubyOnRails
[21:01:04] tbuehlmann: when dealing with, say, an "email" field and I have to do any manipulation on it, I tend to have a value object which serializes the field
[21:01:15] tbuehlmann: as in here: http://www.grok-interactive.com/blog/value-objects-in-ruby-part-2/
[21:01:18] Nuck: yuck opal
[21:01:23] Nuck: I'm a js purist
[21:01:53] Papierkorb: JS is horrific and for my personal project, every thing I can get off the technology stack, is a good thing
[21:02:11] Nuck: I refuse to write JS without Babel any more
[21:02:18] tubbo: Papierkorb: zomg izopmoarprhic
[21:02:25] Nuck: tubbo: ahahaha
[21:02:36] tubbo: nuck: "JS purist" / "still has to compile JS"
[21:02:42] tubbo: but same here
[21:02:44] Nuck: Ey it's still JS
[21:02:49] Nuck: Just... less shitty JS
[21:02:51] tubbo: Babel is really nice, i still use CoffeeScript sometimes though
[21:02:53] tubbo: i do like CS
[21:02:58] Nuck: I'm not fond of CS
[21:02:59] tubbo: but i also <3 JS, it was my first language
[21:03:01] Nuck: Reminds me too much of Python
[21:03:08] Nuck: My first language was BASIC
[21:03:09] tubbo: there are some really neat things you can do though
[21:03:18] Nuck: So I don't have a fondness for that
[21:03:21] matthewd: tbuehlmann: FYI, that use case is probably better served by Sean's attributes API stuff now (4.2 / 5.0+)
[21:03:27] Nuck: My second was PHP and third was Perl. No love for either of those too
[21:03:27] tubbo: like $(".#{some_variable}")
[21:03:33] baweaver: ACTION is secretly a Haskell / OCaml / ML programmer
[21:03:35] tubbo: that is *way* uglier in regular JS, even ES6
[21:03:49] tbuehlmann: matthewd, doesn't ring a bell, have some more information?
[21:03:57] sdwrage: has joined #RubyOnRails
[21:04:08] tubbo: nuck: also i like how CS turns == into ===
[21:04:13] Nuck: tubbo: $(`.${some_Variable}`)
[21:04:13] tubbo: because i forget to do that sometimes
[21:04:18] Nuck: Not *that* much worse
[21:04:19] maxz: has joined #RubyOnRails
[21:04:22] tubbo: i tried that! it didn't work!
[21:04:25] tubbo: is that in Babel now?
[21:04:29] Nuck: Then you did something wrong
[21:04:32] Nuck: That's been in babel since day one
[21:04:38] Nuck: It's literally the easiest thing to implement
[21:04:45] Nuck: Hell, I could implement the transform for that
[21:04:49] Prkl8r: has joined #RubyOnRails
[21:04:59] tubbo: been thinking of replacing my default stack from coffee-rails to whatever the gem is to add babel/es6 js files to sprockets
[21:04:59] Nuck: Did you make sure to use backticks for the string
[21:05:04] tubbo: might not have
[21:05:07] Nuck: es6-sprockets iirc
[21:05:22] tubbo: ember.js made me fall in love with ES6
[21:05:31] Nuck: Ember.js made me fall in love with Ember.js
[21:05:41] Papierkorb: I like Ham, too
[21:05:59] tubbo: this would be a great conversation to narrate
[21:06:15] tubbo: Papierkorb: is that a js framework or do you just really like ham/
[21:06:27] Nuck: Both is a viable option
[21:06:34] tbuehlmann: ember is great, but I also like the fact that I'll be able to write simple SPAs with rails 5 (or rather turbolinks 3)
[21:06:40] Papierkorb: tubbo: https://github.com/jameskeane/ham-script apparently both!
[21:06:48] Papierkorb: (No idea what that ham script there is)
[21:07:07] Nuck: Papierkorb: That language seems a bit hamfisted if you ask me
[21:07:28] Papierkorb: Guyz, this discussion just went recursive1
[21:07:53] Nuck: Oh shit careful guys we'll blow the stack
[21:07:58] glennfu: tubbo: well looks like I'm gonna be an asshole. Creating an Engine still seems the best way to get my two separate apps served to the front like one while keeping the code separate
[21:08:03] Sceko: has joined #RubyOnRails
[21:08:11] Nuck: glennfu: Nginx
[21:08:15] tubbo: glennfu: oh yeah, that's ok...i was more concerned with turning your app into a collection of engines
[21:08:34] glennfu: nuck: it's on Heroku
[21:08:38] tubbo: tbuehlmann: ehhh, i wouldn't call that a "SPA"
[21:08:47] tubbo: tbuehlmann: the whole idea of pages is changing anyway
[21:09:02] tubbo: because it still does most or all of the work on the server
[21:09:32] Nuck: Turbolinks offers the speedy benefits of an SPA without the thick-client benefits
[21:09:45] Nuck: I still prefer Ember + Rails::API
[21:10:03] tbuehlmann: don't add another topic :>
[21:10:10] glennfu: yay more topics!
[21:10:19] Papierkorb: raise TBuehlmann::StackOverflow
[21:10:49] matthewd: tbuehlmann: http://edgeapi.rubyonrails.org/classes/ActiveRecord/Attributes/ClassMethods.html#method-i-attribute & http://confreaks.tv/videos/railsconf2015-designing-a-great-ruby-api-how-we-re-simplifying-rails-5 maybe
[21:10:49] glennfu: nuck: as neat as Ember seems, I can't seem to get away from duplicating model/business logic in both rails and then in ember
[21:11:07] Papierkorb: glennfu: *ahem* the reason why I use Opal.
[21:11:16] tbuehlmann: tubbo, "SPA" then
[21:11:30] Papierkorb: (Note that I can't recommend using Opal for business critical stuff. Personal projects for fun? Take a look!)
[21:12:09] Prkl8r: If anyone has a couple minutes... I've been pulling my hair out trying to figure out what I'm sure is a ridiculously simple problem. Trying to use a scope (or other method if it's easier) to find all active questions (in a quiz app) that have not been answered by the current user. I can't figure out a simple solution. I'm sure I'm just missing something simple. https://gist.github.com/c08b6f040faa7848e673.git
[21:12:17] tbuehlmann: matthewd, nice
[21:12:23] Nuck: glennfu: I find that it's two entirely different forms of business logic
[21:12:29] Nuck: Ember takes over UI logic and Rails handles storage
[21:12:45] Papierkorb: Prkl8r: that's a 404
[21:12:50] Nuck: With AMS the Rails stuff is remarkably thin
[21:12:51] goodcodeguy: has joined #RubyOnRails
[21:13:46] glennfu: nuck: I don't know I still see things like, validation... you can't trust the client, but you try to make it snappy so you have validation client side too to make it feel instantly responsive. Then you have to have all of the same checks, plus more, on the rails side since you can't trust that the front-end actually validated
[21:14:08] Nuck: Validation is easy tho
[21:14:20] Papierkorb: nuck: still code duplication
[21:14:26] Papierkorb: so the devil himself
[21:14:47] Nuck: Not enough to bother me, most of the front entrance validations should be a single line
[21:14:57] glennfu: sure but it's just 1 example
[21:15:04] Nuck: Plus that's not my job :D
[21:15:06] Prkl8r: @Papierkorb: https://gist.github.com/Prkl8r/c08b6f040faa7848e673 Try that one.. Seems to work when I paste it.
[21:15:09] Nuck: I write the rails app
[21:15:28] Nuck: I just give an API to the Ember guy ;3
[21:15:37] romdi: has joined #RubyOnRails
[21:15:49] Pistos: has joined #RubyOnRails
[21:15:51] glennfu: I much prefer something like this: https://github.com/nateberkopec/todomvc-turbolinks
[21:16:00] glennfu: since I have to write the backend and frontend by myself simultaneously
[21:16:31] glennfu: everything you see is always 100% correct. There's never a disconnect between front-end and back-end due to strange network sync issues. You're never faking that you have data that you don't.
[21:16:34] Pistos: When I put `port: 4406` in my database.yml, `bundle exec rails console envname` seems to ignore that port. Halp?
[21:16:44] greengriminal: has joined #RubyOnRails
[21:17:15] glennfu: It makes me so mad to use apps like Wunderlist, where I have 2 devices supposedly showing the same list, and yet I pull to refresh on both of them, and they both show the check mark like "yep all good!" yet they're completely out of sync
[21:17:30] glennfu: too much front-end magic trying to be clever when ultimately it doesn't agree with the backend
[21:18:22] tbuehlmann: glennfu, microsoft? :D
[21:18:24] glennfu: and I always use apps where you hit submit and it looks good, only to find later you hit refresh and it didn't actually save. Too easy and too common to be lazy about that sort of thing.
[21:18:43] glennfu: tbuehlmann: years before Microsoft, and still today!
[21:18:51] nickenchuggets: has joined #RubyOnRails
[21:19:16] glennfu: but yeah, all those reasons are why I really want Turbolinks 5 to be done
[21:19:28] FooMunki: has joined #RubyOnRails
[21:20:38] glennfu: I think I'm just overly crotchety about front-end frameworks, but basically everything DHH said in the latest RailsConf keynote about them I agree with.
[21:20:44] dtordable: has joined #RubyOnRails
[21:20:54] bruno-: has joined #RubyOnRails
[21:21:35] Papierkorb: glennfu: what did he say? TL;DR?
[21:22:03] dviola: I have this in my index method: @games = Game.order(score: :desc) -- so I'm showing games with the score in desc order, is there a way I can get a sequence number like for rankings?
[21:22:19] dviola: just numbers like 10, 9, 8, etc.
[21:22:25] dviola: I don't want any complex algorithm or anything
[21:22:26] glennfu: some of what I ranted about. Basically that too often the front-end frameworks are overkill. Take a look at https://github.com/nateberkopec/todomvc-turbolinks like I referenced before. It's CRAZY how little code there is in this app, and yet it does everything that the Ember or Backbone equivalent does
[21:22:27] Maletor: has joined #RubyOnRails
[21:22:31] _lazarevsky: Describe a program that could detect whether a chunk of text in a document is a list or not. There are no obvious indicators like "1." or "-" or "*" however each list entry is on a new line. An example list would be:
[21:22:50] Papierkorb: dviola: do a .count on Game and then you can count backwards
[21:22:53] _lazarevsky: this is an interview question.. im prepping for an interview
[21:23:03] _lazarevsky: and I came across this question which really tripped me up
[21:23:22] _lazarevsky: people suggested that one possible way of doing it is to iterate through the lines of the document
[21:23:32] dviola: Papierkorb: count backwards how?
[21:23:37] dented42_: has joined #RubyOnRails
[21:23:43] Papierkorb: dviola: total_count - index ?
[21:24:42] dviola: Papierkorb: where is that index coming from?
[21:24:51] Papierkorb: dviola: @games.each_with_index
[21:25:17] yran: has joined #RubyOnRails
[21:25:35] glennfu: @games.each_with_index{|index, game| <tr><td><%= index + 1 %></td><td><%= game.title %></td></tr>}
[21:25:36] Pazician: has joined #RubyOnRails
[21:25:49] flip_digits: has joined #RubyOnRails
[21:26:08] glennfu: _lazarevsky: list.each{ |entry| puts document.include?(entry) }
[21:26:29] _lazarevsky: glennfu: what's list
[21:26:32] _lazarevsky: in your code?
[21:26:41] A124: has joined #RubyOnRails
[21:26:53] glennfu: _lazarevsky: oh I read that as "chunk of text in a document is in a list". Now I see "is a list"
[21:26:55] dviola: Papierkorb: that worked, thanks
[21:26:56] tetraktys: has joined #RubyOnRails
[21:27:00] northfurr: has joined #RubyOnRails
[21:27:06] sdwrage: has joined #RubyOnRails
[21:27:14] zpe: has joined #RubyOnRails
[21:27:16] Nuck: _lazarevsky: I don't think there is a non-contrived answer
[21:27:21] glennfu: _lazarevsky: if this were for my job, I'd say, "can you describe to me what a list is?" because if they can describe it in English, you can probably translate that into Ruby
[21:27:22] yran: has joined #RubyOnRails
[21:27:23] Nuck: No matter how many times you ask it
[21:27:47] Nuck: Papierkorb is a rebel
[21:28:05] MartinElvar: has joined #RubyOnRails
[21:28:40] Papierkorb: nuck: can't say I didn't hope for someone to not post the next circumflex to ambiguously do a combo break.
[21:28:43] glennfu: too many times I get requirements from people on my team that are like "Make it do a thing!" and I'm like "what's a thing?" and they're like "I don't know!" and I'm like "how will you know when it's done then!?"
[21:29:20] Papierkorb: "The computer is broken!" "Mh? Okay, what doesn't work?" "I don't know!" "And I don't work in TechSupport haha".
[21:29:21] tubbo: that sounds like a client
[21:29:27] Prkl8r: Fixed link: https://gist.github.com/Prkl8r/c08b6f040faa7848e673 Any assistance would be greatly appreciated! Trying to return a list of active questions, that, based on an answer table, has not been answered by the current user. I'm thinking it's a simple answer but I keep trying to over complicate, I think.
[21:29:37] duncannz: has joined #RubyOnRails
[21:30:04] Nuck: That's why I always carry a large hunting knife into meetings with clients
[21:30:08] Nuck: And slam it on the table at the start
[21:30:25] Nuck: It gives them the impression that they damn well better know what to ask
[21:31:07] Nuck: If possible I prefer to stab it in the center of the table
[21:31:38] Nuck: But buying new tables gets expensive
[21:31:56] Nuck: So I only do it when I'm at the client's location
[21:32:28] glennfu: makes sense
[21:33:04] Papierkorb: Prkl8r: well, in terms of SQL, it should be (pseudo code, guessing column names) something like: SELECT * FROM questions WHERE id NOT IN (SELECT DISTINCT id FROM answers WHERE user_id = <THE_USER_ID>);
[21:33:22] matthewd: Prkl8r: Question.active_questions.where.not(id: my_user.answered_questions)
[21:33:29] glennfu: Prkl8r: if you have an answer table, and a user table, you need somewhere to store the questions that a user has answered. The most straightforward place would be in something like a join table with answer_id and user_id
[21:33:42] gusrub: has joined #RubyOnRails
[21:33:55] matthewd: Where class User: has_many :answered_questions, through: :answers, source: question
[21:34:07] Nuck: matthewd hit the nail on the head
[21:34:08] glennfu: That is, assuming that answers doesn't have a user_id, which is probable if multiple people can answer the same question
[21:34:31] sdwrage: has joined #RubyOnRails
[21:34:32] glennfu: yeah I like matthewd's stuff there
[21:34:41] matthewd: Prkl8r: I'm ignoring the fact you've named your scope `activeQuestion`, because I really just want to pretend it's not true
[21:34:42] mag42c_: has joined #RubyOnRails
[21:35:01] Nuck: fucking camelCase
[21:35:11] matthewd: (though `active` would be at least as reasonable as `active_questions`)
[21:35:30] woods: has joined #RubyOnRails
[21:35:35] Prkl8r: So much info to take in!! :-) I'm pretty new to rails (and coding so some of this may be total garbage!)
[21:35:37] woods: good morning
[21:35:41] uri: has joined #RubyOnRails
[21:35:50] dviola: I need to be able to get the total game count per user in my Gamescontroller#index but I don't have access to @user.games.count there, any ideas?
[21:36:10] Nuck: Basically, just to clarify, what Papierkorb said is basically what will be generated by what matthewd said
[21:36:37] Papierkorb: dviola: Please elaborate. Do you want to list the game counts of all users in existence?
[21:36:43] glennfu: except it'll be "FROM answered_questions"
[21:36:57] dviola: Papierkorb: yes
[21:37:06] Nuck: glennfu: Note the "Where class User: has_many :answered_questions, through: :answers, source: question"
[21:37:25] Papierkorb: dviola: that's beyond my AR-fu :|
[21:37:41] glennfu: nuck: yeah his sql shows user_id on the answers table, but the user_id column is on the answered_questions table.
[21:37:46] dviola: Papierkorb: :(
[21:38:25] matthewd: glennfu: There's an answered_questions table? :/
[21:38:52] nertzy: has joined #RubyOnRails
[21:38:52] Prkl8r: No, just the questions table and answers table.
[21:38:55] matthewd: dviola: *all* users? What do you want to do with this information?
[21:39:12] glennfu: matthewd: you yourself wrote "has_many :answered_questions" right?
[21:39:19] simkessy: If I'm the only developer on a project, can I call myself Lead Developer?
[21:39:23] yfeldblum: has joined #RubyOnRails
[21:39:28] matthewd: glennfu: .. through: ..
[21:39:31] moeabdol: has joined #RubyOnRails
[21:39:31] glennfu: simkessy: I think you can call yourself CTO of the company
[21:39:33] Papierkorb: simkessy: Yes, and Project Lead too! amazing!
[21:39:35] woods: simkessy, oh yeah
[21:39:38] ss_much: has joined #RubyOnRails
[21:39:59] woods: simkessy, also call yourself any other sweet title you can come up with!
[21:40:12] dviola: matthewd: I want to show it here: http://i.imgur.com/NW2UndR.png
[21:40:19] Nuck: My title is Rails Philosopher
[21:40:23] sparr: has joined #RubyOnRails
[21:40:27] simkessy: Super Master Lead Developer
[21:40:29] Nuck: It's like a ninja but cooler
[21:40:32] woods: nuck, that is a pretty sweet one
[21:40:33] dviola: matthewd: on games played
[21:40:42] simkessy: My resume is going to look sweeeeet
[21:40:53] Nuck: Actually, in all seriousness my website lists myself as a Rails ninja, JavaScript rockstar, and CSS philatelist
[21:40:58] matthewd: dviola: So, you only want/need it for the few users who are on the leaderboard. Or are you showing everyone there?
[21:40:59] Nuck: (philatelist = stamp collector)
[21:41:06] woods: simkessy, whenever anyone asks you for a reference, you can just tell them they are talking to your reference
[21:41:11] glennfu: matthewd: am I crazy? http://guides.rubyonrails.org/association_basics.html#the-has-many-through-association How else are you going to allow multiple people to answer the same question?
[21:41:17] simkessy: woods, I like it!
[21:41:19] matthewd: dviola: Incidentally... highest score == lowest rank? :/
[21:41:20] Radar: -q *!*@li616-49.members.linode.com
[21:41:24] woods: simkessy, :)
[21:41:31] smathy: dviola, Game.group(:user).count
[21:41:42] Nuck: woods: "You want a reference?" [points to StackOverflow]
[21:41:45] Nuck: There's your reference
[21:41:53] Nuck: [points to docs]
[21:42:04] matthewd: glennfu: Per https://gist.github.com/Prkl8r/c08b6f040faa7848e673, `answers` is individual people's answers... it's not multiple-choice
[21:42:06] Papierkorb: nuck: He's so advanced, he even *answers* questions on SO!
[21:42:06] Nuck: There's another!
[21:42:16] Nuck: [points to bottom of wikipedia article on Ruby]
[21:42:23] Nuck: There's a bunch more references!
[21:42:28] Nuck: People should hire me solely for my puns
[21:42:31] woods: nuck, haha they will have no choice but to let you write your own offer!
[21:42:33] Nuck: I can be Punmaster In Residence
[21:42:37] simkessy: haha time to go edit wikipedia
[21:42:38] glennfu: matthewd: ahh my bad! With that in mind yeah, your thing
[21:42:55] woods: nuck, do you incorporate puns into your documentation?
[21:43:05] Nuck: Yes and cultural references into my tests
[21:43:20] woods: nuck, it sounds like you may be the best employee ever
[21:43:23] Nuck: I'm Rails Lead on an anime site and all my tests include anime characters
[21:43:42] woods: nuck, im the rails lead on my WoW guild site
[21:43:52] Nuck: In this case it's not a tiny site
[21:43:56] Nuck: It's 100,000 users
[21:44:01] woods: nuck, im also the Director of Decision Making
[21:44:08] woods: ahh, my site has roughly 5 users lol
[21:44:20] simkessy: nuck, whats your site
[21:44:20] peppers: has joined #RubyOnRails
[21:44:21] Prkl8r: matthewed: would it be recommended to do that as a scope in the question model?
[21:44:25] Nuck: simkessy: hummingbird.me
[21:44:31] ebbflowgo: has joined #RubyOnRails
[21:44:56] simkessy: looks nice!
[21:45:07] Nuck: Yeah we have an amazing designer
[21:45:17] matthewd: Prkl8r: I'd be more likely to make it a method on User... def unanswered_questions; ..; end
[21:45:18] htmldrum: has joined #RubyOnRails
[21:45:31] Nuck: The code is so bad we're literally scrapping it all
[21:45:37] dviola: smathy: I'm not getting an integer with that
[21:45:43] dviola: smathy: but more like this: {#<User id: 1, email: "diego.viola@gmail.com", encrypted_password: "$2a$10$18p.LfSDTw0Q7Okpb9Gbxuu3NZ/YKCNvtc0wWb7B40V...", reset_password_token: nil, reset_password_sent_at: nil, remember_created_at: nil, sign_in_count: 3, current_sign_in_at: "2015-11-13 21:44:41", last_sign_in_at: "2015-11-13 21:44:29", current_sign_in_ip: "127.0.0.1", last_sign_in_ip: "127.0.0.1",
[21:45:44] dviola: created_at: "2015-11-13 21:43:54", updated_at: "2015-11-13 21:44:41">=>1}
[21:45:54] Nuck: We had this awkward tightly-coupled Ember+Rails combo
[21:46:01] Nuck: Buggy as fuck
[21:46:21] woods: i read "tightly-coupled" and i was immediately concerned
[21:46:23] ProLoser: has joined #RubyOnRails
[21:46:26] smathy: dviola, right, you're getting a hash where the key is a User instance, and the value is the count of games they're associated with.
[21:46:36] smathy: dviola, I don't know how that isn't what you were after.
[21:46:53] Nuck: woods: You should be
[21:47:27] peppers: has joined #RubyOnRails
[21:48:00] rakm: has joined #RubyOnRails
[21:48:04] woods: nuck, i feel like you probably have it under control though, so i wont lose much sleep over it
[21:48:14] Nuck: woods: Like I said, we threw it all away
[21:48:29] rhizome: phil collins
[21:48:45] smathy: Another random comment from rhizome
[21:49:02] VeryBewitching: He was a good musician.
[21:49:08] woods: nuck, crisis averted
[21:49:13] Nuck: VeryBewitching: was?
[21:49:14] VeryBewitching: Still is. But you have to like his brand of music.
[21:49:17] rhizome: was it a genesis song?
[21:49:46] VeryBewitching: Google will know
[21:50:16] dviola: smathy: sorry for the lame question but how do I get the value from that?
[21:50:29] VeryBewitching: rhizome: Yes, Gensis
[21:50:34] VeryBewitching: err.. Genesis too
[21:51:08] rhizome: :thumbsup:
[21:51:19] Nuck: Best Phil Collins thing is the erotic fiction they wrote about him
[21:51:19] rhizome: token song of the day
[21:51:24] Nuck: philrotica ftw
[21:51:59] VeryBewitching: He's not my favourite artist, but I like hearing most of his music.
[21:52:45] smathy: dviola, c'mon man, it's a hash.
[21:54:28] stevenw_: has joined #RubyOnRails
[21:54:35] dviola: I'm confused because it has a long string as key
[21:55:32] dviola: actually I read that wrong, nvm
[21:58:51] rodfersou: has joined #RubyOnRails
[21:59:53] northfurr: has joined #RubyOnRails
[21:59:59] djbkd: has joined #RubyOnRails
[22:00:41] safety_cut: has joined #RubyOnRails
[22:01:36] lacrymology: has joined #RubyOnRails
[22:02:21] lacrymology: has joined #RubyOnRails
[22:07:23] towski_: has joined #RubyOnRails
[22:07:45] segy: has joined #RubyOnRails
[22:08:21] njero: has joined #RubyOnRails
[22:08:46] djbkd: has joined #RubyOnRails
[22:09:05] Prkl8r: matthewed, glennfu & Papierkorb. Thanks! I got it working in the console so should be able to get it coded up. Thanks again!
[22:09:13] neanderslob: has joined #RubyOnRails
[22:09:35] darrencauthon: has joined #RubyOnRails
[22:10:22] Pazician: has joined #RubyOnRails
[22:12:54] colleenm_: has joined #RubyOnRails
[22:12:58] nya: has joined #RubyOnRails
[22:13:03] peppers: has joined #RubyOnRails
[22:16:14] sdwrage: has joined #RubyOnRails
[22:16:29] rgrmatt: has joined #RubyOnRails
[22:19:03] rgrmatt: has joined #RubyOnRails
[22:21:48] FooMunki: has joined #RubyOnRails
[22:27:40] EminenceHC: has joined #RubyOnRails
[22:30:05] apofis: has joined #RubyOnRails
[22:32:20] youngbaks: has joined #RubyOnRails
[22:32:24] netzfisch: has joined #RubyOnRails
[22:33:05] Tref: has joined #RubyOnRails
[22:33:39] johnflux: has joined #RubyOnRails
[22:35:09] sdwrage: has joined #RubyOnRails
[22:37:58] krramos: has joined #RubyOnRails
[22:38:45] iamse7en: has joined #RubyOnRails
[22:41:18] mices: i was wrong, you don't have to pass options to `rails generate devise Model` or `rails generate devise:install`
[22:43:59] Slogger: Things happening in France.
[22:45:48] mices: Breaking News: Pentagon 'reasonably certain' that Raqqa air strike killed 'Jihadi John'
[22:46:10] mices: who the f#ck is jihadi john
[22:47:18] northfurr: has joined #RubyOnRails
[22:47:45] woods: i suspect someone that the Pentagon is interested in
[22:48:44] krramos: has joined #RubyOnRails
[22:52:16] arthurix_: has joined #RubyOnRails
[22:53:50] safety_cut: has joined #RubyOnRails
[22:54:29] nettoweb: has joined #RubyOnRails
[22:55:20] nertzy: has joined #RubyOnRails
[22:56:28] weaksauce: mices the guy that beheaded a bunch of people and put it online
[22:58:23] hahuang65: has joined #RubyOnRails
[22:58:28] unreal: has joined #RubyOnRails
[23:03:41] unreal_: has joined #RubyOnRails
[23:08:48] applegrain: has joined #RubyOnRails
[23:11:44] colleenmcguckin: has joined #RubyOnRails
[23:16:42] acti0nman: has joined #RubyOnRails
[23:16:49] mary5030: has joined #RubyOnRails
[23:18:09] vigintas: has joined #RubyOnRails
[23:19:03] applegrain: has joined #RubyOnRails
[23:21:33] SteveC: has joined #RubyOnRails
[23:21:35] lipoqil: has joined #RubyOnRails
[23:22:11] rgrmatt: has joined #RubyOnRails
[23:23:17] flip_digits: has joined #RubyOnRails
[23:23:32] SteveC: Has anyone used Mustache with Rails?
[23:24:15] woods: SteveC, I have not, I've only used it on a LAMP stack, it is a pretty cool tool though
[23:25:01] SteveC: woods: sweet.
[23:25:44] colleenmcguckin: has joined #RubyOnRails
[23:28:27] safety_cut: has joined #RubyOnRails
[23:30:00] baweaver: has joined #RubyOnRails
[23:31:01] user1138: has joined #RubyOnRails
[23:31:57] yoongkang: has joined #RubyOnRails
[23:32:33] aep: has left #RubyOnRails: ("WeeChat 1.3")
[23:33:26] okdas: has joined #RubyOnRails
[23:33:45] okdas: has joined #RubyOnRails
[23:34:19] applegrain: has joined #RubyOnRails
[23:34:53] IrishGringo: has joined #RubyOnRails
[23:37:30] zpe: has joined #RubyOnRails
[23:39:08] Pazician: has joined #RubyOnRails
[23:39:39] framling: has joined #RubyOnRails
[23:39:47] rgtk: has joined #RubyOnRails
[23:41:20] bruno-: has joined #RubyOnRails
[23:43:07] Scripore: has joined #RubyOnRails
[23:43:30] ebbflowgo: has joined #RubyOnRails
[23:46:04] htmldrum: has joined #RubyOnRails
[23:48:17] applegrain: has joined #RubyOnRails
[23:49:43] northfurr: has joined #RubyOnRails
[23:49:49] EminenceHC: has joined #RubyOnRails
[23:55:16] djbkd: has joined #RubyOnRails
[23:56:25] arta82: has joined #RubyOnRails
[23:59:24] applegrain: has joined #RubyOnRails