« Back to channel list

#RubyOnRails - 11 December 2015

« Back 1 day Forward 1 day »
[00:04:49] tvw: has joined #RubyOnRails
[00:04:54] quazimodo: has joined #RubyOnRails
[00:05:43] johnflux: has joined #RubyOnRails
[00:05:43] johnflux: has joined #RubyOnRails
[00:06:15] yfeldblum: has joined #RubyOnRails
[00:08:36] Radar: me@ryanbigg.com
[00:08:44] Radar: Wrong window.
[00:08:48] Radar: ACTION disappears into shadows
[00:10:04] AntiSpamMeta: has joined #RubyOnRails
[00:10:06] FCser: has joined #RubyOnRails
[00:11:44] K_r3aPeR: has joined #RubyOnRails
[00:12:15] annlewis: has joined #RubyOnRails
[00:12:16] pyemkey: has joined #RubyOnRails
[00:14:17] paulodiniz: has joined #RubyOnRails
[00:14:42] ur5us: has joined #RubyOnRails
[00:14:47] nettoweb: has joined #RubyOnRails
[00:14:50] krzkrz: has joined #RubyOnRails
[00:16:20] renegadeandy: smathy: can you help me understand why this monkey patch isnt actually replacing the original gem???s implementation : https://gist.github.com/ArmyAndy/26a25bcdeb1986aa39f5 quazimodo
[00:17:52] smathy: renegadeandy, which gem?
[00:19:25] brendan-: has joined #RubyOnRails
[00:20:54] smathy: renegadeandy, your code is probably being called before the Faye code.
[00:21:09] dh5: has joined #RubyOnRails
[00:22:01] banister: has joined #RubyOnRails
[00:22:19] renegadeandy: renegadeandy: ok???.but why cant i see my puts output?
[00:22:48] rdavila: has joined #RubyOnRails
[00:23:17] jetpackjoe: has joined #RubyOnRails
[00:23:25] smathy: renegadeandy, that's all inside a method that if your faye_extension.rb is loaded first will not be the method being called.
[00:23:52] smathy: renegadeandy, put some log at the very top of both files, the faye_extension.rb from the gem and your own one, see which one is being loaded first/last. The last one wins.
[00:24:33] renegadeandy: smathy: i don???t know how to edit the gem???s faye_extension
[00:24:55] _Tariq: has joined #RubyOnRails
[00:25:25] ElectricAlan: has joined #RubyOnRails
[00:25:40] smathy: renegadeandy, vim `bundle list private_pub`/lib/private_pub/faye_extension.rb
[00:26:46] ElectricAlan: so is it acceptable to write migrations by hand or should that be avoided if possible?
[00:27:11] banister_: has joined #RubyOnRails
[00:27:17] tubbo: ElectricAlan: you can write migrations by hand if you'd like
[00:27:25] smathy: ElectricAlan, the generator will help you avoid silly mistakes, but it's very rare that I don't edit a migration after creating it.
[00:27:26] ElectricAlan: and only generating them through commands
[00:27:27] DLSteve: has joined #RubyOnRails
[00:27:51] ElectricAlan: so what I've done is made my models, then wanting to add the association afterwards
[00:27:53] renegadeandy: smathy: above the module line?
[00:28:01] renegadeandy: module PrivatePub line
[00:28:02] smathy: renegadeandy, yes.
[00:28:14] smathy: renegadeandy, that is run when the file is loaded.
[00:28:18] ElectricAlan: I can't see any way to have them generated automatically from the model files
[00:28:31] smathy: ElectricAlan, no there's not.
[00:29:03] ElectricAlan: so I in fact have write them by hand, or delete the model files and generate them again
[00:29:24] ElectricAlan: and run another migration or w/e I need
[00:29:25] smathy: ElectricAlan, the models get their attributes from the DB table, which is created by the migration. If we could generate a migration from a model then we'd have a perpetual app writing machine ;)
[00:29:52] smathy: ElectricAlan, if the model file exists then the generator will prompt you to overwrite it or skip.
[00:30:34] ElectricAlan: well I've worked with the php framework symfony and it has something like that
[00:30:47] smathy: ElectricAlan, although there's also a migration generator (although it's clunkier than the model generator).
[00:31:27] ElectricAlan: it will read a schema file and generate any migrations necessary to make the current db resemble that schema
[00:31:40] ElectricAlan: or somethign along those lines
[00:31:45] ElectricAlan: ....I think at least
[00:31:50] bigbob: has joined #RubyOnRails
[00:32:27] ql6wlld: has joined #RubyOnRails
[00:32:41] renegadeandy: smathy: after i made the change in vim???oddly..git status doesnt show the change?
[00:33:03] bigbob: is the file in .gitignore ?
[00:33:24] renegadeandy: ive no idea???is a file ive never known how to access (part of a gem)
[00:35:12] ElectricAlan: ok I've figured out what I need to do now
[00:35:28] ElectricAlan: ACTION has to be on his way
[00:35:32] _Tariq: has joined #RubyOnRails
[00:35:36] smathy: renegadeandy, no, git isn't tracking the gem files out in your system.
[00:35:44] ElectricAlan: cya all, probably back later
[00:36:03] ElectricAlan: has left #RubyOnRails: ("Leaving")
[00:36:57] renegadeandy: smathy: well when i add this to my version of the file in lib : puts "Overide loaded"
[00:36:57] renegadeandy: module PrivatePub ??? i do not see Overide loaded in my logging anywhere??? which makes me think the file isnt even loaded at all at the moment
[00:37:11] renegadeandy: i do not see Overide loaded in my logging anywhere??? which makes me think the file isnt even loaded at all at the moment
[00:37:59] smathy: renegadeandy, then that file mustn't be being tracked by git, or you forgot to write.
[00:38:42] smathy: renegadeandy, oh right, so put something in the file you put in `initializers` - just trace it back (perhaps the `puts` isn't going where you think, I'd have used Rails.logger.debug myself)
[00:39:24] puria: has joined #RubyOnRails
[00:42:58] renegadeandy: smathy: ok i must have deployed funny, because now im getting both the require puts and the faye_extensions puts
[00:43:10] renegadeandy: but i think the gem is overiding my load...
[00:43:18] renegadeandy: so i can enforce mine is loaded AFTER the gem?
[00:44:08] dnewkerk: has joined #RubyOnRails
[00:44:36] lyoshajapan: has joined #RubyOnRails
[00:44:52] maesitos: has joined #RubyOnRails
[00:45:05] SteenJobs: has joined #RubyOnRails
[00:51:21] shibabu: has joined #RubyOnRails
[00:53:50] duncannz: has joined #RubyOnRails
[00:54:20] annlewis: has joined #RubyOnRails
[00:56:07] blackmesa: has joined #RubyOnRails
[00:56:48] smathy: renegadeandy, I'm guessing that it's because you're doing the `require`, bundler does funny things to ensure dependencies are resolved.
[00:57:06] smathy: renegadeandy, I'd have the code that does the override directly in the config/initializers file.
[00:58:13] renegadeandy: smathy: hmm, so instead of having require.rb inside initializers and my code in the lib folder, jsut move my faye_extension.rb into the initializers folder?
[00:58:38] renegadeandy: smathy: let me give that a shot
[01:00:34] maesitos: has joined #RubyOnRails
[01:00:38] jmrepetti: has joined #RubyOnRails
[01:02:29] jmrepetti: has joined #RubyOnRails
[01:02:35] maesitos_: has joined #RubyOnRails
[01:03:40] renegadeandy: Ok - so i still see my puts line above the module line???but i still don???t see my new puts statements in faye_extension.rb running...#
[01:03:54] renegadeandy: could rails console help to tell me which file has been loaded?
[01:04:22] maesitos: has joined #RubyOnRails
[01:04:24] jmrepetti: has joined #RubyOnRails
[01:05:03] smathy: renegadeandy, you said before you were getting both puts - you guessed a funny deploy, now you'e saying "still don't see..."
[01:05:14] akshat: What's a good wiki gem for rails? I'm looking at Gollum, but git-powered is just overkill.
[01:05:39] kmckelvi1: has joined #RubyOnRails
[01:06:16] jmrepetti: has joined #RubyOnRails
[01:06:29] maesitos: has joined #RubyOnRails
[01:07:04] smathy: ACTION was going to suggest Gollum, stares blankly at screen instead
[01:07:54] renegadeandy: Sorry smathy , see here : https://gist.github.com/ArmyAndy/6f566cb219d1f3c3add8 ???so i see Overide loaded in my log..but not MY MEGA CHANGE or inside incoming override???.sucessfully sending a message using private_pub and faye
[01:08:09] jmrepetti: has joined #RubyOnRails
[01:08:11] maesitos: has joined #RubyOnRails
[01:10:04] maesitos: has joined #RubyOnRails
[01:10:06] jmrepetti: has joined #RubyOnRails
[01:10:11] berserk_ren: has joined #RubyOnRails
[01:11:39] renegadeandy: smathy: which means that the version of faye_extension which is running, is still the bundled version, not mine???
[01:11:56] renegadeandy: even when my code is inside initializers directly
[01:11:57] jmrepetti: has joined #RubyOnRails
[01:11:58] maesitos: has joined #RubyOnRails
[01:11:59] ruid: has joined #RubyOnRails
[01:12:00] ruid: has joined #RubyOnRails
[01:13:51] jmrepetti: has joined #RubyOnRails
[01:13:54] maesitos: has joined #RubyOnRails
[01:14:59] eddiegrey: has joined #RubyOnRails
[01:15:11] nya: has joined #RubyOnRails
[01:15:47] jmrepetti: has joined #RubyOnRails
[01:15:58] maesitos: has joined #RubyOnRails
[01:16:09] tenderlove: has joined #RubyOnRails
[01:16:31] lyoshajapan: has joined #RubyOnRails
[01:17:39] jmrepetti: has joined #RubyOnRails
[01:17:50] maesitos_: has joined #RubyOnRails
[01:19:36] jmrepetti: has joined #RubyOnRails
[01:19:45] maesitos: has joined #RubyOnRails
[01:20:25] smathy: It does mean that, yes. Maybe it's an autoloading problem (although private_pub didn't look to be using that), try forcing the autoload before your module by just having a line with PrivatePub::FayeExtension on it.
[01:20:59] shanemcd: has joined #RubyOnRails
[01:21:30] jmrepetti: has joined #RubyOnRails
[01:22:09] eddiegrey: has joined #RubyOnRails
[01:23:18] jhn: has joined #RubyOnRails
[01:23:23] jmrepetti: has joined #RubyOnRails
[01:23:43] renegadeandy: smathy: like so : https://gist.github.com/ArmyAndy/a7a61c96bcad56b892a1 ?
[01:25:16] jmrepetti: has joined #RubyOnRails
[01:25:34] Sawbones: has joined #RubyOnRails
[01:26:38] berserk_ren: has joined #RubyOnRails
[01:27:09] jmrepetti: has joined #RubyOnRails
[01:27:59] rdavila: has joined #RubyOnRails
[01:28:24] rgrmatt: has joined #RubyOnRails
[01:28:25] eddiegrey1: has joined #RubyOnRails
[01:29:04] jmrepetti: has joined #RubyOnRails
[01:29:29] one_zero: has joined #RubyOnRails
[01:30:34] renegadeandy: smathy: still nothing???.whats going on,,this is hell?!
[01:30:55] smathy: renegadeandy, you're restarting your app properly?
[01:30:57] jmrepetti: has joined #RubyOnRails
[01:31:05] renegadeandy: yeap terminating unicorn
[01:31:07] renegadeandy: starting it again
[01:31:08] smathy: renegadeandy, I gathered from something you said earlier that this is in production?
[01:31:15] renegadeandy: smathy: indeed
[01:31:27] smathy: ...well actually, it must be running because you're seeing the `puts`
[01:31:38] renegadeandy: yeah its running???but being replaced
[01:31:39] smathy: Sorry, it's baffling me too. The first thing you had should have worked.
[01:32:10] smathy: Did you notice that there were two outputs in your log.
[01:32:16] smathy: I'd expect only one.
[01:32:48] smathy: Although two should make EXTRA sure that your class is being loaded, not the inverse, but it still is an anomaly.
[01:32:49] jmrepetti: has joined #RubyOnRails
[01:33:08] renegadeandy: smathy: yeah i did notice and wonder why that was.
[01:33:12] nettoweb: has joined #RubyOnRails
[01:33:49] ornerymoose: has joined #RubyOnRails
[01:34:11] eddiegrey: has joined #RubyOnRails
[01:34:14] lyoshajapan: has joined #RubyOnRails
[01:34:44] jmrepetti: has joined #RubyOnRails
[01:34:50] jessemcgilallen_: has joined #RubyOnRails
[01:35:08] renegadeandy: smathy: maybe if i take a step back you can help me solve my problem in a different way. I simply want to get a list of currently connected subscribers, through PrivatePub???but thats not part of its offered API, so I need to extend it in some way, and its this im trying to achieve
[01:35:56] renegadeandy: smathy: http://stackoverflow.com/questions/34033517/how-can-i-find-the-number-of-current-subscriptions-using-privatepub-and-faye-in?noredirect=1#comment55822971_34033517
[01:36:02] renegadeandy: == my question
[01:36:09] berserk_ren: has joined #RubyOnRails
[01:36:22] renegadeandy: and i spotted a possible resolution by extending this faye_extension???which is now the path im stuck on because of this monkey_patch
[01:36:41] jmrepetti: has joined #RubyOnRails
[01:36:47] kp666: has joined #RubyOnRails
[01:37:04] tenderlove: has joined #RubyOnRails
[01:37:08] baweaver: has joined #RubyOnRails
[01:38:04] smathy: That commenter has a good point.
[01:38:34] jmrepetti: has joined #RubyOnRails
[01:39:33] renegadeandy: smathy: but private_pub gives me a level of security and service hwich works???what i am looking for should not be hard to add here?
[01:39:36] smathy: Your approach is probably what I'd have done to solve that proble,
[01:40:00] zubnola: has joined #RubyOnRails
[01:40:13] renegadeandy: smathy: thats good news???.so now im just sort of left wondering what else to try
[01:40:26] jmrepetti: has joined #RubyOnRails
[01:40:34] ruid: has joined #RubyOnRails
[01:40:35] ruid: has joined #RubyOnRails
[01:40:47] chipotle: has joined #RubyOnRails
[01:41:12] daivyk: has joined #RubyOnRails
[01:41:38] smathy: Yep, I'm out of ideas too. I thought the gems were all loaded before any initializers were called.
[01:42:07] renegadeandy: It seems thats not necessarily the case :/
[01:42:11] smathy: I'd probably break out a brand new rails app, and start from scratch to see if the that exhibits the same behavior.
[01:42:19] jmrepetti: has joined #RubyOnRails
[01:42:42] renegadeandy: smathy: certainly wont have time to do that tonight
[01:42:45] renegadeandy: this is a shame :(
[01:43:01] smathy: rails new r42; cd r42; vim Gemfile... really?
[01:43:15] renegadeandy: smathy: If you get 10 minutes would you mind giving it a go,,,maybe i made a noob error somewhere
[01:43:31] smathy: Yes, but I can tell you I won't have time.
[01:43:44] eddiegrey: has joined #RubyOnRails
[01:43:51] smathy: My dinner's just about ready, and I'm flat out with other things too.
[01:44:16] jmrepetti: has joined #RubyOnRails
[01:44:28] renegadeandy: smathy: well i really appreciate all your time with help???if you do get some inspiration please head it onto the SO post?
[01:44:33] renegadeandy: smathy: Thank you once again
[01:44:55] smathy: Sorry we couldn't get it put to bed.
[01:45:16] hardtail: has joined #RubyOnRails
[01:45:45] renegadeandy: smathy: its not your fault!
[01:46:09] jmrepetti: has joined #RubyOnRails
[01:48:03] jmrepetti: has joined #RubyOnRails
[01:49:54] jmrepetti: has joined #RubyOnRails
[01:50:28] jhn: has joined #RubyOnRails
[01:51:43] rgrmatt: has joined #RubyOnRails
[01:51:49] jmrepetti: has joined #RubyOnRails
[01:52:12] rickmasta: has joined #RubyOnRails
[01:53:27] shibabu: has joined #RubyOnRails
[01:53:43] jmrepetti: has joined #RubyOnRails
[01:55:07] rakm: has joined #RubyOnRails
[01:55:39] jmrepetti: has joined #RubyOnRails
[01:57:06] DavidDudson: has joined #RubyOnRails
[01:57:33] jmrepetti: has joined #RubyOnRails
[01:57:53] Sawbones: has joined #RubyOnRails
[01:58:38] tjbiddle: has joined #RubyOnRails
[01:59:24] jmrepetti: has joined #RubyOnRails
[02:01:05] lord4163: has joined #RubyOnRails
[02:01:19] elton: has joined #RubyOnRails
[02:01:23] jmrepetti: has joined #RubyOnRails
[02:02:04] DiCablo: has joined #RubyOnRails
[02:03:16] jmrepetti: has joined #RubyOnRails
[02:03:41] ruid: has joined #RubyOnRails
[02:03:42] ruid: has joined #RubyOnRails
[02:04:19] annlewis: has joined #RubyOnRails
[02:05:09] jmrepetti: has joined #RubyOnRails
[02:05:27] arooni: has joined #RubyOnRails
[02:05:54] NBarnes: has joined #RubyOnRails
[02:06:12] NBarnes: Is anybody familiar with a way to check to see if Sidekiq is running during Rails? I'm trying to test that it is, but I can't find a way to query Sidekiq's status (other than a Stack Overflow thread about checking for Sidekiq's PID, which isn't really where I want to go)
[02:07:03] jmrepetti: has joined #RubyOnRails
[02:07:23] AsgardBSD: has joined #RubyOnRails
[02:07:41] AsgardBSD: Hi, anyone know some cheap host/vps for ruby on rail?
[02:07:57] AsgardBSD: 5$ per month is too much, looking at 3$ per month and less
[02:08:24] AsgardBSD: Of course, its not for deployment and serving thousend of people, its just for personnal development and a small website to put my resume on it, and playing
[02:08:26] kmckelvi1: has joined #RubyOnRails
[02:08:49] AsgardBSD: Oh, and I need to know what would be the recommended spec for a small ruby on rail website, mostly in term of ram
[02:08:56] NBarnes: AsgardBSD; Heroku?
[02:08:58] jmrepetti: has joined #RubyOnRails
[02:09:01] SteenJobs: has joined #RubyOnRails
[02:09:08] DiCablo: heroku or aws
[02:09:11] AsgardBSD: because i am doing some shopping for vps, and without knowing ram requirement... its hard
[02:09:18] AsgardBSD: heroku = min 7$ per month
[02:09:35] DiCablo: amazon web services is free for 1st year
[02:09:39] diegoviola: has joined #RubyOnRails
[02:10:03] AsgardBSD: free for first year (AWS) or crappy free plan only available few hour per day (heroku) is not ok for me
[02:10:29] centrx: Digital Ocean has $5/month
[02:10:55] centrx: You can also use instances billed by the hour anywhere
[02:11:01] centrx: Turn it off and might add up to less than $3/month
[02:11:23] DiCablo: also you can take a look at ovh vps
[02:11:35] DiCablo: Digital Ocean is really good tbh :)
[02:13:19] sonofdirt: has joined #RubyOnRails
[02:13:41] lessless: has joined #RubyOnRails
[02:14:14] eddiegrey: has joined #RubyOnRails
[02:14:30] pyemkey: has joined #RubyOnRails
[02:16:00] kegan_: has joined #RubyOnRails
[02:16:34] elton: has joined #RubyOnRails
[02:17:54] rgrmatt: has joined #RubyOnRails
[02:17:55] Nuck: has joined #RubyOnRails
[02:19:13] AsgardBSD: but what about ram requirement?
[02:19:32] krzkrz: has joined #RubyOnRails
[02:19:59] DiCablo: I am usually fine with 2GB of ram
[02:20:18] lyoshajapan: has joined #RubyOnRails
[02:22:09] Guest65039: has joined #RubyOnRails
[02:22:14] AsgardBSD: 2GB on a vps cost a lot
[02:22:33] DiCablo: on ovh is about $3
[02:23:30] eddiegrey: has joined #RubyOnRails
[02:23:42] atomical: has joined #RubyOnRails
[02:24:14] quazimodo: has joined #RubyOnRails
[02:24:34] AsgardBSD: I dont think i need 2 GB
[02:25:03] AsgardBSD: What would be the minimum recommeded ram for ruby on rail, the the maximum or the amount you use on your powerful server
[02:25:16] tenderlove: has joined #RubyOnRails
[02:26:36] mrbubbles: has joined #RubyOnRails
[02:27:34] DLSteve: AsgardBSD, Ram requirements will depend on your traffic and caching requirements.
[02:27:39] eddiegrey: has joined #RubyOnRails
[02:27:55] AsgardBSD: like i said, extremly low traffic
[02:27:56] baweaver: has joined #RubyOnRails
[02:28:31] _Tariq: has joined #RubyOnRails
[02:28:51] DLSteve: 1 - 2 GB should be fine. I run a small business website on 512 but it is not RoR.
[02:34:22] B1n4r10: has joined #RubyOnRails
[02:34:48] sleungcy: has joined #RubyOnRails
[02:34:56] The_Phoenix: has joined #RubyOnRails
[02:35:58] bigbob_: has joined #RubyOnRails
[02:39:39] duderonomy: hello! Uhm... perhaps somebody knows what this means... (to help me get unstuck) from RSpec:
[02:39:39] duderonomy: expect(User.new(admin: "1")).to raise_error(ActiveModel::MassAssignmentSecurity::Error)
[02:40:03] duderonomy: I get an error because something "was not given a block"
[02:42:46] duderonomy: more info: http://pastie.org/10624421
[02:42:55] duderonomy: thanks in advance!
[02:42:56] eddiegrey: has joined #RubyOnRails
[02:44:11] crystalmaiden: has joined #RubyOnRails
[02:44:58] crystalmaiden: has joined #RubyOnRails
[02:45:46] crystalmaiden: has joined #RubyOnRails
[02:46:15] sharkman: has joined #RubyOnRails
[02:46:45] crystalmaiden: has joined #RubyOnRails
[02:47:21] tenderlove: has joined #RubyOnRails
[02:49:28] kmckelvi1: has joined #RubyOnRails
[02:52:43] elton: has joined #RubyOnRails
[02:55:31] crystalmaiden: has joined #RubyOnRails
[02:56:33] tjbiddle: has joined #RubyOnRails
[02:57:10] nettoweb: has joined #RubyOnRails
[02:57:35] lyoshajapan: has joined #RubyOnRails
[03:05:06] annlewis: has joined #RubyOnRails
[03:05:16] A124: has joined #RubyOnRails
[03:05:33] jessemcgilallen_: has joined #RubyOnRails
[03:05:40] Maletor: has joined #RubyOnRails
[03:06:33] krzkrz: has joined #RubyOnRails
[03:10:08] sonofdirt: has joined #RubyOnRails
[03:10:10] zubnola: has joined #RubyOnRails
[03:12:39] Rodya_: has joined #RubyOnRails
[03:13:50] K_r3aPeR: has joined #RubyOnRails
[03:14:21] pulgalipe: has joined #RubyOnRails
[03:14:50] viiralvx: has joined #RubyOnRails
[03:15:10] K_r3aPeR: has joined #RubyOnRails
[03:15:19] pyemkey: has joined #RubyOnRails
[03:17:24] chipotle: has joined #RubyOnRails
[03:19:04] chipotle: has joined #RubyOnRails
[03:19:20] Nuck: Okay, as somebody in #ruby pointed out to me, this is probably Rails going fucky but basically
[03:19:33] Nuck: I have UsersController < ApplicationController < ActionController::Base
[03:19:48] Nuck: But in my tests, ApplicationController ceases existence
[03:20:05] Nuck: I can instantiate ApplicationController, but it doesn't have its own methods
[03:20:08] Nuck: And neither do any subclasses
[03:20:48] rhizome: a controller test?
[03:21:24] Nuck: => [ApplicationController, #<Module:0x007f84c730fb30>, #<Module:0x007f84c1923a18>, #<Module:0x007f84c1923c48>,
[03:21:32] Nuck: There's also this in the ancestors array
[03:21:38] Nuck: Three modules right there, all anonymous
[03:21:49] rhizome: what are you trying to test?
[03:21:50] willywos: has joined #RubyOnRails
[03:22:34] Nuck: Well, anything
[03:22:40] Nuck: Lots of my code calls `current_user`
[03:22:48] Nuck: Which is defined on a Concern I include into ApplicationController
[03:23:18] Nuck: I stub out `current_user` by defining a singleton method on the controller instance
[03:23:34] lyoshajapan: has joined #RubyOnRails
[03:23:39] jgt: has joined #RubyOnRails
[03:23:54] ruid: has joined #RubyOnRails
[03:23:54] Nuck: In hindsight I can probably use RSpec stubs for that
[03:23:54] ruid: has joined #RubyOnRails
[03:24:45] rhizome: well, i want to say it's the wrong kind of test for that
[03:24:47] K_r3aPeR: has joined #RubyOnRails
[03:25:00] rhizome: i'm not 100% sure, but i think
[03:25:12] Nuck: It's basically just recreating the Devise current_user stuff
[03:25:23] Nuck: Where I can call `sign_in user` in my tests
[03:25:36] rhizome: and you do the Devise::TestHelpers or whatever it is?
[03:25:39] AsgardBSD: has joined #RubyOnRails
[03:25:40] rhizome: s/do/have/
[03:25:47] Sawbones: has joined #RubyOnRails
[03:26:00] Nuck: Nah, we only use Devise to handle user emailing and stuff, we use Doorkeeper to do sessions
[03:26:12] Nuck: So I have a small curent_user method which pulls it from the doorkeeper token
[03:26:38] rhizome: yeah, sign_in is a integrations thing for me
[03:27:10] rhizome: something the user does
[03:27:33] Nuck: Well. We don't have anything to test in controllers because I use jsonapi_resources
[03:27:43] rhizome: problem solved!
[03:28:06] Nuck: I just want to integration-test to make sure that certain things work
[03:28:21] kmckelvi1: has joined #RubyOnRails
[03:28:30] Nuck: And it's really problematic to have ApplicationController#current_user missing
[03:28:51] rhizome: ok, but an integration test is different than a controller test
[03:29:14] Nuck: Well. It's an API, so it's not really integrating anything major either
[03:29:22] Nuck: It's just testing the whole request/response stack
[03:29:36] Nuck: Singular requests
[03:29:37] sleungcy: has joined #RubyOnRails
[03:30:02] Nuck: Like "if user is logged in, can access /users?filter[self]=true"
[03:30:02] rhizome: integration is just a word for client-side
[03:30:11] Oog: has joined #RubyOnRails
[03:30:16] elton: has joined #RubyOnRails
[03:30:29] rhizome: right, which sweeps up all your other junk and yep. integration
[03:30:36] Nuck: But either way, terms don't really matter as much as the damn thing working :P
[03:30:56] rhizome: right, but whether it works as expected depends on which kind of test you're inheriting from
[03:30:56] rdavila: has joined #RubyOnRails
[03:31:29] Nuck: Fair enough, but I don't think the test type affects whether ApplicationController's methods exist or not
[03:32:22] rhizome: well it does
[03:32:47] Nuck: I mean isn't this just ruby inheritance o_o
[03:33:00] Nuck: Like I checked and @controller is definitely an instance of UsersController
[03:33:17] Nuck: And I've triple checked that UsersController inherits from ApplicationController
[03:35:05] Nuck: And I can instantiate an ApplicationController instance, even if Pry can't figure out where it came from
[03:35:20] krzkrz: has joined #RubyOnRails
[03:36:26] exadeci: has joined #RubyOnRails
[03:36:53] lyoshajapan: has joined #RubyOnRails
[03:37:28] rhizome: tryna track down chapter and verse on this
[03:38:43] ap4y: has joined #RubyOnRails
[03:39:39] bronson: has joined #RubyOnRails
[03:40:30] kuroro: has joined #RubyOnRails
[03:40:32] rhizome: http://helabs.com/blog/2014/01/31/how-do-i-test-an-application_controller-on-a-rails-app/
[03:41:28] Nuck: That's cool, but doesn't help me
[03:41:29] rhizome: http://www.johnnyji.me/rspec/2015/06/18/stubbing-controller-instance-methods-in-rspec.html
[03:41:32] rhizome: instance methods
[03:41:43] rhizome: stub them. i avoid that by leaving that stuff to integrations
[03:42:23] nickenchuggets: has joined #RubyOnRails
[03:42:24] nickenchuggets: has joined #RubyOnRails
[03:42:54] diego1: has joined #RubyOnRails
[03:43:51] Nuck: https://github.com/hummingbird-me/hummingbird/blob/the-future/server/app/controllers/concerns/doorkeeper_helpers.rb#L5-L7
[03:43:58] blackmesa: has joined #RubyOnRails
[03:44:07] Nuck: None of these methods are defined on UsersController when I run my tests
[03:44:14] Nuck: Despite this being mixed into ApplicationController
[03:44:39] Nuck: I don't currently need advice on testing, I need advice on why my UsersController doesn't have the methods it's supposed to
[03:45:14] elton: has joined #RubyOnRails
[03:45:34] Nuck: It's causing a NoMethodError every time something wants to check current_user or signed_in?
[03:45:51] Nuck: signed_in? strangely works but I think that's the Devise::Helpers which are loaded into the controllers via a railtie
[03:48:00] rdavila: has joined #RubyOnRails
[03:48:06] Contigi: has joined #RubyOnRails
[03:49:35] diego1: has joined #RubyOnRails
[03:55:30] shibabu: has joined #RubyOnRails
[03:55:55] lyoshajapan: has joined #RubyOnRails
[03:57:05] shanemcd: has joined #RubyOnRails
[04:00:03] tjbiddle: has joined #RubyOnRails
[04:00:51] tjbiddle: Shit - was disconnected, re-asking (Sorry - Damn Bali internet): Hey all - Thoughts on design pattern: We're going to be using the user's phone contact list to find user's of our application. Should I create an endpoint that searches a single phone number, and we iterate over their contact list on the device making n calls; or create an endpoint that accepts n phone numbers, and return an array of all matching users?
[04:01:51] owenjones: has joined #RubyOnRails
[04:03:15] stannard: has joined #RubyOnRails
[04:04:00] mrbubbles: has joined #RubyOnRails
[04:05:44] smathy: has joined #RubyOnRails
[04:05:50] NBarnes: has joined #RubyOnRails
[04:05:54] annlewis: has joined #RubyOnRails
[04:07:43] Oog: has joined #RubyOnRails
[04:07:44] Maletor: has joined #RubyOnRails
[04:08:18] kmckelvi1: has joined #RubyOnRails
[04:17:43] Sawbones: has joined #RubyOnRails
[04:18:22] braincrash: has joined #RubyOnRails
[04:21:23] Sawbones: has joined #RubyOnRails
[04:24:57] jgt: has joined #RubyOnRails
[04:27:40] srinidhi: has joined #RubyOnRails
[04:28:07] kegan_: has joined #RubyOnRails
[04:31:27] brycesenz: has joined #RubyOnRails
[04:31:34] baweaver: has joined #RubyOnRails
[04:34:48] brycesenz: So random Rails question - apparently you can pass a block to a has_many association definition, and it will extend that class with new methods. Is there ever a use case for doing this that wouldn't be a bad idea? It just seems like an awful practice to me.
[04:34:49] rdavila: has joined #RubyOnRails
[04:38:33] lyoshajapan: has joined #RubyOnRails
[04:38:34] brycesenz: has joined #RubyOnRails
[04:38:53] pvertenten: has joined #RubyOnRails
[04:39:07] pvertenten: has left #RubyOnRails: ()
[04:40:47] rhizome: i dunno, maybe if there wasn't much to the added stuff and it was more convenient to have everything in one file like that
[04:41:45] rhizome: i think that's kind of a bad example there since it's a reimplementation of a standard AR method
[04:41:47] bronson: has joined #RubyOnRails
[04:41:57] duderonomy: I'm trying to determine who "was not given a block" in this RSpec message: http://pastie.org/10624421
[04:42:05] Rodya_: has joined #RubyOnRails
[04:42:40] sarink: has joined #RubyOnRails
[04:42:54] rhizome: guessing it's on line 34, or somewhere in your User model if you're doing anything fruity
[04:43:22] bronson: has joined #RubyOnRails
[04:43:53] rhizome: console looks pretty dispositive
[04:44:08] duderonomy: The only thing fruity was converting Hartl's old Rails 3.2 content to Rails 4/RSpec 3
[04:44:11] duderonomy: Dispositive?
[04:44:20] rhizome: just that it should error
[04:45:05] rhizome: i don't really know rspec so i can't say anything about that
[04:45:27] bronson: has joined #RubyOnRails
[04:45:34] duderonomy: Im thinking this is referring to a Ruby block.
[04:47:08] brycesenz: has joined #RubyOnRails
[04:47:37] bronson: has joined #RubyOnRails
[04:47:39] BlackCoyote: has joined #RubyOnRails
[04:47:55] rhizome: does this relate? http://stackoverflow.com/questions/19960831/rspec-expect-vs-expect-with-block-whats-the-difference
[04:48:41] rickmasta: has joined #RubyOnRails
[04:49:43] bronson: has joined #RubyOnRails
[04:50:12] kmckelvi1: has joined #RubyOnRails
[04:50:15] duderonomy: Yeah maybe... I'll read it.
[04:51:48] bronson: has joined #RubyOnRails
[04:52:07] jacksparrow007: has joined #RubyOnRails
[04:53:24] rubyonrailed: has joined #RubyOnRails
[04:53:58] bronson: has joined #RubyOnRails
[04:56:03] bronson: has joined #RubyOnRails
[04:56:54] yfeldblum: has joined #RubyOnRails
[04:58:04] creature: I have an Event model. My Event has_many Invitations; my Invitations have a status field & scopes. My invitations also have an associated user. I've found myself writing things like "@event.invitations.attending.map(&:user)" lately.
[04:58:11] creature: But that seems icky, and there should be a better way of doing it.
[04:58:13] bronson: has joined #RubyOnRails
[04:58:18] creature: Can someone suggest that better way?
[04:58:44] creature: (I have a feeling this is going to be a forehead-slap of obviousness when I see it.)
[04:59:49] tjbiddle: has joined #RubyOnRails
[05:00:24] bronson: has joined #RubyOnRails
[05:00:57] rickmasta: has joined #RubyOnRails
[05:01:05] qurve: has joined #RubyOnRails
[05:01:31] qurve: Has anyone here deployed a rails app using docker? Was it awesome, terrible, or somewhere inbetween?
[05:01:52] qurve: Have a greenfield project, but no experience with docker yet, wondering if it's even worth toying with.
[05:02:06] qurve: The past couple years I've used vagrant (local) + opsworks (live)
[05:02:28] qurve: I like OpsWorks functionally, but it's very slow.
[05:02:29] bronson: has joined #RubyOnRails
[05:04:39] bronson: has joined #RubyOnRails
[05:05:16] kegan_: does someone mind looking at my shit code and explaining to me just how fundamentally wrong i am about my approach
[05:05:24] kegan_: berating me about my general lack of intelligence
[05:05:37] kegan_: and then enlightening me to a proper solution?
[05:05:46] kegan_: ~40 lines
[05:05:48] lemur: has joined #RubyOnRails
[05:05:55] lyoshajapan: has joined #RubyOnRails
[05:06:08] creature: If you pastebin your code, and it's easy to follow, I expect we can all skip the berating and move straight to the helpful and friendly part.
[05:06:21] kegan_: which are the preferred paste sites for this channel
[05:06:36] annlewis: has joined #RubyOnRails
[05:06:49] kegan_: you said pastebin but somehow i recall being berated about that part
[05:06:49] bronson: has joined #RubyOnRails
[05:07:10] DiCablo: you can gist it or use pastie.org
[05:07:17] Sawbones: has joined #RubyOnRails
[05:08:16] kegan_: creature: have you tried nested attributes?
[05:08:28] Maletor: has joined #RubyOnRails
[05:08:49] bronson: has joined #RubyOnRails
[05:08:49] creature: kegan_: I think that's just going to help me in my controllers, rather than in my model accesses?
[05:08:51] kegan_: i vaguely recall running into a similar problem on backend and that cleaned things up a bit
[05:08:54] podman: has joined #RubyOnRails
[05:10:59] bronson: has joined #RubyOnRails
[05:11:12] hello9: has joined #RubyOnRails
[05:11:49] hello9: is there a "convenient" way to add javascript to a link_to_remote tag https://gist.github.com/anonymous/36d7d1d695d2d5e7cf32
[05:12:05] codeurge: has joined #RubyOnRails
[05:12:14] hello9: by js i mean add a div value as a param to that tag
[05:13:04] bronson: has joined #RubyOnRails
[05:14:28] blackmesa: has joined #RubyOnRails
[05:14:33] lyoshajapan: has joined #RubyOnRails
[05:14:48] hello9: nvm i think i found it in the docs
[05:15:11] berserk_ren: has joined #RubyOnRails
[05:16:30] DiCablo: has joined #RubyOnRails
[05:16:39] kegan_: creature: hmm, maybe I have a basic misunderstanding here, I thought that would allow you to omit at least one reference there, for invitations.
[05:16:46] kegan_: were you being polite in your lack of certainty?
[05:17:19] pyemkey: has joined #RubyOnRails
[05:17:29] sleungcy: has joined #RubyOnRails
[05:17:49] kegan_: for the sake of my potentially awful suggestion, i mean : )
[05:18:29] creature: kegan_: Well, Let's say I've got an event. My URL is going to be /events/:id, and my controller action is going to be EventsController#show.
[05:18:56] pwnd_nsfw: has joined #RubyOnRails
[05:19:06] creature: If I want to display a list of attendee names, then I have to get to the users associated with the confirmed invites.
[05:19:34] creature: Which is where that @event.invitations.attending.map(&:user) comes in.
[05:21:20] rhizome: i would put attendances on event. invitations convert a user to an attendee
[05:21:46] kegan_: well, @event.attending.map(&:user) is a bit nicer, rhizome is probably smarter here, though
[05:22:02] srinidhi: has joined #RubyOnRails
[05:22:21] kegan_: read:almost certainly : )
[05:22:51] creature: rhizome: How do you mean, "put attendances on event"? Just add a method to retrieve an ActiveRecord::Relation?
[05:24:00] Bloomer: has joined #RubyOnRails
[05:24:21] elton: has joined #RubyOnRails
[05:28:49] rhizome: event has_many :attendees, through :rsvps, class_name: 'User'
[05:30:29] djbkd: has joined #RubyOnRails
[05:31:07] kmckelvi1: has joined #RubyOnRails
[05:31:48] rvanlieshout: has joined #RubyOnRails
[05:31:50] creature: rhizome: I guess the tricky thing is, I want to keep track of a number of RSVP statuses. Hence the scopes.
[05:32:04] codelahoma: has joined #RubyOnRails
[05:33:11] lyoshajapan: has joined #RubyOnRails
[05:35:03] gamov: has joined #RubyOnRails
[05:37:01] krzkrz: has joined #RubyOnRails
[05:37:31] gamov: hi guys. I have a active_recort query with a subquery and rails is automatically aliasing tables when joining (breaking merged scopes). Does anybody knows how to tell rails: it's ok, don't alias the tables?
[05:38:46] yogeshrt: has joined #RubyOnRails
[05:39:30] kegan_: creature: what is the cleanup that you are hoping to accomplish?
[05:39:40] rvanlieshout: gamov: how are you joining them?
[05:40:23] DavidDudson: has joined #RubyOnRails
[05:41:59] lyoshajapan: has joined #RubyOnRails
[05:42:25] creature: kegan_: The main thing is avoiding the map call, which kinda screams "lurking N+1". Which I can avoid by adding an includes() call in there, but then that's adding yet another method to that method chain.
[05:43:01] creature: Which again, I can disguise by creating a helper method. But really, I just looked at it and thought "You know, there must be a better way than this." and I don't know what that better way would be.
[05:43:02] gamov: rvanlieshout: standard association joins: https://gist.github.com/gamov/85dd1ed098d86cf3a168
[05:43:42] nertzy: has joined #RubyOnRails
[05:44:01] rvanlieshout: and it fails with what error?
[05:44:07] rvanlieshout: and what sql does it generate?
[05:45:00] DavidDudson: has joined #RubyOnRails
[05:45:29] hardtail: has joined #RubyOnRails
[05:51:15] gamov: rvanlieshout: I've added the error??? it's ugly
[05:54:30] mices: has joined #RubyOnRails
[05:54:34] raunicolae: has joined #RubyOnRails
[05:54:40] diegoviola: I'm refactoring this: https://gist.github.com/diegoviola/9c972e101016f169f209 to this: https://gist.github.com/diegoviola/18013eb723da2d38a066
[05:54:52] diegoviola: but I wonder if there's a better way to do this
[05:54:55] diegoviola: than what I'm doing now
[05:54:59] tenderlove: has joined #RubyOnRails
[05:55:04] rvanlieshout: gamov: could you add the PurchasedItem model?
[05:55:13] rvanlieshout: more specific the relationship with item_variants
[05:55:17] diegoviola: I'm not sure I'm happy with that if/else/end block
[05:55:19] diegoviola: but it works
[05:55:45] rvanlieshout: diegoviola: what's wrong with a if/else/block?
[05:55:54] rvanlieshout: you could use a case, but imo that's not cleaner here
[05:56:11] diegoviola: rvanlieshout: nothing wrong
[05:58:46] shibabu: has joined #RubyOnRails
[05:59:48] DavidDudson: has joined #RubyOnRails
[06:00:44] gamov: rvanlieshout: done. now to think of it. I don't think the order statement in ItemVariant.default_order is vanilla Rails (3.2)
[06:01:56] rvanlieshout: gamov: true, but what would happen if you leave out the first joins of :item_variant?
[06:02:03] rvanlieshout: it's also joined by that default_order scope
[06:02:04] colleenmcguckin: has joined #RubyOnRails
[06:02:50] rvanlieshout: i would expect it to use a different name if you join it twice, but the first join isn't in your query. although it's in your subquery. it might have matched that
[06:03:01] rvanlieshout: just guessing there
[06:04:48] gamov: rvanlieshout: the same joins actually coalesce.
[06:05:53] rvanlieshout: i didn't see it twice in the query
[06:06:53] gamov: rvanlieshout: together, I mean. In this case, the joins :item_variant is called twice but is coalesced into one. that's the beauty of merge()
[06:07:22] annlewis: has joined #RubyOnRails
[06:07:55] rvanlieshout: yeah. but then i don't know why it would use a table alias
[06:09:03] gamov: rvanlieshout: I think it's because i'm joining with my subquery. if I remove the subquery join, the aliases are gone
[06:09:12] Maletor: has joined #RubyOnRails
[06:09:16] rhizome: creature: multiple statuses?
[06:09:27] gamov: rvanlieshout: I guess rails protects itself against namespace pollution
[06:09:31] rvanlieshout: gamov: ah right. so then it's the rails default that if you join things twice it'll use an alias
[06:09:43] rvanlieshout: and it matches that on the current to_sql then i guess
[06:09:56] rvanlieshout: so you might need to write out the joins there
[06:10:27] creature: rhizome: An invite can be accepted, declined, or cancelled. Amongst others.
[06:11:07] rhizome: gotcha. then a scope/method on event, then i guess
[06:12:13] gamov: rvanlieshout: it seems so??? so sad. I confirm that order with symbols are only available since rails 4, I use Squeel and it offers this feature. thanks for the help!
[06:13:45] diegoviola: so I've just refactored this: https://gist.github.com/diegoviola/9c972e101016f169f209 into this: https://gist.github.com/diegoviola/6a2cdf737b07b525fa2b
[06:13:50] diegoviola: I wonder what else I can improve...
[06:14:37] kmckelvi1: has joined #RubyOnRails
[06:14:54] bronson: has joined #RubyOnRails
[06:15:06] diegoviola: I think it's easier to understand now
[06:15:15] rvanlieshout: then carry on for now :)
[06:15:22] rvanlieshout: you might want to use Time.zone.now over Time.now though
[06:15:24] diegoviola: because the other conditionals just make me dizzy
[06:15:46] diegoviola: rvanlieshout: yeah, thanks
[06:15:51] ornerymoose: has joined #RubyOnRails
[06:18:14] lyoshajapan: has joined #RubyOnRails
[06:18:46] mrbubbles: has joined #RubyOnRails
[06:19:18] alex88: has joined #RubyOnRails
[06:19:35] baweaver_: has joined #RubyOnRails
[06:21:09] RTG`: has joined #RubyOnRails
[06:21:19] bmalum: has joined #RubyOnRails
[06:21:32] Hazim: has joined #RubyOnRails
[06:22:00] Hazim: hi, i need to do eager load, and want to load the nested associated model with condition
[06:22:06] Hazim: e.g @attendance = Subscribem::Member.scoped_to(current_account).includes(staff:[:time_loggers])
[06:22:37] Hazim: how do i eager load :time_loggers where i can specify the condition
[06:23:10] Hazim: let's say query time_logger within a certain date
[06:25:36] jgt: has joined #RubyOnRails
[06:26:50] rvanlieshout: hazim: includes and use it in conditions?
[06:26:55] chouhoul_: has joined #RubyOnRails
[06:27:17] Hazim: i include staff which has time loggers
[06:27:28] Hazim: but i only want time loggers for a certain date only
[06:27:46] rvanlieshout: but you don't have to specify that IN the join statement
[06:27:47] Hazim: includes(staff:[:time_loggers])
[06:27:48] SuppliedRelic: has joined #RubyOnRails
[06:27:58] rvanlieshout: or you'll have to use a subquery
[06:28:08] rvanlieshout: but then it won't eager load
[06:28:27] Hazim: because if everyone has more than a 1000 time logger records
[06:28:41] Hazim: won't it use up memory
[06:29:00] rvanlieshout: nope, that eager load will only load it if you use it
[06:29:06] rvanlieshout: and you might want to use .find_each over .each
[06:29:07] Hazim: i could put in the view staff.time_loggers.where(date: xx)
[06:29:22] rvanlieshout: to prevent it from loading all recrods in the collection and then using the x
[06:29:30] rvanlieshout: hazim: not with eager loading i'm afraid
[06:29:47] rvanlieshout: that would trigger a new query
[06:29:56] bigbob: has joined #RubyOnRails
[06:29:58] rvanlieshout: then you would have to .select or .filter them using a block
[06:30:04] rvanlieshout: cause the collection is already loaded
[06:30:21] Hazim: so what's the best way to do this
[06:30:27] rvanlieshout: but if it's just 1 staff you're showing eager load is useless
[06:30:27] Hazim: staff has time_loggers
[06:30:35] rvanlieshout: so then just with that .where
[06:31:09] rvanlieshout: and then use .find_each
[06:31:19] Hazim: let me show you the sql i did previously to query this
[06:31:24] rvanlieshout: cause it's better to use a separate query then using a left join
[06:31:41] yogeshrt: has joined #RubyOnRails
[06:31:50] Hazim: sql = "SELECT
[06:31:50] Hazim: staffs.*, time_loggers.id as tlid, time_loggers.*
[06:31:51] Hazim: subscribem_members, subscribem_users, staffs
[06:31:51] Hazim: LEFT OUTER JOIN
[06:31:52] sarink: has joined #RubyOnRails
[06:31:52] Hazim: time_loggers on staffs.id = time_loggers.staff_id and time_loggers.daterec = '#{@dat}'
[06:31:53] Hazim: WHERE subscribem_members.user_id = subscribem_users.id and staffs.user_id = subscribem_users.id and subscribem_members.account_id = #{current_account.id}"
[06:31:56] Hazim: sql = "SELECT
[06:31:58] Hazim: staffs.*, time_loggers.id as tlid, time_loggers.*
[06:32:02] Hazim: subscribem_members, subscribem_users, staffs
[06:32:04] Hazim: LEFT OUTER JOIN
[06:32:06] Hazim: time_loggers on staffs.id = time_loggers.staff_id and time_loggers.daterec = '#{@dat}'
[06:32:08] Hazim: WHERE subscribem_members.user_id = subscribem_users.id and staffs.user_id = subscribem_users.id and subscribem_members.account_id = #{current_account.id}"
[06:32:08] rvanlieshout: could you use gist plz?
[06:32:13] Hazim: sql = "SELECT
[06:32:15] Hazim: staffs.*, time_loggers.id as tlid, time_loggers.*
[06:32:19] Hazim: subscribem_members, subscribem_users, staffs
[06:32:21] Hazim: LEFT OUTER JOIN
[06:32:23] Hazim: time_loggers on staffs.id = time_loggers.staff_id and time_loggers.daterec = '#{@dat}'
[06:32:25] Hazim: WHERE subscribem_members.user_id = subscribem_users.id and staffs.user_id = subscribem_users.id and subscribem_members.account_id = #{current_account.id}"
[06:32:30] Hazim: it didn't scroll when i pasted it
[06:32:51] rvanlieshout: and don't write sql yourself
[06:32:54] codeurge: has joined #RubyOnRails
[06:32:54] rvanlieshout: you don't need to
[06:33:12] rvanlieshout: also left joins are slow
[06:33:15] Glenny: has joined #RubyOnRails
[06:33:41] Hazim: https://gist.github.com/hazim78/07489d25a81e60700d3b
[06:33:55] Hazim: so it's better to to perform sub queries?
[06:34:30] rvanlieshout: not if you want to display it
[06:34:58] rvanlieshout: so that member has 1 staff, right?
[06:35:00] Hazim: if you look in index
[06:35:07] Hazim: member has only 1 staff yes
[06:35:12] rvanlieshout: then don't eager load things
[06:35:19] Hazim: but staff has time_loggers
[06:35:20] rvanlieshout: just perform a second query for the time loggers where date: x
[06:35:37] rvanlieshout: stuffing all in one query is not a good idea
[06:35:51] ewnd9: has joined #RubyOnRails
[06:35:51] rvanlieshout: @date = params[:tarikh] || Date.today
[06:36:29] rvanlieshout: you should know a few things
[06:36:34] rvanlieshout: 1. multiple queries isn't bad per se
[06:36:37] rvanlieshout: 2. left joins are slow
[06:36:50] Hazim: thank you
[06:36:57] Hazim: that's new to me
[06:37:07] Hazim: always thought multiple queries are bad,
[06:37:19] Hazim: because rails designed eager load to reduce multiple queries
[06:37:24] trautwein: has joined #RubyOnRails
[06:37:27] Hazim: thats what they mentioned in their docs
[06:37:35] rvanlieshout: let's say you load 5 books and iterate over them
[06:37:39] rvanlieshout: displaying it's author
[06:37:50] rvanlieshout: it'll perform a query to fetch the author for each of the books
[06:38:00] rvanlieshout: THEN it's better to eager load
[06:38:02] techsethi: has joined #RubyOnRails
[06:38:05] rvanlieshout: in that case it'll perform 2
[06:38:23] rvanlieshout: it'll juse a select * from books and a select * from authors where id IN (...)
[06:38:29] rvanlieshout: why? because select * from books LEFT JOIN authors is slow
[06:38:31] Hazim: but because the way i display the time logs, i iterate for each staff
[06:38:39] rvanlieshout: and inner join gives a different result
[06:38:47] rvanlieshout: but aren't you displaying it for only 1 staff member?
[06:39:06] Hazim: let's say for a single date
[06:39:12] Hazim: there will be many staffs
[06:39:17] Hazim: and each staff has many time_loggers
[06:39:25] rvanlieshout: and what do you want to display?
[06:39:34] rvanlieshout: aren't you then displaying all time loggers for that day with staff information?
[06:39:36] Hazim: i want to display the time log for that date for each staff
[06:39:52] rvanlieshout: then use TimeLogger.includes(:staff)
[06:39:54] Hazim: I also want to list down the staff without timelogs
[06:39:55] rvanlieshout: add conditions for the day
[06:40:05] rvanlieshout: and use .group_by(&:staff)
[06:40:30] zpe: has joined #RubyOnRails
[06:40:41] Hazim: but that will only display staff with time loggers only
[06:40:55] Hazim: i need to print out all the staff list with or without time logger
[06:40:55] agit0: has joined #RubyOnRails
[06:41:13] Hazim: and if they have a timelog for the date, show it
[06:41:32] Hazim: so we can see who has clocked in or not
[06:41:33] rvanlieshout: then i guess you'll have to write out the joins of time_loggers using a string
[06:41:37] rvanlieshout: and telling rails to eager lod it
[06:41:40] rvanlieshout: if that works
[06:42:01] Hazim: u mean the sql statement
[06:42:37] rvanlieshout: only the joins
[06:42:50] tagrudev: has joined #RubyOnRails
[06:42:59] Hazim: ic, and the eager load?
[06:43:06] rvanlieshout: there is an eager_load method
[06:43:21] rvanlieshout: use it without the conditions first and note how rails aliasses each of the columns
[06:43:29] rvanlieshout: hope that it'll see that you already did that
[06:43:33] rvanlieshout: but i doubt it
[06:43:44] lyoshajapan: has joined #RubyOnRails
[06:43:47] Hazim: ok I'll look into that
[06:43:49] rvanlieshout: so you might end up still using TimeLogger and then performing a second query to fetch all users without
[06:44:07] Hazim: yep, that's another way to do things
[06:44:24] Hazim: except that it will display a different list for people who aren't in
[06:45:03] rvanlieshout: you can combine those 2 user lists
[06:45:04] blackmesa: has joined #RubyOnRails
[06:45:26] Hazim: how do you do that?
[06:45:53] Hazim: you mean combine the results?
[06:46:31] Hazim: i need to go rvanlieshout, thanks for your help. will catch up with you later
[06:46:35] rvanlieshout: @users + @time_loggers.map(&:user)
[06:47:18] Hazim: that will simplify things
[06:47:50] kegan_: https://gist.github.com/anonymous/09fed8e7057cfd2a8ede
[06:48:16] kegan_: why do i need the styling on line 30 for it to align, how am i misusing these divs, how can i clean this up?
[06:48:30] kegan_: left alignment of the button and the form inputs
[06:50:42] lemur: has joined #RubyOnRails
[06:53:26] EcleticAlan: has joined #RubyOnRails
[06:56:11] baweaver_: has joined #RubyOnRails
[06:57:26] User458764: has joined #RubyOnRails
[06:57:51] Pazician: has joined #RubyOnRails
[07:00:32] tenderlove: has joined #RubyOnRails
[07:00:36] jetpackjoe: has joined #RubyOnRails
[07:01:00] Cohedrin: has joined #RubyOnRails
[07:01:20] diegoviola: rvanlieshout: https://gist.github.com/diegoviola/c81ad220bdd638de6cdc
[07:01:43] diegoviola: rvanlieshout: just updated my code to use a return instead of the if else block
[07:02:00] rvanlieshout: yeah. imho this is not cleaner
[07:02:41] diegoviola: it's easier to read with the if/else block, no?
[07:03:01] rvanlieshout: it makes the fist line something else then the second
[07:03:13] rvanlieshout: i only use returns at the beginning of a method for cases where the rest should not be executed
[07:03:56] jmimi: has joined #RubyOnRails
[07:04:17] solars: has joined #RubyOnRails
[07:05:00] diegoviola: not sure how to clean this up
[07:05:06] kmckelvi1: has joined #RubyOnRails
[07:05:14] sleungcy: has joined #RubyOnRails
[07:06:02] rvanlieshout: it's clean enough with the if/else
[07:06:09] diegoviola: https://gist.github.com/fdbfb4d2520e41eae7bd
[07:06:14] diegoviola: yeah sure, thanks
[07:07:29] jmrepetti: has joined #RubyOnRails
[07:08:08] annlewis: has joined #RubyOnRails
[07:10:00] Maletor: has joined #RubyOnRails
[07:11:20] johnflux: has joined #RubyOnRails
[07:13:32] jacksparrow007: has joined #RubyOnRails
[07:13:53] lemur: has joined #RubyOnRails
[07:14:09] dionysus69: has joined #RubyOnRails
[07:14:11] darutoko: has joined #RubyOnRails
[07:14:23] diegoviola: what's the advantage of using drapper over helpers?
[07:15:46] rvanlieshout: helpers are just a bunch of separate methods
[07:15:50] rvanlieshout: decorated / presenters have an instance
[07:17:00] baweaver_: has joined #RubyOnRails
[07:18:52] yogeshrt: has joined #RubyOnRails
[07:21:11] pyemkey: has joined #RubyOnRails
[07:24:48] exadeci: has joined #RubyOnRails
[07:25:13] iateadonut: has joined #RubyOnRails
[07:27:26] diegoviola: do draper classes always bound to a model class?
[07:28:09] diegoviola: can I have a Sedex class that doesn't necessarily bound to a Sedex model?
[07:28:41] diegoviola: so I can say Sedex#delivered? etc
[07:30:37] aganov: has joined #RubyOnRails
[07:31:17] emilebosch: has joined #RubyOnRails
[07:31:36] yardenbar: has joined #RubyOnRails
[07:31:56] owenjones: has joined #RubyOnRails
[07:32:10] gamov: rvanlieshout: i've implemented the join with the subquery with Squeel and everything works as it should now...
[07:34:06] sarink: has joined #RubyOnRails
[07:35:57] DeXterbed: has joined #RubyOnRails
[07:36:12] srinidhi: has joined #RubyOnRails
[07:36:26] codeurge: has joined #RubyOnRails
[07:38:38] krzkrz: has joined #RubyOnRails
[07:39:01] diegoviola: ACTION tries draper
[07:39:03] thoraxe: has joined #RubyOnRails
[07:41:28] gaustin: has joined #RubyOnRails
[07:42:06] DavidDudson: has joined #RubyOnRails
[07:42:31] AimlessRAven: has joined #RubyOnRails
[07:42:46] ewnd9: has joined #RubyOnRails
[07:43:03] [dmp]: has joined #RubyOnRails
[07:43:27] AimlessRAven: Mornin all :) i want to create q link_to i have hash status with values.. pending .. shipped .. my link looks like = link_to sname.humanize, admin_orders_path({q:{status_name_cont: 'pending'}})
[07:43:36] AimlessRAven: how to define values of this status
[07:45:09] NBarnes: has joined #RubyOnRails
[07:45:36] B1n4r10: has joined #RubyOnRails
[07:45:58] sandstrom: has joined #RubyOnRails
[07:46:28] blackmesa: has joined #RubyOnRails
[07:47:11] AimlessRAven: Can anyone help me
[07:48:15] rvanlieshout: AimlessRaven: i don't undertand your question?
[07:48:19] diegoviola: wow I can't believe how easy it was to convert to draper
[07:49:06] raunicolae: has left #RubyOnRails: ("Once you know what it is you want to be true, instinct is a very useful device for enabling you to know that it is")
[07:49:43] stesind: has joined #RubyOnRails
[07:49:50] diegoviola: https://gist.github.com/diegoviola/aaa2fa44f526cebc4937
[07:50:07] tvw: has joined #RubyOnRails
[07:50:21] diegoviola: department.department_status
[07:50:25] diegoviola: that still doesn't feel right, in my view
[07:50:36] rvanlieshout: diegoviola: let me upgrade that
[07:50:59] AimlessRAven: i want to create link_to with _path() argument 2 hashes
[07:51:04] AimlessRAven: 1st hash is my q:
[07:51:22] AimlessRAven: second is my status_name_cont: 'pending' for example
[07:51:39] AimlessRAven: then how to define a values of this status, which i click
[07:52:42] rvanlieshout: diegoviola: on the phone for a few min. let me get back to you
[07:52:53] diegoviola: rvanlieshout: sure
[07:53:57] DavidDudson: has joined #RubyOnRails
[07:55:36] jbrhbr: has joined #RubyOnRails
[07:59:03] juddey: has joined #RubyOnRails
[08:01:13] rvanlieshout: diegoviola: added comment
[08:01:19] rvanlieshout: another step in the right direction
[08:02:45] ishamo: has joined #RubyOnRails
[08:03:53] shibabu: has joined #RubyOnRails
[08:04:05] diegoviola: rvanlieshout: that's cool, thanks
[08:06:50] mrbubbles: has joined #RubyOnRails
[08:06:58] agit0: has joined #RubyOnRails
[08:07:48] brunto: has joined #RubyOnRails
[08:08:54] annlewis: has joined #RubyOnRails
[08:10:45] Maletor: has joined #RubyOnRails
[08:11:18] ibouvousaime: has joined #RubyOnRails
[08:11:25] defsdoor: has joined #RubyOnRails
[08:12:26] quazimodo: has joined #RubyOnRails
[08:13:20] Silox|: has joined #RubyOnRails
[08:15:10] adac: has joined #RubyOnRails
[08:15:25] pulgalip1: has joined #RubyOnRails
[08:15:35] Bloomer: has joined #RubyOnRails
[08:16:22] DeXterbed: has joined #RubyOnRails
[08:17:23] wldcordeiro: has joined #RubyOnRails
[08:17:36] yogeshrt: has joined #RubyOnRails
[08:18:45] Palsson: has joined #RubyOnRails
[08:19:19] TvL2386: has joined #RubyOnRails
[08:20:19] alex88: has joined #RubyOnRails
[08:21:20] theod: has joined #RubyOnRails
[08:26:40] jgt: has joined #RubyOnRails
[08:28:02] davonrails: has joined #RubyOnRails
[08:30:46] artto: has joined #RubyOnRails
[08:34:00] tetraktys: has joined #RubyOnRails
[08:38:02] pyemkey: has joined #RubyOnRails
[08:38:33] mauro1291: has joined #RubyOnRails
[08:40:11] diegoviola: rvanlieshout: https://gist.github.com/diegoviola/cb26d06de7f4e8f210a4
[08:40:27] diegoviola: rvanlieshout: using it this way in my helper before I convert it to draper :P
[08:40:27] mauro1254: has joined #RubyOnRails
[08:40:46] sandstrom: has joined #RubyOnRails
[08:41:05] diegoviola: old habits die hard
[08:41:07] diegoviola: just kidding
[08:44:02] bronson: has joined #RubyOnRails
[08:44:27] mauro1254: I guys, I have a question. I have a books table and I would like to sort records by title. My idea is to compute a new field for this purpose (let's call it title_no_art) and store a normalized version of the title (articles, special characters, ... removed).
[08:44:54] rvanlieshout: mauro1254: what's in your normal title field?
[08:44:55] mauro1254: Is the I18n transliterate method useful for my problem?
[08:45:05] rvanlieshout: and don't use abbr
[08:45:14] mauro1254: I have title of books in several languages.
[08:45:26] artto: has joined #RubyOnRails
[08:45:44] rvanlieshout: stored where?
[08:45:51] emilebosch: has joined #RubyOnRails
[08:46:03] mauro1254: books table (mysql)
[08:46:20] rvanlieshout: and what's the issue about just sorting on that?
[08:46:38] mauro1254: The issue is that title may begin with articles
[08:46:53] rvanlieshout: why is that stored in title?
[08:47:04] rvanlieshout: and how would you then know what the title actually is
[08:47:11] chihaja_: has joined #RubyOnRails
[08:47:37] mauro1254: Title may contains articles, but when you sort by title you want to ignore articles
[08:47:51] blackmesa: has joined #RubyOnRails
[08:48:13] rvanlieshout: then why do you have an invalid value saved in the title attribute?
[08:48:28] mauro1254: It is not an invalid value
[08:48:43] marr: has joined #RubyOnRails
[08:48:46] rvanlieshout: but it's also not the title
[08:48:49] rvanlieshout: so what is the title?
[08:48:58] mauro1254: In title I store the real title, in title_no_art I save a useful value for sorting purpose
[08:49:13] rvanlieshout: how is it different?
[08:49:40] rvanlieshout: and you're going to tell that title includes articles again
[08:49:47] rvanlieshout: so why does title include articles? why not just the title
[08:49:50] rvanlieshout: as the attribute name implies
[08:49:57] mauro1254: Example: https://books.google.ch/books?vid=ISBN9781446203187&hl=en
[08:50:20] mauro1254: The title of this book is "The Sage Handbook of Research Management"
[08:50:45] comrad: has joined #RubyOnRails
[08:50:55] mauro1254: When I sort by title I want to consider Sage as the first word
[08:51:12] rvanlieshout: that's not an article
[08:51:24] srinidhi: has joined #RubyOnRails
[08:51:28] rvanlieshout: https://github.com/brenes/stopwords-filter
[08:51:37] rvanlieshout: then save that in a differnet column
[08:51:39] rvanlieshout: with a sane name
[08:51:41] rvanlieshout: not title_no_art
[08:52:28] chihaja_: has joined #RubyOnRails
[08:52:40] mauro1254: Isn't "the" an article?
[08:53:05] paulodiniz: has joined #RubyOnRails
[08:53:37] rvanlieshout: https://en.wiktionary.org/wiki/article
[08:53:39] rvanlieshout: not that i know
[08:53:50] sleungcy: has joined #RubyOnRails
[08:54:46] mauro1254: 5. (grammar) A part of speech that indicates, specifies and limits a noun (a, an, or the in English).
[08:56:05] rvanlieshout: didn't know what one, but i find it confusing with (dated) number 9
[08:56:09] rvanlieshout: but hey. article it is then
[08:56:45] rvanlieshout: http://dev.mysql.com/doc/refman/5.7/en/fulltext-stopwords.html
[08:57:43] jas02: has joined #RubyOnRails
[08:57:48] diegoviola: I read it's a bad idea to instantiate more than one object in a controller, but this is what I have for my dashboard: https://gist.github.com/diegoviola/4f480d73f985e3f711db
[08:57:54] DavidDudson: has joined #RubyOnRails
[08:58:06] diegoviola: not sure how to improve this
[08:58:30] diegoviola: I *need* that data to be available in my dashboard
[09:00:02] arBmind: has joined #RubyOnRails
[09:01:00] pydave6367: has joined #RubyOnRails
[09:01:36] rvanlieshout: diegoviola: anybody who blindly uses a number to indicate if something is good or bad is wrong
[09:01:37] chihaja_: has joined #RubyOnRails
[09:01:39] rvanlieshout: that's not how it works
[09:01:57] rvanlieshout: but you might want to check if you're not just displaying too much information on the view
[09:02:14] rvanlieshout: a dashboard in generic might contain quite some info, so i don't thikn it's a real problem there
[09:03:04] Pumukel: has joined #RubyOnRails
[09:03:10] snowy: has joined #RubyOnRails
[09:03:37] quazimodo: has joined #RubyOnRails
[09:04:10] krzkrzkrz: has joined #RubyOnRails
[09:04:11] sandstrom: has joined #RubyOnRails
[09:05:05] snowy: has joined #RubyOnRails
[09:05:28] mauro1254: rvanlieshout: thx for your help
[09:05:46] drptbl: has joined #RubyOnRails
[09:05:55] shibabu: has joined #RubyOnRails
[09:06:00] Bloomer: has joined #RubyOnRails
[09:08:02] diegoviola: rvanlieshout: https://robots.thoughtbot.com/sandi-metz-rules-for-developers
[09:08:07] diegoviola: I've just read that there
[09:08:25] diegoviola: what are your thoughts about that?
[09:08:52] diegoviola: why thought?
[09:08:57] techsethi: has joined #RubyOnRails
[09:09:11] rvanlieshout: because it is immediatly followed by 'When to break these rules'
[09:09:15] rvanlieshout: then it's not a rule
[09:09:20] rvanlieshout: it's a guideline
[09:09:22] tagrudev: has joined #RubyOnRails
[09:09:37] rvanlieshout: and we do use rubocop to enforce a proper style
[09:09:41] annlewis: has joined #RubyOnRails
[09:09:43] rvanlieshout: minus the class documentation and set linelength to 120
[09:09:45] DavidDudson: has joined #RubyOnRails
[09:09:46] cornerma1: has joined #RubyOnRails
[09:10:00] rvanlieshout: class documentation is ok, but not required for a class User < ActiveRecord::Base imo
[09:10:27] afroboy: has joined #RubyOnRails
[09:10:31] rvanlieshout: so agreed on those numbers, but handled with common sense
[09:11:34] Maletor: has joined #RubyOnRails
[09:13:06] Cervajz: has joined #RubyOnRails
[09:13:32] User458764: has joined #RubyOnRails
[09:14:27] jacksparrow007: has joined #RubyOnRails
[09:14:49] lessless: has joined #RubyOnRails
[09:15:11] jbrinkmusic: can somebody point me to where I've gone wrong? https://gist.github.com/jBrinkMusic/9a724a14e4702760d9d1
[09:15:17] Cervajz_: has joined #RubyOnRails
[09:15:45] rvanlieshout: Company.first.users
[09:16:34] rvanlieshout: 1) you settings table should have a company_id and user_id, not users_id and companies_id
[09:16:42] rvanlieshout: 2) you didn't specify that relationship in the company model
[09:18:25] jbrinkmusic: rvanlieshout: ah, of course... the revenge of the singular vs. plural
[09:18:33] rvanlieshout: is that a revenge? :)
[09:18:40] jsrn_: has joined #RubyOnRails
[09:19:43] jbrinkmusic: rvanlieshout: it's quite easy to miss... being on too little sleep might be a part of it but I've been pulling hairs because of this error for a time too long to admit :D
[09:20:51] kitsuneyo: has joined #RubyOnRails
[09:22:23] DavidDudson: has joined #RubyOnRails
[09:25:32] paulodiniz: has joined #RubyOnRails
[09:28:24] avelldiroll: has joined #RubyOnRails
[09:28:39] Pumukel: has joined #RubyOnRails
[09:29:13] lyoshajapan: has joined #RubyOnRails
[09:30:13] emilebosch: has joined #RubyOnRails
[09:31:18] diegoviola: rvanlieshout: what do you mean by class documentation?
[09:31:23] DavidDudson: has joined #RubyOnRails
[09:32:02] rvanlieshout: rubocop enforces that every class has documentation above it
[09:32:02] jgt: has joined #RubyOnRails
[09:32:27] Tempesta: has joined #RubyOnRails
[09:33:02] DeXterbed: has joined #RubyOnRails
[09:33:03] diegoviola: I'm not sure I see much point with that, I just tried rubocop and I don't see myself adding documentation with every class
[09:33:29] rvanlieshout: so we've disabled that company wide for now
[09:33:48] rvanlieshout: documentation is good, but not required for all classes
[09:33:52] rvanlieshout: and i just don't like the :nodoc: thing
[09:34:22] B1n4r10: has joined #RubyOnRails
[09:34:57] Tempesta: has joined #RubyOnRails
[09:35:08] diegoviola: is it possible to run rubocop but disable some checks, like documentation?
[09:35:41] DavidDudson: has joined #RubyOnRails
[09:36:02] rvanlieshout: https://github.com/bluerail/rubocop-config
[09:36:33] Ergo: has joined #RubyOnRails
[09:37:58] user1138: has joined #RubyOnRails
[09:38:55] krzkrzkrz: has joined #RubyOnRails
[09:40:12] n00bDev: has joined #RubyOnRails
[09:40:35] n00bDev: hi is anyone here
[09:41:39] teclator: has joined #RubyOnRails
[09:42:04] n00bDev: does anyone know if its possible to do a SOA for 2 different frameworks i.e rails and node
[09:42:38] n00bDev: im thinking of building a simple chat app using node as the socket server and rails as the front end/backend app
[09:42:53] n00bDev: most blogs ive come across do SOA within the same framework
[09:43:20] rvanlieshout: what's a SOA?
[09:45:10] rvanlieshout: i only know it in a DNS context
[09:45:26] NBarnes: has joined #RubyOnRails
[09:45:26] rvanlieshout: and if you're just talking about using framework A and connecting to B then yes, thats possible
[09:45:33] rvanlieshout: as long as both parties agree on how they communicate
[09:46:57] emilebosch: has joined #RubyOnRails
[09:48:10] DefV_: Service Oriented Architecture, I guess?
[09:49:13] blackmesa: has joined #RubyOnRails
[09:50:00] Sylario: has joined #RubyOnRails
[09:50:12] diegoviola: Buzzword Oriented Architecture
[09:51:42] rvanlieshout: http://www.atrixnet.com/bs-generator.html
[09:51:54] n00bDev: yeah buzzword oriented arch
[09:52:19] DefV_: Don't shoot the translator. All I know about it are those 3 words and to stay away from people that utter them
[09:52:30] lemur: has joined #RubyOnRails
[09:53:40] Palsson: has joined #RubyOnRails
[09:54:05] n00bDev: if you think about it just a design pattern?
[09:54:14] rvanlieshout: it's not a deisng pattern
[09:54:32] quazimodo: has joined #RubyOnRails
[09:54:34] baweaver: has joined #RubyOnRails
[09:54:47] n00bDev: what is it then?
[09:54:53] mrbubbles: has joined #RubyOnRails
[09:55:39] user1138: has left #RubyOnRails: ("Leaving")
[09:55:39] DefV_: a buzzword
[09:55:46] DefV_: managers like to use
[09:55:52] rvanlieshout: and visit http://www.atrixnet.com/bs-generator.html
[09:56:02] elton: has joined #RubyOnRails
[09:59:42] rodfersou: has joined #RubyOnRails
[10:00:04] Sylario: I use globalize for my data. Usually it is transparent but when you do not use a hash for your where, it does not join the translation table to the query. My workaround is to add a where.not(nom: nil)
[10:00:06] Sylario: Good.where('good_translations.nom ILIKE ?', "%par chambre%").where.not(nom: nil)
[10:00:21] Sylario: It works, but maybe there is a more elegant solution?
[10:00:28] Maletor: has joined #RubyOnRails
[10:00:42] Sylario: The presence of the searched field in the where not trigger a join using the correct locale
[10:00:45] rvanlieshout: sylario: it's because using that string Rails doesn't kwow what to join
[10:00:52] rvanlieshout: Good.joins(:good_translations).where('...')
[10:01:26] ayonkhan: has joined #RubyOnRails
[10:01:45] Sylario: rvanlieshout: this is dangerous because when a Italian user search a product name, he will see the Italian name of a product matching by the french string ^^
[10:02:27] Sylario: the where not works, but i feel like it's a bit hacky
[10:02:28] lacrymology: has joined #RubyOnRails
[10:02:41] rvanlieshout: it is. isn't there a method on globalize to tell it to include the right language?
[10:02:54] Sylario: I did not find it
[10:02:56] ethe: has joined #RubyOnRails
[10:02:57] Sylario: the doc is succint
[10:03:17] rhizome: has joined #RubyOnRails
[10:04:49] Sylario: rvanlieshout: you were right there is a method
[10:04:57] FernandoBasso: has joined #RubyOnRails
[10:05:39] lacrymology: has joined #RubyOnRails
[10:08:40] Haydos_: has joined #RubyOnRails
[10:08:54] njero: has joined #RubyOnRails
[10:10:08] jgt: has joined #RubyOnRails
[10:10:26] annlewis: has joined #RubyOnRails
[10:14:54] ql6wlld: has joined #RubyOnRails
[10:15:23] srinidhi: has joined #RubyOnRails
[10:16:02] blackmesa: has joined #RubyOnRails
[10:19:14] bronson: has joined #RubyOnRails
[10:20:54] alex88: has joined #RubyOnRails
[10:22:43] nya: has joined #RubyOnRails
[10:23:17] loren: has joined #RubyOnRails
[10:23:27] theod: has joined #RubyOnRails
[10:24:08] Cervajz: has joined #RubyOnRails
[10:27:42] nfk|laptop: has joined #RubyOnRails
[10:27:42] adre: has joined #RubyOnRails
[10:28:13] Cervajz_: has joined #RubyOnRails
[10:29:38] yfeldblum: has joined #RubyOnRails
[10:30:55] owenjones: has joined #RubyOnRails
[10:31:26] DeXterbed: has joined #RubyOnRails
[10:34:57] ql6wlld: has joined #RubyOnRails
[10:36:27] pyemkey: has joined #RubyOnRails
[10:38:46] pyemkey: Hello, anyone have tried create alias to default as: options in simple form https://github.com/plataformatec/simple_form#available-input-types-and-defaults-for-each-column-type I would like to use different name for :tel option? Any idea how could I do this?
[10:39:33] rvanlieshout: can't you just set the html attribute name?
[10:40:35] maesitos: has joined #RubyOnRails
[10:41:15] baweaver: has joined #RubyOnRails
[10:41:46] emilebosch: has joined #RubyOnRails
[10:43:46] pyemkey: I can, but I'm curious how could I do this in different way :) Any experience with this?
[10:44:19] silverdust: How can I properly place a tag on condition. I have :class => "#{x? 'red' : 'black'}"
[10:44:49] silverdust: is this okay or can I have :class => "#{x?} red {:} black"
[10:44:57] rvanlieshout: pyemkey: the proper way would be to use the proper name
[10:45:07] DefV_: you can have :class => (x ? 'red' : 'black')
[10:45:15] rvanlieshout: silverdust: you might want to use a helper method that return the class
[10:45:21] ldnunes: has joined #RubyOnRails
[10:45:22] rvanlieshout: so you don't have to force it all in 1 line
[10:46:03] silverdust: sounds like a better idea
[10:46:51] silverdust: but uhm since helpers are controller based and this is in the master layout I wouldn't want to repeat the helper
[10:46:55] artto: has joined #RubyOnRails
[10:46:57] silverdust: for all controllers
[10:47:02] rvanlieshout: application_helper
[10:48:35] quazimodo: has joined #RubyOnRails
[10:50:48] adre: has joined #RubyOnRails
[10:52:49] lacrymology: has joined #RubyOnRails
[10:54:23] adre: has joined #RubyOnRails
[10:56:22] beast: has joined #RubyOnRails
[10:57:06] elton: has joined #RubyOnRails
[10:57:14] shibabu: has joined #RubyOnRails
[10:57:43] Peg-leg: has joined #RubyOnRails
[11:02:02] Maletor: has joined #RubyOnRails
[11:03:08] adre: has joined #RubyOnRails
[11:05:11] zpe: has joined #RubyOnRails
[11:05:26] zpe: has joined #RubyOnRails
[11:06:05] nettoweb: has joined #RubyOnRails
[11:09:25] FooMunki: has joined #RubyOnRails
[11:11:14] annlewis: has joined #RubyOnRails
[11:15:18] jacksparrow007: has joined #RubyOnRails
[11:15:38] blackmesa: has joined #RubyOnRails
[11:16:19] chipotle: has joined #RubyOnRails
[11:17:45] emilebosch: has left #RubyOnRails: ()
[11:19:05] netzfisch: has joined #RubyOnRails
[11:19:40] jds: has joined #RubyOnRails
[11:20:30] rickmasta: has joined #RubyOnRails
[11:21:06] nya: has joined #RubyOnRails
[11:22:07] c355E3B: has joined #RubyOnRails
[11:22:35] kitsuneyo: has joined #RubyOnRails
[11:23:09] B1n4r10: has joined #RubyOnRails
[11:25:22] Haydos_: has left #RubyOnRails: ()
[11:25:48] Haydos: has joined #RubyOnRails
[11:27:07] annlewis: has joined #RubyOnRails
[11:27:25] stamina: has joined #RubyOnRails
[11:29:37] quazimodo: has joined #RubyOnRails
[11:31:43] ql6wlld: has joined #RubyOnRails
[11:34:49] sandstrom: has joined #RubyOnRails
[11:34:56] mrbubbles: has joined #RubyOnRails
[11:36:37] rodferso1: has joined #RubyOnRails
[11:39:31] dideler: has joined #RubyOnRails
[11:42:31] blackhuey: has joined #RubyOnRails
[11:45:55] nettoweb: has joined #RubyOnRails
[11:46:26] rodfersou: has joined #RubyOnRails
[11:46:38] NBarnes: has joined #RubyOnRails
[11:47:29] Ropeney: has joined #RubyOnRails
[11:50:33] eddiegrey: has joined #RubyOnRails
[11:53:57] tetraktys: has joined #RubyOnRails
[11:57:31] sandstrom: has joined #RubyOnRails
[11:57:53] elton: has joined #RubyOnRails
[11:59:51] Palsson: has joined #RubyOnRails
[12:00:02] Sceko: has joined #RubyOnRails
[12:00:02] Sceko: has joined #RubyOnRails
[12:00:16] rubyonrails253: has joined #RubyOnRails
[12:01:16] sandstrom: has joined #RubyOnRails
[12:02:09] DeXterbed: has joined #RubyOnRails
[12:02:29] eddiegrey: has joined #RubyOnRails
[12:02:31] renegadeandy: has joined #RubyOnRails
[12:02:35] Giorgio: has joined #RubyOnRails
[12:02:39] renegadeandy: Can somebody please help with this : Can anybody please help with this : http://stackoverflow.com/questions/34214950/rails-gem-class-override-implementation-load-order
[12:02:49] Maletor: has joined #RubyOnRails
[12:03:16] atumzin: has joined #RubyOnRails
[12:04:18] sandstrom: has joined #RubyOnRails
[12:04:27] nettoweb: has joined #RubyOnRails
[12:05:15] spiman: has joined #RubyOnRails
[12:05:23] rodferso1: has joined #RubyOnRails
[12:06:20] spiman: hello. In Rspec, where would you place test-specific seed files?
[12:09:02] rubyonrails257: has joined #RubyOnRails
[12:09:56] Hates_: renegadeandy: have you tried using class_eval to monkey patch the original class?
[12:10:46] techsethi: has joined #RubyOnRails
[12:11:16] renegadeandy: Hates_: actually I did, without much luck, can you explain how you would use that maybe I made a mistake?
[12:11:33] loechel: has joined #RubyOnRails
[12:11:56] bronson: has joined #RubyOnRails
[12:12:06] rubyonrails257: has joined #RubyOnRails
[12:12:06] ql6wlld: has joined #RubyOnRails
[12:12:11] Hates_: renegadeandy: you would do PrivatePub::FayExtension.class_eval do { your stuff }} end
[12:12:14] Pumukel: has joined #RubyOnRails
[12:13:56] wmdrossard: has joined #RubyOnRails
[12:13:59] rubyonrails257: Hi, all. Is there a better way of iterating over the response list and creating/updating records than this response.each {|r| Contact.find_or_initialize_by(outer_id: r[:id]).tap {|c| c.some_attr = r[:some_attr]}.save! }
[12:14:48] rubyonrails257: When response is large it results in big mem allocations
[12:16:26] jhass: rubyonrails257: so response is the result of what?
[12:18:48] renegadeandy: Hates_: inside my faye_extension.rb file inside config/initializers?
[12:20:27] rubyonrails257: response is result that other API returned
[12:21:32] alex88: has joined #RubyOnRails
[12:22:11] sandstrom: has joined #RubyOnRails
[12:22:58] atumzin: has joined #RubyOnRails
[12:23:24] violarium: has joined #RubyOnRails
[12:24:05] baweaver: has joined #RubyOnRails
[12:24:46] sandstrom: has joined #RubyOnRails
[12:26:46] tknz: has joined #RubyOnRails
[12:29:47] jgt: has joined #RubyOnRails
[12:31:37] chipotle: has joined #RubyOnRails
[12:33:37] annlewis: has joined #RubyOnRails
[12:35:06] atumzin: has joined #RubyOnRails
[12:39:27] jhass: rubyonrails257: I bet fetching the "response" already allocates most of that memory.
[12:40:53] cjk101010: has joined #RubyOnRails
[12:41:37] rodfersou: has joined #RubyOnRails
[12:42:51] lunks: has joined #RubyOnRails
[12:43:14] lunks: Hi, how can use t.references with an uuid column?
[12:43:24] User458764: has joined #RubyOnRails
[12:45:53] pvertenten: has joined #RubyOnRails
[12:46:12] B1n4r10: has joined #RubyOnRails
[12:47:29] _Tariq: has joined #RubyOnRails
[12:48:19] Xentil: has joined #RubyOnRails
[12:48:29] tbuehlmann: Lunks, easiest way: just add the column yourself
[12:50:16] atumzin: has joined #RubyOnRails
[12:53:23] Detch: has joined #RubyOnRails
[12:53:31] kitsuneyo: has joined #RubyOnRails
[12:53:50] Ergo^: has joined #RubyOnRails
[12:54:18] atomical: has joined #RubyOnRails
[12:55:53] techsethi: has joined #RubyOnRails
[12:56:09] tenderlove: has joined #RubyOnRails
[12:57:21] daivyk: has joined #RubyOnRails
[12:58:29] Spami: has joined #RubyOnRails
[13:00:39] artto: has joined #RubyOnRails
[13:01:08] shibabu: has joined #RubyOnRails
[13:03:33] Maletor: has joined #RubyOnRails
[13:04:02] FernandoBasso: I am in person controller. I need a form for a specific action not related to "people".
[13:04:08] FernandoBasso: form_for <what> ?
[13:07:05] Palsson: has joined #RubyOnRails
[13:07:09] rodfersou: has joined #RubyOnRails
[13:08:52] renegadeandy: Can somebody highlight to me how I can reference a global class array :: https://gist.github.com/ArmyAndy/4b323f861fa83ec1c8ea my stntax is wrong here
[13:09:37] renegadeandy: FernandoBasso: if you had a @something_else which you had called @something_else = SomethingElse.build on in the controller, you could do form_for @something_else
[13:09:41] mostlybadfly: has joined #RubyOnRails
[13:10:16] rubyonrails895: has joined #RubyOnRails
[13:10:24] desmondhume: has joined #RubyOnRails
[13:11:19] elaptics: renegadeandy: class variables are referenced like @@clients = Array.new
[13:12:46] elaptics: renegadeandy: basically like an ivar with an extra @
[13:12:48] renegadeandy: elaptics: so now I have this : https://gist.github.com/ArmyAndy/4b323f861fa83ec1c8ea which is similar
[13:13:45] elaptics: renegadeandy: can you gist the whole class and how you're calling it
[13:15:01] rubyninja: has joined #RubyOnRails
[13:15:09] renegadeandy: elaptics: here we go : https://gist.github.com/ArmyAndy/4b323f861fa83ec1c8ea
[13:15:34] d0nn1e: has joined #RubyOnRails
[13:15:39] meeto: has joined #RubyOnRails
[13:15:50] desmondhume: has joined #RubyOnRails
[13:16:09] jacksparrow007: has joined #RubyOnRails
[13:16:41] elaptics: renegadeandy: have you saved your code and reloaded the console before running the method call again?
[13:16:58] NBarnes: has joined #RubyOnRails
[13:17:17] elaptics: the error suggests it's still looking for the old name
[13:17:38] elaptics: actually that looks like it's in an initializer, you need to quit the console and restart it fully
[13:17:44] elaptics: initializers don't get reloaded
[13:17:55] railsKE: has joined #RubyOnRails
[13:17:58] renegadeandy: Thats what it was
[13:18:01] renegadeandy: you fix it! Cheers mate
[13:23:18] jcromartie: has joined #RubyOnRails
[13:23:53] _Tariq: has joined #RubyOnRails
[13:23:56] _Tariq: has left #RubyOnRails: ()
[13:23:59] FernandoBasso: renegadeandy: Thanks.
[13:24:00] _Tariq: has joined #RubyOnRails
[13:25:44] snowy: has joined #RubyOnRails
[13:26:01] agit0: has joined #RubyOnRails
[13:26:15] techsethi: has joined #RubyOnRails
[13:27:44] _Tariq: has joined #RubyOnRails
[13:28:15] rickmasta: has joined #RubyOnRails
[13:28:16] fox_mulder_cp: hi, all. now i add pundit gem into my app, but can't know, how to describe my policies (on test app use defaul blog app from rails manual with articles and assocated comments)
[13:29:50] lunks: tbuehlmann: thanks, you can add a `type: :uuid` to it
[13:31:56] _Tariq: has joined #RubyOnRails
[13:32:04] elaptics: fox_mulder_cp: what is the problem you're having?
[13:32:12] Hazim: has joined #RubyOnRails
[13:32:28] lunks: I'm having another issue here. I had a model named `Team` on my app living in `app/models/team.rb` but had to create a `Foo::Team` which lives in `app/models/foo/team.rb`. Now Rails expects `Team` to be defined in the namespaced file `app/models/foo/team.rb` probably because of the autoloading path order. I'd like `Team` to be autoloaded from `app/models/team.rb`. How can I solve this?
[13:32:56] fox_mulder_cp: elaptics: can't rescribe pundit policies for my app classes Article and Comment
[13:33:17] elaptics: fox_mulder_cp: can't describe in what way?
[13:33:38] eddiegrey: has joined #RubyOnRails
[13:33:57] elaptics: Lunks: why did you create a Foo::Team namespace then?
[13:34:00] atomical: has joined #RubyOnRails
[13:34:02] fox_mulder_cp: elaptics: i see for a default ruleset for user and record, but how to adopt it for my app..
[13:34:12] lunks: elaptics: Because they are different Teams.
[13:34:21] nickenchuggets: has joined #RubyOnRails
[13:34:21] nickenchuggets: has joined #RubyOnRails
[13:34:22] annlewis: has joined #RubyOnRails
[13:34:35] elaptics: Lunks: ok, so you want two different team models?
[13:34:40] lunks: elaptics: Exactly
[13:34:55] elaptics: fox_mulder_cp: can't really help unless you provide some more detail about what you need to be able to do
[13:35:17] elaptics: Lunks: namespacing the other team would be the best bet?
[13:35:26] tenderlove: has joined #RubyOnRails
[13:35:44] elaptics: or be more specific to your name of the team model
[13:35:47] lunks: elaptics: Is there another alternative? I'd rather not touch the previous stuff
[13:35:51] elaptics: like FooTeam and BarTeam
[13:36:05] rodfersou: has joined #RubyOnRails
[13:36:12] lunks: I'll have a bunch of these, it'd be better to have those namespaced
[13:36:19] theod: has joined #RubyOnRails
[13:37:18] elaptics: I'd namespace them both, and if you really want to - not sure I'd recommend this - but you could maybe choose one of them that you then assign to the Team constant so that it's available as just Team
[13:37:26] fox_mulder_cp: elaptics: ok. i write blogapp from official manual from rails app, which have a Article class (Title, Content) and it has_many association to Comment (second class)
[13:37:27] elaptics: I've never tried it, but it might work
[13:37:40] lunks: The app did some stuff related to American Football and now's doing some stuff for Basketball, so I'll have Team, Player and a lot of others with relatively the same name, elaptics. Am I going the wrong way?
[13:38:01] lunks: I'll try that, see if that works
[13:38:37] fox_mulder_cp: elaptics: i add Devise gem, and need add access rights matrix. cancan gem is outdated
[13:38:44] elaptics: Lunks: hard to really advise without knowing a lot more of the app
[13:39:13] build22: has joined #RubyOnRails
[13:39:30] lunks: elaptics: Sure, I just wanted to know if there's anything I can do to make Rails pickup the one without namespace first
[13:39:32] fox_mulder_cp: elaptics: now i try adopt Pundit Policies to my app
[13:39:52] lunks: maybe declaring Foo::Team as it is, without a module but directly namespacing it?
[13:40:29] lunks: It doesn't look like
[13:40:31] hardtail: has joined #RubyOnRails
[13:43:57] B1n4r10: has joined #RubyOnRails
[13:44:19] ramortegui: has joined #RubyOnRails
[13:45:28] shanemcd: has joined #RubyOnRails
[13:48:13] IFrank00: has joined #RubyOnRails
[13:49:20] dstarh: has joined #RubyOnRails
[13:49:34] herbst: has joined #RubyOnRails
[13:49:34] herbst: has joined #RubyOnRails
[13:50:14] Dbugger: has joined #RubyOnRails
[13:50:14] herbst: is there anything that exposed the basic-auth mechanism to me? So i could check if a user is authed or not? similiar to user_signed_in?
[13:50:17] Dbugger: Hello fellas
[13:51:17] kitsuneyo: has joined #RubyOnRails
[13:52:28] veloutin: is there a way to get the current erb engine? I want to test inline erb before saving it
[13:52:36] lunks: elaptics: I'll just do FooTeam for the duplicated names and live with it, namespace everything else
[13:52:40] Dbugger: I have a small doubt, and I was hoping I could find someone here that could enlighten me a little: Let's say I have a Map object, with a matrix 80x80 of objects Tile. How would be the best way to store this on the database? Should I have a "tiles" table with 160 entries for each map? Isn't that a little exaggerated?
[13:52:45] lunks: elaptics: Thanks for the help
[14:00:23] elton: has joined #RubyOnRails
[14:00:40] jtb__: has joined #RubyOnRails
[14:02:43] Cork: ActionController#url_for seams to automatically include keys from params
[14:02:51] Cork: is there a way to avoid this?
[14:03:38] shibabu: has joined #RubyOnRails
[14:03:40] NBarnes: has joined #RubyOnRails
[14:04:22] Maletor: has joined #RubyOnRails
[14:05:00] teclator: has joined #RubyOnRails
[14:05:06] chipotle: has joined #RubyOnRails
[14:06:50] dopie: has joined #RubyOnRails
[14:08:55] pulgalip1: has joined #RubyOnRails
[14:09:29] jkamenik: has joined #RubyOnRails
[14:11:35] workmad3: has joined #RubyOnRails
[14:11:43] voker57: has joined #RubyOnRails
[14:11:43] voker57: has joined #RubyOnRails
[14:12:00] jtb___: has joined #RubyOnRails
[14:13:18] Palsson: has joined #RubyOnRails
[14:13:30] sonofdirt: has joined #RubyOnRails
[14:14:00] jkamenik: has joined #RubyOnRails
[14:14:01] Bloomer: has joined #RubyOnRails
[14:18:15] sleungcy: has joined #RubyOnRails
[14:20:06] jtb__: has joined #RubyOnRails
[14:20:44] Or1on: has joined #RubyOnRails
[14:20:44] Or1on: has joined #RubyOnRails
[14:21:26] ornerymoose: has joined #RubyOnRails
[14:21:30] tenderlove: has joined #RubyOnRails
[14:22:09] B1n4r10: has joined #RubyOnRails
[14:23:01] shapeshifter: has joined #RubyOnRails
[14:24:33] ElFerna: has joined #RubyOnRails
[14:25:24] ewnd9: has joined #RubyOnRails
[14:26:05] baweaver: has joined #RubyOnRails
[14:26:09] voker57: has joined #RubyOnRails
[14:26:09] voker57: has joined #RubyOnRails
[14:26:34] FLeiXiuS: has joined #RubyOnRails
[14:26:34] FLeiXiuS: has joined #RubyOnRails
[14:26:39] centrx: has joined #RubyOnRails
[14:26:56] sharkman: has joined #RubyOnRails
[14:27:34] chipotle: has joined #RubyOnRails
[14:31:45] edwinvdgraaf: has joined #RubyOnRails
[14:32:03] s2013: has joined #RubyOnRails
[14:35:08] annlewis: has joined #RubyOnRails
[14:40:14] ornerymoose: has joined #RubyOnRails
[14:42:04] nertzy: has joined #RubyOnRails
[14:43:01] Hazim: has joined #RubyOnRails
[14:43:49] renegadeandy: has joined #RubyOnRails
[14:44:13] ornerymoose_: has joined #RubyOnRails
[14:44:23] renegadeandy: elaptics: When I run this code the result is always an empty @@clients???despite me invoking incoming() multiple times : https://gist.github.com/ArmyAndy/a3a4b1812c61843dabd8
[14:44:40] jacksparrow007: has joined #RubyOnRails
[14:44:44] atomical_: has joined #RubyOnRails
[14:45:19] darkxploit: has joined #RubyOnRails
[14:45:19] yardenbar: has joined #RubyOnRails
[14:45:34] akshat: has joined #RubyOnRails
[14:45:40] User458764: has joined #RubyOnRails
[14:45:41] shibabu: has joined #RubyOnRails
[14:48:18] n1lo: has joined #RubyOnRails
[14:49:28] stannard: has joined #RubyOnRails
[14:49:59] nettoweb: has joined #RubyOnRails
[14:51:27] Fernando1: has joined #RubyOnRails
[14:51:59] chouhoulis: has joined #RubyOnRails
[14:53:39] Hazim: has joined #RubyOnRails
[14:54:16] theblang: has joined #RubyOnRails
[14:54:23] chipotle: has joined #RubyOnRails
[14:54:47] rdavila: has joined #RubyOnRails
[14:55:29] jcromartie: has joined #RubyOnRails
[14:55:43] theod: has joined #RubyOnRails
[14:56:22] atomical: has joined #RubyOnRails
[14:56:56] puria: has joined #RubyOnRails
[14:57:46] pvertenten: has joined #RubyOnRails
[15:00:31] uris: has joined #RubyOnRails
[15:00:39] theod: has joined #RubyOnRails
[15:00:52] mary5030: has joined #RubyOnRails
[15:01:29] elton: has joined #RubyOnRails
[15:01:59] johnnegron: has joined #RubyOnRails
[15:03:05] elaptics: theod: nope :)
[15:03:42] IFrank00: has joined #RubyOnRails
[15:04:18] atomical: has joined #RubyOnRails
[15:05:05] Maletor: has joined #RubyOnRails
[15:05:13] atomical: has joined #RubyOnRails
[15:05:47] smathy: has joined #RubyOnRails
[15:06:20] B1n4r10: has joined #RubyOnRails
[15:09:12] adavia: has joined #RubyOnRails
[15:10:37] annlewis: has joined #RubyOnRails
[15:10:38] nfk|laptop: has joined #RubyOnRails
[15:10:43] bronson: has joined #RubyOnRails
[15:10:44] noodman: has joined #RubyOnRails
[15:12:00] Hazim: has joined #RubyOnRails
[15:12:00] Cork: how can one get a route key to match "the rest of the url"?
[15:12:19] Cork: i can't manage to get it to accept /
[15:12:24] FernandoBasso: How to do this in a better way? value="<% if params[:email] %><%= params[:email] %><% end %>"
[15:12:58] Cork: <%= params[:email] if params[:email] %
[15:13:42] Cork: or use the helpers to generate the field
[15:13:48] Cork: instead of raw html
[15:14:07] alex88: has joined #RubyOnRails
[15:14:36] ornerymoose: Hello, could someone offer some insight as to why my view is only returning 1 user/subscriber? There are 3 subscribers altogether. https://gist.github.com/ornerymoose/7262371548c5dfa4e7ed
[15:14:44] atomical: has joined #RubyOnRails
[15:14:52] ornerymoose: It is returning the last one only (ie Subscriber.last)
[15:15:07] ornerymoose: Subscription.last I mean.
[15:15:38] tenderlove: has joined #RubyOnRails
[15:15:58] hazim_: has joined #RubyOnRails
[15:16:43] owenjones: has joined #RubyOnRails
[15:16:45] jhn: has joined #RubyOnRails
[15:18:52] tubbo: ornerymoose: because it's just a hash and you keep overwriting the keys. the hash looks like { 'name' => something, 'phone_number' => something }. if you want a hash for each object, you probably want an array of hashes.
[15:19:06] silverdust: How can I have a table unique based on a role . i.e if exists and role is foo fail sign up else if role is bar and email does not exist allow sign up
[15:19:40] tubbo: ornerymoose: alternatively, you can do @all_users.map { |user| user.slice(:phone_number, :name).merge(categories: user.categories.map { |category| { name: category.name } }) }
[15:20:18] tubbo: ornerymoose: the slice() part of that returns a Hash, and merge() is a method on Hash that combines it with another Hash and returns that result, then in the merge() i'm mapping over user.categories in a similar way to return the name.
[15:20:38] fryguy: if my rails root is located at a symlink (/home/www/app/current for example) using capistrano. is there a way to make Rails.root return /home/www/app/current instead of /home/www/app/releases/{timestamp}
[15:20:54] tubbo: not that i know of
[15:21:11] tubbo: in theory that is a dangerous proposition
[15:21:17] ornerymoose: tubbo: thank you, that makes sense.
[15:22:14] fryguy: i'm storing some references to temporary data, and because that reference is timestamped, it becomes invalid after X releases
[15:22:43] fryguy: I guess I could just move the temporary storage out of Rails.root/tmp, but that doesn't seem very rails-like
[15:23:02] mrbubbles: has joined #RubyOnRails
[15:23:50] tubbo: fryguy: perhaps if you symlinked tmp/ to shared?
[15:24:12] tubbo: fryguy: though i would recommend making a folder in tmp/ and symlinking that so it's easier to blow away other tmp files
[15:24:16] fryguy: it is symlinked, that's the problem
[15:24:17] Rodya_: has joined #RubyOnRails
[15:24:31] fryguy: rails.root parses the symlink and returns the absolute path
[15:24:53] fryguy: instead of the symlinked path
[15:25:09] fryguy: it's doing the equivalent of calling readlink on the path
[15:25:39] tubbo: yeah i mean, i'd just move it out of Rails.root/tmp, maybe just doing it in /home/www/app/shared directly would help
[15:26:12] fryguy: yah, ideally i don't want the code to be dependent on a capistrano deployment though, because then it won't work in local dev for example
[15:27:52] Hazim: has joined #RubyOnRails
[15:29:38] User458764: has joined #RubyOnRails
[15:29:38] mag42c: has joined #RubyOnRails
[15:30:25] tubbo: you can always use /tmp
[15:33:04] gavit: ussually with a has_many you enter 'new data' like an order has_many order_lines, or a person has_many bank accounts. But what if the 'bank_account' already exists and I want to add a reference to it?
[15:33:29] Hazim: has joined #RubyOnRails
[15:33:41] krz: has joined #RubyOnRails
[15:34:42] uris: has joined #RubyOnRails
[15:35:37] gavit: I get "banks_attributes"=>{"0"=>{"banks"=>"2", "_destroy"=>"false"} which i want to do a Bank.find(id)
[15:36:29] smathy: has joined #RubyOnRails
[15:36:37] renegadeandy: Can a guru please help explain why when I run this code the result is always an empty @@clients???despite me invoking incoming() multiple times : https://gist.github.com/ArmyAndy/a3a4b1812c61843dabd8
[15:37:18] renegadeandy: im running the incoming() method multiple times, but @@clients remains empty when I call it in my view as per the gist
[15:37:58] victortyau: has joined #RubyOnRails
[15:40:44] rubyonrailed: has joined #RubyOnRails
[15:40:53] kuroro: has joined #RubyOnRails
[15:41:03] rodfersou: has joined #RubyOnRails
[15:42:21] Hazim: has joined #RubyOnRails
[15:43:32] teclator: has joined #RubyOnRails
[15:43:40] FernandoBasso: I have a verify_accounts_form, and a verify_accounts_list (views and methods on the controller). When I submit the form, I need to verify a list of emails and then list some emails the passed or failed some tests. Should I submit the for the verify_accounts_list, do the filtering and render the view or some other approach would be advisable?
[15:44:16] flashpoint9: has joined #RubyOnRails
[15:44:21] centrx: has joined #RubyOnRails
[15:44:38] FernandoBasso: I though about submitting to verify_accounts, and then redirecting to verify_accounts_list. Just that I don't save the results of the verification anywhere.
[15:44:40] DaniG2k: has joined #RubyOnRails
[15:44:43] FernandoBasso: s/though/thought/
[15:46:36] sonofdirt: has joined #RubyOnRails
[15:46:59] johnnegron: has joined #RubyOnRails
[15:47:09] sarink: has joined #RubyOnRails
[15:47:27] kies: has joined #RubyOnRails
[15:47:34] renegadeandy: tubbo: can you see if ive made a blunder in my understanding of variable scoping in my post above?
[15:48:38] fox_mulder_cp: oh, as i see my pundit works properly %)
[15:48:56] tubbo: renegadeandy: hmm, what are you trying to do there?
[15:49:19] tubbo: FernandoBasso: i suppose that would be best done in a validation of some kind
[15:49:32] tubbo: for the model backing whatever form is being submitted
[15:49:43] renegadeandy: tubbo: I want to make an array when the application launches, and each time incoming() is called, add something to the array. I then want ot be able to make a static call to a class level method to get the current array contents
[15:50:20] FernandoBasso: tubbo: That list of emails is not tied to model. It just happens to be the case that I must filter a list of all the people emails.
[15:50:44] FernandoBasso: It is not something that is done "to" a model.
[15:50:46] lxsameer: has joined #RubyOnRails
[15:50:46] lxsameer: has joined #RubyOnRails
[15:50:58] FernandoBasso: I am kind of confused about this :p
[15:52:03] tubbo: FernandoBasso: you can continue to leverage active_record's errors object by instantiating other POROs inside your model that actually do the work. this list of emails is provided by the user when they submit the form, i assume?
[15:52:24] FernandoBasso: Yes, you are right.
[15:52:43] pipework: He is also left. For that is the way of tubbo.
[15:53:25] renegadeandy: tubbo: without having the instance of FayeExtension
[15:55:01] lacrymology: In AModel, I've got a bunch of fields named foo_something, foo_anotherthing, foo_stuff, and I want to receive in the payload amodel[foo][something], amodel[foo][anotherthing], amodel[foo][stuff], rather than amodel[foo_something], etc. What's the right way to do that?
[15:55:23] renegadeandy: lacrymology: nested forms , google it :)
[15:55:25] ewnd9: has joined #RubyOnRails
[15:56:30] lacrymology: renegadeandy: this is not a nested resource. It's a bunch of related fields in the model
[15:57:31] renegadeandy: lacrymology: well its all to do with the names of the html elements???so you probably want to play around with the names of the html elements, rather than using the form helpers which are not helping you achieve the mapping you want
[15:58:20] renegadeandy: tubbo: I want to make an array when the application launches, and each time incoming() is called, add something to the array. I then want ot be able to make a static call to a class level method to get the current array contents without having an explicit FayeExtension instance
[15:58:23] tubbo: renegadeandy: hmm, i'm not sure a class variable is what you want. honestly, i've never had a good experience with class vars in ruby...
[15:58:31] lacrymology: there's no html this is an API and I'm going to be getting a JSON object
[15:58:36] renegadeandy: tubbo: whats my alternative here?
[15:58:49] tubbo: renegadeandy: why not have an explicit FayeExtension instance?
[15:59:09] lacrymology: I'm asking what to do in the controller to map params[amodel][foo][something] to params[amodel][foo_something]
[15:59:32] renegadeandy: tubbo: because the instance is created deep within the gem???and i dont want to have to have 2 monkey patches
[16:00:59] wildlander: has joined #RubyOnRails
[16:03:17] jacksparrow007: has joined #RubyOnRails
[16:05:51] Maletor: has joined #RubyOnRails
[16:06:20] sleungcy: has joined #RubyOnRails
[16:07:30] jtb___: has joined #RubyOnRails
[16:08:04] rdavila: has joined #RubyOnRails
[16:08:23] netzfisch: has joined #RubyOnRails
[16:09:25] tenderlove: has joined #RubyOnRails
[16:12:24] bmalum: has joined #RubyOnRails
[16:12:54] smathy: has joined #RubyOnRails
[16:15:58] arup_r: has joined #RubyOnRails
[16:17:07] arup_r: I wrote a line code like this for my one activeadmin controller, f.input :account_id, as: :select, collection: -> { Account.order('legal_company_name').collect { |a| ["#{a.legal_company_name} - #{a.id} - #{a.master_user.try(:email)}", a.id] } }, label: 'Account', include_blank: false but it is throwing error https://gist.github.com/aruprakshit/00f95c41d9c6f7779674
[16:17:19] arup_r: I am not getting what is wrong..
[16:17:59] annlewis: has joined #RubyOnRails
[16:18:13] akshat: has joined #RubyOnRails
[16:18:38] centrx: arup_r, Why is collection a Proc?
[16:19:10] edwinvdgraaf: has joined #RubyOnRails
[16:19:10] njero: has joined #RubyOnRails
[16:19:10] arup_r: That is how ActiveAdmin suggest to write for lazy loading.. otherwise it gives error..
[16:20:53] kmckelvi1: has joined #RubyOnRails
[16:20:58] centrx: arup_r, It looks like the error is in formtastic
[16:22:05] jhn: has joined #RubyOnRails
[16:22:42] soahccc: I'm reading about updating from 4.1 => 4.2 and stumbled over "masked authenticity tokens"... The tokens in forms are different on each request now. Does someone have a link on why that is good and what it changes? I don't get it from the short paragraph in the updating docs
[16:25:51] Hazim: has joined #RubyOnRails
[16:26:10] jtb__: has joined #RubyOnRails
[16:27:17] bronson: has joined #RubyOnRails
[16:27:29] Axilla: hey all, how can I ignore an id here, if its not found.. instead of breaking down and returning a 400, i'd like to just ignore and find the rest of the assets in the array. @assets = current_user.client.assets.where(id: ids).order("created_at desc")
[16:28:12] Axilla: ids = params[:ids].split(",")
[16:29:02] arup_r: params[:ids].to_s.split(",")
[16:29:10] jtb___: has joined #RubyOnRails
[16:29:11] Axilla: its already a string
[16:29:31] arup_r: if it is `nil`.. `.to_s` is a guard
[16:29:45] Axilla: its not nil, its a non existant ID..
[16:29:55] arup_r: then.. no issue
[16:30:01] arup_r: youu query is perfect
[16:30:17] claytonzaugg: has joined #RubyOnRails
[16:30:44] arup_r: what do you meant by `how can I ignore an id here, if its not found..` ?
[16:30:44] colleenmcguckin: has joined #RubyOnRails
[16:30:45] Axilla: for instance if i have 2 ids in the array, 1,2 and 2 doesn't exist but 1 does, i want to ignore the 400 error that is raised because 2 doesn't exist.
[16:31:04] renegadeandy: arup_r: can you help me understand why @@clients is always [] when I make the call seen in the view on this gist : https://gist.github.com/ArmyAndy/a3a4b1812c61843dabd8 despite making multiple calls to the incoming() method
[16:31:06] puria: has joined #RubyOnRails
[16:31:07] arup_r: .Where() will not give 404 evenr
[16:31:36] tbuehlmann: axilla, where(id: ids) shouldn't raise an error, right?
[16:31:55] arup_r: axilla: messed up with find() :)
[16:32:47] shibabu: has joined #RubyOnRails
[16:32:53] arup_r: renegadeandy: this huge code and without data, not easy to explain you why is that ?
[16:34:15] suchness: has joined #RubyOnRails
[16:34:42] Axilla: yea you're right..
[16:34:56] Axilla: i just switched to the .where issue must be somewhere else now.. thanks
[16:35:03] Axilla: digging more =/
[16:35:11] greengriminal: has joined #RubyOnRails
[16:35:31] jbrhbr: has joined #RubyOnRails
[16:35:55] disgrntld: has joined #RubyOnRails
[16:37:11] Yomero2: has joined #RubyOnRails
[16:37:21] FLeiXiuS`: has joined #RubyOnRails
[16:38:17] arash: has joined #RubyOnRails
[16:40:26] Hates_: renegadeandy: and you've confirmed that your override of incoming is being called?
[16:42:58] _Tariq: has joined #RubyOnRails
[16:43:10] darkxploit: has joined #RubyOnRails
[16:43:15] arash: has joined #RubyOnRails
[16:43:27] edwinvdgraaf: has joined #RubyOnRails
[16:43:27] Hates_: renegadeandy: tbh relying on class variables might not be a good idea as you can't guarantee that requests will be available for all requests
[16:43:39] Hates_: renegadeandy: I mean the value
[16:44:10] podman: has joined #RubyOnRails
[16:45:10] Rodya_: has joined #RubyOnRails
[16:45:19] banister: has joined #RubyOnRails
[16:45:57] Croves: has joined #RubyOnRails
[16:46:11] Polysics: has joined #RubyOnRails
[16:47:19] Croves: Hi! I keep getting this ""ImageMagick/GraphicsMagick is not installed" error in my Shoppe. I already installed `libmagickwand-dev` with apt-get, but still nothing
[16:47:20] B1n4r10: has joined #RubyOnRails
[16:47:46] Hates_: renegadeandy: tbh class variables usually have a bad reputation and are avoided
[16:48:08] njero: has joined #RubyOnRails
[16:48:12] Polysics: hello! I have a setup where Company has_many Brands through CompanyBrands
[16:48:26] Hates_: Croves: have you installed imagemagick?
[16:48:32] Polysics: and a form where I just use f.input :brands, as: :check_boxes
[16:49:47] Polysics: CompanyBrand validates_presence_of Company
[16:49:54] njero: has joined #RubyOnRails
[16:50:01] Polysics: but with that validation, the creation of a new Company where I also add the Brands fails
[16:50:09] Polysics: taking out the validation makes it work
[16:50:24] Polysics: am I right in saying this is "how Rails works"?
[16:50:30] ElFerna: has joined #RubyOnRails
[16:50:37] speakingcode: has joined #RubyOnRails
[16:50:46] Croves: Hates_: I just did it... and now it's working
[16:50:48] Croves: Thank you!
[16:51:01] Hates_: Croves: np :)
[16:52:07] Fernando1: has joined #RubyOnRails
[16:52:22] Polysics: a few posts seem to imply the above is intended because of object creation order
[16:52:30] Hates_: polysics: You're using simple_form?
[16:53:06] Polysics: Hates_: yes, this is part of inherited_resources but it's simple_form
[16:53:13] aaronr: has joined #RubyOnRails
[16:53:22] Polysics: (before you say anything, I inherited the inherited_resources :D )
[16:53:26] Hates_: looking at this, perhaps you need f.association and not f.input? https://github.com/plataformatec/simple_form#associations
[16:53:54] [Butch]: has joined #RubyOnRails
[16:55:32] johnnegron: has joined #RubyOnRails
[16:56:49] Polysics: Hates_: interesting enough, I was wrong. IH does not use simple_form, because it does not know about the #association method
[16:57:20] Hates_: polysics: it's also possible that it's using an older version, as I've not heard of it until I just looked
[16:57:37] eggie5: has joined #RubyOnRails
[16:57:43] Hates_: polysics: f.input with as is normally simple_form
[16:57:50] Polysics: I think #association has been there for a long time but I might be wrong
[16:58:01] IFrank00: has joined #RubyOnRails
[16:58:20] colleenmcguckin: has joined #RubyOnRails
[17:00:38] sleungcy: has joined #RubyOnRails
[17:00:42] Polysics: I'll chalk it up to some weird initialization issue
[17:01:24] tubbo: renegadeandy: i'm not sure what you're trying to do, but if you're like monkey-patching a class for Faye i would really start to question whether this is the only place you can do this
[17:02:18] maesitos: has joined #RubyOnRails
[17:03:52] tenderlove: has joined #RubyOnRails
[17:04:13] moeabdol: has joined #RubyOnRails
[17:05:03] FLeiXiuS: has joined #RubyOnRails
[17:05:03] FLeiXiuS: has joined #RubyOnRails
[17:05:09] sarink: has joined #RubyOnRails
[17:06:41] Maletor: has joined #RubyOnRails
[17:07:00] cold_zero: has joined #RubyOnRails
[17:07:55] Polysics: Faye is easy enough to extend, generally speaking
[17:08:10] codeurge: has joined #RubyOnRails
[17:11:40] nettoweb: has joined #RubyOnRails
[17:12:27] d0nn1e: has joined #RubyOnRails
[17:12:50] rakm: has joined #RubyOnRails
[17:15:09] cold_zero: Hello. Do you see any messages from me ?
[17:15:18] cold_zero: just for testing purposes
[17:15:26] tildes: has joined #RubyOnRails
[17:15:34] hololeap: has joined #RubyOnRails
[17:15:36] ziggy: has joined #RubyOnRails
[17:15:37] ziggy: has joined #RubyOnRails
[17:16:40] jhass: cold_zero: yes
[17:17:01] Hates_: cold_zero: yup
[17:17:26] cold_zero: how do you send messages using to me ?
[17:17:38] cold_zero: I mean I got notification and so on
[17:17:55] jhass: just by including your nick in the message cold_zero
[17:18:15] cold_zero: jhass: like this
[17:18:26] cold_zero: jhass one more attempt
[17:18:29] User458764: has joined #RubyOnRails
[17:18:45] annlewis: has joined #RubyOnRails
[17:18:56] cold_zero: I new to rails and I'd like to ask question about DB
[17:19:07] Fernando1: has joined #RubyOnRails
[17:19:10] cold_zero: it seems like a lot of projects using PostgreSQL
[17:19:20] cold_zero: does anybody use MySQL?
[17:19:32] ElFerna: has joined #RubyOnRails
[17:20:12] edwinvdgraaf: has joined #RubyOnRails
[17:20:21] slash_nick: cold_zero: !use
[17:20:21] helpa: cold_zero: Don't ask "does anyone use <thing>?". It's better to just state your problem and if anyone has used <thing> they will most likely answer.
[17:20:29] Sigfrid: has joined #RubyOnRails
[17:21:02] mrbubbles: has joined #RubyOnRails
[17:21:13] markh: has joined #RubyOnRails
[17:21:52] markh: has left #RubyOnRails: ()
[17:21:56] cold_zero: actually I don't have any problem yet. I just know some MySQL and I wonder can I still use it or I should learn PostgreSQL?
[17:22:19] jhass: cold_zero: https://www.youtube.com/watch?v=emgJtr9tIME watch this and tell me you still want to use mysql :P
[17:22:27] seaworthy: has left #RubyOnRails: ()
[17:22:27] kegan_: has joined #RubyOnRails
[17:22:36] dragonkh: has joined #RubyOnRails
[17:22:45] Polysics: although frankly if you are just starting out you can use MySQL without issues
[17:22:45] Maletor: has joined #RubyOnRails
[17:23:14] Polysics: there are a lot of people who are crazy for PG then never use the features :D
[17:23:37] jhass: it just increases the pain when you have to migrate later and postgres is rejecting all your data inconsistencies mysql swallowed
[17:24:01] Polysics: how many times have you migrated an app between DBs? seriously?
[17:24:10] slash_nick: polysics: several
[17:24:12] cold_zero: so you suggesting learn PostgreSQL because it makes my life easier latter
[17:24:23] lacrymology: this is really weird.. some of my tests are failing, and when I see the diffs between the expected and found objects, I see that the found objects are from the development db, rather than testing.
[17:24:28] lacrymology: anyone found something like this?
[17:24:29] Polysics: slash_nick: I would never want your job, sorry :)
[17:24:39] slash_nick: cold_zero: there's not a steep learning curve... as you know some mysql, you'll be just as proficient with one as with the other
[17:24:48] slash_nick: polysics: good, you can't have it
[17:25:51] lacrymology: it only seems to happen in one test
[17:25:55] cold_zero: slash_nick: you mean if I have good understand or proficient how to work with DB in general and all concept shifting to other DB will be not huge pain
[17:26:26] slash_nick: cold_zero: exactly
[17:27:16] rakm: has joined #RubyOnRails
[17:27:48] sbarg: has joined #RubyOnRails
[17:27:58] cold_zero: slash_nick: thank you, you helped me decide because I have several books like High performance MySQL from which I'd like to learn. Then I can just to PostgreSQL if needed.
[17:28:28] cold_zero: I was going to say 'jump to PostgreSQL'
[17:28:30] baweaver: has joined #RubyOnRails
[17:28:40] kmckelvi1: has joined #RubyOnRails
[17:28:46] slash_nick: cold_zero: no problem... good luck to you :)
[17:29:29] sbarg: has left #RubyOnRails: ()
[17:32:25] Pro|: has joined #RubyOnRails
[17:32:39] jamo: has joined #RubyOnRails
[17:32:40] agit0: has joined #RubyOnRails
[17:32:52] elton: has joined #RubyOnRails
[17:33:07] lacrymology: weird.. It had something to do with me doing MessageBoard.connection on a separate rails console terminal
[17:34:16] paulodiniz: has joined #RubyOnRails
[17:37:21] dici: has joined #RubyOnRails
[17:37:49] bronson: has joined #RubyOnRails
[17:38:25] goodcodeguy: has joined #RubyOnRails
[17:39:26] pramsky: has joined #RubyOnRails
[17:39:47] cold_zero: jhass: I've watched the link you gave me. Yeah, this is definitely not a good sign for MySQL
[17:40:27] jhass: cold_zero: and there are tons of similar issues
[17:40:40] jhass: like ut8 isn't UTF8, utf8mb4 is
[17:41:20] cold_zero: jhass: I see. Would you argue to use PostreSQL from your experience point of view?
[17:42:30] cold_zero: jhass: I just started recently to learn how to work with DB and have few books. All of them mostly about MySQL. Is it hard for me then jump to PostgreSQL later?
[17:42:52] jhass: that's different for each individual
[17:42:54] cold_zero: or should throw them away and start to learn PostgreSQL from beginning
[17:43:20] jhass: well, there are not that different on the high level
[17:43:28] Polysics: cold_zero: unless you are going for a DBA career, the two databases are essentially the same to you
[17:43:52] Polysics: plus or minus the information here: http://guides.rubyonrails.org/active_record_postgresql.html
[17:43:54] slash_nick: cold_zero: i wouldn't throw the books away... but i'd be brave and start with psql.. your new books will be more like this: http://www.postgresql.org/docs/9.3/static/sql-copy.html
[17:44:08] Gizmokid2005: has joined #RubyOnRails
[17:44:17] B1n4r10: has joined #RubyOnRails
[17:44:19] slash_nick: or http://www.postgresql.org/docs/9.3/static/sql-commands.html
[17:44:31] cold_zero: I think you made few good point why PostgreSQL can be a better choice, but I stick to MySQL while I'm learning and then shift to PostgreSQL when I feel myself ready
[17:45:28] shanemcd: has joined #RubyOnRails
[17:45:41] cold_zero: thank for your help and advice. :)
[17:46:08] yos7ph: has joined #RubyOnRails
[17:46:38] NBarnes: has joined #RubyOnRails
[17:46:45] Hates_: cold_zero: as long as you're not doing anything funky then most of your stuff will be easily portable between the two
[17:49:52] Sawbones: has joined #RubyOnRails
[17:51:32] ElFerna: has joined #RubyOnRails
[17:51:43] jhn: has joined #RubyOnRails
[17:52:17] jbrhbr: has joined #RubyOnRails
[17:52:23] The_Phoenix: has joined #RubyOnRails
[17:53:02] matthias_: has joined #RubyOnRails
[17:53:03] njero: has joined #RubyOnRails
[17:53:41] mrtomme: has joined #RubyOnRails
[17:53:44] based_pdev_: has joined #RubyOnRails
[17:53:44] based_pdev: has joined #RubyOnRails
[17:53:57] Fernando1: has joined #RubyOnRails
[17:54:29] kmckelvi1: has joined #RubyOnRails
[17:55:22] chadhs: has joined #RubyOnRails
[17:55:52] bigbob: has joined #RubyOnRails
[17:56:03] ElFerna: has joined #RubyOnRails
[17:57:04] djellemah: has joined #RubyOnRails
[17:57:43] sbarg1: has joined #RubyOnRails
[17:57:52] johnnegron: has joined #RubyOnRails
[17:58:17] tenderlove: has joined #RubyOnRails
[18:00:17] SteenJobs: has joined #RubyOnRails
[18:00:24] baweaver: has joined #RubyOnRails
[18:00:33] maesitos: has joined #RubyOnRails
[18:01:12] gaustin: has joined #RubyOnRails
[18:01:42] adac: has joined #RubyOnRails
[18:01:56] `based_pdev`: has joined #RubyOnRails
[18:02:50] jessemcgilallen: has joined #RubyOnRails
[18:05:47] sleungcy: has joined #RubyOnRails
[18:06:09] colleenmcguckin: has joined #RubyOnRails
[18:06:22] based_pdev: has joined #RubyOnRails
[18:06:49] paulodiniz: has joined #RubyOnRails
[18:07:40] renegadeandy: I would appreciate everyone from this fantastic community helping with this : http://stackoverflow.com/questions/34229703/ruby-on-rails-global-class-variable-not-updating-when-changed I know tubbo has taken a look as has elaptics
[18:08:11] RegulationD: has joined #RubyOnRails
[18:09:12] cirn0: has joined #RubyOnRails
[18:11:08] djbkd: has joined #RubyOnRails
[18:11:22] mrbubbles: has joined #RubyOnRails
[18:12:02] ornerymoose: has joined #RubyOnRails
[18:12:07] based_pdev_: has joined #RubyOnRails
[18:13:20] NBarnes: Does anybody know how I might check Sidekiq's status during runtime? I want to be able to fail gracefully if Sidekiq isn't running (like, maybe have an error that says 'Sidekiq not running' instead of some random error someplace down the line).
[18:13:36] duderonomy: Hi. I am using Rails 4. Can somebody help identify what entity is not given the block? http://pastie.org/10624421
[18:14:02] SteenJobs: has joined #RubyOnRails
[18:14:13] duderonomy: For comparison, this is what Hartl's Rails 3 console displays: http://i.imgur.com/07ebajD.jpg
[18:14:14] NBarnes: Looks like a strong parameters error, duderonomy.
[18:14:14] bojuana: has joined #RubyOnRails
[18:14:29] colleenmcguckin: has joined #RubyOnRails
[18:14:45] NBarnes: If there's a Rails 3 -> Rails 4 delta in play, that increases the sensation that it's a strong params issue.
[18:15:21] duderonomy: Thank you. I will do some reading on that. Yes, I had a hunch about that but have not sorted it out yet.
[18:19:04] nertzy: has joined #RubyOnRails
[18:19:31] annlewis: has joined #RubyOnRails
[18:20:31] berserk_ren: has joined #RubyOnRails
[18:25:07] hahuang65: has joined #RubyOnRails
[18:25:39] Jasaka: has joined #RubyOnRails
[18:25:41] DukeDave: Is there a pattern for extending a model with scopes, without polluting the model itself?
[18:25:41] DukeDave: I.e. I have some scope which would be useful for a report, but which don't belong on the model itself.
[18:26:13] DukeDave: There's stuff like, "Extract Query Objects", here: http://blog.codeclimate.com/blog/2012/10/17/7-ways-to-decompose-fat-activerecord-models/
[18:26:14] colleenmcguckin: has joined #RubyOnRails
[18:26:28] versatiletech: has joined #RubyOnRails
[18:26:44] DukeDave: But I'd rather be able to use, e.g. default_scope
[18:26:46] berserk_ren: has joined #RubyOnRails
[18:26:47] yardenbar: has joined #RubyOnRails
[18:27:15] lacrymology: is there a way to join with a second-degree relation?
[18:27:26] lacrymology: A has B, B has C, A.join(c)
[18:29:01] jhass: .joins(:b => :c) works iirc
[18:30:04] lacrymology: jhass: yeah, I just found that. Thanks
[18:32:33] lacrymology: I can't recall, what's the right join to use when I want a join b to also return rows where a.b is nil?
[18:32:43] lacrymology: inner join doesn't
[18:33:12] lacrymology: left outer join is what I want
[18:33:28] shibabu: has joined #RubyOnRails
[18:35:04] bronson: has joined #RubyOnRails
[18:35:16] elton: has joined #RubyOnRails
[18:36:56] B1n4r10: has joined #RubyOnRails
[18:37:22] berserk_ren: has joined #RubyOnRails
[18:37:39] bmalum: has joined #RubyOnRails
[18:38:07] adac: has joined #RubyOnRails
[18:39:09] User458764: has joined #RubyOnRails
[18:40:08] User458764: has joined #RubyOnRails
[18:41:16] tubbo: i noticed this error message in RuboCop: "Do not use Time.now without zone. Use one of Time.zone.now, Time.now.current, Time.now.in_time_zone, Time.now.utc, Time.now.getlocal, Time.now.iso8601, Time.now.jisx0301, Time.now.rfc3339, Time.now.to_i, Time.now.to_f instead."
[18:41:52] tubbo: my question is are these just formatting the output differently, or do any of these Time.now replacements actively change the mechanics of what you're doing?
[18:42:56] desmondhume: has joined #RubyOnRails
[18:43:04] tbuehlmann: they change the timezone iirc
[18:43:56] tbuehlmann: a guess: Time.now is taking the nodes OS timezone, Time.current the setup timezone from your config/application.rb
[18:44:22] desmondhume: has joined #RubyOnRails
[18:45:01] ElFerna: has joined #RubyOnRails
[18:45:54] Frem: has joined #RubyOnRails
[18:46:06] tubbo: tbuehlmann: i understand they're all replacements for Time.zone, don't understand if e.g. Time.zone.now and Time.now.in_time_zone return the same thing.
[18:46:37] tbuehlmann: dunno, never had to use that, always using Time.current
[18:46:53] tubbo: agreed. i changed all my stuff to Time.zone.now
[18:49:10] Scient: tbuehlmann is spot on
[18:49:17] Scient: Time.now is your OS timezone based time
[18:49:24] Scient: Time.current and other shit is your app configuration based
[18:49:54] Scient: same applies to Date.current and Date.today ? if im not mistaken
[18:49:57] Scient: or some other Date method :P
[18:51:15] tubbo: Scient: as is Time.zone.now
[18:52:23] Scient: the Time.now vs other mehtods is one of the biggest gotchas imo if you havent ran into it before
[18:52:31] rakm: has joined #RubyOnRails
[18:52:36] tenderlove: has joined #RubyOnRails
[18:52:36] Scient: i cant count the times when ive seen data or reports being off because of using Time.now in queries :D
[18:52:43] bmalum_: has joined #RubyOnRails
[18:52:45] netzfisch: has joined #RubyOnRails
[18:53:43] NBarnes: Every time I touch Date or Time, I make sure to re-read the gotchas so that I'm getting what's intended. It's pretty complicated stuff, even with ActiveSupport's help.
[18:53:49] nfk|laptop: has joined #RubyOnRails
[18:54:03] tubbo: Scient: i had the opposite issue occur. i had to use system time due to time zone conversions.
[18:54:11] tubbo: in a past job
[18:54:28] tubbo: scheduling TV content is hard, but it's even harder for shitty developers.
[18:55:10] symbol: has joined #RubyOnRails
[18:56:48] bmalum: has joined #RubyOnRails
[19:00:09] kmckelvi1: has joined #RubyOnRails
[19:01:57] Pazician: has joined #RubyOnRails
[19:04:59] tb1: has joined #RubyOnRails
[19:05:15] targaf_: has left #RubyOnRails: ()
[19:05:18] berserk_ren: has joined #RubyOnRails
[19:05:22] targaf: has joined #RubyOnRails
[19:06:47] bigbob: has joined #RubyOnRails
[19:07:37] jtb__: has joined #RubyOnRails
[19:08:07] lacuna: has joined #RubyOnRails
[19:08:08] lacuna: has joined #RubyOnRails
[19:08:25] srinidhi: has joined #RubyOnRails
[19:08:41] Trynemjoel: has joined #RubyOnRails
[19:09:04] moeabdol: has joined #RubyOnRails
[19:09:49] dionysus69: has joined #RubyOnRails
[19:12:02] jtb__: has joined #RubyOnRails
[19:12:32] sbarg: has joined #RubyOnRails
[19:12:41] dragonkh: has joined #RubyOnRails
[19:17:37] lacuna: has joined #RubyOnRails
[19:18:51] rdavila: has joined #RubyOnRails
[19:20:18] annlewis: has joined #RubyOnRails
[19:21:28] shock_one: has joined #RubyOnRails
[19:21:28] BlackCoyote: has joined #RubyOnRails
[19:22:16] colleenmcguckin: has joined #RubyOnRails
[19:22:22] lacuna: has joined #RubyOnRails
[19:22:23] lacuna: has joined #RubyOnRails
[19:22:24] kadoppe: has joined #RubyOnRails
[19:22:47] jgt: has joined #RubyOnRails
[19:23:17] ethe: has joined #RubyOnRails
[19:24:35] johnnegron: has joined #RubyOnRails
[19:25:33] dbnoch: has joined #RubyOnRails
[19:26:50] colleenmcguckin: has joined #RubyOnRails
[19:27:03] berserk_ren: has joined #RubyOnRails
[19:29:19] lemur: has joined #RubyOnRails
[19:30:17] theod: has joined #RubyOnRails
[19:32:12] Trynemjoel: has joined #RubyOnRails
[19:33:41] Darkman738: has joined #RubyOnRails
[19:34:28] _djbkd: has joined #RubyOnRails
[19:34:33] lacuna_: has joined #RubyOnRails
[19:34:36] colleenm_: has joined #RubyOnRails
[19:34:45] goodcodeguy: has joined #RubyOnRails
[19:35:02] rubyonrailed: has joined #RubyOnRails
[19:35:28] AndroidLoverInSF: has joined #RubyOnRails
[19:35:55] lacuna_: has joined #RubyOnRails
[19:36:02] elton: has joined #RubyOnRails
[19:36:23] rubyonra_: has joined #RubyOnRails
[19:40:46] annlewis: has joined #RubyOnRails
[19:41:41] annlewis_: has joined #RubyOnRails
[19:42:08] Dbugger: has joined #RubyOnRails
[19:42:32] Darkman738: I'm attempting to build a tableless model for input validation but I'm running into issues creating custom validation methods
[19:42:37] Darkman738: I haven't found much in the way of examples to work from so I don't have much
[19:42:39] Dbugger: Hey fellas. Anyone here has experience with Paperclip? For some reason I am always getting missing.png. The entry in database is completed, but my folder "images" is not working...
[19:43:18] ElFerna: has joined #RubyOnRails
[19:43:19] Dbugger: Here is the model: http://hastebin.com/ibubuyoxip.ruby
[19:43:40] nettoweb: has joined #RubyOnRails
[19:45:03] paulodiniz: has joined #RubyOnRails
[19:45:45] Darkman738: http://pastie.org/private/2vgyde6t3kx4463rjjw# is my model, basically trying to use an existing method to throw a new exception.
[19:45:54] shanemcd: has joined #RubyOnRails
[19:46:15] flashpoint9: has joined #RubyOnRails
[19:49:33] qejk: has joined #RubyOnRails
[19:49:43] mag42c: has joined #RubyOnRails
[19:49:48] lacuna: has joined #RubyOnRails
[19:54:24] jbrhbr1: has joined #RubyOnRails
[19:55:52] paulodiniz: has joined #RubyOnRails
[19:56:08] sarink: has joined #RubyOnRails
[19:57:04] jessemcgilallen: has joined #RubyOnRails
[19:58:33] djbkd: has joined #RubyOnRails
[20:00:19] lacuna: has joined #RubyOnRails
[20:00:19] lacuna: has joined #RubyOnRails
[20:01:25] bronson: has joined #RubyOnRails
[20:01:30] maesitos: has joined #RubyOnRails
[20:02:06] Hates_: dbugger: and there are no errors in your logs?
[20:02:06] sbarg1: has joined #RubyOnRails
[20:02:34] Hates_: dbugger: you have imagemagick installed?
[20:03:33] RegulationD: has joined #RubyOnRails
[20:03:57] djbkd: has joined #RubyOnRails
[20:11:48] kegan_: has joined #RubyOnRails
[20:12:21] chipotle: has joined #RubyOnRails
[20:19:56] replay: has joined #RubyOnRails
[20:20:54] jstransky: has joined #RubyOnRails
[20:21:55] nettoweb: has joined #RubyOnRails
[20:22:05] jstransky: What should I use to handle image uploads in Rails?
[20:22:52] tbuehlmann: jstransky, I like Refile, but that really only works well with a CDN in front
[20:22:54] kegan_: i'm partial to carrierwave
[20:23:03] prookie: has joined #RubyOnRails
[20:26:01] NBarnes: Last time I ran into the need for image uploads, I tried and tried and TRIED to make Paperclip do what I needed and... yeah, not so much. Carrierwave uber alles.
[20:26:58] jstransky: Ok, carrierwave seems to be what my co-worker is fighting with atm. Not really sure what the issue is. Probably a requirement for it work with something non-standard.
[20:27:13] yfeldblum: has joined #RubyOnRails
[20:27:14] jstransky: Good to hear its been successful for others though
[20:28:03] prookie: hi. my application gets a request header with every request, that indicates if the request was made from within my smartphone app or not. so "request.env['HTTP_APPREQUEST']" gets set. i would like to have a "global" helper function to retrieve this info. how can i do this?
[20:28:48] kegan_: jstransky i had the same experience as nbarnes with paperclip, as well as nifty-attachments
[20:29:00] juddey: has joined #RubyOnRails
[20:29:22] kegan_: but if you aren't going for carrierwave, what else have you tried
[20:30:21] rhizome: prookie: helper method in application controller
[20:30:24] prookie: i tried setting a constant for the ApplicationHelper via "ApplicationHelper.const_set" and then just return this value in the helper function, but that gets shared between request doesn't it?
[20:30:28] nickenchuggets: has joined #RubyOnRails
[20:30:28] nickenchuggets: has joined #RubyOnRails
[20:30:34] rhizome: const_set?
[20:30:38] prookie: yeah but does the helper gets the request?
[20:31:00] prookie: i would like to not pass the request to the helper method all the time
[20:31:10] rhizome: all requests go through application controller by default, yes
[20:32:12] prookie: hmm so transferring the helper method from ApplicationHelper to ApplicationController would do it?
[20:32:31] rhizome: it's a good first step :)
[20:32:40] rhizome: i don't know how your method is written
[20:33:17] jstransky: kegan_: turns out its an issue of getting it to work with contenttools
[20:33:17] baweaver: has joined #RubyOnRails
[20:33:35] jstransky: which doesn???t provide a native image handling interface
[20:33:47] rhizome: prookie: frankly i'd make it a query method
[20:34:16] prookie: what i currently have is this: http://pastebin.com/HUUVX396
[20:34:17] rhizome: "contenttools"
[20:34:24] Darkman738: has joined #RubyOnRails
[20:34:43] rhizome: why are you including ApplicationHelper
[20:35:03] prookie: to make it possible to set the constant for the class :D
[20:35:17] rhizome: def app_request?; !!(request.env['blah'] == 'foo'); end
[20:35:55] bronson: has joined #RubyOnRails
[20:36:05] lemur: has joined #RubyOnRails
[20:36:35] Darkman738: has joined #RubyOnRails
[20:36:43] elton: has joined #RubyOnRails
[20:37:20] tubbo: seems kinda bullshit yeah
[20:37:43] tubbo: webview_request? could just be defined as request.env['HTTP_APPREQUEST'].present?
[20:38:02] shibabu: has joined #RubyOnRails
[20:38:27] shanemcd: has joined #RubyOnRails
[20:38:53] prookie: i mean the problem would be inexistant, if the request object always gets passed to the ApplicationHelper automagically?
[20:39:07] rhizome: what problem exactly?
[20:39:15] gooberfoo: has joined #RubyOnRails
[20:39:26] rhizome: but yes, you can essentially use the request object anywhere
[20:40:34] prookie: so this would be totally working? http://pastie.org/private/2lxazt6hcxxos4z91gsx9q
[20:40:57] rhizome: i know a way to find out
[20:41:41] prookie: let me see...
[20:43:02] atomical: has joined #RubyOnRails
[20:43:49] rubyonrailed: has joined #RubyOnRails
[20:44:44] prookie: ah. it has been some time that i implemented this. i just realized i need the detection in a controller. "undefined method `webview_request?' for #<EventsController:0x007fcefd707dc0>". so a controller does not have access to helper methods
[20:45:08] prookie: is "include ApplicationHelper" in the controller a good or bad idea?
[20:46:05] gooberfoo: has joined #RubyOnRails
[20:47:22] annlewis: has joined #RubyOnRails
[20:49:31] prookie: i mean architecturally
[20:50:02] rhizome: eh, try restarting
[20:50:13] rhizome: (the app, not your computer)
[20:50:49] prookie: i did restart it
[20:50:58] havenwood: has joined #RubyOnRails
[20:51:08] somedude: has joined #RubyOnRails
[20:51:21] norc: has joined #RubyOnRails
[20:52:34] gooberfoo: has joined #RubyOnRails
[20:52:35] rhizome: wait, that's still your helper
[20:53:04] desmondhume: has joined #RubyOnRails
[20:53:45] jmarchello: has joined #RubyOnRails
[20:56:45] jmarchello: Good afternoon, I have a rails app serving as a json api for a mobile application. My question is this, is there a way to format my request from the mobile app so that I can simply do an Object.new(object_params) to build the object? Nested attributes are a factor and this is a Rails 4 application.
[20:57:26] jmarchello: Do I just have to look at a normal rails request and do my best to format my json the same way?
[20:58:09] JakFrist: has joined #RubyOnRails
[20:58:20] gooberfoo: has joined #RubyOnRails
[20:58:27] prookie: oh hell... you're right
[20:58:55] AzaToth: has joined #RubyOnRails
[20:59:04] ciree: jmarchello: Thats an option, but you can also have your API calls do the mapping of the parameters
[20:59:48] ciree: fetch('/my/rails/api').then((res) => res.json()).then(json => /* do logic to format it nice for my models*/)
[20:59:59] ciree: try not to over think it
[21:00:13] jmarchello: ciree: as in just picking values from the params hash and loading them all in one by one?
[21:00:34] ciree: its really your call, since you said model you probably need static typing
[21:00:38] ciree: is it a native app?
[21:00:49] ciree: android, ios?
[21:01:27] ciree: not to familar with the ecosystem there, but dont over think it
[21:01:48] prookie: rhizome: now it is not possible to access the methon in the views. lol
[21:01:56] ciree: say your Object.new(name, email, integer, otherthing)
[21:02:01] ciree: then just pick those out of the response
[21:02:07] jmarchello: ciree: the code you provided earlier did not make sense to me. What are you doing there?
[21:02:17] jmarchello: ciree: ie. fetch('/my/rails/api').then((res) => res.json()).then(json => /* do logic to format it nice for my models*/)
[21:02:18] ciree: that was javascript, sorry lol
[21:02:22] ciree: basically
[21:02:32] ciree: data = makeApiCallFunction()
[21:02:43] ciree: then pick out the keys you want
[21:03:02] rhizome: prookie: there are worse problems
[21:03:19] Pazician: has joined #RubyOnRails
[21:03:44] gooberfoo: has joined #RubyOnRails
[21:04:05] sucks: has joined #RubyOnRails
[21:04:07] hardtail: has joined #RubyOnRails
[21:04:27] baweaver: has joined #RubyOnRails
[21:06:10] gooberfoo: I am new to ruby on rails, and I ran rails server and got an error, and need help resolving it. Here is the error http://pastebin.com/92BZAV1n
[21:07:09] craysiii: i thought helpa would post it to gist for you?
[21:07:27] netzfisch: has joined #RubyOnRails
[21:08:16] gooberfoo: I will post it there, and see what happens.
[21:10:49] gooberfoo: this might sound stupid, but others will be able to comment if I made it public ?
[21:11:04] snophey: has joined #RubyOnRails
[21:11:41] prookie: i have to go now. thanks for you help rhizome!
[21:11:42] rhizome: craysiii: that would be a good idea
[21:11:47] rhizome: prookie: no prob
[21:13:13] Darkman738: has joined #RubyOnRails
[21:13:23] claytonzaugg: has joined #RubyOnRails
[21:14:32] bronson: has joined #RubyOnRails
[21:16:06] Darkman738: has joined #RubyOnRails
[21:16:44] gooberfoo: Well, still need help to why I got an error. Here is the error when running rails server http://pastie.org/10626224r
[21:17:07] rhizome: not really reading the channel are ya
[21:17:11] craysiii: rhizome maybe i was thinking of ruboto in #ruby, but yes a good idea :)
[21:17:20] gooberfoo: sorry here is the right link http://pastie.org/10626224
[21:17:30] owenjones: has joined #RubyOnRails
[21:17:45] banister: has joined #RubyOnRails
[21:18:10] Hates_: gooberfoo: you have the bundler gem installer?
[21:18:25] sucks: has joined #RubyOnRails
[21:19:02] daivyk: has joined #RubyOnRails
[21:20:40] Spami: has joined #RubyOnRails
[21:22:29] gooberfoo: i apologize for asking but how would i know ?
[21:22:46] gooberfoo: I am not even sure what the error is even telling me that I am missing
[21:23:29] urkle: has joined #RubyOnRails
[21:23:56] dopieee: has joined #RubyOnRails
[21:26:06] mercwithamouth: has joined #RubyOnRails
[21:28:24] lemur: has joined #RubyOnRails
[21:29:00] AndroidLoverInSF: has joined #RubyOnRails
[21:29:46] mercwithamouth: can someone point me in the right direction here? i'm trying to attach my families table to users. http://pastebin.com/Hv5DAEdB
[21:30:52] Cohedrin: has joined #RubyOnRails
[21:31:09] isjaylee: has joined #RubyOnRails
[21:32:51] moeabdol: has joined #RubyOnRails
[21:34:21] delsol: has joined #RubyOnRails
[21:35:43] unreal: has joined #RubyOnRails
[21:35:52] lemur: has joined #RubyOnRails
[21:37:10] moeabdol1: has joined #RubyOnRails
[21:37:25] elton: has joined #RubyOnRails
[21:38:36] jmarchello: has joined #RubyOnRails
[21:39:06] isjaylee: has left #RubyOnRails: ()
[21:40:36] Hates_: mercwithamouth: have you added the association to your User model?
[21:40:40] arooni: has joined #RubyOnRails
[21:40:51] Hates_: gooberfoo: you can see the gems installed with "gem list -l"
[21:41:52] bronson: has joined #RubyOnRails
[21:42:01] mercwithamouth: i realized part of my mistake. it's a has_one relationship so it should be 'family' opposed to families
[21:42:07] mercwithamouth: now it's complaining about the build method
[21:42:30] Hates_: mercwithamouth: you want build_family then instead of families.build
[21:44:06] rubyonrailed: has joined #RubyOnRails
[21:47:45] sbarg: has joined #RubyOnRails
[21:48:09] annlewis: has joined #RubyOnRails
[21:50:07] sharkman: has joined #RubyOnRails
[21:50:29] atomical: has joined #RubyOnRails
[21:50:50] snophey: has joined #RubyOnRails
[21:51:16] bigbob: has joined #RubyOnRails
[21:53:13] Spami_: has joined #RubyOnRails
[21:55:35] B1n4r10: has joined #RubyOnRails
[21:55:56] jbrhbr: has joined #RubyOnRails
[21:57:10] hardtail: has joined #RubyOnRails
[21:58:00] kuroro: has joined #RubyOnRails
[21:58:07] arBmind: has joined #RubyOnRails
[22:02:19] maesitos: has joined #RubyOnRails
[22:02:38] solars: has joined #RubyOnRails
[22:06:30] NBarnes: is build_whatever Rails magic? I haven't encountered it, I always just did Whatever.build
[22:08:41] rgrmatt: has joined #RubyOnRails
[22:11:56] smathy: has joined #RubyOnRails
[22:13:21] shock_one: has joined #RubyOnRails
[22:14:10] rhizome: nbarnes: you must have always done it on a has_many side of an association
[22:23:28] Darkman738: has joined #RubyOnRails
[22:24:16] duncannz: has joined #RubyOnRails
[22:25:21] nettoweb: has joined #RubyOnRails
[22:28:23] Rodya_: has joined #RubyOnRails
[22:29:03] yfeldblum: has joined #RubyOnRails
[22:29:32] s2013: has joined #RubyOnRails
[22:29:52] atomical_: has joined #RubyOnRails
[22:34:13] Rodya_: has joined #RubyOnRails
[22:37:04] urkle: has joined #RubyOnRails
[22:38:16] elton: has joined #RubyOnRails
[22:38:51] NBarnes: rhizome; seems likely.
[22:41:00] shibabu: has joined #RubyOnRails
[22:41:42] axl_: has joined #RubyOnRails
[22:41:49] jscheel: has joined #RubyOnRails
[22:42:15] johnflux: has joined #RubyOnRails
[22:42:16] johnflux: has joined #RubyOnRails
[22:44:28] Coldblackice: has joined #RubyOnRails
[22:45:28] sucks: has joined #RubyOnRails
[22:48:02] sbarg: has joined #RubyOnRails
[22:48:54] annlewis: has joined #RubyOnRails
[22:49:22] rhizome: been there
[22:49:27] _Tariq: has joined #RubyOnRails
[22:52:35] quazimodo: has joined #RubyOnRails
[22:55:16] hardtail: has joined #RubyOnRails
[22:55:31] sleungcy: has joined #RubyOnRails
[22:57:21] Darkman738: has joined #RubyOnRails
[22:57:25] baweaver: has joined #RubyOnRails
[23:00:56] bronson: has joined #RubyOnRails
[23:01:47] viiralvx: has joined #RubyOnRails
[23:04:42] ibouvousaime: has joined #RubyOnRails
[23:05:52] dstarh: has joined #RubyOnRails
[23:07:21] B1n4r10: has joined #RubyOnRails
[23:09:24] Darkman738: has joined #RubyOnRails
[23:09:39] ornerymoose: has joined #RubyOnRails
[23:12:02] versatiletech: has joined #RubyOnRails
[23:12:31] Trynemjoel: has joined #RubyOnRails
[23:13:17] rdavila: has joined #RubyOnRails
[23:13:30] tenderlove: has joined #RubyOnRails
[23:14:30] jgt: has joined #RubyOnRails
[23:14:41] baweaver: has joined #RubyOnRails
[23:15:28] djbkd: has joined #RubyOnRails
[23:15:49] shanemcd: has joined #RubyOnRails
[23:21:49] tenderlove: has joined #RubyOnRails
[23:22:30] eddiegrey: has joined #RubyOnRails
[23:26:35] sonOfRa: has joined #RubyOnRails
[23:27:21] tenderlove: has joined #RubyOnRails
[23:29:09] baweaver: has joined #RubyOnRails
[23:32:19] pvertenten: has left #RubyOnRails: ()
[23:32:26] lemur: has joined #RubyOnRails
[23:33:28] Papierkorb: Is there a gem out there which lets me write some HAML and SCSS stuff and just serve it to me?
[23:33:45] Papierkorb: kinda like codepen but local with my beloved local text editor
[23:34:24] kitsuneyo: has joined #RubyOnRails
[23:35:23] kitsuneyo: i'm using a bootstrap modal to update some records in my model. how do i write a test for that?
[23:35:32] tenderlove: has joined #RubyOnRails
[23:35:34] versatiletech: has joined #RubyOnRails
[23:38:42] kuroro: has joined #RubyOnRails
[23:39:02] elton: has joined #RubyOnRails
[23:39:27] owenjones: has joined #RubyOnRails
[23:41:30] kmckelvi1: has joined #RubyOnRails
[23:46:15] atumzin: has joined #RubyOnRails
[23:46:50] rhizome: kitsuneyo: depends on whether it degrades or not
[23:47:04] kitsuneyo: rhizome: degrades how?
[23:47:14] rhizome: provides the same functionality without js
[23:48:10] kitsuneyo: well i tried the regular test with and without format :js, but it fails
[23:48:11] rhizome: you're probably just asking about integration tests, maybe?
[23:48:20] rhizome: what's the "regular" test?
[23:48:33] kitsuneyo: i'll take a controller or integration test
[23:48:51] rhizome: if you want to operate the modal, integration
[23:49:09] rhizome: "feature" i think in rspec land
[23:49:16] kitsuneyo: oh right i don't care about the modal
[23:49:20] kitsuneyo: at the moment
[23:49:40] annlewis: has joined #RubyOnRails
[23:49:40] rhizome: ok, then exercising just the controller stuff
[23:49:58] mary5030: has joined #RubyOnRails
[23:50:02] kitsuneyo: the way i would normally write the controller test is: patch :update, id: @record.id, place: { name: 'new name' }
[23:50:11] kitsuneyo: then just do assert_equal
[23:50:49] kitsuneyo: but the @record isn't updating in the test, even though it works in the development env
[23:51:30] annlewis_: has joined #RubyOnRails
[23:52:28] rhizome: might be how you're checking
[23:53:23] rhizome: @record.foo_changed?
[23:53:48] NBarnes: has joined #RubyOnRails
[23:55:28] kitsuneyo: can i just put a boolean in there like that?
[23:56:42] bigbob: has joined #RubyOnRails
[23:57:02] kitsuneyo: well, the test passes that way but i don't understand why assert_equal didn't work
[23:59:52] jgt1: has joined #RubyOnRails