« Back to channel list

#RubyOnRails - 04 May 2016

« Back 1 day Forward 1 day »
[00:00:02] whoughton: I do have a user and assignment record in the system
[00:00:02] Radar: stack trace please?
[00:00:38] whoughton: sec, I'll copy from the console into another gist
[00:01:36] whoughton: https://gist.github.com/whoughton/aeef34c2cbedd9e88e55c3fc7bcbd0e9
[00:01:52] whoughton: not wildly helpful stack trace, unless I am doing something wrong to get it
[00:02:21] Radar: whoughton: use "wtf???" in Pry to get a bigger stacktrace please.
[00:03:00] whoughton: updated the gist: https://gist.github.com/whoughton/aeef34c2cbedd9e88e55c3fc7bcbd0e9
[00:03:51] Radar: ACTION wants to blame Spring.
[00:04:00] Radar: that's where it points to
[00:04:19] Radar: https://github.com/rails/spring/blob/master/lib/spring/application.rb#L277
[00:04:22] Radar: oh look it's in Spring
[00:04:31] Radar: Remove Spring, let me know if the issue still happens
[00:04:38] idefine: has joined #RubyOnRails
[00:05:22] Radar: And then when it works after Spring, perhaps consider using Zeus instead.
[00:05:48] DragonPunch: has joined #RubyOnRails
[00:05:54] Radar: (why yes, it's true that every new "helpful" feature Rails added to the framework after 2011 is, essentially, bullshit)
[00:06:04] Radar: Ref: turbolinks, spring, actioncable
[00:06:34] Radar: "Let's add more points where things can go wrong" Yup great idea.
[00:07:00] Ropeney: has joined #RubyOnRails
[00:07:10] whoughton: (not going to dispute that point, by the way)
[00:07:30] whoughton: https://gist.github.com/whoughton/059a03d87398f7a6d710344e0a60203e
[00:07:32] whoughton: without spring
[00:07:54] whoughton: there must be an odd relationship given the programs table query
[00:08:09] DoctorMonocular: has joined #RubyOnRails
[00:08:16] quazimodo: has joined #RubyOnRails
[00:11:01] RegulationD: has joined #RubyOnRails
[00:14:40] tds5016: has joined #RubyOnRails
[00:14:50] hahuang65: has joined #RubyOnRails
[00:14:58] tds5016: hi all. I am having a problem turning of asset pipeline/sprockets...
[00:15:16] tds5016: I've done config.assets.enabled = false, but it appears that doesn't work.
[00:16:55] discounted: has joined #RubyOnRails
[00:19:55] Radar: tds5016: Did you remove sprockets-rails from your Gemfile?
[00:23:48] manfrin: has joined #RubyOnRails
[00:24:13] tds5016: sure did not :-)
[00:26:30] craysiii: anyone can help me get my nginx to serve my rails app properly? https://gist.github.com/craysiii/82dd414176381a22313dd1d35dce449c I can get jenkins working but my rails app just refuses to serve anything. nothing in the nginx logs. CNAME pointing to server for both.
[00:28:02] Limix: has joined #RubyOnRails
[00:28:28] tds5016: What would be the easiest way to tell if sprockets is touching my files?
[00:29:45] yfeldblum: has joined #RubyOnRails
[00:29:54] tds5016: Sprockets should be disabled, but I'm not sure how I can tell :-/. It looks like it's still touching my css, at the very least.
[00:30:38] Megamos: has joined #RubyOnRails
[00:36:18] quazimodo: has joined #RubyOnRails
[00:43:57] bronson: has joined #RubyOnRails
[00:47:44] GodFather: has joined #RubyOnRails
[00:52:19] jenrzzz: has joined #RubyOnRails
[00:52:19] jenrzzz: has joined #RubyOnRails
[00:54:44] tanuki: has joined #RubyOnRails
[00:56:56] StaticVoid: has joined #RubyOnRails
[00:57:13] chipotle: has joined #RubyOnRails
[00:57:34] brianpWins: has joined #RubyOnRails
[01:02:54] DragonPunch: has joined #RubyOnRails
[01:05:47] jstransky: has joined #RubyOnRails
[01:11:25] tvon: has joined #RubyOnRails
[01:12:03] dikaio: has joined #RubyOnRails
[01:12:19] ornerymoose: has joined #RubyOnRails
[01:15:22] ur5us: has joined #RubyOnRails
[01:17:55] supernov_a: has joined #RubyOnRails
[01:18:06] yfeldblum: has joined #RubyOnRails
[01:21:22] sevenseacat: has joined #RubyOnRails
[01:23:54] safetypin: has joined #RubyOnRails
[01:24:46] maxz: has joined #RubyOnRails
[01:26:49] bronson: has joined #RubyOnRails
[01:27:54] Limix: has joined #RubyOnRails
[01:31:24] nettoweb: has joined #RubyOnRails
[01:32:22] trinaldi: has joined #RubyOnRails
[01:35:38] nettoweb: has joined #RubyOnRails
[01:37:21] akshat: has joined #RubyOnRails
[01:37:38] one_zero: has joined #RubyOnRails
[01:40:10] jhack: has joined #RubyOnRails
[01:41:52] edavis: has joined #RubyOnRails
[01:45:02] pyemkey: has joined #RubyOnRails
[01:48:07] tcopeland: has joined #RubyOnRails
[01:48:45] sp1rs: has joined #RubyOnRails
[01:50:05] sp1rs: has joined #RubyOnRails
[01:50:44] pawnbox: has joined #RubyOnRails
[01:50:49] macsteps: has joined #RubyOnRails
[01:50:57] benlieb: has joined #RubyOnRails
[01:53:17] ensyde: has joined #RubyOnRails
[01:55:51] Limix: has joined #RubyOnRails
[01:58:54] havenwood: supernov_a: greeting_s
[01:59:10] Coldblackice: has joined #RubyOnRails
[01:59:16] w0rd-driven: has joined #RubyOnRails
[02:02:06] crystal77: has joined #RubyOnRails
[02:04:44] diegoaguilar: has joined #RubyOnRails
[02:05:14] Maletor: has joined #RubyOnRails
[02:05:27] jhack: has joined #RubyOnRails
[02:07:30] ornerymoose: has joined #RubyOnRails
[02:08:41] maesitos: has joined #RubyOnRails
[02:08:45] crystal77: has joined #RubyOnRails
[02:09:51] flashpoint9: has joined #RubyOnRails
[02:11:33] xcesariox: has joined #RubyOnRails
[02:12:03] crystal77: has joined #RubyOnRails
[02:14:49] crystal77: has joined #RubyOnRails
[02:20:26] zacts: has joined #RubyOnRails
[02:21:50] supernov_a: has joined #RubyOnRails
[02:22:29] discounted: has joined #RubyOnRails
[02:24:06] one_zero: has joined #RubyOnRails
[02:25:39] Ebok: has joined #RubyOnRails
[02:26:52] crystal77: has joined #RubyOnRails
[02:27:15] emachnic: has joined #RubyOnRails
[02:32:17] DragonPunch: has joined #RubyOnRails
[02:32:17] dikaio: has joined #RubyOnRails
[02:32:53] discounted: has joined #RubyOnRails
[02:34:45] _Sypheren: has joined #RubyOnRails
[02:36:02] crystal77: has joined #RubyOnRails
[02:36:28] crdpink: has joined #RubyOnRails
[02:36:46] kgrz: has joined #RubyOnRails
[02:40:43] crystal77: has joined #RubyOnRails
[02:41:16] Infinite_182: has joined #RubyOnRails
[02:43:46] malcolmva: has joined #RubyOnRails
[02:44:16] beilabs: has joined #RubyOnRails
[02:44:22] Sid05: has joined #RubyOnRails
[02:44:28] crystal77: has joined #RubyOnRails
[02:46:12] Infinite_182: has joined #RubyOnRails
[02:51:25] mattp_: has joined #RubyOnRails
[02:51:31] crystal77: has joined #RubyOnRails
[02:54:15] crystal77: has joined #RubyOnRails
[02:55:41] KensoDev: has joined #RubyOnRails
[02:58:01] htmldrum: has joined #RubyOnRails
[03:00:41] DoctorMonocular: has joined #RubyOnRails
[03:01:48] crystal77: has joined #RubyOnRails
[03:05:59] Maletor: has joined #RubyOnRails
[03:08:34] macsteps: has joined #RubyOnRails
[03:10:40] JesseH: has joined #RubyOnRails
[03:10:56] JesseH: has joined #RubyOnRails
[03:14:02] crdpink2: has joined #RubyOnRails
[03:16:02] SteenJobs: has joined #RubyOnRails
[03:16:33] braincrash: has joined #RubyOnRails
[03:18:17] moeabdol: has joined #RubyOnRails
[03:22:59] lxsameer: has joined #RubyOnRails
[03:24:59] xMopxShell: has joined #RubyOnRails
[03:25:30] camilasan: has joined #RubyOnRails
[03:26:21] safetypin: has joined #RubyOnRails
[03:27:25] dikaio: has joined #RubyOnRails
[03:28:03] macsteps: has joined #RubyOnRails
[03:28:41] bronson: has joined #RubyOnRails
[03:30:08] sypheren: has joined #RubyOnRails
[03:35:40] njero: has joined #RubyOnRails
[03:38:26] Devalo: has joined #RubyOnRails
[03:46:31] Limix: has joined #RubyOnRails
[03:48:05] pyemkey: has joined #RubyOnRails
[03:50:35] pawnbox: has joined #RubyOnRails
[03:51:30] jfelchner: has joined #RubyOnRails
[03:53:27] bazz_: has joined #RubyOnRails
[03:54:27] bazz_: If I have some utility classes that I need to share between a RoR project and a relevant non-RoR ruby project, where is a good location to put them?
[03:54:30] fedexo: has joined #RubyOnRails
[03:55:22] Radar: bazz_: put them in a gem and then include the gem into the Gemfile of both projects.
[03:55:44] bazz_: aww, I've never made a gem before. It sounds like a no-brainer!
[03:57:23] Radar: BAD HELPA. NOT BOTSNACK>
[03:57:34] Radar: bazz_: https://github.com/radar/guides/blob/master/gem-development.md
[03:57:37] Radar: There's a guide for that :)
[03:58:02] bazz_: Radar, you're the one who wrote that Rails 4 book, right?
[03:58:27] Radar: bazz_: Yes and the Getting Started Guide and the Active Record Querying Guide and the Configuration Guide and the Asset Pipeline Guide (well, most of it) and the Engines Guide.
[03:59:06] bazz_: seriously considering buying it, but the last time(s) I bought a RoR book it was outdated in seconds flat xD
[03:59:14] godzillaenlacasa: has joined #RubyOnRails
[03:59:44] sevenseacat: well its been out for 6 months and still very relelvant, given Rails 5 is still who knows wherew
[04:00:04] sevenseacat: actually, more than 6 months now. go us.
[04:00:30] sevenseacat: bazz_: I also co-authored 'that Rails 4 book' :)
[04:00:33] bazz_: go you! co-authors?
[04:00:39] helpa: Rails 4 in Action - http://manning.com/bigg2 - An excellent book combining Rails and TDD/BDD development. Written by Rebecca Skinner, Steve Klabnik, Ryan Bigg, Yehuda Katz
[04:00:57] Radar: I'm Ryan Bigg, she's Rebecca Skinner
[04:01:00] bazz_: I apologize for attributing authorship to only 1 person!
[04:01:14] sevenseacat: no probs, he did most of it anyway :P
[04:01:22] Radar: You did the back half :D
[04:01:24] greghoggard: has joined #RubyOnRails
[04:02:25] dikaio: has joined #RubyOnRails
[04:02:28] rickmasta: has joined #RubyOnRails
[04:03:43] yfeldblum: has joined #RubyOnRails
[04:05:12] benlieb: has joined #RubyOnRails
[04:05:22] rickmasta: has joined #RubyOnRails
[04:06:46] Maletor: has joined #RubyOnRails
[04:07:50] hhee: has joined #RubyOnRails
[04:08:30] brent__: has joined #RubyOnRails
[04:09:29] maesitos: has joined #RubyOnRails
[04:10:44] htmldrum: has joined #RubyOnRails
[04:11:15] shinnya: has joined #RubyOnRails
[04:11:19] jenrzzz: has joined #RubyOnRails
[04:13:20] RegulationD: has joined #RubyOnRails
[04:13:50] rickmasta: has joined #RubyOnRails
[04:15:39] bazz_: In the same theme of non-RoR and RoR code-sharing .. what about for a config file .. is it more sensible to somehow include it from the parent-directory of the 2 sub-projects? or would you gem it also?
[04:15:51] chipotle: has joined #RubyOnRails
[04:16:02] bazz_: doesn't seem like the kind of thing you would 'gem' ...
[04:17:19] bazz_: but then again, I'm a little curious on the proper way or location (in code) to include an external file ... Rails is rather new to me, :| (again, because I keep taking multi-year breaks from it)
[04:17:46] bazz_: to clarify, by external I mean outside of the project directory (likely the parent directory)
[04:17:58] Limix: has joined #RubyOnRails
[04:18:30] bazz_: config/initializers seems to be the place for this kind of "foreign" code inclusion
[04:21:39] duncannz: has joined #RubyOnRails
[04:23:04] emachnic: has joined #RubyOnRails
[04:23:47] greghoggard: has joined #RubyOnRails
[04:24:42] idefine: has joined #RubyOnRails
[04:26:59] audy_: has joined #RubyOnRails
[04:28:44] glaksmono: has joined #RubyOnRails
[04:28:51] glaksmono: anyone is around?
[04:30:35] bazz_: I'm interested in getting involved in testing frameworks .. but the thing is that I manage projects using a multitude of languages (C/CPP, python, ruby, RoR) -- I'm wondering what I can use for all of the above, if possible? I'm interested in keeping life as simple as possible despite the situation
[04:31:12] fedexo: has joined #RubyOnRails
[04:31:36] bazz_: (there are other languages too, but I'm not mentioning them - well let's just say various assembly languages, Euphoria, possibly Go-lang .. )
[04:31:44] hhee: has left #RubyOnRails: ("Leaving")
[04:32:07] pipework: bazz_: Depends on what you want to be able to test, I guess.
[04:32:17] bazz_: what are you entailing?
[04:32:38] pipework: If you take a functional approach, your tests and the framework can be agnostic by just running code and giving it in put and then observing any outputs and compare with the expected results.
[04:32:55] bazz_: and that would be independent of the language it would seem
[04:34:05] bazz_: :) OK. thank you for providing me some terminology I can correlate to my intended goal
[04:34:25] bazz_: Do you have any other feedback or opinions?
[04:35:11] pipework: bazz_: There's also cucumber, but that's usually meant for BDD-related development, not just having an agnostic testing framework.
[04:36:39] bazz_: hmm, BDD is a new term (I looked it up) .. I'm still clueless whether it's something I should be interested in.. Maybe I should research it more .. Although you seem to speak with a hint it's not what I'm after
[04:38:30] bazz_: BDD seems to agnostic in itself as far as "at a glance" reading goes
[04:39:37] pipework: bazz_: Yeah, it is.
[04:40:42] chipotle: has joined #RubyOnRails
[04:41:53] bazz_: the wikipedia entry on BDD makes it sound very "industrial" solution, but I get the impression it can suit anyone.. I am a small-timer developer with a serious approach.. I have a lot of aspiration to incorporate a good test-driven-development (or some better pattern I'm not aware of yet) into my daily practice ..
[04:42:37] maxz: has joined #RubyOnRails
[04:42:53] bazz_: It seems to be a huge time investment so I'm really hoping to put my best foot forward and go in the right direction from the start
[04:43:35] bazz_: so you seemed to have drawn a line inbetween BDD and agnostic testing .. what were you implying? pipework
[04:46:45] bazz_: I am already inquisitive whether functional tests will be "enough" .. sometimes I think in "unit" tests ... But I manage a variety of different software so Functional Testing seems like the heart of what I need
[04:47:29] bazz_: pipework, also my question still hangs (2 posts ago)
[04:48:33] bazz_: just visited this page, and it's putting a smile on my face before I actually focus http://bbc.github.io/ShouldIT/
[04:50:27] bazz_: I'm also surprised to have no heard mention of RSpec yet.. was it already deemed against my needs?
[04:52:59] scepticulous: has joined #RubyOnRails
[04:56:35] pipework: bazz_: BDD is an approach, and agnostic testing is another ,they aren't mutually exclusive.
[04:57:06] pipework: bazz_: BDD has a lot more junk in its trunk with regard to its porpoise and intent.
[04:57:54] troys: has joined #RubyOnRails
[05:04:13] bronson: has joined #RubyOnRails
[05:04:53] discounted: has joined #RubyOnRails
[05:06:19] moeabdol: has joined #RubyOnRails
[05:07:34] Maletor: has joined #RubyOnRails
[05:08:09] sp1rs: has joined #RubyOnRails
[05:08:14] htmldrum: has joined #RubyOnRails
[05:11:03] discounted: has joined #RubyOnRails
[05:11:23] thehardikjoshi: has joined #RubyOnRails
[05:15:21] roadt__: has joined #RubyOnRails
[05:16:13] tildes_: has joined #RubyOnRails
[05:17:05] sp1rs: has joined #RubyOnRails
[05:17:12] ashishsingh173: has joined #RubyOnRails
[05:18:31] roadt_: has joined #RubyOnRails
[05:24:35] dionysus69: has joined #RubyOnRails
[05:27:26] SteenJobs: has joined #RubyOnRails
[05:28:04] duderonomy: has joined #RubyOnRails
[05:34:21] PedramT: has joined #RubyOnRails
[05:39:41] aiguu_: has joined #RubyOnRails
[05:39:46] maxz: has joined #RubyOnRails
[05:40:40] nickjj: has joined #RubyOnRails
[05:43:44] jstransky: has joined #RubyOnRails
[05:44:32] triptec_: has joined #RubyOnRails
[05:45:58] shibly: has joined #RubyOnRails
[05:46:02] zave: has joined #RubyOnRails
[05:46:07] shibly: has left #RubyOnRails: ()
[05:47:57] timdotrb: has joined #RubyOnRails
[05:50:53] yfeldblum: has joined #RubyOnRails
[05:56:23] pawnbox_: has joined #RubyOnRails
[05:58:17] pyemkey: has joined #RubyOnRails
[05:58:59] dikaio: has joined #RubyOnRails
[05:59:59] moeabdol: has joined #RubyOnRails
[06:01:15] dionysus69: has joined #RubyOnRails
[06:02:46] Spami: has joined #RubyOnRails
[06:06:21] kgrz: has joined #RubyOnRails
[06:07:19] EdwardIII: has joined #RubyOnRails
[06:08:22] Maletor: has joined #RubyOnRails
[06:09:49] d0nn1e: has joined #RubyOnRails
[06:10:24] maesitos: has joined #RubyOnRails
[06:10:50] malcolmva: has joined #RubyOnRails
[06:13:35] PedramT: has joined #RubyOnRails
[06:14:05] RegulationD: has joined #RubyOnRails
[06:14:43] scepticulous: has joined #RubyOnRails
[06:15:19] pawnbox: has joined #RubyOnRails
[06:16:58] PedramT: has joined #RubyOnRails
[06:20:30] pLaToOn: has joined #RubyOnRails
[06:21:13] ornerymoose: has joined #RubyOnRails
[06:23:17] pyemkey: has joined #RubyOnRails
[06:23:18] jordanm: has joined #RubyOnRails
[06:24:09] PedramT: has joined #RubyOnRails
[06:24:10] beilabs: has joined #RubyOnRails
[06:26:19] tetraktys: has joined #RubyOnRails
[06:26:40] fox_mulder_cp: morning is ...
[06:28:26] dionysus69: has joined #RubyOnRails
[06:31:54] emilkarl: has joined #RubyOnRails
[06:32:34] emilkarl: How is yield used in controllers? What can be done with the yield on L54 here? https://github.com/scambra/devise_invitable/blob/master/app/controllers/devise/invitations_controller.rb#L54
[06:33:14] artto: has joined #RubyOnRails
[06:34:27] pLaToOn: rails development with a windows machine is such a pain
[06:34:39] sevenseacat: emilkarl: it yields to the block given to the method
[06:34:50] audy: pLaToOn have you tried this new ubuntu in windows thing?
[06:35:24] sevenseacat: emilkarl: eg. if you define your own update method, then call `super do #stuff# end`
[06:35:38] emilkarl: ah! Awesome
[06:35:41] pLaToOn: I'm setting up a buntu 16.4 VM right now
[06:35:46] emilkarl: thanks sevenseacat
[06:36:01] emilkarl: and resource is sent into the block then?
[06:36:05] audy: pLaToOn I can't imagine. But I have to write random one-off ruby scripts for windows and that's already a huge pain
[06:36:24] emilkarl: super do |kaka| #stuff# end?
[06:36:32] sevenseacat: emilkarl: i think so
[06:36:48] pLaToOn: I think about switching to mint or another linux distro
[06:36:58] audy: pLaToOn what about vagrant?
[06:37:13] pLaToOn: is it better than just a normal virtualbox vm?
[06:37:34] audy: pLaToOn it makes it easier to set up and makes environments more reproducible
[06:37:44] pLaToOn: well, that sounds good
[06:37:55] pLaToOn: I tried vagrant before, but the boxes were a bit old
[06:38:01] audy: pLaToOn and I'm pretty sure there are probably pretty standard Vagrantfiles for building a rails app
[06:38:20] Pazician: has joined #RubyOnRails
[06:38:32] macsteps: has joined #RubyOnRails
[06:38:39] tvw: has joined #RubyOnRails
[06:39:00] Pazician: has joined #RubyOnRails
[06:40:21] pLaToOn: I'll try that
[06:40:38] pLaToOn: but the rails boxes are old
[06:40:48] pLaToOn: I'll better set up my own based on ubuntu 16.04
[06:41:10] alfie_max15: has joined #RubyOnRails
[06:41:20] alfie_max15: hey, i just have a doubt
[06:41:28] sevenseacat: I kinda get the appeal of vagrant, but it adds so much overhead and frustration
[06:41:30] audy: pLaToOn there's also docker-machine which has replaced Vagrant for me. I have never tried it on Windows though
[06:41:37] alfie_max15: a constant defined in the development.rb like `ROOT_URL = 'http://localhost:3000'`
[06:41:42] artto: has joined #RubyOnRails
[06:41:50] alfie_max15: will it be available throughout the application?
[06:41:53] audy: sevenseacat not when you want to recreate a dev environment you haven't touched in over a year
[06:42:06] sevenseacat: audy: if you say so
[06:42:08] htmldrum: has joined #RubyOnRails
[06:42:40] pLaToOn: I tried to set up docker
[06:42:45] pLaToOn: didnt work :D
[06:42:56] audy: pLaToOn did you try running docker in vagrant? ;P
[06:42:59] pLaToOn: still dont know why, I have to try this again
[06:43:12] pLaToOn: docker is a pain in windows as well :D
[06:43:27] pLaToOn: I'll better do that audy, yes :D
[06:43:35] pLaToOn: we want to use docker for deployment
[06:44:17] PedramT: has joined #RubyOnRails
[06:46:03] discounted: has joined #RubyOnRails
[06:49:54] sp1rs: has joined #RubyOnRails
[06:51:55] dikaio: has joined #RubyOnRails
[06:54:28] pawnbox: has joined #RubyOnRails
[06:56:00] Coldblackice: has joined #RubyOnRails
[06:56:13] Guest_: has joined #RubyOnRails
[06:56:36] aganov: has joined #RubyOnRails
[06:56:43] pyemkey: has joined #RubyOnRails
[06:57:15] relix: Hi - I'm using devise/omniauth with google provider, and checking out the generated routes using `rake routes`, there's this beauty: ` users/omniauth_callbacks#(?-mix:google_oauth2)`
[06:57:25] relix: what does the `?-mix:...` pattern stand for?
[06:57:34] dikaio: has joined #RubyOnRails
[06:57:35] relix: that's in the controller#action column
[06:57:53] Radar: It's a regular expression, albeit not a very complicated one.
[06:58:07] Radar: http://stackoverflow.com/questions/28630936/what-is-mix-in-a-ruby-regular-expression
[06:58:26] Radar: it literally matches on google_oauth2 and I don't know why.
[06:59:03] relix: aha ok, thanks radar, I thought it was routes-specific, should've expanded my scope
[07:02:30] relix: radar in case you're interested, it's because the code that defines the route accepts an array of providers, so it just matches on google_oauth2 because in my case, there's only one provider
[07:02:31] relix: https://github.com/plataformatec/devise/blob/v3.4.1/lib/devise/rails/routes.rb#L436
[07:02:42] Radar: oh right :D
[07:02:47] Radar: Thanks relix
[07:02:47] relix: I'm guessing it makes sense when there are multiple
[07:03:44] hahuang61: has joined #RubyOnRails
[07:05:31] bronson: has joined #RubyOnRails
[07:08:32] alfie_max15: has joined #RubyOnRails
[07:09:00] mvxlr: has joined #RubyOnRails
[07:11:32] sp1rs: has joined #RubyOnRails
[07:12:27] tagaulap: has joined #RubyOnRails
[07:12:32] dopie: has joined #RubyOnRails
[07:13:17] comrad: has joined #RubyOnRails
[07:14:06] sp1rs: has joined #RubyOnRails
[07:15:36] arBmind: has joined #RubyOnRails
[07:17:14] edwinvdgraaf: has joined #RubyOnRails
[07:17:55] hahuang65: has joined #RubyOnRails
[07:19:28] PedramT: has joined #RubyOnRails
[07:21:24] aligo: has joined #RubyOnRails
[07:23:44] pawnbox: has joined #RubyOnRails
[07:26:42] Seich: has joined #RubyOnRails
[07:27:19] antgel: has joined #RubyOnRails
[07:29:00] artto: has joined #RubyOnRails
[07:30:54] pyemkey: has joined #RubyOnRails
[07:31:29] bonswouar: has joined #RubyOnRails
[07:34:32] alfie_max15: has joined #RubyOnRails
[07:37:17] artto: has joined #RubyOnRails
[07:38:09] mark_66: has joined #RubyOnRails
[07:38:38] habitullence: has joined #RubyOnRails
[07:39:23] mikecmpbll: has joined #RubyOnRails
[07:39:25] htmldrum: has joined #RubyOnRails
[07:40:00] Devalo: has joined #RubyOnRails
[07:40:03] snowy: has joined #RubyOnRails
[07:43:42] greghoggard: has joined #RubyOnRails
[07:43:46] PedramT: has joined #RubyOnRails
[07:44:51] moeabdol: has joined #RubyOnRails
[07:45:09] discounted: has joined #RubyOnRails
[07:45:48] sp1rs: has joined #RubyOnRails
[07:46:03] roshanavand: has joined #RubyOnRails
[07:48:20] PedramT: has joined #RubyOnRails
[07:51:16] lubekpl: has joined #RubyOnRails
[07:51:16] darutoko: has joined #RubyOnRails
[07:52:51] rubyonrails260: has joined #RubyOnRails
[07:53:20] pawnbox_: has joined #RubyOnRails
[07:54:45] PedramT: has joined #RubyOnRails
[07:55:26] hahuang65: has joined #RubyOnRails
[07:55:50] kgrz: has joined #RubyOnRails
[07:56:23] pyemkey: has joined #RubyOnRails
[07:57:40] ariejan: has joined #RubyOnRails
[08:01:10] sp1rs: has joined #RubyOnRails
[08:02:19] mikecmpbll: has joined #RubyOnRails
[08:04:50] jsrn_: has joined #RubyOnRails
[08:06:56] Sharcho: has joined #RubyOnRails
[08:07:55] PedramT: has joined #RubyOnRails
[08:09:04] xcesariox: has joined #RubyOnRails
[08:10:12] Maletor: has joined #RubyOnRails
[08:10:51] artto: has joined #RubyOnRails
[08:11:16] maesitos: has joined #RubyOnRails
[08:11:49] AzaToth: has joined #RubyOnRails
[08:13:19] drptbl: has joined #RubyOnRails
[08:13:47] Ergo: has joined #RubyOnRails
[08:14:52] RegulationD: has joined #RubyOnRails
[08:15:28] pyemkey: has joined #RubyOnRails
[08:16:39] xploshioon: has joined #RubyOnRails
[08:17:30] dANOKELOFF: has joined #RubyOnRails
[08:20:13] sypheren: has joined #RubyOnRails
[08:21:46] pyemkey: has joined #RubyOnRails
[08:21:50] greghoggard: has joined #RubyOnRails
[08:22:22] yfeldblum: has joined #RubyOnRails
[08:23:17] kp666: has joined #RubyOnRails
[08:24:44] greghoggard: I'm trying to populate a database with a csv file. I have read every tutorial out there and followed their code to the letter yet I still can't get my code to work. I am getting the error "TypeError: no implicit conversion of Hash into String" and im not sure how i can fix this
[08:24:45] greghoggard: https://gist.github.com/greghoggard/920b4601f13399cf932db7bfaa91ef8b
[08:25:09] tetraktys: has joined #RubyOnRails
[08:26:58] PedramT: has joined #RubyOnRails
[08:27:10] sevenseacat: give people more than two seconds to look at the code :p
[08:27:32] sevenseacat: whats on line 8 of the seeds file, because it isnt whats in lione 8 of that gist
[08:28:01] greghoggard: oh i didnt paste the commented out things
[08:28:11] greghoggard: line 8 is the CSV.foreach block
[08:28:39] adre: has joined #RubyOnRails
[08:28:56] sevenseacat: ok, so try breaking it down - what does the Rails.root.join method give you? is that something that can be passed to CSV.foreach?
[08:29:31] ariejan: has joined #RubyOnRails
[08:29:48] htmldrum: has joined #RubyOnRails
[08:31:28] sevenseacat: have you checked it to see? :)
[08:31:34] greghoggard: what do you mean?
[08:31:48] sevenseacat: what does that Rails.root.join method return?
[08:31:50] greghoggard: i think im unsure of what rails.root.join actually does
[08:32:00] sevenseacat: and also what arguments it takes
[08:32:25] greghoggard: so what would be a better method to use?
[08:32:34] sevenseacat: why don't you look up what it actually does?
[08:32:38] sevenseacat: and what arguments it takes?
[08:34:24] pawnbox: has joined #RubyOnRails
[08:34:40] Megamos: has joined #RubyOnRails
[08:34:58] sevenseacat: if you need a hand doing that, let me know.
[08:35:10] alfie_max15: has left #RubyOnRails: ("Ex-Chat")
[08:35:12] greghoggard: join would just take the arguments passed to it and append it to the pathname to create a new path.
[08:35:26] greghoggard: so the headers and quote_char arguments are getting appended to the path?
[08:35:26] sevenseacat: right, so you're passing in a string, and a hash
[08:35:39] sevenseacat: are they? you tell me
[08:35:42] Palsson: has joined #RubyOnRails
[08:35:48] sevenseacat: easy to check it out and see :)
[08:35:56] sevenseacat: just fire up a console, and run that method call
[08:36:12] emilkarl: has joined #RubyOnRails
[08:36:35] pyemkey: has joined #RubyOnRails
[08:36:37] dANOKELOFF: Hi, I created a tchat with rails 5 and ActionCable, But I want to know if it's possible to create some curl request ( maybe with Faraday ? ) in my Job ?
[08:38:22] greghoggard: so this was the problem i was having earlier when i added that to the path. I took it out and am only passing in a string but when i run rake db:seed i get the error of CSV::MalformedCSVError: Illegal quoting in line 1
[08:38:35] greghoggard: so thats why i added the quote_char to it
[08:38:51] greghoggard: just couldnt find any resources on where i should be putting it
[08:38:53] blackmes1: has joined #RubyOnRails
[08:39:03] sevenseacat: greghoggard: so what told you you needed quote_char ?
[08:39:36] sevenseacat: does quote_char sound like it should be part of the filename? :/
[08:41:41] maesitos: has joined #RubyOnRails
[08:41:48] sevenseacat: but thats what you're passing it to, the Rails.root.join method that constructs a file path
[08:42:07] gamov: has joined #RubyOnRails
[08:43:03] greghoggard: I understand now that it shouldnt be part of the pathname. I need to have the csv file parsed with quote_char before it is put into the foreach loop
[08:43:29] moep: has joined #RubyOnRails
[08:43:41] ql6wlld: has joined #RubyOnRails
[08:44:18] sevenseacat: CSV.foreach is the one doing the parsing
[08:44:24] sevenseacat: and then the iterating
[08:45:24] Palsson: has joined #RubyOnRails
[08:45:25] Sharcho: has left #RubyOnRails: ("Leaving")
[08:46:00] sevenseacat: again, what told you you needed to use quote_char ?
[08:46:24] sevenseacat: because that should have also given you clues on how to use it
[08:46:35] greghoggard: how else would i be able to avoid that error
[08:46:59] sevenseacat: you haven't yet shown that error
[08:47:02] sevenseacat: so I can't tell you
[08:47:22] pawnbox: has joined #RubyOnRails
[08:47:37] sevenseacat: but I can tell you for sure that you are not using pipes to quote values, so quote_char:
[08:47:41] sevenseacat: "|" is incorrect
[08:47:56] greghoggard: https://gist.github.com/greghoggard/920b4601f13399cf932db7bfaa91ef8b
[08:48:30] jenrzzz: has joined #RubyOnRails
[08:48:46] sevenseacat: so what character *are* you using to quote values in your CSV?
[08:49:59] greghoggard: if you click on raw for the csv file it shows how its set up
[08:50:36] sevenseacat: thats why I'm prompting you to help you figure out the answers.
[08:51:16] greghoggard: but isnt the csv parser expecting quotes to entirely surround the comma-delimited text?
[08:51:29] sevenseacat: it's expecting a CSV file.
[08:51:58] sevenseacat: which your cards.csv definitely is
[08:52:09] pyemkey: has joined #RubyOnRails
[08:52:34] greghoggard: i want to first say that i seriously appreciate the amount of help you are giving me
[08:53:09] ariejan: has joined #RubyOnRails
[08:53:21] sevenseacat: https://gist.github.com/sevenseacat/2ae9eb8c6609a9feed14b9d2e440897c
[08:53:31] sevenseacat: definitely a valid csv.
[08:59:55] artto: has joined #RubyOnRails
[09:00:10] macsteps: has joined #RubyOnRails
[09:00:35] roadt_: has joined #RubyOnRails
[09:00:54] Infinite_182: has joined #RubyOnRails
[09:03:20] roshanavand: has joined #RubyOnRails
[09:03:22] greghoggard: i cant reproduce your results
[09:03:31] emilkarl: has joined #RubyOnRails
[09:06:53] mikecmpbll: has joined #RubyOnRails
[09:07:11] gamov: hello the pros! I wonder if it’s possible to control table aliasing in a AR:Relation. AR (4.0.15) automagically rename tables when a subquery is present breaking other conditions or ordering on the outer query https://gist.github.com/gamov/c761f0ac845f7bbbe002ad88e6d23cb8 Can I tell AR not to alias table?
[09:07:44] bronson: has joined #RubyOnRails
[09:08:23] digneety: has joined #RubyOnRails
[09:10:42] Maletor: has joined #RubyOnRails
[09:11:17] rrawlins: has joined #RubyOnRails
[09:14:22] rrawlins: Hey all, what's the recommended Ruby version for Rails 4.1.x?
[09:14:57] pyemkey: has joined #RubyOnRails
[09:15:16] xall: has joined #RubyOnRails
[09:15:21] FooMunki: has joined #RubyOnRails
[09:15:30] tbuehlmann: rrawlins: the guide says "The Ruby language version 1.9.3 or newer.", so I'd give 2.3.1 a try
[09:16:12] artto: has joined #RubyOnRails
[09:16:16] rrawlins: tbuehlmann: thanks. I'll see how I get on with that.
[09:16:26] sp1rs: has joined #RubyOnRails
[09:17:03] sevenseacat: rrawlins: always use the latest versions unless you have a reason not to :)
[09:17:16] sevenseacat: greghoggard: what are you seeing?
[09:17:24] sevenseacat: greghoggard: with what code?
[09:17:51] rrawlins: sevenseacat: yeah that was my gut, just wondered if their were any specific compat issues. Will see how I get on with the upgrade. Thanks.
[09:18:01] maokomioko: has joined #RubyOnRails
[09:18:12] greghoggard: right now im trying to figure out the rails console. Never have really used it before so im trying to figure out how to get it to find the csv file
[09:19:50] pawnbox: has joined #RubyOnRails
[09:21:31] sevenseacat: i simply used irb and opened it up in the folder I downloaded your CSV in. if you're using the rails console, you might need a different path, ie. "db/seeds_data/cards.csv" like in your code
[09:21:36] rwsq1: has joined #RubyOnRails
[09:23:10] rwsq1: how can I run an arbitrary validation on a variable? I have different kinds of user input that depend on other variables, and I would like to be able to validate those in some kind of free form way
[09:23:21] sevenseacat: rwsq1: !vague
[09:23:21] helpa: rwsq1: Your question has just been deemed vague; please consider rewording it. It may also help to give us any relevant code or errors so that we may better assist you.
[09:23:30] rwsq1: yeah, gimme a chance
[09:23:54] sevenseacat: get everything together before you ask your question. that way, if you solve it yourself before you ask, we'll never know :P
[09:24:16] greghoggard: https://gist.github.com/greghoggard/a5789940ca64e30d096d58a6ac42f3ed
[09:24:20] greghoggard: this is what i got
[09:24:49] rwsq1: ok so sometimes for the same input I want the input validated as a positive integer, other times as a string with a minimum length
[09:25:00] sevenseacat: greghoggard: are you actually providing the right path to your CSV file?
[09:25:19] marr: has joined #RubyOnRails
[09:25:27] greghoggard: i am in the seeds_data folder
[09:25:46] greghoggard: where my csv is located
[09:26:01] rwsq1: the actual validation will be need to be looked up from an entry in some other model
[09:26:16] emachnic: has joined #RubyOnRails
[09:26:21] sevenseacat: rwsq1: when you ask your question line by line, it also gets totally lost in amongst other conversation
[09:26:52] solars: has joined #RubyOnRails
[09:26:56] sevenseacat: greghoggard: and you're sure that cards.csv in that folder is the exact same csv you posted on github?
[09:27:55] rwsq1: OK let's try it again. User inputs data. I need to look up another model and then apply an appropriate validation. So I guess I need some kind of ruby class containing the validations and then apply the right one. So is it possible to have an array of validations and pick the one I want to use?
[09:28:10] tildes: rwsq1: sounds like a custom validator http://guides.rubyonrails.org/active_record_validations.html#validates-with
[09:28:20] sevenseacat: rwsq1: example?
[09:28:22] tildes: not sure what you mean with array of validations
[09:28:29] sevenseacat: because its still very vague
[09:28:51] sevenseacat: sounds like conditional validations, but who knows
[09:29:37] workmad3: has joined #RubyOnRails
[09:29:55] rwsq1: actually I think a custom validator might do what I want.
[09:29:57] rwsq1: thanks :)
[09:31:19] lxsameer: any solution to remove a view path from `view_paths` ?
[09:32:33] PedramT: has joined #RubyOnRails
[09:32:58] greghoggard: @sevenseacat im even more lost now. You used the exact same file as me, and i ran the exact same command as you did from the seeds_data folder where cards.csv is located yet i still get the MalformedCSVError. I've checked the paths a million times.
[09:33:39] sevenseacat: greghoggard: you using irb or rails console?
[09:34:03] lessless: has joined #RubyOnRails
[09:34:04] greghoggard: should i use rails console?
[09:34:08] sevenseacat: does File.read("cards.csv") give you the file?
[09:34:41] franzip: has joined #RubyOnRails
[09:35:12] greghoggard: so its there, its just the parser is unable to do it on my end
[09:35:44] sevenseacat: try saving the CSV you uploaded over your one, just in case its some weird formatting issue?
[09:36:30] quazimodo: has joined #RubyOnRails
[09:36:41] greghoggard: i still get teh malformed csv
[09:38:03] sevenseacat: i'm out of ideas :/
[09:38:27] yfeldblum: has joined #RubyOnRails
[09:38:52] sevenseacat: can CSV.read("cards.csv") read it?
[09:39:20] greghoggard: nope. malformed
[09:39:36] sevenseacat: can you gist your terminal when you run File.read("cards.csv") ?
[09:40:37] basldex: has joined #RubyOnRails
[09:40:45] basldex: I want to add a custom format to active admin'
[09:40:50] basldex: s download_links
[09:41:04] greghoggard: https://gist.github.com/greghoggard/a5789940ca64e30d096d58a6ac42f3ed
[09:41:07] beilabs: has joined #RubyOnRails
[09:41:11] basldex: when I override the index action the other formats are gone. how can I preserve them?
[09:42:29] sevenseacat: greghoggard: wondering if your mac is choking on the — characters for some reason
[09:42:43] basldex: or, different direction asked: how can I add a format to a controller without losing the default formats made by active admin
[09:43:14] Megamos: has joined #RubyOnRails
[09:43:15] sevenseacat: oh wait, you've got \r\n line endings
[09:43:21] sevenseacat: whats with that
[09:43:23] greghoggard: that makes sense. When it said line 1 i thought that just meant the headers but the output is all one line so it could be an error anywhere in there
[09:43:51] greghoggard: This was a json file that i converted to csv
[09:43:58] greghoggard: idk if the converter did that
[09:44:19] greghoggard: would a json file be better for this?
[09:44:50] sevenseacat: much the same, doesn't really matter
[09:45:18] greghoggard: so is the /r/n/ messing it up?
[09:45:28] sevenseacat: its the only difference I can see to my file
[09:45:42] greghoggard: is my mac putting that in there?
[09:46:01] sevenseacat: I just saved the file you uploaded
[09:48:39] PedramT: has joined #RubyOnRails
[09:50:41] greghoggard: is there a way to ignore the carriage returns?
[09:51:27] eckesicle: has joined #RubyOnRails
[09:51:38] eckesicle: In ActiveRecord
[09:51:47] eckesicle: Model.includes(:other)
[09:51:59] eckesicle: can i somehow specify conditions on the LEFT JOIN ?
[09:52:20] eckesicle: Model.includes(:other).where(other: some_cond)
[09:52:46] eckesicle: specifies the condition AFTER the join, I want to filter it before the join.
[09:53:19] eckesicle: SELECT * FROM models LEFT OUTER JOIN others ON others.model_id = models.id AND XXX <- my condition here
[09:53:35] sevenseacat: you've also changed the type of join
[09:53:41] Pupeno: has joined #RubyOnRails
[09:54:33] Pupeno: Is there an easy way of having a separate project for the admin tool and still share models?
[09:54:49] sevenseacat: Pupeno: i wouldnt bother
[09:54:51] wolfravenous: has joined #RubyOnRails
[09:55:07] Pupeno: sevenseacat: well, I do, I have to.
[09:56:02] Pupeno: Because company policy says that admin tools require client cert.
[09:56:42] sevenseacat: i have no idea what that means, but i'll take your word for it.
[09:56:55] adaedra: This does not make it compulsory to have separate projects.
[09:57:37] Pupeno: adaedra: can you elaborate? How would do you achieve that?
[09:58:17] adaedra: Where is your client certificate checking done? In the Rails app or on the front HTTP server?
[09:58:17] zfx: has joined #RubyOnRails
[09:58:55] greghoggard: i got it to work...
[09:58:56] greghoggard: https://gist.github.com/greghoggard/a5789940ca64e30d096d58a6ac42f3ed
[09:58:59] greghoggard: and I dont know how
[09:59:11] zfx: that's when you know you're alive
[09:59:15] sevenseacat: greghoggard: what did you change in your file?
[09:59:26] Pupeno: adaedra: http server checks the certificates.
[09:59:40] Pupeno: adaedra: not tho rails app.
[09:59:48] eckesicle: greghoggard just put nginx in front of it
[09:59:58] sevenseacat: eckesicle: wrong person
[09:59:58] eckesicle: and choose cert depending on endpoint
[10:00:19] greghoggard: i read on some website to open the csv in a plain text editor. Add a line then save the file. Then delete that line and save the file again
[10:00:43] greghoggard: idk if that removed some weird formatting on it
[10:00:52] adaedra: Pupeno: so your server could totally do the check only for a part of the requests, based i.e. on paths or domain, and still redirect both to the rails app
[10:01:06] nirakara: has joined #RubyOnRails
[10:01:10] nirakara: has left #RubyOnRails: ("Leaving")
[10:01:41] adaedra: You still have the strong protection, but everything is in the same application
[10:01:43] greghoggard: and now when i run rake db:seed with the command you gave me it outputs the same as well
[10:02:02] sevenseacat: greghoggard: :)
[10:02:10] arBmind: has joined #RubyOnRails
[10:02:21] greghoggard: so now what would be the best way to get that data into my database
[10:02:45] sevenseacat: with the code you originally had
[10:03:30] kgrz: has joined #RubyOnRails
[10:03:53] greghoggard: https://gist.github.com/greghoggard/920b4601f13399cf932db7bfaa91ef8b
[10:04:05] greghoggard: can you just look over it real quick and verify if that looks good?
[10:04:20] sevenseacat: greghoggard: did you try running it?
[10:04:39] greghoggard: im terrified of breaking it again lmao
[10:04:43] greghoggard: but yeah im about to
[10:04:46] sevenseacat: well when you run it it will break again
[10:04:55] Pupeno: adaedra: we require to separate internal tools from external tools. They run in different machines with different security constraints.
[10:05:30] greghoggard: NoMethodError: undefined method `subtypes002='
[10:05:55] greghoggard: are my key pairs in the right format?
[10:06:23] ur5us: has joined #RubyOnRails
[10:06:30] sevenseacat: then the code you're running isnt the code in that gist :)
[10:07:05] sevenseacat: also, where have you defined subtypes002 in your schema?
[10:07:29] edwinvdgraaf: has joined #RubyOnRails
[10:09:09] chipotle: has joined #RubyOnRails
[10:10:23] greghoggard: oh wow its not in there
[10:10:30] chipotle: hi all! i have two questions, one about RoR and the other about ruby static site generators. fir the latter, what is the main differences between jekyll and nanoc? i am having trouble deciding between the two...
[10:10:33] ferr: has joined #RubyOnRails
[10:10:35] chipotle: Radar: any chance you are around?
[10:10:45] chipotle: i am afraid to look at the front page of the nytimes today
[10:10:54] sevenseacat: can only Radar help you?
[10:11:07] chipotle: all i can think about is the "fake" front page on donald trump's first day in office
[10:11:22] sevenseacat: seems unrelated to rails
[10:11:24] chipotle: sevenseacat: no, i had a question about is rails 4 book he invited me to on github
[10:11:27] greghoggard: @sevenseacat we talked about the rails.root.join, the header: true needs to be outside of that correct?
[10:11:27] Maletor: has joined #RubyOnRails
[10:11:31] sevenseacat: chipotle: the one I also cowrote?
[10:11:47] greghoggard: (Rails.root.join("db/seeds_data/cards.csv"), headers: true)
[10:11:48] chipotle: sevenseacat: i wasn't aware you cowrote it
[10:11:59] chipotle: it will be my first rails app
[10:12:00] sevenseacat: greghoggard: does it work?
[10:12:15] artto: has joined #RubyOnRails
[10:12:21] sevenseacat: chipotle: I can help answer any questions about Rails 4 in Action, yes.
[10:13:28] chipotle: and i now know it is ambitious. which is why i am trying to start with jekyll or nanoc on a static blog type website (i'd use fb comments to allow for commenting, other than that, the only things i guess that my blog would lack is a block that said "most viewed articles" or "most commented articles", right? or is that still possible with jekyll and nanoc
[10:14:39] voidDotClass: has joined #RubyOnRails
[10:14:58] sevenseacat: jekyll has no way of knowing about facebook comments.
[10:14:59] pyemkey: has joined #RubyOnRails
[10:15:15] greghoggard: HOLY FUCK IT WORKED!!
[10:15:16] sevenseacat: if there are javascript widgets that can pull that kind of information, well, maybe
[10:15:19] sevenseacat: greghoggard: :D
[10:15:21] greghoggard: sorry for the language
[10:15:28] sevenseacat: lol no probs, its exciting when it works!
[10:15:29] greghoggard: THANK YOU SO MUCH!!!!
[10:15:52] voidDotClass: If I have a db column of the type Date, and I'm getting date in the form of unix timestamp milliseconds from client side, should I convert that to Date via Date.strptime(sec, '%s') before saving it in db?
[10:15:53] greghoggard: You have no idea!!! I have been working on this for a whole week!!!
[10:15:53] sevenseacat: you're welcome :)
[10:16:14] greghoggard: can i give you like reddit karma or something to repay you
[10:16:27] greghoggard: or buy your book?
[10:17:04] sevenseacat: lol if you want to buy the book, sure, but you don't have to, just pay it forward if you can :)
[10:17:06] helpa: Rails 4 in Action - http://manning.com/bigg2 - An excellent book combining Rails and TDD/BDD development. Written by Rebecca Skinner, Steve Klabnik, Ryan Bigg, Yehuda Katz
[10:17:24] voidDotClass: If I have a db column of the type Date, and I'm getting date in the form of unix timestamp milliseconds from client side, should I convert that to sec = millis / 1000, Date via Date.strptime(sec, '%s') before saving it in db?
[10:17:34] greghoggard: yeah i'll be buying it
[10:17:58] sevenseacat: I do recommend it if you're learning Rails :) both Radar and I can answer any questions about it
[10:18:11] ss0: has joined #RubyOnRails
[10:18:11] voidDotClass: sevenseacat, can you answer my q?
[10:18:15] sevenseacat: (he's Ryan, I'm Rebecca)
[10:18:39] sevenseacat: voidDotClass: if it isn't causing any problems, I wouldn't bother.
[10:18:51] voidDotClass: whats not causing problems
[10:19:06] sevenseacat: voidDotClass: whatever you're doing at the moment
[10:19:39] voidDotClass: sevenseacat, i'm not doing anything, i just want to know how i should save incoming unix timestamp milliseconds into a date column in the db
[10:19:52] voidDotClass: should i convert it to Date using Date.strptime ?
[10:20:06] sevenseacat: if that will get you the right answer out the other side, then sure
[10:20:20] sevenseacat: I've never heard of timestamps being provided in 'unix timestamp milliseconds'
[10:20:40] voidDotClass: sevenseacat, I just mean milliseconds since 1970 epoch
[10:20:49] sevenseacat: i am aware of what you meant.
[10:21:02] voidDotClass: What's the right way to save them to a db column in rails?
[10:21:07] sevenseacat: like I said, I've never heard of timestamps being presented that way
[10:21:18] sevenseacat: that doesn't mean I don't know what they are
[10:21:20] ss0: I'm new to web development in general and rails specifically and I'm hoping someone could point me in the right direction in regard to a project I want to pursue. I'm building a form, and part of the form requires the ability to add more form elements. Like if you have multiple email addresses you want the pdf sent to you would click add another email address link below where you can enter your single email address and it provides
[10:21:20] ss0: you another form element to input another email address. I believe this is called a nested form? In which case would cocoon be my best choice to provide this functionality in rails 4.2?
[10:21:30] voidDotClass: Why not? Its a pretty standard way to represent dates?
[10:21:38] sevenseacat: ss0: cocoon is a great choice for that
[10:21:43] voidDotClass: Anyway, how can I get the timestamp out of a Rails date?
[10:21:54] sevenseacat: voidDotClass: thats a different question entirely
[10:21:56] voidDotClass: timestamp = milliseconds
[10:22:15] ss0: @sevenseacat, and its indeed called a nested form? I was kind of worried that maybe that would all be handled by jquery with hidden form elements.
[10:22:35] sevenseacat: ss0: that is indeed how cocoon does it under the hood lol
[10:23:05] n008f4g_: has joined #RubyOnRails
[10:24:06] ss0: @sevenseacat, ah ok I will read the cocoon docs then, I'm literally just now scaffolding the form elements and then blocking unauthenticated access to edit and destroy etc.
[10:24:26] voidDotClass: How can I get the timestamp out of a Rails date?
[10:24:27] sevenseacat: i'd recommend not relying on scaffolding for anything, especially if you're just learning how the pieces fit together
[10:24:53] artto: has joined #RubyOnRails
[10:25:05] ss0: @sevenseacat, I'm following the "practicing rails" method of using scaffolding to get a quick demo app that I will throw away together so I can get an idea of what I need.
[10:25:49] ss0: @sevenseacat, but I'd like to know why scaffolding is bad, I hear that a lot, is it generating a ton of boiler plate code I don't need or want?
[10:26:03] sevenseacat: because you don't know how the pieces fit together
[10:26:11] ss0: @sevenseacat, (I'm not convinced I know anything and I'm here to learn).
[10:26:16] sevenseacat: so you don't know what all that boilerplate is or does
[10:26:16] zfx: has left #RubyOnRails: ()
[10:27:07] ss0: That's a good point.
[10:27:25] ss0: I do kind of know what it all does but I'm not comfortable putting it together quickly.
[10:29:58] pyemkey: has joined #RubyOnRails
[10:30:23] blackmes1: has joined #RubyOnRails
[10:31:55] chipotle: sevenseacat: keyll can't use fb comments? but it can use disquis comments? i figured it was just a javascript code i embed into my html? is that not true? can nanoc do fb commenting?
[10:32:10] sevenseacat: thats what I said, js widgets
[10:32:18] sevenseacat: jekyll itself has nothing to do with it
[10:33:01] ss0: @sevenseacat, thanks for your help. It probably gets tiresome fielding such questions but I really do appreciate it. Later #ror I'm off to mess with cocoon for a bit.
[10:33:53] markhkim: has joined #RubyOnRails
[10:33:53] markhkim: has joined #RubyOnRails
[10:37:46] artto: has joined #RubyOnRails
[10:39:13] GodFather: has joined #RubyOnRails
[10:39:24] chipotle: sevenseacat: i just thought starting with a static site generator like jekyll or nanoc was the best way to get myself ready to build a rails app
[10:39:59] sevenseacat: chipotle: it's building a totally different app, and none of the code will be reusable.
[10:40:25] artto: has joined #RubyOnRails
[10:40:38] chipotle: sevenseacat: well, i am a beginner in ruby. you still think i could build a basic blog app using RoR?
[10:40:50] sevenseacat: if you follow a tutorial, sure.
[10:41:31] mdw: has joined #RubyOnRails
[10:41:33] Devalo: has joined #RubyOnRails
[10:43:48] PedramT: has joined #RubyOnRails
[10:46:01] Craigimus: has joined #RubyOnRails
[10:46:16] chipotle: sevenseacat: i guess my main concern is that i'll be in over my head with RoR
[10:46:27] chipotle: sevenseacat: can you recomend a tutorial for setting up an RoR blog site?
[10:46:41] kareeoleez: has joined #RubyOnRails
[10:46:53] xcesariox: has joined #RubyOnRails
[10:46:58] sevenseacat: I recommend R4IA for learning how to use Rails - we don't build a blog app, we build something much bigger
[10:47:23] kareeoleez: I have a route like this: match 'settings', to: 'system_settings#index', via: [:patch, :put] but it always come up with a prefix when rake routes. How can I disable the prefix for these two routes ?
[10:49:11] kareeoleez: this is the result of rake routes: system_settings PATCH|PUT /system/settings(.:format) system/system_settings#index
[10:49:15] pyemkey: has joined #RubyOnRails
[10:49:26] sevenseacat: have you nested that route inside a namespace?
[10:49:27] kareeoleez: the "system_settings" is set automatically by Rails I guess
[10:49:47] sevenseacat: wait, what 'prefix' are you trying to get rid of?
[10:49:51] kareeoleez: http://pastie.org/10823691
[10:50:18] kareeoleez: sevenseacat: I don't know how else is called
[10:50:23] Craigimus: has joined #RubyOnRails
[10:50:35] kareeoleez: it's the one listed on the column "PRefix" when you rake routes
[10:50:58] sevenseacat: right, its a combination of the namespace you've applied, and the name you've given the route
[10:51:21] kareeoleez: but If you use resources: then this prefix for PUT & PATCH is always empty
[10:51:53] kareeoleez: at least rake routes doesn't show anything in that column
[10:52:08] kareeoleez: maybe it's recursive from the previous one above ?
[10:52:09] sevenseacat: because they use the same route helper as the lines above them
[10:52:27] sevenseacat: what exactly are you trying to accomplish by pointing all those route helpers to the same action?
[10:53:11] kareeoleez: sevenseacat: I have a form in my "index" action / index page
[10:53:28] kareeoleez: and I want to fill it in and do a put request
[10:53:40] kareeoleez: then render the same page
[10:53:58] sevenseacat: so you're going to have the logic for processing the form... in the index action?
[10:54:05] kareeoleez: it's like a settings page which displays several input boxes
[10:54:17] sevenseacat: thats.. unusual
[10:54:28] kareeoleez: you just update the input boxes values and save the changes
[10:54:34] kareeoleez: sevenseacat: what else ?
[10:54:46] sevenseacat: submit it to a controller action to handle it, like any other form
[10:55:04] kareeoleez: and then redirect back to index ?
[10:55:20] kareeoleez: yes this sounds like what I should be doing
[10:55:27] kareeoleez: why didn't I do this ?
[10:56:26] kareeoleez: btw the update action is controlled by settings#update action
[10:57:00] kareeoleez: the whole question is dump
[10:57:05] kareeoleez: sorry I got to research more
[10:58:38] tetraktys: has joined #RubyOnRails
[11:00:51] Craigimus: has joined #RubyOnRails
[11:01:04] idefine: has joined #RubyOnRails
[11:01:53] macsteps: has joined #RubyOnRails
[11:02:25] Ropeney: has joined #RubyOnRails
[11:03:16] ql6wlld: has joined #RubyOnRails
[11:04:35] apeiros: an OR spanning multiple columns must still be done via SQL string fragment, right? e.g. `Foo.where("colA = ? OR colB = ?", a, b)` (most recent rails 4)
[11:05:48] tbuehlmann: apeiros: also possible using arel
[11:06:16] apeiros: ok, so presumably relatively verbose? do you have an example at hand?
[11:06:27] tbuehlmann: sure: Model.arel_table[:colA].eq(a).or(Model.arel_table[:colB].eq(b))
[11:06:51] apeiros: and you put that expression into the .where()?
[11:06:53] tbuehlmann: not sure about the eq, could be eql, equal or something different
[11:08:40] PedramT: has joined #RubyOnRails
[11:08:41] Pupeno: has joined #RubyOnRails
[11:08:51] apeiros: I think I'll stick with sql fragment. or is there a good reason not to?
[11:09:01] Bloomer: has joined #RubyOnRails
[11:09:35] bronson: has joined #RubyOnRails
[11:09:42] ur5us: has joined #RubyOnRails
[11:09:56] tbuehlmann: in this case it's just preference I'd say, since it's basic SQL and "db agnostic code" isn't an argument
[11:10:36] Pupeno_: has joined #RubyOnRails
[11:10:49] voidDotClass: has joined #RubyOnRails
[11:11:09] apeiros: db agnostic code isn't an argument in my case anyway.
[11:11:40] apeiros: SUM() over multiple columns is also still only available via either AREL or .select + SQL fragment
[11:11:46] voidDotClass: has joined #RubyOnRails
[11:12:13] Maletor: has joined #RubyOnRails
[11:12:17] tbuehlmann: probably, or maybe even as a string argument of #sum
[11:12:48] voidDotClass: has joined #RubyOnRails
[11:13:45] voidDotClass: has joined #RubyOnRails
[11:17:26] PedramT: has joined #RubyOnRails
[11:19:46] flashpoint9: has joined #RubyOnRails
[11:19:57] rodfersou: has joined #RubyOnRails
[11:20:00] pyemkey: has joined #RubyOnRails
[11:24:29] mvxlr: has joined #RubyOnRails
[11:26:19] mvxlr: What does the "!" and "?" mean in the the highlighted line? https://gist.github.com/maximveksler/04370b8cc7ec8ea1f035558470ea631e#file-applicationcontroller-rb-L8
[11:27:05] mvxlr: and generally what goes on in there? How is the hook being performed in practice?
[11:27:32] adaedra: ! and ? are part of the method names
[11:27:53] yardenbar: has joined #RubyOnRails
[11:28:00] njero: has joined #RubyOnRails
[11:28:03] ldnunes: has joined #RubyOnRails
[11:28:36] adaedra: you declare a before_hook which will be a method (here export_i18n_messages) which will be executed by rails before executing the action method
[11:30:44] pyemkey: has joined #RubyOnRails
[11:30:52] IrishGringo: has joined #RubyOnRails
[11:31:43] mvxlr: ok I get this part. but why is the syntax for assignment into before_filter is not a "=", or am I just passing the function as parameter to before_filter?
[11:32:01] mvxlr: q2: why the ! and ? - why do they mean in Ruby?
[11:33:27] mvxlr: q3: I understand that rails will call my export_i18n_messages before the action method but shouldn't it be modifying some parameters that are passed to it? or does rails have the concept of a per request "session" that SimplesIdeias::I18n.export accesses?
[11:33:32] voidDotClass: I have an rspec factory where I have the column: is_private false . In my model I have: validates :is_private, presence: true . Yet if I try to do create(:team) I get 'is private cant be blank'
[11:33:49] sevenseacat: voidDotClass: false is blank.
[11:34:10] voidDotClass: sevenseacat, then how do i just check if its not nil?
[11:34:38] sevenseacat: you can validate the inclusion of it in true or false
[11:35:16] voidDotClass: validates :is_private, allow_nil: false
[11:35:26] voidDotClass: that gives 'you must specify at least one validation'
[11:35:34] artto: has joined #RubyOnRails
[11:36:04] sevenseacat: you didnt specify any.
[11:38:56] blackmes1: has joined #RubyOnRails
[11:39:20] Craigimus: has joined #RubyOnRails
[11:40:53] mvxlr: adaedra think you can provide a scope please on ^ ?
[11:41:46] adaedra: there's no parameter, it's a postfixed if
[11:42:03] adaedra: the method export! is only called in development mode
[11:42:48] adaedra: ! usually denotes a method that will mutate the variable it is called on. ? denotes a method that will normally return either true or false.
[11:43:03] adaedra: But that's open to the developper, really
[11:43:08] voidDotClass: if you have a has_many assoc, can you do a find_by on it?
[11:43:36] sevenseacat: voidDotClass: try it and see
[11:44:23] adaedra: mvxlr Both methods are called on the same controller instance and both have access to request, session, etc. Everything you have access from your action you have from your filter — both are just methods on the controller class
[11:44:58] chipotle: has joined #RubyOnRails
[11:46:16] King_Rex: has joined #RubyOnRails
[11:49:35] aagapovjr: has joined #RubyOnRails
[11:50:13] godzillaenlacasa: has joined #RubyOnRails
[11:52:23] PedramT: has joined #RubyOnRails
[11:52:50] aagapovjr: hello people
[11:53:58] rrawlins: Any ideas how to run "rvm use 2.1.6 --install" but have it pick the version from the projects Gemfile instead of statically defining it?
[11:54:29] bobbobbins: has joined #RubyOnRails
[11:55:05] thehardikjoshi: has joined #RubyOnRails
[11:55:14] pyemkey: has joined #RubyOnRails
[11:55:27] PedramT: has joined #RubyOnRails
[11:56:35] markhkim: has joined #RubyOnRails
[11:56:35] markhkim: has joined #RubyOnRails
[11:56:50] aagapovjr: has anyone had any experience configuring legit email senders to avoid spam filters? what are the key considerations here?
[11:57:38] aagapovjr: i know there's a lot of talk about standards like RFC 5322, but nothing seems universal here
[11:57:38] sevenseacat: step 1: dont be spammy
[11:58:10] chipotle: has joined #RubyOnRails
[11:58:12] PedramT: has joined #RubyOnRails
[11:58:22] aagapovjr: nobody's spammy here. i'm talking about emails sent to a website's users
[11:58:37] aagapovjr: purchase confirmations etc
[11:58:42] sevenseacat: i see, don't usually have a problem with those
[11:58:53] moep: has joined #RubyOnRails
[11:59:43] rrawlins: aagapovjr: Just use an experienced provide i.e. Postmark, Mailgun, Mailchimp etc.
[12:00:18] mvxlr: adaedra thank you. cool i understand now
[12:00:33] aagapovjr: rrawlins: looks good, will examine. thanks a bunch!
[12:00:33] pyemkey: has joined #RubyOnRails
[12:00:34] _Tariq: has joined #RubyOnRails
[12:01:29] rrawlins: aagapovjr: no problem. They'll talk you through adding SPF and DKIM records to your DNS, and send from reputable IPs which helps a great deal.
[12:01:49] aagapovjr: sounds like much
[12:03:36] cgfbee: has joined #RubyOnRails
[12:03:39] xardion_: has joined #RubyOnRails
[12:08:31] roshanavand: has joined #RubyOnRails
[12:09:16] dcope: has joined #RubyOnRails
[12:09:28] adlerdias: has joined #RubyOnRails
[12:09:39] mdw: has joined #RubyOnRails
[12:10:26] lxsameer: has joined #RubyOnRails
[12:11:58] aagapovjr: has left #RubyOnRails: ()
[12:12:59] Maletor: has joined #RubyOnRails
[12:13:07] _Tariq: has joined #RubyOnRails
[12:13:08] sp1rs: has joined #RubyOnRails
[12:13:40] srinidhi: has joined #RubyOnRails
[12:15:30] pyemkey: has joined #RubyOnRails
[12:16:13] RegulationD: has joined #RubyOnRails
[12:16:42] maxz: has joined #RubyOnRails
[12:17:10] pawnbox: has joined #RubyOnRails
[12:17:26] maokomioko: has joined #RubyOnRails
[12:23:41] dici: has joined #RubyOnRails
[12:26:27] Megamos: has joined #RubyOnRails
[12:26:49] franzip: has joined #RubyOnRails
[12:28:08] crystal77: has joined #RubyOnRails
[12:30:54] fox_mulder_cp: has joined #RubyOnRails
[12:33:55] pyemkey: has joined #RubyOnRails
[12:36:48] ornerymoose: has joined #RubyOnRails
[12:38:53] JakFrist: has joined #RubyOnRails
[12:39:29] idefine: has joined #RubyOnRails
[12:39:59] rodfersou: has joined #RubyOnRails
[12:40:51] ornerymoose_: has joined #RubyOnRails
[12:45:10] pyemkey: has joined #RubyOnRails
[12:45:51] mvxlr: On the rails guide the text speaks about 2 types of "Rake" on is https://github.com/ruby/rake and the other is http://rack.github.io
[12:46:08] mvxlr: does a default project generated with rails new NAME uses both by default ?
[12:47:07] ql6wlld: has joined #RubyOnRails
[12:47:29] xall: has joined #RubyOnRails
[12:49:22] futilegames: has joined #RubyOnRails
[12:51:40] chouhoulis: has joined #RubyOnRails
[12:52:18] GodFather: has joined #RubyOnRails
[12:52:19] SeanLazer: has joined #RubyOnRails
[12:53:58] flashpoint9: has joined #RubyOnRails
[12:54:15] Ebok: has joined #RubyOnRails
[12:54:17] akkmaxon: has joined #RubyOnRails
[12:57:20] _Tariq: has joined #RubyOnRails
[12:58:25] ramortegui: has joined #RubyOnRails
[12:59:30] elaptics: mvxlr: rack and rake are two different things
[12:59:45] mvxlr: yes, I've since noticed the different spelling.
[12:59:49] mvxlr: my mistake.
[13:00:12] franzip: has joined #RubyOnRails
[13:00:18] mvxlr: another q please, how it the line /*id get's produced from the following routes configuration ? https://gist.github.com/maximveksler/aa358536cfb5ebf6f18e13b7ea70c5c2#file-rake-routes-L5
[13:00:31] pyemkey: has joined #RubyOnRails
[13:01:29] elaptics: mvxlr: what do you mean exactly?
[13:02:04] mikecmpbll: short answer, it doesn't? :)
[13:02:28] PedramT: has joined #RubyOnRails
[13:02:39] macsteps: has joined #RubyOnRails
[13:06:13] chipotle: has joined #RubyOnRails
[13:07:42] deavid: has joined #RubyOnRails
[13:08:37] drbayer: has joined #RubyOnRails
[13:08:44] futilegames: has joined #RubyOnRails
[13:09:33] tildes: serious security issue with imagemagick https://imagetragick.com/
[13:10:56] bronson: has joined #RubyOnRails
[13:11:24] tildes: instructions for fixing it provided on the page (of course you might want to verify the news from other sources before doing anything, but this is real and with a suitable file that you upload to the system, you can execute shell script)
[13:11:32] mikecmpbll: tildes : interesting. pretty sure paperclip's content-type spoofing detection happens before anything to do with imagemagick commences
[13:11:38] tildes: ACTION figured it's serious enough to post
[13:11:48] mikecmpbll: i'll double check though
[13:12:00] tildes: mikecmbll: idk, hope so
[13:12:35] tildes: we were able to repeat the issue, and also verify the fix here at our bases
[13:12:58] beilabs: has joined #RubyOnRails
[13:12:59] wolfravenous: has joined #RubyOnRails
[13:13:47] Maletor: has joined #RubyOnRails
[13:14:17] Mia: has joined #RubyOnRails
[13:14:17] Mia: has joined #RubyOnRails
[13:14:53] mikecmpbll: tildes : details of the exploit anywhere?
[13:16:05] tildes: mikecmpbll: can't share, all I can say is that we were able to verify it's existence
[13:17:02] IrishGringo: has joined #RubyOnRails
[13:17:02] tetraktys: has joined #RubyOnRails
[13:17:27] lxsameer: has joined #RubyOnRails
[13:20:24] sfr^: has joined #RubyOnRails
[13:20:35] Ergo^: has joined #RubyOnRails
[13:21:14] PedramT: has joined #RubyOnRails
[13:21:27] mvxlr: has joined #RubyOnRails
[13:23:01] macsteps: has joined #RubyOnRails
[13:23:16] tildes: mikecmpbll: I suggest you just fix it, and verify the functionality still works
[13:23:41] greghogg_: has joined #RubyOnRails
[13:23:45] mikecmpbll: can't know if it's fixed without knowing the details of the exploit :)
[13:23:58] tildes: I'm sure there will be official patch too but idk when
[13:24:30] mikecmpbll: exploit info here, anyway: http://www.openwall.com/lists/oss-security/2016/05/03/18
[13:25:14] futilegames: has joined #RubyOnRails
[13:25:33] pyemkey: has joined #RubyOnRails
[13:26:30] workmad3: mikecmpbll: I don't think paperclip's content-type spoofing checks magic numbers... could be wrong though
[13:27:13] drptbl_: has joined #RubyOnRails
[13:27:14] mikecmpbll: workmad3 : it uses the unix `file` command which i understand checks magic numbers
[13:27:32] workmad3: mikecmpbll: ah cool, that's probably fine then :)
[13:27:32] Megamos: has joined #RubyOnRails
[13:28:31] wolfravenous_: has joined #RubyOnRails
[13:30:47] pyemkey: has joined #RubyOnRails
[13:31:29] yellow5: has joined #RubyOnRails
[13:31:42] rodfersou: has joined #RubyOnRails
[13:32:17] PedramT: has joined #RubyOnRails
[13:33:54] diegoviola: has joined #RubyOnRails
[13:34:34] safetypin: has joined #RubyOnRails
[13:40:15] jonathanwallace1: has joined #RubyOnRails
[13:41:25] moeabdol: has joined #RubyOnRails
[13:44:07] godzillaenlacasa: is there a way to redirect a user back to a ajax partial instead of the main page I have? My user goes to /settings, then selects the partial page to load through a menu on the left /settings/12/edit. However, since it's a page loaded with 'remote true' the URL is still /settings. So when a user clicks 'save' after changing their settings, they are redirected back to /settings instead of the
[13:44:07] godzillaenlacasa: RESTful /settings they just edited.
[13:44:40] wolfravenous_: has joined #RubyOnRails
[13:45:07] PedramT: has joined #RubyOnRails
[13:45:52] MarcoGL: has joined #RubyOnRails
[13:47:11] SteenJobs: has joined #RubyOnRails
[13:47:52] defsdoor_: has joined #RubyOnRails
[13:47:59] alaing: has joined #RubyOnRails
[13:48:18] Veejay: has left #RubyOnRails: ("WeeChat 0.4.2")
[13:48:21] tetraktys: has joined #RubyOnRails
[13:48:51] alaing: has joined #RubyOnRails
[13:48:51] akshat: has joined #RubyOnRails
[13:49:27] Limix: has joined #RubyOnRails
[13:51:28] sfr^: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[13:51:28] supernov_a: has joined #RubyOnRails
[13:51:36] franzip: has joined #RubyOnRails
[13:51:59] fmcgeough: has joined #RubyOnRails
[13:52:11] alaing: hi, i want to setup my ror app to use an existing sql server database. Do i still need to create db migrations etc to setup my local dev/test database?
[13:53:14] alaing: I'm hoping to eventually migrate the data from sql server to another db like postgres
[13:56:18] GodFather: has joined #RubyOnRails
[13:56:36] akshat_: has joined #RubyOnRails
[13:56:38] bwlang: alaing: you don’t need every migration… you can load your development database (which does not have to be local) from a schema dump (schema.rb or structure.sql)
[13:57:37] bwlang: alaing: PS - the “ping” almost made me not answer your question - perhaps the opposite effect of what you intended.
[13:58:08] sevenseacat: 'i didnt get a response in two whole minutes!'
[13:58:19] alaing: bwlang: sorry I typed "ping" in the wrong window
[13:59:55] bwlang: damn… but it worked - look all this activity now ;)
[13:59:56] alaing: :-( i didn't mean it honest
[14:00:45] bwlang: alaing: there are worse offences - you didn’t key my car or anything :D
[14:00:45] pyemkey: has joined #RubyOnRails
[14:01:05] DragonPunch: has joined #RubyOnRails
[14:01:36] chouhoulis: has joined #RubyOnRails
[14:02:01] alaing: lol - what car do you drive ;-)
[14:02:07] bwlang: alaing: if you’re planning to use sql server, i would recommend doing your development on the same version … and if you’re new to rails - you’re in for a tough time getting rails to be happy with you pre-existing back end.
[14:02:44] bwlang: alaing: not telling you - vandal!!
[14:03:00] epochwolf: bwlang: it's a Chystler Minivan, isn't it?
[14:03:20] bwlang: epochwolf: you must be a telepath…
[14:03:32] tetraktys: has joined #RubyOnRails
[14:03:33] idefine_: has joined #RubyOnRails
[14:03:41] alaing: bwlang: currently I'm working with an existing legacy application developed in Java. I've got sql server setup on a virtual machine
[14:03:48] epochwolf: bwlang: nope, just a time traveler.
[14:04:27] epochwolf: You answered the question and I came back to be creepy with that information.
[14:05:02] Detch: has joined #RubyOnRails
[14:05:24] bwlang: alaing: you might be better off just re-implementing the data model and munging it back to the legacy schema - never tried this approach.
[14:05:39] bwlang: epochwolf: username checks out - i’ll believe it.
[14:06:13] idefine_: has joined #RubyOnRails
[14:07:31] idefine: has joined #RubyOnRails
[14:07:35] apeiros: how'd I do the equivalent of `CREATE TABLE foos (code nvarchar(4000) PRIMARY KEY)` in a migration? `create_table :foos, id: false, primary_key: :code do |t| t.string :code end` omits the "PRIMARY KEY" part
[14:07:47] JesseH2: has joined #RubyOnRails
[14:07:51] Ispira: has joined #RubyOnRails
[14:07:54] wolfravenous: has joined #RubyOnRails
[14:09:33] mvxlr: has joined #RubyOnRails
[14:09:47] arup_r: has joined #RubyOnRails
[14:10:31] openstruct: has joined #RubyOnRails
[14:11:28] n008f4g_: has joined #RubyOnRails
[14:11:51] apeiros: I'm using it with the sqlserver adapter (most recent version), in case it is a db-server specific issue
[14:13:15] macsteps: has joined #RubyOnRails
[14:13:42] chopin: has joined #RubyOnRails
[14:14:33] Maletor: has joined #RubyOnRails
[14:14:39] franzip: has joined #RubyOnRails
[14:16:04] tetraktys: has joined #RubyOnRails
[14:17:05] eljimmy: has joined #RubyOnRails
[14:17:15] idefine: has joined #RubyOnRails
[14:20:25] Robtop__: has joined #RubyOnRails
[14:21:26] munish: has joined #RubyOnRails
[14:22:07] habitullence_: has joined #RubyOnRails
[14:22:17] idefine: has joined #RubyOnRails
[14:22:52] emachnic: has joined #RubyOnRails
[14:23:06] PedramT: has joined #RubyOnRails
[14:23:34] munish: has left #RubyOnRails: ()
[14:25:30] SteenJobs: have any of you worked up a patch for ImageMagick?
[14:26:13] workmad3: apeiros: I think it might be `create_table :foos, id: false do |t| t.string :code, primary_key: true; end`
[14:26:29] workmad3: apeiros: the docs do state that the `primary_key` option is ignored if `id: false` btw
[14:26:45] workmad3: (primary_key option passed to `create_table` that is)
[14:26:49] idefine_: has joined #RubyOnRails
[14:26:55] bronson: has joined #RubyOnRails
[14:28:02] apeiros: workmad3: tried that one too (and repeated just now) - that omits the PRIMARY KEY part in the generated sql as well :-/
[14:28:22] apeiros: indeed. writing those creates by hand is annoying.
[14:28:36] apeiros: also it means it doesn't end up in schema.rb
[14:29:01] apeiros: though, that isn't that bad. I don't think I've ever used schema.rb in the last ~8 years.
[14:29:07] ldnunes: has joined #RubyOnRails
[14:29:36] idefine: has joined #RubyOnRails
[14:29:43] tubbo: SteenJobs: http://imagetragick.com has the patch..
[14:29:51] tubbo: oh you mean on the byte level?
[14:29:58] filipechagas: has joined #RubyOnRails
[14:29:59] tubbo: i guess it would depend on your file uploading library
[14:30:34] GodFather: has joined #RubyOnRails
[14:30:41] SteenJobs: ya i read it - was wondering if someone swung together some class that takes image type as an arg and checks the magic bytes of the uploaded file
[14:31:06] workmad3: SteenJobs: paperclip has content-type spoofing checks already that shell out to `file` to do mime-type checking
[14:31:16] idefine: has joined #RubyOnRails
[14:31:41] workmad3: apeiros: hmm... digging into it a bit more, seems like it's a gap in migrations :(
[14:31:42] tubbo: SteenJobs: i just got disconnected so not sure if you saw my msg, but it would depend on your file upload library
[14:31:45] SteenJobs: right - that i know, and i use paperclip - i presumed that it checks the magic bytes to determine file type when adding validations
[14:32:00] SteenJobs: tubbo: ya i read it - was wondering if someone swung together some class that takes image type as an arg and checks the magic bytes of the uploaded file
[14:32:09] dANOKELOFF: Hi, I created a tchat with rails 5 and ActionCable, But I want to know if it's possible to create some curl request ( maybe with Faraday ? ) in my Job ?
[14:32:10] bratchley: has left #RubyOnRails: ()
[14:32:20] workmad3: SteenJobs: the `file` command has a bunch of heuristics, including checking the magic numbers, iirc
[14:32:20] SteenJobs: workmad3: so if i already have paperclip running, would you still recommend adding the policy.xml patch?
[14:32:36] workmad3: SteenJobs: are you allowing svg or mvg uploads?
[14:32:57] SteenJobs: nope, jpeg, gif, and png
[14:32:59] apeiros: workmad3: oh, you did even more digging than I :D, thanks
[14:33:01] tubbo: SteenJobs: policy.xml should be altered regardless, according to imagetragick.com
[14:33:15] workmad3: SteenJobs: you're probably safe, but yeah update policy.xml anyway
[14:33:15] tubbo: at least, that's the most secure way. it says you're required to do one or the other, but preferably both if you can.
[14:33:32] SteenJobs: workmad3: why would svg’s be a particular exception?
[14:33:45] tubbo: because SVGs aren't processed by imagemagick right?
[14:33:51] tubbo: like why would you, it's just code ;)
[14:33:52] workmad3: SteenJobs: because the attack is about embedding shell scripts in svg and mvg files, from what I've seen
[14:33:57] tubbo: oh never mind
[14:34:57] SteenJobs: yea so i assume validates_attchment: :model, content_type: {} checks magic numbers but i’d want to double ccheck paperclip’s source unless someone knows for sure
[14:35:49] workmad3: http://www.openwall.com/lists/oss-security/2016/05/03/18 includes exploit svg and mvg files if you're interested
[14:36:34] workmad3: SteenJobs: had that discussion with mikecmpbll earlier... he confirmed that it did, and I then looked at the source and saw it too :)
[14:36:53] FooMunki: has joined #RubyOnRails
[14:36:54] workmad3: https://github.com/thoughtbot/paperclip/blob/master/lib/paperclip/content_type_detector.rb is the codepath if you want to check yourself
[14:36:55] SteenJobs: well i verrrrrry much trust both of you over anything i may see for myself, so we’re good :D
[14:37:01] SteenJobs: oh nice, thanks!
[14:37:34] SteenJobs: i literally do trust your ability to interpret the code more than mine haha but yea i’d like to take a look - been getting into the habit of reading parts of the source code of the libraries i use.
[14:37:37] PedramT: has joined #RubyOnRails
[14:37:37] kailido: has joined #RubyOnRails
[14:37:54] kailido: how can i generate a controller in a plugin?
[14:37:57] workmad3: SteenJobs: haha :) trust but verify
[14:38:04] kailido: i have a app inside other app
[14:38:13] tubbo: appception
[14:38:31] LastWhisper____: has joined #RubyOnRails
[14:39:01] jhack: has joined #RubyOnRails
[14:39:04] kailido: if I rails g controller ... , it creates in the root app
[14:40:04] greghoggard: has joined #RubyOnRails
[14:40:39] mikecmpbll: i assume the magic bytes check is worthless if you still accept the file-types which are deemed vulnerbale
[14:40:53] sp1rs: has joined #RubyOnRails
[14:40:56] kailido: i want something like, rails g controller plugins/aims2 hello
[14:41:11] pyemkey: has joined #RubyOnRails
[14:41:26] idefine: has joined #RubyOnRails
[14:41:43] idefine: has joined #RubyOnRails
[14:42:58] Megamos: has joined #RubyOnRails
[14:43:54] tubbo: kailido: i think it might be because your plugins are located underneath your rails app dir, and they're using the `bin/rails` script from your app
[14:44:00] tubbo: kailido: in your plugin dirs, is there a bin/rails?
[14:46:02] kailido: i dont have bin rails
[14:46:32] kailido: i created once controllers in my plugins, but i dont know how I did it :(
[14:49:04] pyemkey: has joined #RubyOnRails
[14:50:41] polishdub: has joined #RubyOnRails
[14:50:58] tetraktys: has joined #RubyOnRails
[14:51:18] arup_r: SteenJobs: Let me know what actions you took to mitigate it, because there is no patch yet. :)
[14:51:39] lubekpl: has joined #RubyOnRails
[14:52:01] hobodave: has joined #RubyOnRails
[14:52:18] SteenJobs: literally doing nothing re the first fix bec of paperclip, and for the second just need to go into the IM installation on the production server and add the policy file
[14:55:03] Scient: I think this channel just got some props at RailsConf :P
[14:55:05] boontdustie: has joined #RubyOnRails
[14:55:33] arup_r: ok SteenJobs
[14:55:48] LastWhisper____: has joined #RubyOnRails
[14:55:56] LastWhisper____: did we just get a shoutout?
[14:56:58] wolfravenous: has joined #RubyOnRails
[14:58:02] tubbo: from all of us in IRC...fuck you railsconf!
[14:58:50] tubbo: good thing we just implemented some anti-troll stuff haha
[14:59:31] Scient: what kind of anti troll?
[14:59:41] njero: has joined #RubyOnRails
[14:59:46] ChanServ: +q *!*@suurhans.com
[15:00:08] ChanServ: -q *!*@suurhans.com
[15:00:13] tubbo: i have no idea what does that fwiw
[15:00:23] Scient: quiet mode something something?
[15:00:32] tubbo: i wonder if it's freenode or a bot :D
[15:01:10] tetraktys: has joined #RubyOnRails
[15:01:17] rafalee: has joined #RubyOnRails
[15:01:41] Scient: chanserv? thats freenode
[15:01:49] njero: !kick tubbo
[15:01:57] blackmes1: has joined #RubyOnRails
[15:02:22] tubbo: well yeah but it could be a bot just sending commands to ChanServ
[15:02:28] epochwolf: n_e_o: !unworthy
[15:02:28] helpa: n_e_o: You are not worthy of this bot!
[15:02:31] njero: *disobedient helpa
[15:02:52] arup_r: n_e_o: !unworthy
[15:02:52] helpa: n_e_o: You are not worthy of this bot!
[15:03:07] arup_r: going to do work...
[15:03:37] Scient: oh i believe its helpa doing the command proxying
[15:04:33] DataDyne: has joined #RubyOnRails
[15:04:40] smathy: has joined #RubyOnRails
[15:05:09] pyemkey: has joined #RubyOnRails
[15:05:49] DataDyne: Does anyone have any experience with Twitch API? I'm trying to use devise and omniauth-twitch gem(https://rubygems.org/gems/omniauth-twitch) and having a hard time figuring out why the uri url isn't matching
[15:06:22] hobodave: Hey guys, using Rails 4.1 -- where in the initialization process is the appropriate place to access ActiveRecord models? I was naively doing it in an initializer -- it worked, but it doesn't work for fresh checkouts with rake db:migrate etc. becuase the table doesn't exist yet. I need to access this model only when booting the application server.
[15:06:37] PedramT: has joined #RubyOnRails
[15:07:30] tubbo: hobodave: consider the implications of this. how can that model be created/updated on the server when the server hasn't booted yet?
[15:08:03] smathy: hobodave, what are you trying to do in the intiializer?
[15:08:46] hobodave: tubbo maybe I'm not communicating my problem clearly. I'm pre-populating a cache -- that's the simple explanation.
[15:09:41] macsteps: has joined #RubyOnRails
[15:10:13] GnuYawk: has joined #RubyOnRails
[15:10:14] wolfravenous_: has joined #RubyOnRails
[15:10:16] GnuYawk: has joined #RubyOnRails
[15:11:23] hobodave: tubbo smathy any help?
[15:12:49] tubbo: hobodave: !gist of your initializer and model might help..
[15:12:49] helpa: hobodave: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[15:13:05] tbuehlmann: btw, railsconf 2016 day 1: https://www.youtube.com/watch?v=fC-r51Dgwik
[15:13:14] w0rd-driven: has joined #RubyOnRails
[15:13:27] tubbo: hobodave: frankly i think it's a bad practice to depend on this kind of data in the initializer. but if you're basically just checking whether any models exist and pre-populating a cache or something, that's a little different. it could be written in an idempotent way.
[15:14:39] disgrntld: has joined #RubyOnRails
[15:14:45] hobodave: tubbo I've reached that conclusion already. I'm asking where in the process is the appropriate place to do it?
[15:15:20] Maletor: has joined #RubyOnRails
[15:16:00] hobodave: let me throw together a minimal gist
[15:16:46] greghoggard: has joined #RubyOnRails
[15:20:42] Guest_: has joined #RubyOnRails
[15:21:53] SteenJobs: has joined #RubyOnRails
[15:24:43] pyemkey: has joined #RubyOnRails
[15:24:53] hobodave: tubbo smathy https://gist.github.com/hobodave/013274b10ef9ad7ce3795ce668ad74dc
[15:24:57] hobodave: that's what I'm doing currently
[15:25:10] hobodave: obviously the initializer is not the correct place for that
[15:26:06] n008f4g_: has joined #RubyOnRails
[15:28:17] smathy: hobodave, I'd probably just rescue the exception here, this seems like a lot of effort for an edge case.
[15:28:50] hobodave: smathy that's not a bad idea
[15:29:00] hobodave: icky, but it works
[15:29:17] dopie: has joined #RubyOnRails
[15:29:25] jonathanwallace1: has joined #RubyOnRails
[15:30:10] smathy: Rescuing exceptions in exceptional situations isn't icky.
[15:30:34] smathy: I mean, do you really want your cache seeded during a db:drop ?
[15:30:58] smathy: Truth is that you will only ever want that to happen when those classes are working/defined.
[15:31:00] hobodave: no :) I don't need it seeded at all for test -- we have unit tests for that
[15:31:21] idefine: has joined #RubyOnRails
[15:31:25] smathy: I think it's icky to have that initialization run in the many situations where they're not needed, doing work for nothing then.
[15:31:50] hobodave: agreed, is there a more conventional place to do something like that?
[15:32:40] hobodave: is there a way to check if I'm running in a server context?
[15:32:47] hobodave: of course that's someone's name
[15:33:17] epochwolf: So... I upgraded from Rails 3.2.22 to 3.2.22.2 and now I have a massive list of warnings... "not initialized" and "circular require considered harmful"
[15:33:36] smathy: hobodave, there are ways to hook into the load process, register a callback with railties, I've never bothered learning it though because meh.
[15:33:45] epochwolf: It seems to be happening all over the application and I'm not sure how to troubleshoot this.
[15:33:51] alaing: has joined #RubyOnRails
[15:34:15] PedramT: has joined #RubyOnRails
[15:34:20] smathy: epochwolf, right, wasn't 3.2.22.x designed to be a precursor to the 4.0 leap, and hence added all the warnings?
[15:34:27] pyemkey: has joined #RubyOnRails
[15:34:56] epochwolf: smathy: so, that's normal?
[15:35:00] ravi_sun66: has joined #RubyOnRails
[15:35:09] smathy: ...there's zero benefit going from 3.2.22 to 3.2.22.x OTHER THAN getting all those warnings.
[15:35:18] epochwolf: smathy: security fix.
[15:35:31] ravi_sun66: expecting rc5.0
[15:35:33] smathy: Oh right, annoying.
[15:35:42] drbayer: has joined #RubyOnRails
[15:35:48] epochwolf: smathy: PCI requirements. We have to patch within 30 days.
[15:35:49] smathy: Ignore me then, I thought I remembered it was just for the 4.0 upgrade.
[15:36:20] smathy: Your PCI reqs will require > 3 soon enough though right? Maybe just plan for that ;)
[15:36:23] epochwolf: Is there a way to disable the warnings.
[15:36:41] epochwolf: smathy: Rails 4 upgrade has been in progress for months.
[15:36:49] smathy: They're just to STDERR right? I think the way to disable them is to ignore them,
[15:37:00] smathy: epochwolf, gotcha, want help with that? I know a company ;)
[15:37:39] epochwolf: smathy: yeah, we have some consulting company that charges $125/hr for this month's code academy graduates
[15:38:02] akshat_: Is Rails 3 EOL'd?
[15:38:17] epochwolf: akshat: soon, my friend. Soon.
[15:38:28] epochwolf: ACTION loads his shotgun.
[15:38:29] akshat: I can't find an official announcement
[15:38:53] ravi_sun66: yup finger crossed.. ;)
[15:38:53] hobodave: thank you smathy
[15:38:54] smathy: epochwolf, heh, I'll match that for elite experts.
[15:38:59] smathy: hobodave, no prob.
[15:39:54] moeabdol: has joined #RubyOnRails
[15:39:59] havenwood: akshat: http://guides.rubyonrails.org/maintenance_policy.html
[15:40:14] shibly: has joined #RubyOnRails
[15:40:22] havenwood: akshat: Rails 5 is the harbinger of the end.
[15:40:49] akshat: there we go, so if you're using Rails 3, you can't even assert any kind of PCI Compliance. Rails 3 is now like Windows XP. If you're still using it. You're definitely behind.
[15:40:49] shibly: has left #RubyOnRails: ()
[15:41:41] havenwood: akshat: Well, Rails 5 isn't quite out yet: https://github.com/rails/rails/milestones/5.0.0
[15:42:20] akshat: What's between Rails 3 and Rails 5? ;)
[15:42:51] havenwood: A riddle bit of Ruby.
[15:42:53] epochwolf: akshat: two major versions
[15:43:42] davidw: has joined #RubyOnRails
[15:44:11] chouhoulis: has joined #RubyOnRails
[15:44:15] akshat: neither of which have been EOL'd. So if you're doing stuff with Credit Cards or even Health, you're good to go with those 2 major versions
[15:44:54] tubbo: akshat: what haha
[15:45:14] chouhoulis: has joined #RubyOnRails
[15:45:29] pyemkey: has joined #RubyOnRails
[15:45:54] tubbo: i'm not sure you can assert PCI compliance with any older major version of rails.
[15:46:00] tubbo: even when rails 3 wasn't EOL
[15:46:11] tubbo: but i wouldn't know...
[15:46:36] akshat: Basically what I'm saying is Rails 4, you're good to go. Rails 3. Not so much.
[15:47:28] tubbo: probably, yeah
[15:47:33] tubbo: that's the case for a lot of things
[15:48:12] tubbo: especially with 3.0 you might be running an outdated ruby, not be able to upgrade due to severe lack of tests, etc.
[15:48:12] bronson: has joined #RubyOnRails
[15:51:27] duderonomy: has joined #RubyOnRails
[15:52:22] bruce_lee: has joined #RubyOnRails
[15:52:22] bruce_lee: has joined #RubyOnRails
[15:53:41] [Butch]: has joined #RubyOnRails
[15:55:59] epochwolf: tubbo: working on upgrading to ruby 2.0 as well.
[15:56:48] The_Phoenix: has joined #RubyOnRails
[15:57:38] The_Phoenix: has joined #RubyOnRails
[15:59:52] ravi_sun66: has joined #RubyOnRails
[16:00:07] asker__: has joined #RubyOnRails
[16:00:08] The_Phoenix: has joined #RubyOnRails
[16:00:25] VeryBewitching: has joined #RubyOnRails
[16:00:50] arup_r: hi VeryBewitching :)
[16:01:03] zave: has joined #RubyOnRails
[16:02:20] asker__: hey guys, has anyone tried to setup swagger with rails?
[16:02:34] The_Phoenix: has joined #RubyOnRails
[16:03:27] VeryBewitching: Does anyone happen to know if Stripe can let you apply a credit to a card?
[16:03:33] RegulationD: has joined #RubyOnRails
[16:03:48] VeryBewitching: A referral fee for example
[16:04:03] Megamos: has joined #RubyOnRails
[16:04:17] wolfravenous: has joined #RubyOnRails
[16:06:08] ornerymoose: has joined #RubyOnRails
[16:07:12] VeryBewitching: Oh, there's a channel, sorry my bad
[16:11:16] Malgorath: has joined #RubyOnRails
[16:12:37] djbkd: has joined #RubyOnRails
[16:16:03] Maletor: has joined #RubyOnRails
[16:16:09] GnuYawk: has joined #RubyOnRails
[16:16:12] GnuYawk: has joined #RubyOnRails
[16:17:08] Cache_Money: has joined #RubyOnRails
[16:19:16] dici: has joined #RubyOnRails
[16:21:52] chadhs: has joined #RubyOnRails
[16:22:22] pawnbox: has joined #RubyOnRails
[16:27:41] Malgorath: Anyone know a really good tutorial(video prefered) for creating engines for RoR? I keep hitting brick walls and need to figure out how to knock them down
[16:27:53] emachnic: has joined #RubyOnRails
[16:28:17] emachnic: has joined #RubyOnRails
[16:29:51] emachnic_: has joined #RubyOnRails
[16:31:00] ferr1: has joined #RubyOnRails
[16:31:16] voidDotClass: I have a users table + model, a schools table + model, and an invites table + model which stores the user + school, i.e the schools that a user has been invited to. How can I get only those users who haven't been invited to a particular school?
[16:31:52] voidDotClass: e.g something like Select * from user where user id NOT in (select user_id from invites where school_id = xxx)
[16:36:04] godzillaenlacasa: has joined #RubyOnRails
[16:36:12] arup_r: has joined #RubyOnRails
[16:36:37] xcesariox: has joined #RubyOnRails
[16:38:22] scepticulous: has joined #RubyOnRails
[16:38:35] safetypin: has joined #RubyOnRails
[16:39:08] reckoner: has joined #RubyOnRails
[16:39:45] supernov_a: has joined #RubyOnRails
[16:40:07] Jon30: has joined #RubyOnRails
[16:40:07] Jon30: has joined #RubyOnRails
[16:40:25] arpegius: has joined #RubyOnRails
[16:41:09] Coldblackice: has joined #RubyOnRails
[16:42:02] beilabs: has joined #RubyOnRails
[16:42:20] Limix: has joined #RubyOnRails
[16:42:33] arpegius: i’ve got some data coming out of redis that gets made into a hash and served through a controller a la “render json: @result”. the way it gets built, everything is a string. “1234”, “true”, etc. is there a way i can process @result one more time to convert any numeric strings to plain numbers, booleans to booleans, etc?
[16:42:39] joaumg: has joined #RubyOnRails
[16:43:01] Limix: Hi all, after doing a csv import to PG, it seems the primary key auto_inc doesn’t respect what is already there.
[16:43:34] tinylobsta: has joined #RubyOnRails
[16:43:36] Limix: getting duplicate key errors now, is there a way to reset the auto_inc to start after the last key of whatever was imported via csv?
[16:43:58] tinylobsta: has the rails system matured enough that it can be used as an effective platform managing a web app that is centered around natural language processing?
[16:44:11] tinylobsta: so many resources point to python and django for this kind of application, but i really like ruby as a language
[16:46:00] Guest37414: has joined #RubyOnRails
[16:46:00] manfrin: has joined #RubyOnRails
[16:46:03] greghoggard: has joined #RubyOnRails
[16:47:03] Ispira: I couldn't make Django work ever. It also seemed really oddly structured for something to build a web app
[16:47:08] zacts: if I want to learn both, is it better to start with rails or sinatra first?
[16:47:25] zacts: and how much ruby proper is required to learn rails?
[16:47:29] pawnbox: has joined #RubyOnRails
[16:47:50] arBmind: has joined #RubyOnRails
[16:48:33] Ispira: zacts: well they're both library/framework, I've never heard of Sinatra personally, I'd say Rails is the most commonly known. It'd be very helpful to understand Ruby syntax before diving into using things like that.
[16:48:51] Jon30: Hey guys, having a bit of a problem making will_paginate work with a nested resource located within an Engine. Getting "No route matches" -- https://gist.github.com/slavajacobson/0006c00e757bef620516e9e640742a1f
[16:49:16] pawnbox: has joined #RubyOnRails
[16:49:50] Cohedrin: has joined #RubyOnRails
[16:53:27] mikecmpbll: has joined #RubyOnRails
[16:53:33] idefine: has joined #RubyOnRails
[16:54:30] tubbo: zacts: both require ruby, but i think it's easier to start with rails first. generators and all that. :)
[16:54:38] wolfravenous: has joined #RubyOnRails
[16:54:48] tubbo: it's not like sinatra is some subset of rails, they mostly don't work the same way.
[16:55:50] audy: has left #RubyOnRails: ("bye")
[16:57:30] Craigimus: has joined #RubyOnRails
[16:58:44] xall: has joined #RubyOnRails
[17:02:05] Fire-Dragon-DoL: entirely random programming question. When using NullObject pattern, should NullObject return `nil? => true` ?
[17:02:51] smathy: Shouldn't matter because you'd never be testing that.
[17:03:44] arup_r: Limix: http://stackoverflow.com/a/2097175
[17:03:46] cschneid_: has joined #RubyOnRails
[17:03:58] cschneid_: What's the timeline on rails 5? Seems pretty imminent at this point?
[17:04:00] yellow5: has joined #RubyOnRails
[17:04:15] tbuehlmann: rc1 coming "this week"
[17:04:29] akshat: has joined #RubyOnRails
[17:04:38] tubbo: cschneid_: https://github.com/rails/rails/milestones
[17:04:41] tinylobsta: has joined #RubyOnRails
[17:04:44] tubbo: cschneid_: http://rails5countdown.com/
[17:05:19] cschneid_: heh. I like the velocity based one.
[17:05:30] cschneid_: thank you for the pointers, gotta finally make my library compatible.
[17:05:36] Limix: arup_r thank you
[17:05:37] tubbo: same haha
[17:14:20] diegoaguilar: has joined #RubyOnRails
[17:14:33] Puffball: has joined #RubyOnRails
[17:14:35] yardenbar: has joined #RubyOnRails
[17:16:32] roamingdog: has joined #RubyOnRails
[17:16:51] Megamos: has joined #RubyOnRails
[17:16:52] Maletor: has joined #RubyOnRails
[17:17:24] macsteps: has joined #RubyOnRails
[17:17:25] tinylobsta: has joined #RubyOnRails
[17:17:25] fox_mulder_cp: beta 4 published some days ago
[17:17:45] DoubleMalt: has joined #RubyOnRails
[17:18:29] GnuYawk: has joined #RubyOnRails
[17:18:32] GnuYawk: has joined #RubyOnRails
[17:18:42] roamingdog: has joined #RubyOnRails
[17:20:36] mikecmpbll: has joined #RubyOnRails
[17:22:59] hahuang61: has joined #RubyOnRails
[17:24:43] voidDotClass: I have a User model. How can I do something like Users.find_where(id, NOT in, [array of ids])?
[17:25:28] fox_mulder_cp: voidDotClass: Users.where('your selection here')
[17:25:52] voidDotClass: fox_mulder_cp, any cleaner way to do it than building the sql string myself?
[17:25:59] fox_mulder_cp: voidDotClass: try to start irb in new tab and make tons of experiments to do it
[17:26:41] fox_mulder_cp: voidDotClass: sorting and selection by id - as for me bad idea - in all real world projects we have an uuid as id, not int
[17:27:13] smathy: voidDotClass, !querying
[17:27:13] helpa: voidDotClass: http://guides.rubyonrails.org/active_record_querying.html - ActiveRecord Querying Guide by Ryan Bigg
[17:27:30] fox_mulder_cp: http://guides.rubyonrails.org/active_record_querying.html#retrieving-objects-from-the-database
[17:28:30] a1fa: has joined #RubyOnRails
[17:29:17] apeiros: voidDotClass: where.not(id: id_array)
[17:29:18] Craigimus: has joined #RubyOnRails
[17:29:31] voidDotClass: apeiros, thanks a bunch
[17:29:41] voidDotClass: exactly what i was looking for
[17:29:47] a1fa: helloo. i am doing some data massaging through rails console. and i get a mysql error duplicate record error, if have: unless model.save. but it stops processing next record. how do i make it continue processing and skipped the ones that failed?
[17:30:02] idefine: has joined #RubyOnRails
[17:30:10] a1fa: s/if have/i'm using unless model.save../
[17:30:23] Megamos: has joined #RubyOnRails
[17:30:36] a1fa: i don't want Model.each loop to stop
[17:31:21] LastWhisper____: has joined #RubyOnRails
[17:31:54] fox_mulder_cp: alethea: try/catch loop, as variant?
[17:32:03] LastWhisper____: has joined #RubyOnRails
[17:32:06] a1fa: should i do rescue next?
[17:32:17] tubbo: a1fa: perhaps only .select the elements you want
[17:32:18] a1fa: do begin, model.save, rescue, next
[17:32:24] Ebok: has joined #RubyOnRails
[17:32:28] a1fa: tubbo: thats the thing, i selected the element
[17:32:45] blackmes1: has joined #RubyOnRails
[17:32:47] a1fa: *s, i need, but some are duplicates, trying to rename a unique key, and remove the dupes
[17:32:50] fox_mulder_cp: a1fa: what u can do it with your objects?
[17:33:16] tercenya: has joined #RubyOnRails
[17:33:25] sp1rs: has joined #RubyOnRails
[17:33:30] fox_mulder_cp: a1fa: hm, i'm intrested - how dupes with non-uniq primary key added into sql
[17:33:58] a1fa: they were not dupes at one point, but after coorelation, they became dupes
[17:34:02] idefine: has joined #RubyOnRails
[17:34:41] fox_mulder_cp: a1fa: what you mean in dupes and corellation?
[17:35:09] a1fa: fox_mulder_cp: its a home designated compound key that was set to uniq
[17:36:24] tubbo: a1fa: i would at the very least rescue Mysql2::Error or whatever the actual exception is. you might want to know about other exceptions that get raised in this process.
[17:37:04] a1fa: thanks, that's what im in process of doing
[17:37:19] fox_mulder_cp: a1fa: i recommend switch to uuids, if u use pgsql
[17:37:29] a1fa: fox_mulder_cp: mysql :(
[17:38:02] Megamosaren: has joined #RubyOnRails
[17:38:09] fox_mulder_cp: a1fa: hm. what about uuids in percona/maria etc?
[17:39:35] akshat_: has joined #RubyOnRails
[17:40:32] jonathanwallace1: has joined #RubyOnRails
[17:40:36] cnk: has joined #RubyOnRails
[17:41:18] d08z: has joined #RubyOnRails
[17:41:33] hobodave: has joined #RubyOnRails
[17:41:51] arup_r: has joined #RubyOnRails
[17:42:00] davidw: has joined #RubyOnRails
[17:42:02] a1fa: [35] pry(main)* next
[17:42:02] a1fa: Error: Cannot find local context. Did you use `binding.pry`?
[17:42:23] a1fa: fox_mulder_cp: long term i am going to shoot for pgsql
[17:42:31] chouhoul_: has joined #RubyOnRails
[17:43:18] tetraktys: has joined #RubyOnRails
[17:43:24] d08z: i have a file "lib/blah.rb" and inside "blah.rb" there is a "require_relative foo.rb" ... now, to use my lib in my controller i "require_dependency lib/blah". How can i ensure BOTH files are "reloaded" when i update the code in dev mode?
[17:43:34] a1fa: i't not liking "next" in rescue
[17:44:30] fryguy: how do people typically differentiate the 'web' and 'app' roles when deploying via capistrano?
[17:44:31] tubbo: d08z: you have to use require_dependency or put that file in the autoload_paths for Rails to load it the same way it loads all the code in app/**/*
[17:44:38] fox_mulder_cp: a1fa: may be make a sort/compare objects in loop for drop dupes?
[17:44:40] arpegius: has joined #RubyOnRails
[17:44:57] tbuehlmann: d08z, I'd add lib to the eager_load_paths, stick to naming conventions and don't require things
[17:45:08] d08z: tubbo: i dont have to, but, putting it in the autoload_paths does not reload the code on each request
[17:45:29] a1fa: [37] pry(main)* rescue "Mysql2::Error: Duplicate entry" => e
[17:45:36] a1fa: ^ i guess this is part of my problem
[17:45:59] tubbo: d08z: no i am telling you that require_dependency is the thing that ActiveSupport provides to add stuff to the dependencies that get autoloaded.
[17:46:23] tubbo: d08z: check this out guides.rubyonrails.org/autoloading_and_reloading_constants.html
[17:46:26] tubbo: http://guides.rubyonrails.org/autoloading_and_reloading_constants.html
[17:46:28] d08z: i do use require_dependency
[17:46:33] Malgorath: Anyone know a really good tutorial(video prefered) for creating engines for RoR? I keep hitting brick walls and need to figure out how to knock them down
[17:46:34] d08z: i did read that guide
[17:47:06] d08z: the "blah.rb" library _IS_ reloaded on each request but NOT the "foo.rb" one
[17:47:14] fox_mulder_cp: Malgorath: what your mean as engine? what you want to create?
[17:47:37] d08z: (foo.rb is "required" at the beginning of blah.rb)
[17:47:55] fox_mulder_cp: i'm not a engish native speaking, so sorry, if i make mistakes
[17:48:16] tubbo: d08z: there are a couple ways you could attack this. my favorite is this: https://gist.github.com/tubbo/ba896b407b0016fcddd7dc67f55906d0
[17:48:53] tubbo: d08z: that would allow you to not have to explicitly require anything but 'blah'
[17:49:04] lubekpl: has joined #RubyOnRails
[17:49:23] d08z: tubbo: i know but then the lib is only useable in rails, not in "generic" ruby
[17:49:34] cnk: Malgorath: So we can assume that the guide on guides.rubyonrails.com isn't cutting it for you?
[17:49:56] d08z: tubbo: the lib is being used in a ruby and a rails project
[17:49:56] tbuehlmann: having the files as lib/blah.rb and lib/blah/foo.rb doesn't work for you?
[17:49:58] tubbo: d08z: it would require ActiveSupport, yeah...but that doesn't necessarily mean it requires rails for usage.
[17:50:17] tbuehlmann: oh, are we in a gem and not a rails app?
[17:50:26] tubbo: d08z: ruby actually has autoloading built-in, but it works slightly differently. at any rate, if you're using require_dependency, you are dependent on ActiveSupport :)
[17:50:30] PedramT: has joined #RubyOnRails
[17:50:32] tubbo: that is *NOT* a ruby method, that is an AS method.
[17:50:39] d08z: tbuehlmann: yes and no, both symbols are loaded and works, the "blah" class is reloaded on each request but NOT the foo class (although loaded the first time)
[17:51:08] Craigimus: has joined #RubyOnRails
[17:51:11] cnk: Malgorath: This book doesn't sound like it is engine related but each chapter starts by making in an engine: https://pragprog.com/book/jvrails2/crafting-rails-4-applications so might be worthwile
[17:51:14] d08z: tubbo: the "require_dependency" instruction is in a rails controller, not in the libs
[17:51:27] tbuehlmann: um, they shouldn't reload on each request either way, right?
[17:51:38] tubbo: if that's the case, you shouldn't need require_dependency in your controller :)
[17:51:57] d08z: then how do i "include and use my lib in /lib"
[17:51:59] tubbo: d08z: gems don't get reloaded on each request IIRC
[17:52:18] tubbo: if it's a gem it should just be loaded automatically at init time
[17:52:22] tbuehlmann: files neither, only on update
[17:52:26] d08z: its not a gem
[17:52:36] d08z: its a lib
[17:52:53] tubbo: d08z: how are you using it in two places at once?
[17:53:18] d08z: the ruby project uses "require /var/www/rails/.....lib/" lol
[17:53:27] tubbo: haha that's so fucking stupid
[17:53:43] fox_mulder_cp: idiotic requirement
[17:53:44] d08z: but not here to discuss legacy code
[17:54:06] fox_mulder_cp: d08z: fqdn path - bad ideeq
[17:54:06] blackmes1: has joined #RubyOnRails
[17:54:26] d08z: i ... *sigh* ....
[17:54:39] sypheren: has joined #RubyOnRails
[17:54:49] fox_mulder_cp: d08z: smile, u can rewrite it :)
[17:55:06] d08z: lets just rephrase my question: can i work on a lib under /lib without always re-starting the rails server
[17:55:16] epochwolf: d08z: I don't think you can.
[17:55:19] akshat: has joined #RubyOnRails
[17:55:24] fox_mulder_cp: d08z: in production mode - unreal
[17:55:30] d08z: in dev mode
[17:55:36] fox_mulder_cp: d08z: symlink?
[17:55:48] epochwolf: d08z: just ignore fox_mulder_cp
[17:56:12] d08z: ok i think there might be a language barrier i dont know how to ask my question (which sounded so simple in my head)
[17:56:17] epochwolf: d08z: In my experience rail's reloading doesn't work on stuff that's explictly required.
[17:56:23] tubbo: d08z: nah you're good you're just doing a really shitty thing haha
[17:56:30] tubbo: d08z: you definitely can't autoload this...
[17:56:42] tubbo: unless you added that dir to your autoload paths. but that might be a bad idea.
[17:56:43] epochwolf: d08z: if you call require on it, it doesn't use autoload and can't be unloaded.
[17:56:47] d08z: then how are the models and the controllers re-loaded on each requests?
[17:57:10] mwlang: has joined #RubyOnRails
[17:57:13] epochwolf: d08z: rails tracks autoloaded classes and deletes them from memory after the request.
[17:57:22] tubbo: well first of all the basic requirement for your own sanity is that your app code is isolated to your app. you can't just use your app code in some other lib and expect things to work. that's what engines are for.
[17:58:03] njero: has joined #RubyOnRails
[17:58:12] Malgorath: cnk: thanks I'll give that a gander
[17:58:31] d08z: ok well thank you all for your time anyway
[17:58:33] tubbo: d08z: the whole way rails autoloads stuff is a little complicated, imho
[17:58:49] tubbo: d08z: and so it's best to have a really good understanding of where that code is being used, otherwise isolate it and make sure it can be portable.
[17:59:44] d08z: should i put my /lib folder under /app as a "hack" lol
[18:00:18] tubbo: d08z: actually what you SHOULD do is make it a gem then load it locally with `path:`
[18:00:32] epochwolf: d08z: I put a lib folder under the app folder but you still need to let autoload do it's thing.
[18:00:37] emachnic: has joined #RubyOnRails
[18:00:55] tubbo: d08z: http://stackoverflow.com/questions/5633939/how-do-i-specify-local-gem-files-in-my-gemfile
[18:00:59] d08z: event if i could make a gem
[18:01:07] tubbo: gem 'legacy_lib', path: '/var/www/your_legacy_path'
[18:01:12] tubbo: sooo easy
[18:01:20] d08z: yes but it does not reload
[18:01:27] d08z: so you cannot test rapidly
[18:01:49] d08z: you have to restart the server each time you modify the gem
[18:02:01] mwlang: d08z: add to your config/application.rb: config.paths.add "lib", eager_load: true
[18:02:24] LastWhisper____: has joined #RubyOnRails
[18:02:55] mwlang: d08z: but regarding testing of gems, TDD/BDD helps with that. If you take the time to build as a gem, then cover properly with tests, then it “just works(tm)” in your app.
[18:03:26] epochwolf: mwlang: yes, the solution here is to stop everything and write a ton of tests for legacy code.
[18:03:42] mwlang: epochwolf: :-D
[18:03:58] epochwolf: We are past the point where we can preach TDD.
[18:03:59] d08z: the problem with asking questions about programming is you always get answers about engineering :(
[18:04:00] mwlang: well, if it’s a ton of legacy code, write tests as you change things.
[18:04:10] tubbo: d08z: haha that's true
[18:04:26] epochwolf: d08z: yeah, I know. That happens to me all the time.
[18:04:32] tubbo: d08z: the good news is if the question is too hard to ask, it's probably not a good idea in the first place ;)
[18:04:40] tubbo: but i feel for you, i've been there
[18:04:49] epochwolf: d08z: there's no good solution here to make autoloading work.
[18:04:51] d08z: tubbo: the questions has been hasked like 1,000,000 times on SO
[18:04:53] wolfravenous: has joined #RubyOnRails
[18:05:09] d08z: question asked
[18:05:12] mwlang: I probably missed the significant part of the conversation, having just joined the channel. ;-)
[18:05:54] tubbo: d08z: sorry we can't help, autoloading is a bitch.
[18:05:58] epochwolf: mwlang: it would be a good idea to understand the context before offering opinions.
[18:06:12] tubbo: ^ literally everyone who answers questions here
[18:06:39] epochwolf: tubbo: literally no one does that. :(
[18:06:54] d08z: in fact my question is really simple: how can i modify and reload the code of a file that is NOT under /app
[18:07:09] DoctorMonocular: has joined #RubyOnRails
[18:07:32] d08z: ... or so i thought
[18:07:41] tubbo: d08z: right but you keep adding requirements like "it's not in the same folder/repo", "it's used outside of the rails app". that expands the scope of your question. it's not really simple, that's a false representation of the scope of your problem...
[18:07:43] idefine: has joined #RubyOnRails
[18:07:58] jgt: has joined #RubyOnRails
[18:08:02] edwinvdgraaf: has joined #RubyOnRails
[18:08:16] mwlang: and that’s the question I thought I was answering with my initial chime in….
[18:08:35] chopin: has joined #RubyOnRails
[18:08:52] tubbo: your question IS really simple GIVEN that you are doing things the same way that 99.9999% of people are...
[18:08:55] d08z: tubbo: ok let's say i have a file called "foo.rb" that only contains ONE LINE: "require_relative bar.rb"
[18:08:58] tubbo: but you don't seem to be
[18:09:20] d08z: and, in bar.rb there is only one line: "puts 'hello'"
[18:09:40] jonathanwallace1: has joined #RubyOnRails
[18:10:11] d08z: i move those two files in rails/my_app/lib
[18:10:13] helpa: Please do not use fake values, as they can be confusing or misleading. Sometimes both.
[18:10:23] idefine_: has joined #RubyOnRails
[18:10:30] akshat_: has joined #RubyOnRails
[18:10:37] d08z: in my controller i "require_dependency lib/foo.rb"
[18:10:59] tubbo: baweaver: dude for real look at the backscroll :(
[18:11:09] d08z: i start the rails server, the console will print "hello"
[18:11:23] roamingdog: has joined #RubyOnRails
[18:11:36] mwlang: for those of you with experience with gitlab’s CI server: like it? hate it? easy to keep it updated over time?
[18:11:47] d08z: tubbo: are you still with me or am i not clear
[18:11:54] tubbo: d08z: still with you.
[18:11:59] epochwolf: baweaver: ffs, really?
[18:12:23] d08z: if add, in my sublime text, a line in foo.rb : "puts 'banana'"
[18:12:27] d08z: and hit refresh
[18:12:37] d08z: the console will now print banana
[18:12:40] hnanon: has joined #RubyOnRails
[18:12:46] d08z: so far so good right
[18:12:46] tubbo: d08z: whoa!
[18:12:50] tubbo: now that's interesting
[18:12:55] tubbo: i never heard of BOTH things getting called
[18:13:02] d08z: the problem is
[18:13:15] d08z: if i modify foo.rb
[18:13:30] roamingdog: has joined #RubyOnRails
[18:13:37] d08z: i mean blah.rb
[18:13:50] tubbo: haha whatever i get what you're saying
[18:14:00] d08z: and change 'hello' to 'hi' .. now the console STILL prints hello
[18:14:23] tubbo: d08z: perhaps try adding another require_dependency line
[18:14:25] d08z: but the file has been required by the other file which was required_depdencily (!)
[18:14:38] tubbo: require_dependency 'lib/foo.rb' and require_dependency 'lib/foo/bar.rb'
[18:14:53] d08z: yes this work
[18:15:00] drusepth: has joined #RubyOnRails
[18:15:12] tubbo: i think the issue here is that you want your rails app to autoload/reload these files, but you don't want other ruby things using this code to do that
[18:15:27] tubbo: so in that case, you need to keep any code related to autoloading in your rails app. period.
[18:15:30] tubbo: you can't have that in your gem.
[18:15:40] tubbo: sorry, LIBRARY
[18:16:03] d08z: i know i know but i thought that if i require_dependency a file, the whole "graph" is not loaded
[18:16:33] roelof: has joined #RubyOnRails
[18:16:41] d08z: not = now
[18:16:59] SteenJobs: has joined #RubyOnRails
[18:17:06] tubbo: d08z: definitely not.
[18:17:13] idefine: has joined #RubyOnRails
[18:17:14] roelof: I have a menu. Can I make it work that some menuchoices are only visible on some pages and not on the other pages ?
[18:17:22] tubbo: d08z: you can set it up to do that, but then your lib would need to depend on activesupport haha
[18:17:30] macsteps: has joined #RubyOnRails
[18:17:32] d08z: yes i know i tested it
[18:17:37] tubbo: roelof: yes. check out the current_page? helper.
[18:17:47] d08z: i have like 10 solutions that are 80% good
[18:17:53] d08z: none are 100%
[18:18:13] d08z: --but then-- how does rails makes /app all magically works
[18:18:15] tubbo: d08z: i think the best solution is to keep rails code in your rails code, and just require_dependency each file your rails app explicitly
[18:18:21] tubbo: app/**/* are added to the autoload_paths
[18:18:44] wolfravenous: has joined #RubyOnRails
[18:18:47] roelof: tubbo : thanks
[18:19:03] d08z: soooo, why does adding /lib to the autoload_paths considered a bad idea
[18:19:25] tubbo: d08z: frankly, the way i handle autoloading in rails apps these days is to just put everything in app/...it's guaranteed to be auto-loaded. it's going to work with spring (mostly).
[18:19:33] tubbo: just less shit to think about
[18:19:35] epochwolf: I think it had something to do with rake tasks in lib.
[18:19:41] tubbo: it's also a convention
[18:20:02] tubbo: lib/ is *supposed* to be for things you require at init time. it's basically a staging ground for non-rails-specific gems.
[18:20:09] d08z: what happens if you put a file with a "require" instruction in /app
[18:20:21] tubbo: it gets loaded once
[18:20:24] Malgorath: Anyone recommend a resource, paid or free, for learning Ruby on Rails in depth. Books and tutorials are nice but I'm wanting to put a serious effort forward in learning RoR.
[18:20:29] tubbo: and then if it's already been loaded it won't get re-loaded
[18:20:39] tubbo: something else in the system may re-load it though
[18:20:46] d08z: mv lib/ app/lib
[18:20:49] tubbo: like if you have require 'controllers/application_controller' or whatever that just won't matter.
[18:20:55] jenrzzz: has joined #RubyOnRails
[18:20:55] jenrzzz: has joined #RubyOnRails
[18:21:01] tubbo: d08z: you might wanna mv lib/ app/services or something so it doesn't look like asshole
[18:21:12] roelof: Malgorath: I do follow the Rails 4 in action book. I only do not know if this is enough depth for you
[18:21:47] Malgorath: roelof: I'm actually looking at things like codeschool udemy and such for actual courses.
[18:21:58] d08z: look like asshole?
[18:22:16] epochwolf: d08z: tubbo is being funny. Having an app/lib looks wierd.
[18:22:27] roelof: oke, then the question is do you want a paid one or a free one
[18:22:51] d08z: lol im really confused with some things that i thought would be so simple
[18:22:59] d08z: programming i guess
[18:23:00] Malgorath: roelof: I said either, I'm just looking for opinoins on ones people used that would be effective and worth while
[18:23:02] jstransky: has joined #RubyOnRails
[18:23:56] Craigimus: has joined #RubyOnRails
[18:24:36] SteenJobs: what is the appropriate element to use if we’re displaying a terms of service agreement and it’s super long, so we want a responsive but fixed size element with scrollable content
[18:24:44] SteenJobs: i know i should really ask in #html
[18:24:51] hnanon: When I try to create a company and associated user and subscription, only the subscription gets created. I have the following:
[18:24:54] hnanon: https://gist.github.com/anonymous/12e145ae6220d26a5468072ec0edf592
[18:25:17] idefine: has joined #RubyOnRails
[18:25:19] djbkd: has joined #RubyOnRails
[18:25:37] epochwolf: Malgorath: Everyone I know is self-taught but we all did this stuff before there was a school for it.
[18:25:47] SteenJobs: hnanon: is user a devise model?
[18:26:39] djbkd: has joined #RubyOnRails
[18:27:04] epochwolf: SteenJobs: an iframe maybe?
[18:27:12] SteenJobs: epochwolf: that’s what i thought
[18:27:13] Malgorath: epochwolf: my concern is that I have a lot of little bits of knowledge in RoR and my stringing things together is very...ungood :D
[18:27:16] SteenJobs: just wanted to verify
[18:27:22] cnk: Malgorath: Code School is pretty worth while. Other than that, books.
[18:27:32] SteenJobs: although should i just embed the actual text in the html rather than supply a src url?
[18:27:39] hnanon: SteenJobs: No. I'm using Sorcery.
[18:27:55] SteenJobs: hnanon: either way, where are creating the user in your create action?
[18:27:59] SteenJobs: *where are you
[18:28:12] epochwolf: Malgorath: I don't see what a class would teach that a book wouldn't.
[18:28:21] hnanon: The user is associated with the company when I create the company.
[18:28:33] hnanon: Does he have to be explicitly created?
[18:29:00] Malgorath: epochwolf: its more I need to be able to ask questions and hopefully get answers
[18:29:00] hnanon: I have white listed the user_attributes in the the company_params in the companies controller.
[18:29:20] SteenJobs: but that’s different than the logic in your new action
[18:29:23] SteenJobs: unless i’m missing something
[18:29:32] PedramT: has joined #RubyOnRails
[18:29:35] epochwolf: Malgorath: that's a very important criteria. A lot of courses don't offer that.
[18:29:43] gamer5: has joined #RubyOnRails
[18:29:46] SteenJobs: you have “@user = @company.users.build” in #new, indicating your building a new user object
[18:29:53] dionysus69: has joined #RubyOnRails
[18:29:59] SteenJobs: but then you’re accessing @company.users.first -> it shouldn’t exist yet
[18:30:02] voidDotClass: has joined #RubyOnRails
[18:30:06] hnanon: SteenJobs: Should I not be building a user in the new action?
[18:30:20] nertzy2: has joined #RubyOnRails
[18:30:23] cnk: Malgorath: are you somewhere with a lot of Meetups? The LA area has a ton of folks getting together to learn rails
[18:30:30] SteenJobs: if you’re creating a new user sure you can -> the problem is that user isn’t persisting to the create action
[18:30:45] SteenJobs: @company.users will be nil if you havent created and saved a user for that company yet
[18:30:55] pipework: SteenJobs: or built an instance.
[18:30:58] epochwolf: cnk: my experience in seattle was most of the good programmers left the meetups because of the number of people trying to use them as a learning resource.
[18:31:20] pipework: Maybe it's swayed since 2006 tho, epochwolf.
[18:31:21] tubbo: yeah i feel like that happened here in philly
[18:31:21] SteenJobs: and considering there is no existent user instance (thanks pipework), and you create the company in https://gist.github.com/anonymous/12e145ae6220d26a5468072ec0edf592#file-companies_controller-rb-L17
[18:31:24] SteenJobs: the user doesn’t exist
[18:31:31] epochwolf: pipework: that was only 4 years ago.
[18:32:06] cnk: I ran a weekly study group for a couple of years - so that sort of learning was what we were all about. YMMV
[18:32:12] arup_r: has joined #RubyOnRails
[18:32:12] SteenJobs: epochwolf: can i embed text in an iframe instead of supplying a src? i have a word doc with the text of the TOS
[18:32:16] lwu__: has joined #RubyOnRails
[18:32:22] Malgorath: epochwolf: like I'm trying to write an engine for a very customized RoR application(Openproject) and I can't even figure out how to modify any of the views to show my engine beyond adding a basic link_to in the sidebar
[18:32:33] jfelchner: has joined #RubyOnRails
[18:32:51] hnanon: So, my new action is correct? I need to build the user, right?
[18:32:59] qejk: has joined #RubyOnRails
[18:33:07] SteenJobs: peeps - anyone been to any meetups in NYC? i’ve never been to a meetup, and being self-taught, the only programmers i know are from IRC or a couple of friends haha
[18:33:07] epochwolf: Malgorath: writing a rails engine is a bit more complex than writing your standard application.
[18:33:08] jonathanwallace1: has joined #RubyOnRails
[18:33:21] jenrzzz_: has joined #RubyOnRails
[18:33:34] SteenJobs: hnanon: do you know what building an object in #new does? what it’s purpose is?
[18:33:52] SteenJobs: that object doesn’t persist to the create action
[18:34:00] hnanon: SteenJobs: I presume it instantiates the user.
[18:34:07] fox_mulder_cp: SteenJobs: iframe - is bad and unsecure idea, for some.. use something, that transform doc into html
[18:34:21] hnanon: So I would have user params that then get saved when I save the company.
[18:34:22] SteenJobs: well what do you mean by “the” user? every time you call User.new you’ll be instantiating a new user object technically
[18:34:37] SteenJobs: right now i’m talking about #new. forget about #create for a sec
[18:34:41] epochwolf: SteenJobs: ignore fox_mulder_cp, iframes are just fine for html.
[18:34:51] Malgorath: epochwolf: Yeah I'm getting that and figuring out how to extend things from openproject is like pulling teeth.
[18:34:52] Craigimus: has joined #RubyOnRails
[18:35:10] SteenJobs: what could be unsecure about it anyway in this use case, nothing jumps out
[18:35:21] epochwolf: Malgorath: that's a difficult project for an experienced developer. I'd recommend not starting with that.
[18:35:34] SteenJobs: i’m insecure about it being unsecure
[18:35:38] SteenJobs: not really, but just wanted to say that
[18:35:55] roelof: tubbo : wierd problem : I have this code in my application.html.erb : <% unless current_page?(controller: 'projects', action: 'show') %>
[18:36:02] SteenJobs: hnanon: when you build the object in #new, it allows you to access that instance in your form helper to build the object’s params
[18:36:13] Malgorath: epochwolf: turns out where I was recently hired on wants a plugin created and since I"m the only one here with any RoR exp guess who they expect to do it.
[18:36:18] roelof: and now I see this error message : No route matches {:action=>"show", :controller=>"projects"}
[18:36:22] epochwolf: SteenJobs: Alternatively, if you don't want to use an iframe, just use a div with fixed height and an overflow-y: scroll :)
[18:36:32] RegulationD: has joined #RubyOnRails
[18:36:32] hnanon: SteenJobs: Yes, I see.
[18:36:37] roelof: but there is a controller names projects with a show function
[18:36:40] SteenJobs: hnanon: but in your #create, you’ll need to call: user = @company.users.build(user_params); user.save;
[18:36:45] Craigimus: has joined #RubyOnRails
[18:36:45] tubbo: roelof: but you're not providing an id
[18:36:46] xall: has joined #RubyOnRails
[18:36:48] epochwolf: Malgorath: good luck, I'd learn the basics of rails and grab a book on rails engines.
[18:37:11] fox_mulder_cp: what difference - .create and .build methods?
[18:37:12] godzillaenlacasa: is there a way to search a returned object array for individual objects that contain a certain string?
[18:37:28] SteenJobs: epochwolf: well now i’m more interested in why it could potentially be an issue haha. and do you HAVE to supply a src for iframe or can you just copy/paste the text?
[18:37:30] godzillaenlacasa: was trying .grep(/Linux/) but that's not working
[18:37:33] Malgorath: epochwolf: I'm decent with basics, but yeah I get what you mean and I'll probably end up getting that book that cnk recommended.
[18:37:33] epochwolf: fox_mulder_cp: .create is equivalent to build().save
[18:37:34] roelof: tubbo: oke, back to the drawing table. I needs to work for any id
[18:37:38] hnanon: SteenJobs: user_params? Then why have user_attributes in the company_params? I've seen some examples that show it that way.
[18:38:03] SteenJobs: fox_mulder_cp: build will instantiate a new object with the proper associations, as if calling .new() and adding the id yourself
[18:38:33] SteenJobs: hnanon: oh oh you’re doing it that way
[18:38:57] hnanon: SteenJobs: Yeah :)
[18:39:23] fox_mulder_cp: epochwolf: so, in build i add nested objects to create it with dependencesm yes?
[18:39:31] epochwolf: SteenJobs: I don't think you can have html inside of the iframe tag. It gets ignored.
[18:39:41] hnanon: The weird thing is that the company is not even being saved.
[18:40:07] epochwolf: fox_mulder_cp: not sure what you're asking.
[18:40:32] SteenJobs: hnanon: lemme check your gist again, one sec
[18:41:30] fox_mulder_cp: epochwolf: now i intrested in create my object with has_many relationships (payment has_many items)
[18:41:35] SteenJobs: epochwolf: wahhh. so could i just host the docx file on s3 and src it from there? i guess it’ll appear as an image?
[18:41:58] epochwolf: SteenJobs: no... only if you have a docx reader installed locally.
[18:42:15] epochwolf: SteenJobs: however, Word can save files as html.
[18:42:31] fox_mulder_cp: u can transform docx -> html. by some converters
[18:42:49] SteenJobs: epochwolf: no kidding, and it’ll format the doc based on the formatting encoded or you have to format yourself?
[18:42:52] roelof: tubbo: so its not possible to display a menu specific on all the show pages ?
[18:43:00] chouhoulis: has joined #RubyOnRails
[18:43:09] epochwolf: SteenJobs: it'll be the ugliest html in the world but you don't need to look at it.
[18:43:22] fox_mulder_cp: roelof: what mnu u want?
[18:43:44] SteenJobs: epochwolf: that’s what we have partials for!
[18:44:01] epochwolf: SteenJobs: then use a div with some css.
[18:44:08] roelof: I have a menu I want to show only on the projects/show pages , but apperantly I need a id
[18:44:11] arup_r: has joined #RubyOnRails
[18:44:16] epochwolf: SteenJobs: iframe only loads external files.
[18:44:29] fox_mulder_cp: roelof: what id you mean?
[18:44:33] SteenJobs: epochwolf: although if it’s formatted with a lot of word formatting, so the word -> html seems like a better idea
[18:44:39] jonathanwallace1: has joined #RubyOnRails
[18:44:39] roelof: but I want to show it on all show pages no matter what the id is
[18:45:01] fox_mulder_cp: roelof: index, but not show/somethere?
[18:45:08] yuizinha: has joined #RubyOnRails
[18:45:19] roelof: I use now <% unless current_page?(controller: 'projects', action: 'show') %> but that does not work because the id of a project is not given
[18:46:05] roelof: No, on the project/show/x pages no matter what x is for number
[18:46:11] cnk: roelof: do the include the other way
[18:46:35] flashpoint9: has joined #RubyOnRails
[18:46:39] cnk: put the content in the show template with content_for - and then have tag that includes it
[18:46:43] cnk: let me find some docs
[18:46:50] fox_mulder_cp: roelof: hm. u can add some boolean in methods, and <% partial: .. if blabla = true %>
[18:47:05] cnk: http://guides.rubyonrails.org/layouts_and_rendering.html#using-the-content-for-method
[18:47:27] fox_mulder_cp: cnk: good idea for learning, thanks
[18:47:54] voidDotClass: has joined #RubyOnRails
[18:48:15] cnk: so in your layout, you will have yield :show and the show template has content_for :show
[18:48:28] tubbo: fox_mulder_cp: that only works if the expression returns nil
[18:48:49] SteenJobs: hnanon: use a debugger and check the value of @user right after “@user = @company.users.first”
[18:49:12] ldnunes: has joined #RubyOnRails
[18:49:23] SteenJobs: hnanon: if you haven’t saved the company object yet, then the user object won’t have been persisted to the db and you wont be able to query it
[18:49:28] fox_mulder_cp: tubbo: u say about my bool method?
[18:50:02] roelof: cnk: thanks, Now I have to figure out how I can make it work for a controller and a action
[18:51:13] fox_mulder_cp: tubbo: u are commiter into redis-rails, but as i see that main redis-store site is down. can u ping site authors?
[18:51:14] hnanon: SteenJobs: I see a user object.
[18:51:22] hahuang65: has joined #RubyOnRails
[18:51:23] cnk: roelof: The method I suggested involves putting everything into the views
[18:51:36] cnk: the stuff you want included - and the yeild as the place to put it
[18:52:09] SteenJobs: hnanon: the user object you intend on being there?
[18:52:50] roelof: cnk yes, I saw that, I try to figure out how to make this work in my case. The examples are all for complete controller and not for a specific action of a controller
[18:53:27] habitullence: has joined #RubyOnRails
[18:53:39] cnk: if you put the content in show.html.erb that is for a specific controller + action
[18:54:17] cnk: has left #RubyOnRails: ()
[18:54:26] cnk: has joined #RubyOnRails
[18:54:28] hnanon: SteenJobs: Yes. I just checked in my console: My last company id is 11. The user is saved and associated with company id 11. I promise it wasn't saving before. No, however, the subscription is being saved, but not being associated with the company.
[18:54:51] SteenJobs: hnanon: haha i believe you, lemme check re subscription, one sec
[18:55:47] fox_mulder_cp: so, about views - in asp.net i know good feature - it show SomThing by easy calling if it find on project view named as SomThing
[18:56:10] SteenJobs: hnanon: try saving the company before you save the subscription object
[18:56:20] SteenJobs: hnanon: not sure if it’ll work, but ruling it out is helpful too
[18:56:37] roelof: I can do that ? but how do I call the content_for then
[18:57:15] tubbo: fox_mulder_cp: i'm not sure who the owner of redis-store.org is, but i think the site should be at redis-store.github.io from now on.
[18:58:55] Dysp: has joined #RubyOnRails
[18:58:57] Dysp: https://gist.github.com/Dysp/ef6a5b3b871ee0333a4abd8c00d03032
[18:59:15] Dysp: Hi there. I have troubles with validations and ignoring these.
[18:59:31] Craigimus: has joined #RubyOnRails
[18:59:46] tubbo: Dysp: https://gist.github.com/Dysp/ef6a5b3b871ee0333a4abd8c00d03032#file-subject-rb-L17-L18 don't make sense
[19:00:08] tubbo: how does @subject have a method called skip_unique_validation if you haven't told Ruby what @subject is?
[19:00:10] hnanon: SteenJobs: Saving company first fixed the problem.
[19:00:40] Dysp: True. But changing the order don't work - I just tried that and forgot to arrange it back
[19:00:50] hnanon: SteenJobs: Thanks so much for helping me. I know you were trying to resolve your own issue and I appreciate the time and effort you spent on mine.
[19:01:25] crystal77: has joined #RubyOnRails
[19:01:25] SteenJobs: hnanon: aw thanks man! of course. listen, helping out here for the rest of my life wouldn’t come close to making up for the time other people have spent helping me.
[19:01:38] hnanon: By the way, can you convert that word doc to markdown?
[19:01:39] lacuna: has joined #RubyOnRails
[19:01:44] hnanon: Would that be helpful?
[19:01:50] hnanon: (I feel the same way).
[19:02:16] Dysp: tubbo: Changed it around, still same. :|
[19:02:27] SteenJobs: we’ll see. they just sent me the html of the doc, so gonna embed it in a scrollable div and see what happens
[19:03:13] fox_mulder_cp: tubbo: it forwards me into dropped site http://redis-store.org/ by 301 redirect
[19:03:41] fox_mulder_cp: curl redis-store.github.io -v
[19:03:48] tubbo: Dysp: hmm i've never tried to conditionally allow a validation based on attr_accessors
[19:03:55] tubbo: though i don't see why it wouldn't work
[19:04:22] Dysp: Alrighty. And if you can't I have no clue myself ^^
[19:04:22] tubbo: fox_mulder_cp: yeah i was assuming that's what "but as i see that main redis-store site is down." meant :P
[19:04:41] jonathanwallace1: has joined #RubyOnRails
[19:05:19] tubbo: https://github.com/redis-store/redis-store.github.io/pull/3 :)
[19:05:40] fox_mulder_cp: tubbo: ahaha. and my gem seems that site is down and don't work, reaally, matrix ))
[19:05:56] tubbo: fox_mulder_cp: wat
[19:06:10] patientj: has joined #RubyOnRails
[19:06:25] craysiii: has joined #RubyOnRails
[19:07:36] yellow5: has joined #RubyOnRails
[19:07:37] fox_mulder_cp: tubbo: i can't use redis-store as session store into my rails 5 app ( it fails when app start
[19:07:49] tubbo: fox_mulder_cp: this isn't the place for redis-rails support.
[19:08:13] tinylobsta: has joined #RubyOnRails
[19:08:39] fox_mulder_cp: tubbo: i know, thanks for hint )
[19:09:08] fox_mulder_cp: tubbo: in manuals i see MyApplication::Application.config.session_store .... but how to knows my real Application name
[19:09:19] ChanServ: +q *!*@home.kastaneda.kiev.ua
[19:09:23] tubbo: sorry dude, you're pissing me off
[19:09:34] tubbo: i'm not gonna get mentioned every time someone has a fucking redis problem in here
[19:09:46] arup_r: has joined #RubyOnRails
[19:09:55] tubbo: if anyone else decides to ask me for support you can go fuck off as well.
[19:10:08] epochwolf: tubbo: I could use some emotional support.
[19:11:08] cpruitt: has joined #RubyOnRails
[19:11:17] srinidhi: has joined #RubyOnRails
[19:11:47] PedramT: has joined #RubyOnRails
[19:16:01] Devalo: has joined #RubyOnRails
[19:17:16] psf: has joined #RubyOnRails
[19:17:36] Maletor: has joined #RubyOnRails
[19:17:45] Cache_Money: I have a fantasy golf app where a User can create a FantasyGame with 1 or more other Users. Right now they need to choose those users based on their username, which is fine b/c it's just me and a couple friends playing. But if I wanted to open it up to the public I feel like scrolling through a huge list of usernames isn't the best UX. Has anyone dealt with something like this or have any advice on ways to improve this process?
[19:18:07] psf: damn :(
[19:18:42] der-landgraf: has joined #RubyOnRails
[19:19:11] agent_white: has joined #RubyOnRails
[19:19:42] jonathanwallace1: has joined #RubyOnRails
[19:20:15] mvxlr: has joined #RubyOnRails
[19:20:29] Craigimus: has joined #RubyOnRails
[19:20:30] zave: has joined #RubyOnRails
[19:21:01] psf: has left #RubyOnRails: ()
[19:21:50] hnanon: I have to change a column to have the following: execute "CREATE SEQUENCE companies_number_seq START 1001"
[19:22:06] hnanon: Do I use change_column?
[19:26:25] P4Titan: has joined #RubyOnRails
[19:26:29] P4Titan: has left #RubyOnRails: ()
[19:26:32] n008f4g_: has joined #RubyOnRails
[19:27:43] apotry: has joined #RubyOnRails
[19:29:03] mostlybadfly: has joined #RubyOnRails
[19:29:57] yfeldblum: has joined #RubyOnRails
[19:30:37] hnanon: I'll just use a before_create and manually autoincrement.
[19:30:46] Ebok: has joined #RubyOnRails
[19:31:00] Malgorath: psf: rails 4 in action is a great book if your looking for a book on rails
[19:31:13] tubbo: hnanon: wat lol
[19:31:30] tubbo: hnanon: oh you're trying to use a sequence...not sure if you can change_column that
[19:31:33] tubbo: but who knows
[19:32:23] Megamos: has joined #RubyOnRails
[19:32:26] SteenJobs: epochwolf: iframe worked - created a view file with the word html, added it to my routes, and then sourced it in the iframe
[19:32:36] SteenJobs: epochwolf: i’m getting some weird characters, like “Ó”
[19:32:59] hnanon: tubbo: https://gist.github.com/anonymous/54cd00a54056002b2aaaf781849cdf9e
[19:33:01] SteenJobs: that’s where a double quote was
[19:33:10] Silox|: has joined #RubyOnRails
[19:33:37] hnanon: If I want to set the number of the first company to 1001 then autoincrement company numbers for subsequent companies, is that a good approach?
[19:34:51] hnanon: tubbo: Looks like you can change_column a sequence but the above is for postgres and not sqlite. I don't want to have to worry about what the db is/will be.
[19:35:27] tubbo: what you posted isn't a change_column
[19:35:42] hnanon: tubbo: I abandoned the change_column approach.
[19:35:56] hnanon: Now I just plan on using a before_create callback,
[19:37:22] akshat_: has joined #RubyOnRails
[19:37:41] idefine_: has joined #RubyOnRails
[19:39:09] epochwolf: SteenJobs: set the encoding properly.
[19:39:27] adre: has joined #RubyOnRails
[19:39:42] SteenJobs: epochwolf: in word? ha this is embarassing
[19:40:04] epochwolf: SteenJobs: You're using word, you'll have to fix it's output somehow.
[19:40:07] FooMunki: has joined #RubyOnRails
[19:41:22] siaw23: has joined #RubyOnRails
[19:41:48] jgt: has joined #RubyOnRails
[19:42:12] SteenJobs: epochwolf: fixed itttttt like a boss
[19:42:15] SteenJobs: kept indentation and everything
[19:42:31] epochwolf: SteenJobs: Word generally does a okay job with export to html.
[19:42:36] SteenJobs: epochwolf: i used pages to export as a .txt, and then ran “textutil -convert html ToS_Global_5.txt”
[19:42:39] epochwolf: The output is nasty to look at.
[19:43:00] SteenJobs: and it’s sooooo much nicer than the html input AND output from the word doc
[19:43:03] epochwolf: SteenJobs: ... if you're using Pages, that's different than MS Word.
[19:43:03] SteenJobs: and the encoding is fine
[19:43:09] SteenJobs: the file was docx
[19:43:12] SteenJobs: i just opened it in pages
[19:43:25] epochwolf: That's a very important detail.
[19:43:26] SteenJobs: haha sorry meant to add i had pages
[19:43:30] SteenJobs: i know i know, totally my b
[19:43:30] roamingdog: has joined #RubyOnRails
[19:43:42] SteenJobs: although there’s no export option for html in pages
[19:43:51] epochwolf: ACTION sticks SteenJobs on a pike as a warning to future generations.
[19:44:13] SteenJobs: i deserve it!
[19:44:27] SteenJobs: it’s like in Lord of the Flies
[19:44:29] ferr: has joined #RubyOnRails
[19:45:07] idefine: has joined #RubyOnRails
[19:45:24] IrishGringo: has joined #RubyOnRails
[19:45:36] bdnelson: has joined #RubyOnRails
[19:46:02] roamingdog: has joined #RubyOnRails
[19:46:52] SteenJobs: epochwolf: what is it that makes such a big diff if having access to pages, even though pages doesn’t have export to html as an option?
[19:47:01] epochwolf: SteenJobs: that's the difference.
[19:47:30] SteenJobs: epochwolf: ah - but the person who created the TOS sent me the docx file, and i had them export it to html and send me that file
[19:47:32] SteenJobs: so i had access to both
[19:47:39] epochwolf: SteenJobs: that works
[19:47:40] SteenJobs: i tried the word html file, and that’s what caused the encoding issue
[19:47:47] SteenJobs: and lost indentation
[19:49:23] chopin: has joined #RubyOnRails
[19:50:04] dikaio: has joined #RubyOnRails
[19:50:16] jenrzzz: has joined #RubyOnRails
[19:50:16] jenrzzz: has joined #RubyOnRails
[19:50:29] bronson: has joined #RubyOnRails
[19:54:05] bdnelson: has joined #RubyOnRails
[19:54:06] LastWhisper____: has joined #RubyOnRails
[19:54:22] chouhoulis: has joined #RubyOnRails
[19:54:57] chouhoul_: has joined #RubyOnRails
[19:55:10] craysiii: has joined #RubyOnRails
[19:56:48] chouhoul_: has joined #RubyOnRails
[20:00:01] ChanServ: -q *!*@home.kastaneda.kiev.ua
[20:01:03] chouhoulis: has joined #RubyOnRails
[20:02:30] LastWhisper____: hey guys what's the consensus when it comes to testing something we have fragment cached?
[20:02:35] LastWhisper____: do you ever write tests for it ?
[20:03:06] pipework: I don't test the fragment caching, it's already independently tested.
[20:03:14] pipework: Do you want to write tests to test that you call the caching code right?
[20:03:22] DoctorMonocular: has joined #RubyOnRails
[20:03:39] LastWhisper____: that's the idea.. or that certain actions 'bust' the cache
[20:03:43] pipework: Sounds like a test where you'd have to really overspecify implementation at that point.
[20:03:52] LastWhisper____: i can obviously manually do it, but it's nice to have a test for it
[20:04:09] pipework: If it's of great importance, I guess you could write some tests for it, what's the important use case?
[20:04:38] pipework: End users in browsers getting cached or new versions?
[20:05:58] pipework: If it's super super important, then I'd just simulate a request to get the page, then for each case of breaking and not breaking the cache, do whatever triggers it and then request the page again. You could assert on etags and stuff or whatnot, but it doesn't sound like that's really worth it.
[20:06:51] blackmes1: has joined #RubyOnRails
[20:07:10] pipework: You could always assert that the caching methods are called.
[20:07:40] pipework: But at that point, it's highly prescriptive in the test, not really describing behaviour.
[20:08:32] supernov_a: has joined #RubyOnRails
[20:09:45] Ebok: has joined #RubyOnRails
[20:10:02] n008f4g_: has joined #RubyOnRails
[20:10:53] roshanavand1: has joined #RubyOnRails
[20:12:09] LastWhisper____: cool pipework I think we'll just do without it
[20:12:16] LastWhisper____: it's not really tested throughout the rest of our codebase
[20:12:29] LastWhisper____: so doesn't seem like a path we want to start going down
[20:12:33] pipework: LastWhisper____: Yeah, I'd only write a test for it if it was like really important.
[20:13:02] pipework: Like some very important constantly updated section of the site that still uses caching.
[20:13:17] pipework: Probably only if it was directly making money or customers money.
[20:13:19] beilabs: has joined #RubyOnRails
[20:13:59] scepticulous: has joined #RubyOnRails
[20:15:04] LastWhisper____: yea its nothing like that
[20:15:14] LastWhisper____: its our internal availability tool
[20:17:47] craysiii: Hey all, i'm having trouble understanding exactly how i should have rails and nginx set up to serve scss files. https://gist.github.com/craysiii/19c6a50b2550df1c0cf4774028fc8096
[20:19:16] renancarvalho: has joined #RubyOnRails
[20:20:24] GodFather: has joined #RubyOnRails
[20:21:09] timdotrb: has joined #RubyOnRails
[20:21:58] craysiii: should rails be serving my css or should nginx?
[20:22:10] craysiii: is there a compilation process im missing?
[20:22:33] weaksauce: craysiii you should be compiling the assets into a folder and serving that folder through nginx.
[20:22:40] jutah: has joined #RubyOnRails
[20:22:45] Synthead: has joined #RubyOnRails
[20:22:56] dikaio: has joined #RubyOnRails
[20:23:10] weaksauce: craysiii http://guides.rubyonrails.org/asset_pipeline.html#in-production
[20:23:37] Infinite_182: has joined #RubyOnRails
[20:23:44] idefine_: has joined #RubyOnRails
[20:23:51] weaksauce: craysiii and any links to css should be handled with the helper functions so the correct version is used
[20:24:34] godzillaenlacasa: if I'm using Morris.js requires a hash to look like (hash : value ) does the hash format that Rails spits out ( hash => value ) matter?
[20:24:46] craysiii: thanks weaksauce, i'll check it out
[20:24:50] chopin: has joined #RubyOnRails
[20:26:10] stannard: has joined #RubyOnRails
[20:28:51] idefine_: has joined #RubyOnRails
[20:30:35] macsteps: has joined #RubyOnRails
[20:32:08] Puffball: has joined #RubyOnRails
[20:33:50] SteenJobs: if i want to conditionally show a modal, i need erb in my JS file - but how can i access the requisite objects? ex: if @profile.terms_of_service != true
[20:34:37] pawnbox: has joined #RubyOnRails
[20:35:36] SteenJobs: i guess just a data attribute
[20:36:55] jfelchner: has joined #RubyOnRails
[20:37:39] idefine: has joined #RubyOnRails
[20:38:20] jhack: has joined #RubyOnRails
[20:39:20] roshanavand: has joined #RubyOnRails
[20:40:32] akshat: has joined #RubyOnRails
[20:40:43] macsteps: has joined #RubyOnRails
[20:40:57] SteenJobs: for some reason @profile is coming up nil
[20:41:01] jfelchner_: has joined #RubyOnRails
[20:41:12] lxsameer: has joined #RubyOnRails
[20:41:27] Devalo: has joined #RubyOnRails
[20:46:29] ur5us: has joined #RubyOnRails
[20:48:04] Disavowed: has joined #RubyOnRails
[20:48:45] siaw23: has joined #RubyOnRails
[20:48:52] chrisja: has joined #RubyOnRails
[20:49:27] Disavowed: has left #RubyOnRails: ()
[20:50:50] stannard: has joined #RubyOnRails
[20:52:06] chouhoulis: has joined #RubyOnRails
[20:55:00] idefine: has joined #RubyOnRails
[20:55:23] DoctorMonocular: has joined #RubyOnRails
[20:59:18] Radar: GOOD MORNING
[21:01:04] roshanavand: has joined #RubyOnRails
[21:01:50] neanderslob: has joined #RubyOnRails
[21:06:25] Maletor: has joined #RubyOnRails
[21:06:38] mikecmpbll: has joined #RubyOnRails
[21:06:55] sypheren: has joined #RubyOnRails
[21:10:47] djbkd: has joined #RubyOnRails
[21:10:48] cydrobolt_: has joined #RubyOnRails
[21:12:36] icedp: has joined #RubyOnRails
[21:12:58] roshanavand: has joined #RubyOnRails
[21:13:12] renancarvalho: http://pt.stackoverflow.com/questions/126864/consulta-no-activerecord
[21:16:29] flashpoint9: has joined #RubyOnRails
[21:16:31] SteenJobs: is there a railsy way with rails 4 to send the value of a checkbox using ajax?
[21:17:10] cydrobolt: has joined #RubyOnRails
[21:17:10] cydrobolt: has joined #RubyOnRails
[21:19:26] idefine: has joined #RubyOnRails
[21:21:46] Craigimus: has joined #RubyOnRails
[21:23:50] rodfersou: has joined #RubyOnRails
[21:26:58] mdw: has joined #RubyOnRails
[21:28:21] roshanavand: has joined #RubyOnRails
[21:28:51] jenrzzz: has joined #RubyOnRails
[21:28:51] jenrzzz: has joined #RubyOnRails
[21:28:53] context: steenjobs: uhh, same way you send the value of any form field ?
[21:28:57] davidw: has joined #RubyOnRails
[21:29:23] SteenJobs: context: it’s in a modal terms of service window, on an edit profile page, so i need an ajax req that won’t cause a redirect
[21:29:25] SteenJobs: i think i got it though
[21:29:44] context: heh. not sure what a checkbox has to do with the server redirecting.
[21:31:52] SteenJobs: context: agh yea that was vague, sorry
[21:32:13] idefine: has joined #RubyOnRails
[21:32:35] FooMunki: has joined #RubyOnRails
[21:33:24] SteenJobs: context: when i submit the ‘checkbox form’, i need to somehow get the checkbox value - which means i need a form_for tag - can i use a form_for tag and have it submit an ajax req without writing additional server code?
[21:33:39] milesmatthias: has joined #RubyOnRails
[21:33:48] SteenJobs: right now, i just have it submitting when the box is clicked - by using “:data => {:remote => true, :url => url_for( :action => :update, :id => @profile.id, :registration_terms_of_service => "1"), :method => :patch}”
[21:34:26] SteenJobs: i presume if i can do it this way, i can do it with form_for
[21:35:04] idefine_: has joined #RubyOnRails
[21:35:57] creature: has joined #RubyOnRails
[21:35:57] creature: has joined #RubyOnRails
[21:36:36] polyidus: has joined #RubyOnRails
[21:38:33] timdotrb: Afternoon, all
[21:38:59] roamingdog: has joined #RubyOnRails
[21:40:16] polyidus: has joined #RubyOnRails
[21:40:28] timdotrb: I have private_pub chat working in an app locally, but can’t seem to get it to push messages in production. I can wget faye.js from the server, and messages are saved after I send them. If I refresh the page, messages appear. Is anyone aware of some way to debug why the messages are not being pushed?
[21:40:40] timdotrb: I can’t seem to find any logs for faye or private_pub
[21:40:42] eljimmy: has joined #RubyOnRails
[21:41:25] timdotrb: If I go into the console and manually do a PrivatePub.publish_to , I get a 200 response but no messages ever appear
[21:42:53] context: any of you use a project manager for home proejcts (ie: NOT development, like your actual home)
[21:44:01] mvxlr: has joined #RubyOnRails
[21:48:58] diegoaguilar: has joined #RubyOnRails
[21:52:37] IrishGringo: has joined #RubyOnRails
[21:53:13] brent__: has joined #RubyOnRails
[21:56:32] macsteps: has joined #RubyOnRails
[21:58:54] tjohnson: has joined #RubyOnRails
[22:00:38] tvon: has joined #RubyOnRails
[22:02:47] xlegoman: has joined #RubyOnRails
[22:05:04] jenrzzz: has joined #RubyOnRails
[22:06:12] DoctorMonocular: has joined #RubyOnRails
[22:12:54] djbkd: has joined #RubyOnRails
[22:14:40] Palsson: has joined #RubyOnRails
[22:17:31] mikecmpbll: has joined #RubyOnRails
[22:17:43] Devalo: has joined #RubyOnRails
[22:18:16] ravi_sun66: has joined #RubyOnRails
[22:18:18] Infinite_182: has joined #RubyOnRails
[22:18:34] idefine: has joined #RubyOnRails
[22:18:35] djbkd: has joined #RubyOnRails
[22:19:05] renancarvalho: has left #RubyOnRails: ()
[22:19:53] d0nn1e: has joined #RubyOnRails
[22:27:39] superlou: has joined #RubyOnRails
[22:29:44] flashpoint9: has joined #RubyOnRails
[22:29:59] brent__: working on a rails blog tutorial
[22:30:24] Radar: hi brent__
[22:30:38] brent__: and i need to add a site wide navigation side-bar, I'm adding a <ul> w/ the navigation links to the application layout
[22:30:57] brent__: what would be the way to turn it into a sidebar?
[22:31:15] baweaver: brent__ are you using bootstrap, or just plain css?
[22:31:30] brent__: i believe plain css
[22:31:49] baweaver: technically easiest way would be `float: left;` with some padding and a clear in the footer
[22:32:12] baweaver: you might consider bootstrap or foundation if for no other reason than their grid system
[22:32:25] Radar: brent__: Do you have the code for this app somewhere so that we can look at it?
[22:32:32] brent__: never looked into bootstrap, is it hard?
[22:32:35] brent__: https://github.com/brentluna/appAcademy/tree/master/prep2/w4/blogger
[22:32:38] Infinite_182: has joined #RubyOnRails
[22:33:23] baweaver: http://getbootstrap.com/ or http://foundation.zurb.com/ or Blueprint or YUI or .... well there are several
[22:33:37] baweaver: mainly don't reinvent the wheel on css if you can help it, because cross browser is a pain
[22:34:04] Radar: http://getbootstrap.com/components/#nav-pills
[22:34:20] baweaver: also grid system is under css if you go that way.
[22:34:39] baweaver: I've done enough CSS by hand to want to avoid doing it from scratch unless I absolutely have to.
[22:35:00] baweaver: Then again I grew up supporting IE 4, 5, 5.5, and 6.
[22:35:41] Radar: Flexbox makes it easier, but not all recent browsers support it.
[22:36:05] mwlang: baweaver: the worst years of IE
[22:36:09] Radar: We've just re-done some of our styles and we're using percentage widths to determine how wide input fields are, for example.
[22:36:15] brent__: i'm going to try and see what those basic css properties giv eme
[22:36:16] baweaver: replace Flexbox with anything new and shiny that looks to solve all your problems
[22:36:21] brent__: and then look into bootstrap
[22:36:29] brent__: is bootstrap commonly used in rails apps?
[22:36:37] baweaver: very much so brent__
[22:36:40] brent__: is it good to know
[22:36:41] mwlang: brent__: fairly common.
[22:36:43] baweaver: so much that they've added it in gems
[22:37:04] baweaver: mwlang I still have nightmares of the holly hack and friends
[22:37:09] mwlang: "bootstrap-sass"
[22:37:11] King_Rex: has joined #RubyOnRails
[22:37:40] mwlang: baweaver: ever feel like those nightmares are coming back with the mobile devices nowadays? :-o
[22:37:46] hahuang65: has joined #RubyOnRails
[22:37:58] baweaver: mwlang: why do you think I avoid mobile? :D
[22:38:19] brent__: for trying w/ css, i should put the <ul> inside a <div> with a class specified, and then make those changes to that class name, correct?
[22:38:19] baweaver: Radar: http://alistapart.com/article/howtosizetextincss - good read for later
[22:38:29] baweaver: brent__ yeah
[22:38:53] smathy: ...we're approaching escape velocity from planet topic.
[22:39:08] Radar: smathy: Sorry to distract you from all the Rails talk that was happening
[22:39:29] smathy: Silence > HTML/CSS chat.
[22:39:52] Radar: even though HTML and CSS is a critical component to Rails?
[22:40:14] Radar: I'm fine with it being talked about here _in the context of a Rails app_
[22:40:36] mwlang: ACTION agrees
[22:40:48] smathy: I'm fine with most things, including complaining about too much HTML/CSS :P
[22:41:45] robbyoconnor: has joined #RubyOnRails
[22:42:43] roshanavand: has joined #RubyOnRails
[22:44:27] idefine: has joined #RubyOnRails
[22:44:28] roamingdog: has joined #RubyOnRails
[22:45:10] brent__: pretty meh result w/ my css knowledge, for some reason teh background isn't adjusting w/ the font-size
[22:45:47] diego1: has joined #RubyOnRails
[22:46:07] diego1: has joined #RubyOnRails
[22:46:21] brent__: nvm, padding was being affected from another class
[22:49:32] brent__: sorry for the extra html/css question, last one and i'll get looking at bootstrap
[22:50:35] mvxlr: has joined #RubyOnRails
[22:50:44] brent__: how would i get the list to persist when the page scrolls? as well as not push the other classes outside it's padding area?
[22:51:12] smathy: ACTION prefers foundation FWIW
[22:51:27] baweaver: smathy how dare you talk about css?
[22:51:31] smathy: brent__, position:fixed
[22:51:38] smathy: baweaver, I'm just toeing the line.
[22:52:00] baweaver: smathy be glad we have a lenient line-height.
[22:52:40] smathy: _Maybe_ I'm just grumpy because I've had to do way more HTML/CSS in the project I've been working on that I like.
[22:52:45] brent__: thanks smathy
[22:52:48] bronson: has joined #RubyOnRails
[22:52:58] dikaio: has joined #RubyOnRails
[22:52:59] baweaver: smathy is always grumpy though :D
[22:53:05] smathy: Well, that's true.
[22:53:07] baweaver: brent__ also read into overflow
[22:53:18] smathy: I have a long history of grump to maintain.
[22:54:52] rakm: has joined #RubyOnRails
[22:54:58] Infinite_182: has joined #RubyOnRails
[22:56:13] Infinite_182: has joined #RubyOnRails
[22:57:13] croberts: has joined #RubyOnRails
[22:59:20] mwlang: ACTION hands smathy some bourbon. brent__: that’s http://neat.bourbon.io/ (yet another css framework)
[22:59:45] baweaver: there are a lot of those
[23:00:00] _Tariq: has joined #RubyOnRails
[23:00:22] DragonPunch: has joined #RubyOnRails
[23:00:54] smathy: Yeah, I don't mind having the additional "weight", just that bootstrap has some frustrations like the internal stuff not using mixins so you can't just grab (for example) the `a` mixin and apply it to other things.
[23:01:26] brent__: soo much to know
[23:01:30] baweaver: zurb foundation was the last railscast too iirc :(
[23:01:50] smathy: I hope he's enjoying his life more.
[23:01:59] baweaver: brent__ welcome to programming
[23:02:15] baweaver: yeah, who knows, he showed back up on twitter at least
[23:02:35] brent__: oh yeah, its frustrating how its so much like spoken languages where if you don't use it, you kind of forget it
[23:02:51] smathy: Yeah, he was going to get back into the railscasts - but didn't work out.
[23:03:37] brent__: i was getting into android before i got accepted into this bootcamp for rails/js webdev and i'm sure i would struggle mightily trying to do any android dev now
[23:03:59] baweaver: if you learn one thing well it's not nearly as bad
[23:04:15] baweaver: but that only really becomes apparent when you go pro
[23:06:10] mwlang: one learns to take good notes (i.e. keep old code around) to make returning to the fold a little easier.
[23:06:14] brent__: any recommened reading/tutorials to get a better understanding of rails?
[23:06:58] helpa: Rails 4 in Action - http://manning.com/bigg2 - An excellent book combining Rails and TDD/BDD development. Written by Rebecca Skinner, Steve Klabnik, Ryan Bigg, Yehuda Katz
[23:07:15] Maletor: has joined #RubyOnRails
[23:07:19] baweaver: two of the authors are in here, one currently
[23:07:32] baweaver: definitely a book to keep on your radar
[23:08:54] Radar: Good morning
[23:09:05] Radar: Rails 4 in Action is the best book ever written by someone called Ryan Bigg.
[23:09:21] smathy: I think Android dev is probably a lot easier than web dev.
[23:09:33] Radar: !offtopic
[23:09:33] helpa: this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Rails related topics. Thanks!
[23:09:46] brent__: i'll take a look
[23:09:48] smathy: ACTION gets smacked (rightly so!)
[23:10:04] moeabdol: has joined #RubyOnRails
[23:10:13] emachnic: has joined #RubyOnRails
[23:11:20] baweaver: brent__: Radar === Ryan Bigg
[23:11:29] Radar: baweaver: F A C T
[23:11:35] brent__: spam!!!! jk
[23:11:38] baweaver: ...too much JS
[23:11:52] voidDotClass: has joined #RubyOnRails
[23:12:01] baweaver: I notice when I use === and ; in ruby
[23:13:02] jenrzzz: has joined #RubyOnRails
[23:13:02] jenrzzz: has joined #RubyOnRails
[23:13:06] SteenJobs: has joined #RubyOnRails
[23:13:18] killerbunny: has joined #RubyOnRails
[23:13:20] Infinite_182: has joined #RubyOnRails
[23:13:29] smathy: ^ is why I coffeescript
[23:13:30] brent__: why js! why!
[23:14:15] Infinite_182: has joined #RubyOnRails
[23:15:38] milesmatthias: has joined #RubyOnRails
[23:15:50] Infinite_182: has joined #RubyOnRails
[23:16:21] aloneintheworld: has joined #RubyOnRails
[23:17:16] brent__: i start a rails/js bootcamp next week, so will probably be in here harassing people quite a bit
[23:17:29] Radar: brent__: which one?
[23:17:40] brent__: app academy
[23:17:47] n008f4g_: has joined #RubyOnRails
[23:21:10] htmldrum: has joined #RubyOnRails
[23:21:15] Infinite_182: has joined #RubyOnRails
[23:22:03] dalbuschat: has joined #RubyOnRails
[23:22:10] Infinite_182: has joined #RubyOnRails
[23:22:37] brent__: yeah, nervous, but looking forward to it. hoping to get that career change jump started. Been a slower process than I liked trying to learn on my own around work
[23:22:59] Infinite_182: has joined #RubyOnRails
[23:23:40] Infinite_182: has joined #RubyOnRails
[23:24:45] Infinite_182: has joined #RubyOnRails
[23:25:44] Infinite_182: has joined #RubyOnRails
[23:25:56] benlieb: has joined #RubyOnRails
[23:29:07] jenrzzz_: has joined #RubyOnRails
[23:29:15] Infinite_182: has joined #RubyOnRails
[23:32:45] Infinite_182: has joined #RubyOnRails
[23:33:23] brent__: thanks for the help guys, i got one ugly sidebar. going to look into bootstrap later tonight
[23:36:52] robbyoconnor: has joined #RubyOnRails
[23:38:29] GodFather: has joined #RubyOnRails
[23:39:42] godzillaenlacasa: has joined #RubyOnRails
[23:39:54] flashpoint9: has joined #RubyOnRails
[23:40:57] adre: has joined #RubyOnRails
[23:43:43] quazimodo: has joined #RubyOnRails
[23:44:02] ftj: has joined #RubyOnRails
[23:44:05] SparkMasterTape: has joined #RubyOnRails
[23:44:40] beilabs: has joined #RubyOnRails
[23:50:51] tweeeaks: has joined #RubyOnRails
[23:52:01] Craigimus: has joined #RubyOnRails
[23:52:13] void__: has joined #RubyOnRails
[23:52:27] meoblast001: has joined #RubyOnRails
[23:55:00] void__: where can I find good tutorials with rails? Like building a blog app for a total newbie
[23:55:26] TheMonster: void__: http://guides.rubyonrails.org/getting_started.html
[23:55:30] void__: i tried to do one, but it lost me at some point...
[23:59:42] pwnd_nsfw: void__, https://www.manning.com/books/rails-4-in-action
[23:59:43] pwnd_nsfw: here you go