« Back to channel list

#RubyOnRails - 10 June 2016

« Back 1 day Forward 1 day »
[00:03:41] nettoweb: has joined #RubyOnRails
[00:05:15] quazimodo: has joined #RubyOnRails
[00:05:17] bmorrison: has joined #RubyOnRails
[00:11:45] IFrank00: has joined #RubyOnRails
[00:12:08] ashleyw: has joined #RubyOnRails
[00:12:39] cnk: has joined #RubyOnRails
[00:16:15] joaumg: has joined #RubyOnRails
[00:17:53] RubyNewbey_____: has joined #RubyOnRails
[00:19:34] DukeDave: has joined #RubyOnRails
[00:19:37] alxndr: has joined #RubyOnRails
[00:19:37] meinside: has joined #RubyOnRails
[00:19:44] joaomdmoura__: has joined #RubyOnRails
[00:19:48] grvgr: has joined #RubyOnRails
[00:20:00] tjohnson: has joined #RubyOnRails
[00:20:09] jxf: has joined #RubyOnRails
[00:20:23] tfitts: has joined #RubyOnRails
[00:20:52] ELCALOR: has joined #RubyOnRails
[00:20:53] mattwithoos: has joined #RubyOnRails
[00:20:54] frem_: has joined #RubyOnRails
[00:20:56] podman: has joined #RubyOnRails
[00:20:59] jlpeters: has joined #RubyOnRails
[00:21:28] upgrayeddd: has joined #RubyOnRails
[00:21:31] adamf: has joined #RubyOnRails
[00:21:36] spastorino: has joined #RubyOnRails
[00:21:39] jord: has joined #RubyOnRails
[00:21:41] hjdivad: has joined #RubyOnRails
[00:21:59] daemonwrangler: has joined #RubyOnRails
[00:22:10] Travis-42: has joined #RubyOnRails
[00:22:10] glasz_: has joined #RubyOnRails
[00:22:42] Rodya_: has joined #RubyOnRails
[00:23:19] sonofdirt: has joined #RubyOnRails
[00:23:31] dorje: has joined #RubyOnRails
[00:25:31] Dios: has joined #RubyOnRails
[00:26:05] Meow-J: has joined #RubyOnRails
[00:27:19] Dios: has joined #RubyOnRails
[00:28:15] ksoze: has joined #RubyOnRails
[00:28:46] allcentury: has joined #RubyOnRails
[00:34:05] sonofdirt: has joined #RubyOnRails
[00:39:04] moeabdol: has joined #RubyOnRails
[00:44:10] sypheren: has joined #RubyOnRails
[00:45:50] sleungcy: has joined #RubyOnRails
[00:45:56] APhilp: has joined #RubyOnRails
[00:46:03] Wolland: has joined #RubyOnRails
[00:49:35] SteenJobs: has joined #RubyOnRails
[00:50:50] ur5us: has joined #RubyOnRails
[00:51:49] macsteps: has joined #RubyOnRails
[00:52:49] ur5us: has joined #RubyOnRails
[00:53:18] Leepoff: has joined #RubyOnRails
[00:53:22] Technodrome: has joined #RubyOnRails
[00:55:09] DoctorMonocular: has joined #RubyOnRails
[00:56:44] svankmajer: has joined #RubyOnRails
[01:01:13] yfeldblum: has joined #RubyOnRails
[01:07:16] sonofdirt: has joined #RubyOnRails
[01:11:24] blackmesa: has joined #RubyOnRails
[01:12:41] _Tariq: has joined #RubyOnRails
[01:20:48] Dios: has joined #RubyOnRails
[01:29:31] allcentury: has joined #RubyOnRails
[01:31:30] lightt: has joined #RubyOnRails
[01:31:33] sevenseacat: has joined #RubyOnRails
[01:36:12] ensyde__: has joined #RubyOnRails
[01:40:34] sleungcy: has joined #RubyOnRails
[01:44:06] achamian: has joined #RubyOnRails
[01:46:49] Wolland: has joined #RubyOnRails
[01:48:33] DoctorMonocular: has joined #RubyOnRails
[01:48:49] FailBit: has left #RubyOnRails: ("WeeChat 0.4.2")
[01:51:52] Rodya_: has joined #RubyOnRails
[01:51:56] sneakers: has joined #RubyOnRails
[01:54:27] dopie: has joined #RubyOnRails
[01:56:26] macsteps: has joined #RubyOnRails
[02:00:04] ElFerna: has joined #RubyOnRails
[02:07:47] _Tariq: has joined #RubyOnRails
[02:08:55] flashpoint9: has joined #RubyOnRails
[02:15:23] Niham: has joined #RubyOnRails
[02:15:28] owenjones: has joined #RubyOnRails
[02:15:49] xlegoman: has joined #RubyOnRails
[02:18:33] ashleyw: has joined #RubyOnRails
[02:18:53] codeshah: has joined #RubyOnRails
[02:22:23] IFrank00: has joined #RubyOnRails
[02:24:13] svankmajer: has joined #RubyOnRails
[02:25:19] sharkman: has joined #RubyOnRails
[02:25:24] sharkman: can i ask a question gentleman
[02:25:25] Axilla: hey all i'm trying to deploy to my production server w/ cap but AWS is saying it can't find aws.yml.. its there in config/aws.yml though and works just fine for staging
[02:25:32] Axilla: any ideas?
[02:28:33] moeabdol: has joined #RubyOnRails
[02:30:16] allcentury: has joined #RubyOnRails
[02:34:51] sleungcy: has joined #RubyOnRails
[02:35:11] Axilla: sharkman: don't ask to ask, just ask.
[02:35:33] sharkman: wow axilla that is same thing eva green said on penny dreadful when she was being seduced by dorian grey
[02:36:29] Axilla: just how it goes man, just ask your question if someone can help they will.
[02:36:31] sharkman: okay so i have an active rails entry want to access like a hash... i.e. entry[:key], but when i access it like this it gives the value as the enum integer. i want it to turn the enum into the readable symbol like when i access it as entry.key
[02:36:35] Axilla: it's a pretty helpful channel.
[02:36:59] Axilla: entry.enum?
[02:37:10] Axilla: if your enum was status
[02:37:14] Axilla: it would be entry.status?
[02:37:17] Axilla: or something of that nature
[02:37:20] Axilla: rails enums kind of suck
[02:37:35] Axilla: i don't use them very often instead i use classyenums by beerlington
[02:38:23] sharkman: oh interesting. why dont you like enums? why do you prefer classyenums?
[02:39:04] Axilla: rails enums don't really function like a enum.. they're not string based
[02:39:37] Axilla: http://edgeapi.rubyonrails.org/classes/ActiveRecord/Enum.html
[02:40:03] sleungcy: has joined #RubyOnRails
[02:40:11] Axilla: so if your enum was staus: [:active, :cancelled] you would say something like status.active! to activate it
[02:40:17] Axilla: and then status.active? would return true
[02:40:43] Axilla: and cancelled would return false
[02:41:01] Axilla: they're not what you think of when you think of enums
[02:41:18] Axilla: not what i like about enums anyway from other langs like C# or whatever i've used.
[02:41:25] Axilla: so I switched to using classyenums and never looked back
[02:41:37] Axilla: its one of the few gems i use in every single application i make and its string based
[02:42:03] Axilla: and also allows you to have logic wrapped in your enum because they're classes(hence the name) so lets say you have an alarm and when alarm is ALERT it can do something
[02:42:06] Axilla: they're really cool.
[02:42:33] Axilla: https://github.com/beerlington/classy_enum
[02:42:43] Axilla: that's what i use to replace rails crappy enums.
[02:45:49] xibalba: has joined #RubyOnRails
[02:47:37] Wolland: has joined #RubyOnRails
[02:47:59] Axilla: but yea sorry, rails enums won't do what you want.
[02:48:18] Axilla: at least i don't think so.. you can map an integer
[02:52:42] Rodya_: has joined #RubyOnRails
[02:52:42] quazimodo: has joined #RubyOnRails
[02:54:56] Axsuul: has joined #RubyOnRails
[02:58:42] roamingdog: has joined #RubyOnRails
[02:59:02] mostlybadfly: has joined #RubyOnRails
[02:59:37] Technodrome: has joined #RubyOnRails
[03:00:09] banister: has joined #RubyOnRails
[03:03:49] engenuine: has joined #RubyOnRails
[03:04:06] jancel: has joined #RubyOnRails
[03:06:31] roamingdog: anyone else seeing %2F (forward slash) in rails 4.2.4 or 4.2.6? this was an issue a while ago (like 4.1...) but thought it was resolved
[03:06:48] roamingdog: seeing them in urls that is
[03:07:10] engenuine: has left #RubyOnRails: ()
[03:07:40] dhoelzer: I hadn't noticed
[03:08:56] sonofdirt: has joined #RubyOnRails
[03:12:31] dionysus69: has joined #RubyOnRails
[03:14:06] jayc0b0: has joined #RubyOnRails
[03:14:40] blackmesa: has joined #RubyOnRails
[03:14:42] kiki_lamb: has joined #RubyOnRails
[03:14:43] tildes_: has joined #RubyOnRails
[03:17:16] Niham: has joined #RubyOnRails
[03:18:13] roamingdog: made a throwaway app to demo this, if anyone's interested. this had different behavior in rails 3 (the version i'm porting from) https://github.com/chrislerum/throwaway
[03:18:56] braincrash: has joined #RubyOnRails
[03:21:11] k3rn31: has joined #RubyOnRails
[03:28:29] svankmajer: has joined #RubyOnRails
[03:28:29] svankmajer: has joined #RubyOnRails
[03:29:31] wd40s: has joined #RubyOnRails
[03:30:07] mohsenjalalian: has joined #RubyOnRails
[03:30:25] Leepoff: has joined #RubyOnRails
[03:31:01] allcentury: has joined #RubyOnRails
[03:35:36] djbkd: has joined #RubyOnRails
[03:40:48] sleungcy: has joined #RubyOnRails
[03:44:25] tgeeky: hm. anyone know instance where, when you assign a field in an activerecord, it goes on to (silently) not save it?
[03:44:40] tgeeky: oh, interesting... nevermind...
[03:44:46] achamian: has joined #RubyOnRails
[03:45:40] tgeeky: it appears I am changing it, then immediately changing it back on the next pass. :p
[03:48:29] Wolland: has joined #RubyOnRails
[03:49:45] flashpoint9: has joined #RubyOnRails
[03:53:01] k3rn31: has joined #RubyOnRails
[03:53:45] owenjones: has joined #RubyOnRails
[04:00:27] pawnbox: has joined #RubyOnRails
[04:00:35] jancel: has joined #RubyOnRails
[04:02:12] yatish27: has joined #RubyOnRails
[04:04:24] der-landgraf: has joined #RubyOnRails
[04:07:38] IFrank00: has joined #RubyOnRails
[04:10:44] snoobydoo: has joined #RubyOnRails
[04:17:11] Gkj8899: has joined #RubyOnRails
[04:17:30] DoctorMonocular: has joined #RubyOnRails
[04:22:27] lightt: has joined #RubyOnRails
[04:23:23] haraigo: has joined #RubyOnRails
[04:25:44] Rodya_: has joined #RubyOnRails
[04:25:55] duncannz: has joined #RubyOnRails
[04:26:58] duncannz: has joined #RubyOnRails
[04:28:48] kgrz: has joined #RubyOnRails
[04:29:20] owenjones: has joined #RubyOnRails
[04:31:48] allcentury: has joined #RubyOnRails
[04:38:43] pawnbox: has joined #RubyOnRails
[04:43:42] sumobob: has joined #RubyOnRails
[04:49:58] Wolland: has joined #RubyOnRails
[04:55:38] jayc0b0: has joined #RubyOnRails
[04:59:14] pawnbox: has joined #RubyOnRails
[05:02:04] tildes_: has joined #RubyOnRails
[05:03:09] jenrzzz: has joined #RubyOnRails
[05:03:09] jenrzzz: has joined #RubyOnRails
[05:10:38] jancel: has joined #RubyOnRails
[05:12:37] mytrile: has joined #RubyOnRails
[05:13:31] alfiemax: has joined #RubyOnRails
[05:13:37] mytrile: Hey guys, how can I check for enqueued mailer job (MailerClass.notification(params).deliver_later) ?
[05:14:15] nartes: has joined #RubyOnRails
[05:14:38] darkxploit: has joined #RubyOnRails
[05:16:42] blackmesa: has joined #RubyOnRails
[05:17:06] axxyhtrx: has joined #RubyOnRails
[05:17:31] achamian: has joined #RubyOnRails
[05:19:00] sevenseacat: there don't seem to be any guys around at the moment, sorry.
[05:21:41] mytrile: guys like "Persons, irrespective of their genders." ?
[05:22:25] mytrile: or guys like "group of male persons"
[05:24:13] kies: has joined #RubyOnRails
[05:26:47] Rodya_: has joined #RubyOnRails
[05:32:31] allcentury: has joined #RubyOnRails
[05:33:11] rvanlieshout: has joined #RubyOnRails
[05:37:33] sypheren: has joined #RubyOnRails
[05:40:58] dblessing: has joined #RubyOnRails
[05:46:14] sypheren: has joined #RubyOnRails
[05:46:14] syndikate: has joined #RubyOnRails
[05:48:12] syndikate: Hello people
[05:50:33] Wolland: has joined #RubyOnRails
[05:51:25] sypheren: has joined #RubyOnRails
[05:51:28] Wolland_: has joined #RubyOnRails
[05:55:51] syndikate: Could somebody explain why my stub is not working here?
[05:55:52] syndikate: https://gist.github.com/anonymous/8882bd6b55d823b156d012730101829e
[05:56:46] dblessing: has joined #RubyOnRails
[06:00:08] sypheren: has joined #RubyOnRails
[06:01:31] apotry: has joined #RubyOnRails
[06:02:47] moeabdol: has joined #RubyOnRails
[06:03:15] _Sypheren: has joined #RubyOnRails
[06:03:43] Macaveli: has joined #RubyOnRails
[06:07:34] alfiemax: syndikate, can you try writing it in a single line
[06:08:18] Ch4rAss: has joined #RubyOnRails
[06:08:52] Radar: syndikate: your body content does not match
[06:09:02] Radar: Top line: TEwIDA1OjQ1Oj
[06:09:18] Radar: Bottom line: TEwIDA1OjEyOj
[06:09:24] darkxploit: has joined #RubyOnRails
[06:12:18] jancel: has joined #RubyOnRails
[06:13:51] ravishankarjha: has joined #RubyOnRails
[06:14:14] yfeldblum: has joined #RubyOnRails
[06:14:39] solars: has joined #RubyOnRails
[06:15:25] Radar: syndikate: Looks like the date field in that base 64 encoded YAML has a completely different time in the two examples
[06:15:30] njero: has joined #RubyOnRails
[06:19:51] sandelius: has joined #RubyOnRails
[06:26:11] Coldblackice: has joined #RubyOnRails
[06:26:22] siaw23: has joined #RubyOnRails
[06:27:06] siaw23: hello i have a task to build an SPA with rails. what will be an easier JS framework to choose for the frontend?
[06:27:29] Rodya_: has joined #RubyOnRails
[06:28:35] tbuehlmann: siaw23: do you have any experience writing js application using a framework?
[06:28:57] siaw23: nope. but ready to learn an submit something in 12 days
[06:29:25] jas02: has joined #RubyOnRails
[06:30:45] tbuehlmann: what about plain rails with remote forms and maybe some turbolinks? :)
[06:31:17] haraigo: has joined #RubyOnRails
[06:33:17] allcentury: has joined #RubyOnRails
[06:33:33] gingray: has joined #RubyOnRails
[06:35:31] aganov: has joined #RubyOnRails
[06:40:24] AzaToth: has joined #RubyOnRails
[06:41:44] siaw23: i was thinking rails + angular :/
[06:42:24] Radar: React is probably your best bet for such a short term project.
[06:42:28] syndikate: Radar, yup, I just figured there was a mismatch and was wondering what it could be...thank..great spot! Now is there anyway I could add wildcards to webmock?
[06:42:31] Radar: Angular has a bastard of a learning curve.
[06:42:34] axxyhtrx: has joined #RubyOnRails
[06:42:51] Radar: syndikate: Why not just freeze time with a gem like Timecop?
[06:43:54] syndikate: Not aware of that..
[06:44:20] siaw23: react. i’ll look into that asap
[06:45:19] Pazician: has joined #RubyOnRails
[06:45:20] Pazician: has joined #RubyOnRails
[06:48:40] blockchan: has joined #RubyOnRails
[06:49:16] Dimik: has joined #RubyOnRails
[06:49:21] owenjones: has joined #RubyOnRails
[06:53:24] ur5us: has joined #RubyOnRails
[06:54:38] Ch4rAss: has joined #RubyOnRails
[06:54:39] ruvort: has joined #RubyOnRails
[06:56:27] blackhuey: has joined #RubyOnRails
[06:57:16] norc: has joined #RubyOnRails
[06:57:17] tvw: has joined #RubyOnRails
[06:59:40] snoobydoo: has joined #RubyOnRails
[07:00:26] tbuehlmann: btw, there's travel_to and travel_back in rails, no need for Timecop often times
[07:01:51] snoobydoo: Hi people, I just setup a rails app with `--database=postgres` flag, and edited my `database.yml` and also `rake:migrate` works. But when i do `rais generate` or `rails console` its just stuck forever without any error
[07:02:21] snoobydoo: The only way I break out of it is Ctrl+C, sort of confused as to whats going wrong. Any ideas?
[07:03:24] norc: snoobydoo: Use strace
[07:03:27] norc: See what it hangs on.
[07:04:19] comrad: has joined #RubyOnRails
[07:05:52] Spami: has joined #RubyOnRails
[07:06:38] agit0: has joined #RubyOnRails
[07:07:15] syndikate: Radar, is there anyway I can add a wildcard to webmock?
[07:07:50] snoobydoo: norc: I just learned there's an alternative for strace on OSX. Let me try that
[07:08:10] norc: snoobydoo: dtruss :)
[07:08:20] rbr: has joined #RubyOnRails
[07:09:40] flashpoint9: has joined #RubyOnRails
[07:10:37] KevinSjoberg: has joined #RubyOnRails
[07:11:54] Axy: has joined #RubyOnRails
[07:12:09] pawnbox: has joined #RubyOnRails
[07:12:58] blockchan: has joined #RubyOnRails
[07:13:07] snoobydoo: norc: Tried `sudo dtruss rails generate` without any luck: "dtruss cannot control executables signed with restricted entitlments" :/
[07:13:32] norc: snoobydoo: Mmm. Let's try something else while I look into that.
[07:13:39] snoobydoo: I'm on OSX El Capitan incase that helps
[07:13:39] norc: snoobydoo: Kill the process with SIGBUG or SIGSEGV
[07:14:04] norc: snoobydoo: That will produce an accurate stack trace, but might not be helpful if the problem is in a forked process or thread.
[07:15:24] darutoko: has joined #RubyOnRails
[07:15:48] norc: snoobydoo: And apparently SIP is preventing from dtruss to work properly. You would have to disable SIP (requiring a reboot) first.
[07:16:47] snoobydoo: norc: Oh. Could you tell me what SIP is and how to disable it?
[07:17:04] snoobydoo: Also, I'm assuming the `kill` command sends SIGBUS to kill the process?
[07:17:19] norc: snoobydoo: System Integrity Protection, a huge bunch of security features making developers lifes real hard since El Capitan.
[07:17:30] blackmesa: has joined #RubyOnRails
[07:17:30] norc: snoobydoo: it can. use kill -BUS
[07:18:36] norc: (You could also use SEGV, but BUS has even less of a chance that someone has installed a handler for it)
[07:21:25] norc: snoobydoo: Im thinking that you should be able to do: sudo dtruss -f sudo -u YOUR_USER rails console
[07:24:42] snoobydoo: norc: I did `kill -BUS <PID for rails generate` - https://gist.github.com/arvindravi/6c3d20aafd490104352af8a1d0d64307
[07:24:52] snoobydoo: Let me try that dtruss now!
[07:25:11] norc: snoobydoo: Mmm, could be spring related.
[07:25:19] norc: snoobydoo: Try: spring restart
[07:25:37] roamingdog: has joined #RubyOnRails
[07:25:52] noobsu_: has joined #RubyOnRails
[07:26:13] norc: snoobydoo: though it seems like its stuck on setting up bundler
[07:26:39] snoobydoo: norc: I tried dtruss with no luck
[07:26:48] snoobydoo: Also spring restart didn't help
[07:26:51] k3rn31: has joined #RubyOnRails
[07:27:08] snoobydoo: actually it did!
[07:27:13] snoobydoo: It works now :D
[07:27:46] snoobydoo: Thanks norc!
[07:28:07] norc: snoobydoo: Yeah based on the control frame information it was stuck in the middle of spring during bundler setup. :)
[07:28:17] Rodya_: has joined #RubyOnRails
[07:29:05] adre: has joined #RubyOnRails
[07:29:10] sevenseacat: don't we just love spring
[07:29:15] snoobydoo: norc: Could you tell me which line has that information? I could maybe figure it out myself next time
[07:29:24] norc: snoobydoo: https://gist.github.com/arvindravi/6c3d20aafd490104352af8a1d0d64307#file-gistfile1-txt-L13-L31
[07:29:35] norc: snoobydoo: This is a representation of the stack that ruby uses internally.
[07:29:49] nertzy3: has joined #RubyOnRails
[07:30:15] siaw23: has joined #RubyOnRails
[07:30:36] snoobydoo: Awesome, thanks!
[07:32:07] pawnbox: has joined #RubyOnRails
[07:33:36] norc: snoobydoo: And for some reason it seems it was stuck on an IO#gets call.
[07:33:43] eGGshke: has joined #RubyOnRails
[07:33:47] lessless: has joined #RubyOnRails
[07:34:02] allcentury: has joined #RubyOnRails
[07:34:31] snoobydoo: norc: Should I look into it further? Now that its fixed?
[07:34:43] norc: snoobydoo: Only as far as sevenseacat as hinted at perhaps
[07:34:53] sevenseacat: step 1. remove spring from app
[07:34:59] sevenseacat: step 2. there is no step 2
[07:35:10] norc: Well now its more than just hints. :-)
[07:36:08] arBmind: has joined #RubyOnRails
[07:36:08] IceBear: has joined #RubyOnRails
[07:36:35] norc: sevenseacat: It just occurred to me, that spring must be the result of some developer who could not afford an SSD.
[07:37:08] edwinvdgraaf: has joined #RubyOnRails
[07:37:19] sevenseacat: I don't know where it came from. all I know is a hell of a lot of work went into solving the wrong problem
[07:37:48] sevenseacat: rails is too slow to start - instead of trying to speed it up, let's just introduce this shitty caching layer
[07:37:49] norc: Back in the day I had quite a few random bizarre problems that a "spring reload" magically fixed, and I never understood why.
[07:38:08] edwinvdg_: has joined #RubyOnRails
[07:38:24] norc: Or was it "spring restart"? I cant remember.
[07:38:42] CornishPasty: Why wasn't it just "respring"?
[07:39:06] lessless: peeps, what is the reason behind setting NOT NULL and DEFAULT: ‘’ together for email column in Devise?
[07:39:08] snoobydoo: it was spring restart
[07:39:18] norc: sevenseacat: That is the thing though I hinted at in an earlier topic here. I think the ability of Ruby to precompile files could be the actual right step.
[07:39:34] defsdoor: has joined #RubyOnRails
[07:39:39] lessless: if it shouldn't be null why would someone want for user to be able to insert empty string?
[07:39:42] norc: (Quite some time is spent just lexing, parsing and compiling all the dependencies)
[07:40:13] sevenseacat: the thing is, Ruby is getting faster and faster with each release, so unless Rails is deliberately getting slower and slower, slow start becomes less and less of a 'problem'
[07:40:14] norc: lessless: Unrelated to Devise in particular NULL and '' are semantically different
[07:40:29] norc: lessless: NULL means "UNKNOWN VALUE" whereas an empty string would rather denote "nothingness"
[07:40:59] lessless: @norc, but email shouldn't be empty, right?
[07:41:03] sevenseacat: yes, back when we were on Ruby 1.9.3 waiting 60 seconds to start an app was unacceptable. now the same app would start in a fraction of the time
[07:41:31] norc: lessless: Either you have an email address or not. You may not want to have the state "It is unknown whether this user has an emaila ddress"
[07:42:18] norc: lessless: Whether you want it in devise depends on you entirely.
[07:42:22] sevenseacat: having not null default "" also allows you to add that column to an existing table without blowing up.
[07:42:34] CornishPasty: norc: null means nothingness, empty string means empty string
[07:42:42] sevenseacat: CornishPasty: no, null in sql means unknown
[07:42:43] norc: CornishPasty: null means unknown value. Go read SQL specs.
[07:43:01] norc: CornishPasty: The best example is that: NULL = NULL does not yield true in SQL.
[07:43:09] norc: Because whether two unknown values are equal is.. well. unknown.
[07:43:15] sevenseacat: which is why you cannot compare anything with null, you need specific IS NULL clauses
[07:44:00] sameerynho: has joined #RubyOnRails
[07:44:50] CornishPasty: Right, sorry for going by Codd's definition
[07:45:08] arBmind1: has joined #RubyOnRails
[07:45:28] sevenseacat: it wouldnt be the first time tech has borrowed a word and changed its definition :)
[07:45:43] CornishPasty: Well, considering SQL adopted Codd's rules, I'm surprised it's so wrong
[07:46:13] norc: CornishPasty: Except modern RDMBS are not Codds Databases, but SQL Databases. ;-)
[07:46:20] CornishPasty: ACTION sighs
[07:46:52] srinidhi: has joined #RubyOnRails
[07:46:54] artto: has joined #RubyOnRails
[07:47:08] norc: CornishPasty: Oh I misunderstood that last statement, my bad.
[07:47:48] soroot: has joined #RubyOnRails
[07:48:06] norc: CornishPasty: According to my findings Codd says: NULLs may mean: Missing data, Not applicable, No value
[07:48:39] CornishPasty: It means "missing information and inapplicable information"
[07:48:41] sevenseacat: I'm guessing Codd is something I would find in my database textbook from uni.
[07:49:21] norc: sevenseacat: Assuming you can find your textbook. ;-)
[07:49:29] sevenseacat: its on my shelf behind me!
[07:49:33] sevenseacat: ACTION looks in it
[07:49:39] darkxploit: has joined #RubyOnRails
[07:50:06] CornishPasty: ACTION went off topic
[07:50:48] sevenseacat: oh, the original definition of relational algebra was by Codd
[07:51:06] KevinSjoberg: has joined #RubyOnRails
[07:51:15] sevenseacat: and he proposed the relational model... yeah I probably should have learned this shit
[07:51:21] moeabdol: has joined #RubyOnRails
[07:51:32] sevenseacat: ACTION leaves textbook out
[07:51:37] norc: And you probably passed the exam with great grades...
[07:51:54] sevenseacat: not great, but good enough!
[07:52:06] sevenseacat: 70-something from memory
[07:52:43] norc: Well, next year Ill finally start with studying myself. Not sure whether it will be a waste of time, but for now it seems like a smart choice if I want to get into the field.
[07:53:15] sevenseacat: you can get into the field without it, and a lot of really smart and clever people never did official study, but I believe it helped me
[07:53:23] Niham: has joined #RubyOnRails
[07:54:28] gingray: has joined #RubyOnRails
[07:55:55] sevenseacat: for the record this is the exact book we used for databases - https://www.amazon.com/Database-System-Concepts-Silberschatz-Abraham/dp/0072958863/ - mine still has its $109.95 price tag on the back
[07:56:38] CornishPasty: Ah yeah, I'm pretty sure I was told to buy that book :P
[07:57:33] norc: sevenseacat: Having a Bachelor at the very least is fairly helpful to work for larger companies, especially for salary negotations.
[07:57:45] norc: That alone is enough reason to consider it.
[07:57:58] CornishPasty: I don't have a bachelor, I'm in a well paying job
[07:58:24] sevenseacat: I have one, and my first job out of uni was pretty much minimum wage :)
[07:58:39] CornishPasty: sevenseacat: you're in AUS, right?
[07:58:51] CornishPasty: Were you disappointed to miss out on winning eurovision? :P
[07:59:02] sevenseacat: next year dammit we will win
[07:59:09] sevenseacat: 5th, to 2nd, can only go up from here
[07:59:15] norc: CornishPasty: More often than not someone with an M.S. will get paid more than someone equally qualified with a B.S.. The thing is HR departments have a tendency to look at what you have on paper.
[07:59:18] CornishPasty: But yeah, degrees are only really important to super-big companies, who probably treat you like a number
[07:59:26] CornishPasty: norc: sadly yes
[07:59:39] CornishPasty: I work with a person with an MSc, and he's as useful as a chocolate teapot
[07:59:42] CornishPasty: In fact, less useful
[07:59:51] norc: And he gets paid more?
[07:59:55] CornishPasty: He's been here 2 years and still doesn't understand basic things
[07:59:57] sevenseacat: yeah I only ever worked for one "big company" and I only lasted three months
[07:59:58] dannyguk: has joined #RubyOnRails
[08:00:10] CornishPasty: I'm about to work at a big-ish company soon
[08:00:18] CornishPasty: No more rails for work
[08:01:54] ecksit: has joined #RubyOnRails
[08:02:18] snoobydoo: Is there a clean way to populate my postgres db and make rails talk to it? Currently I have an empty table, I'm not sure how to go about populating the table with the data i have
[08:02:45] sevenseacat: snoobydoo: you could write a rake task to load it in, or if its seed data, use your seed file
[08:03:44] ecksit: evening folks - i'm having a bit of a dilemma with sending emails in activejob via mailgun. according to the logs it is enqueing and running it but the email never seems to get sent. i am using the configuration mentioned at https://devcenter.heroku.com/articles/mailgun#sending-emails-via-smtp
[08:03:59] snoobydoo: The data is on another database. I was thinking I could do some export/import - but rake makes sense
[08:04:16] mikecmpbll: has joined #RubyOnRails
[08:04:19] sevenseacat: ecksit: how are you actually sending the mail?
[08:04:22] norc: snoobydoo: Is this for production or development?
[08:04:22] ecksit: i've been able to confirm it's not happening as the mailgun UI never says it's receives it
[08:04:31] sevenseacat: ecksit: do you have delivery errors turned on?
[08:04:39] jsrn: has joined #RubyOnRails
[08:04:59] snoobydoo: norc: Development
[08:05:14] ecksit: @sevenseacat, i have a call to mail in a custom mailer that extends ApplicationMailer
[08:05:26] sevenseacat: ecksit: can you show us the code, because that doesnt mean much :P
[08:05:26] norc: snoobydoo: Personally I prefer seeds.rb since its automatically hooked into the db:reset task.
[08:05:40] ecksit: sure, one moment
[08:05:59] snoobydoo: I'm not familiar with seeds.rb - let me look into it
[08:07:18] norc: snoobydoo: It is just a simple ruby file that gets executed on the db:seed task, which in turn is executed by db:setup (which is also executed by db:reset)
[08:08:26] snoobydoo: Okay, So if I had to go about importing data from another db. I'll have to setup seed.rb accordingly and run db:seed?
[08:08:53] norc: snoobydoo: Right.
[08:08:57] artto: has joined #RubyOnRails
[08:09:01] sevenseacat: if it was from another db, i would be writing import tasks using sequel or something to talk to the second db
[08:09:24] sevenseacat: because it likely won't be just a direct copy
[08:09:54] phredus: has joined #RubyOnRails
[08:10:05] Ergo: has joined #RubyOnRails
[08:11:14] ecksit: @sevenseacat, https://gist.github.com/anonymous/b4ee353b2613781a259d7566b74f548e is what i am looking to do
[08:11:34] mark_66: has joined #RubyOnRails
[08:11:41] sevenseacat: ecksit: you're not calling deliver on the mail object :)
[08:12:03] ecksit: ah ok, thanks.
[08:12:04] norc: ecksit: Also your code is incorrect and should give you a NoMethodError.
[08:12:10] ecksit: let me try that
[08:12:14] sevenseacat: norc: how so?
[08:12:22] norc: sevenseacat: The MyCustomMailer has no class method send_email
[08:12:24] ecksit: i'm not seeing any errors
[08:12:30] sevenseacat: norc: it doesnt have to
[08:12:34] sevenseacat: quirk of ActionMailer
[08:13:01] norc: Okay, my apologies then.
[08:13:16] sevenseacat: is a fair point, looking up the guides now to find discussion about it
[08:13:19] ecksit: @norc, yeah - i know that's wierd. everything else wants correct methods but action mailer seems to do it's own thig
[08:14:30] pawnbox: has joined #RubyOnRails
[08:14:52] sevenseacat: doesnt mention it in the ActionMailer guide.... dum de dum
[08:15:44] sevenseacat: > You never instantiate your mailer class. Rather, you just call the method you defined on the class itself.
[08:16:05] sevenseacat: seems to be the only reference I can find
[08:16:22] norc: sevenseacat: So much is clear, but is this just a disgusting hack that will produce some confusing back traces just to save you the trouble of writing "self." in front of the method name?
[08:16:39] sevenseacat: I think there's more to it than that
[08:17:07] sevenseacat: I know that the generated email is lazy-loaded so doesn't actually instantiate until you call deliver
[08:17:12] sevenseacat: which may have something to do with this trickery
[08:18:56] ecksit: thanks a bunch! that was it!
[08:19:22] pawnbox_: has joined #RubyOnRails
[08:23:03] dionysus69: has joined #RubyOnRails
[08:25:20] crdpink: has joined #RubyOnRails
[08:25:46] diegoaguilar: has joined #RubyOnRails
[08:25:52] rikkipitt: has joined #RubyOnRails
[08:26:36] sandelius: has joined #RubyOnRails
[08:29:08] Rodya_: has joined #RubyOnRails
[08:29:41] der-landgraf: has joined #RubyOnRails
[08:32:45] snoobydoo: I got db:seed working! Thanks norc and sevenseacat!
[08:33:09] der-landgraf: has joined #RubyOnRails
[08:34:44] allcentury: has joined #RubyOnRails
[08:37:48] fox_mulder_cp: hi. what is the best way now to start rails development under windows 10? stay with for ubuntu for windows implementaion? now i start to use rubymine under windows and its pretty for me, but ruby, rails and its's gems and postgresql make me cry
[08:40:12] owenjones: has joined #RubyOnRails
[08:40:43] tbuehlmann: fox_mulder_cp: yeah, developing on windows is a pain, don't do that
[08:40:52] tbuehlmann: ubuntu is fine
[08:40:53] pawnbox: has joined #RubyOnRails
[08:41:14] sevenseacat: the whole linux-under-windows thing thats being worked on may work, but who knows
[08:41:33] norc: fox_mulder_cp: If you do it under Windows, vagrant/docker is your friend (so you see, the goal is to avoid the Windows environment entirely)
[08:43:02] Circuit8: has joined #RubyOnRails
[08:45:57] vedu: Hello. What is the "rails way" to rotate logs? (in rails 4.2) I want to delete the old log files rather than compressing and keeping them
[08:46:14] sonofdirt: has joined #RubyOnRails
[08:46:30] sevenseacat: I don't think thats a responsibility of Rails
[08:47:08] norc: vedu: Ruby standard loggers have this functionality built-in already.
[08:47:32] norc: vedu: http://ruby-doc.org/stdlib-2.3.1/libdoc/logger/rdoc/Logger.html#method-c-new
[08:47:43] diegoaguilar: has joined #RubyOnRails
[08:48:05] vedu: norc: I am using the default rails logger. But I still got a 4.7G log file :(
[08:48:46] norc: vedu: ActiveSupport::Logger is derived from ::Logger
[08:49:00] norc: vedu: You need to set it up explicitely, as shown in the documentation linked above.
[08:49:10] sevenseacat: you may need to configure Rails to use those extra params
[08:49:18] vedu: norc: so some configuration must be required
[08:49:35] andywww: has joined #RubyOnRails
[08:50:17] andywww: which of the standard errors would one typically raise when recieving malformed json in the post body?
[08:50:28] norc: andywww: malformed in what sense?
[08:50:37] sevenseacat: 400 Bad request?
[08:51:07] norc: andywww: Is it valid JSON still?
[08:51:22] sevenseacat: malformed kinda means not valid
[08:51:32] norc: sevenseacat: If the JSON is valid then 422 is more appropriate.
[08:51:33] andywww: yes, all i’ve handled most other types
[08:51:45] norc: Or no mmm
[08:51:51] norc: yea sevenseacat is right, 400 is correct.
[08:51:55] sevenseacat: if the JSON is valid its not "malformed json junk" :P
[08:51:55] andywww: what i’m trying to do here is, if the json doesn’t have the right keys and values etc
[08:52:04] sevenseacat: ok thats not malformed junk
[08:52:14] andywww: right okay
[08:52:25] norc: andywww: Ah! Then 422 I would say for sure.
[08:52:29] andywww: but corrections aside, can you understand what i’m trying to do?
[08:52:36] andywww: ah brill thanks
[08:53:34] andywww: thats the one, thanks for that
[08:53:53] norc: andywww: This might also be the point where you could return a 418 just for the giggles.
[08:55:16] srinidhi: has joined #RubyOnRails
[08:55:49] darkxploit: has joined #RubyOnRails
[08:57:16] bookies: has joined #RubyOnRails
[08:57:30] bookies: It is a question that relate to /j aws
[08:57:55] mdw: has joined #RubyOnRails
[08:57:58] norc: andywww: https://tools.ietf.org/html/rfc4918#section-11.2
[08:58:07] norc: Just to confirm: "For example, this error condition may occur if an XML request body contains well-formed (i.e., syntactically correct), but semantically erroneous, XML instructions."
[08:58:26] andywww: yeah its perfect for the job
[08:58:30] andywww: i was just reading this
[08:58:32] andywww: https://wearestac.com/blog/raising-and-rescuing-custom-errors-in-rails
[08:58:52] andywww: i thought there might be a standard exception to raise but it appears not
[08:59:45] sevenseacat: an exception is not a response coded
[09:00:16] sevenseacat: ah, I misread the question.
[09:00:53] snowy: has joined #RubyOnRails
[09:01:15] snowy: has joined #RubyOnRails
[09:01:37] axxyhtrx: has joined #RubyOnRails
[09:03:02] fox_mulder_cp: tbuehlmann: i use linux on desktop ~5+ years, and i think, that all gui's - crazy for my eyes. really, drop some months for set up gui styling make me cry
[09:03:09] genidoi: has joined #RubyOnRails
[09:03:36] tbuehlmann: fox_mulder_cp: are you talking about gnome/unity?
[09:03:38] fox_mulder_cp: i have a very bad eyes (glasses for -20 incerase)
[09:03:44] RandomDrugsTest: has joined #RubyOnRails
[09:03:53] tbuehlmann: not sure how windows differs there
[09:04:00] tbuehlmann: I'm using i3 and I'm very happy with that
[09:04:06] fox_mulder_cp: tbuehlmann: gnome, kde, etc. i use all de and wms, exclude flux
[09:04:38] fox_mulder_cp: tbuehlmann: oh, i say about styling, not for install soft and tune it
[09:04:54] RandomDrugsTest: has joined #RubyOnRails
[09:05:02] sleungcy: has joined #RubyOnRails
[09:05:38] fox_mulder_cp: tbuehlmann: my eyes need a zooming content, and in mac/windows it only needs zoom text/menus/panels, but in linux it make fonts unreadable
[09:06:09] mikecmpbll: has joined #RubyOnRails
[09:07:04] alfiemax: has joined #RubyOnRails
[09:07:34] vedu: norc: what should the file path be here: config.logger = Logger.new(<file_path>, 0, 1.kilobyte) ?
[09:08:49] snoobydoo: has joined #RubyOnRails
[09:08:58] marr: has joined #RubyOnRails
[09:09:47] norc: vedu: There may be a more elegant solution, but Rails.root.join('log', "#{Rails.env}.log") to give you an idea is a great start.
[09:10:14] vedu: norc: right :)
[09:11:25] arBmind: has joined #RubyOnRails
[09:11:55] tjbiddle: has joined #RubyOnRails
[09:12:21] tjbiddle: Where would I change what default folder a controller looks for views in? I have no idea why - but one method is getting called, but rendering a completely different view
[09:12:40] tjbiddle: I can explicitly render it - but then it still can't find the partials that are referenced in that view
[09:12:47] tjbiddle: So that's why I believe it's looking in a different directory entirely
[09:12:51] blockchan: has joined #RubyOnRails
[09:13:11] fox_mulder_cp: tjbiddle: see logs
[09:13:12] tjbiddle: Strange, since I have another controller - that from what I can tell, is setup the exact same way (Routes, folder schema, naming, everything)
[09:13:23] tjbiddle: fox_mulder_cp: Anything specific? It says it's rendering the wrong view there
[09:13:26] fox_mulder_cp: at server console running u can know what is rendered
[09:13:45] fox_mulder_cp: tjbiddle: gist it, plz
[09:13:47] tjbiddle: Yeah - I already know it's rendering a different view
[09:14:02] tjbiddle: fox_mulder_cp: What's to gist though?
[09:14:11] tjbiddle: The controller is 5 lines - an index method, and the class name
[09:14:17] fox_mulder_cp: may be controllers, helpers, or layouts some overide
[09:14:37] fox_mulder_cp: or logic in views...
[09:14:57] rbr: vedu: config.paths['log'].first is also possible
[09:15:00] GorillaA_: has joined #RubyOnRails
[09:15:17] GorillaA_: I have a Warranty model and a Product one
[09:15:22] norc: tjbiddle: Gist your code.
[09:15:22] darkxploit: has joined #RubyOnRails
[09:15:38] blackmesa: has joined #RubyOnRails
[09:15:52] GorillaA_: I want to associate each Warranty with one Product.
[09:16:12] blockchan1: has joined #RubyOnRails
[09:17:00] norc: GorillaA_: http://guides.rubyonrails.org/association_basics.html -- have you worked through this guide already?
[09:17:13] GorillaA_: yes I am reading it
[09:17:20] norc: Great :)
[09:17:50] GorillaA_: I know that a simple index at warranty would suffice but I am confused which one to use
[09:18:07] norc: What do you mean?
[09:19:16] yatish27: has joined #RubyOnRails
[09:19:16] tjbiddle: norc: fox_mulder_cp https://gist.github.com/thomasbiddle/b647ba5fcfd16488f9465c05c3c7ae9e
[09:19:38] tjbiddle: The dashboard/index.html.erb is what's getting rendered when I call company_details#index - however settings#index works perfectly
[09:20:08] norc: tjbiddle: Alright. What URL are you requesting, and what is the error you get?
[09:20:32] workmad3: has joined #RubyOnRails
[09:20:39] tjbiddle: norc: http://localhost:3000/app/account/settings works fine http://localhost:3000/app/account/company renders dashboard#index not account::company_details#index
[09:20:45] moeabdol: has joined #RubyOnRails
[09:20:48] mauro1254: has joined #RubyOnRails
[09:21:03] tjbiddle: No errors - it's just rendering a different view entirely
[09:21:11] tjbiddle: Both in what I'm seeing in browser, as well as logs
[09:23:37] Axsuul: has joined #RubyOnRails
[09:24:00] tjbiddle: View folder name was called "company" not "company_details"
[09:24:18] tjbiddle: Strange it rendered a different view - must be from the inheritence
[09:28:49] andywww: has left #RubyOnRails: ()
[09:32:05] lessless: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[09:32:06] brandon_j_: has joined #RubyOnRails
[09:32:46] moep: has joined #RubyOnRails
[09:33:04] darkxploit: has joined #RubyOnRails
[09:35:23] siaw23: has joined #RubyOnRails
[09:35:31] allcentury: has joined #RubyOnRails
[09:39:44] bonswouar: has joined #RubyOnRails
[09:42:26] rubyonrails949: has joined #RubyOnRails
[09:43:26] lxsameer: has joined #RubyOnRails
[09:47:25] jancel: has joined #RubyOnRails
[09:47:35] AimlessRAven: has joined #RubyOnRails
[09:47:55] AimlessRAven: hi all, i list my categories direcly in index view
[09:48:06] AimlessRAven: how can i find category name witch i click
[09:51:28] dannyguk_: has joined #RubyOnRails
[09:52:25] tbuehlmann: AimlessRaven: I don't understand the question, can you elaborate?
[09:52:41] pawnbox: has joined #RubyOnRails
[09:56:48] Technodrome: has joined #RubyOnRails
[09:58:19] bruce_lee: has joined #RubyOnRails
[09:59:31] sleungcy: has joined #RubyOnRails
[10:03:35] soroot: has joined #RubyOnRails
[10:05:33] GorillaA_: What is best to use
[10:05:38] GorillaA_: cookiestore or cachestore?
[10:06:00] norc: GorillaA_: That depends on what you want to store.
[10:06:38] GorillaA_: simple session data
[10:06:42] srinidhi: has joined #RubyOnRails
[10:07:19] workmad3: GorillaA_: unless you have a good reason to need your session data to be stored server-side, I'd recommend sticking with the default cookiestore and avoiding the extra moving part
[10:08:29] GorillaA_: I want to implement a multi step form and I dont want to store a not valid record at database so I prefer to keep it until complete at session
[10:09:11] workmad3: GorillaA_: my usual advice for a multi-step form is to serve one big form to the user and turn it into a multi-step form with javascript
[10:10:09] norc: GorillaA_: As long as you don't have the need to load a new page between each step there is no need.
[10:10:27] workmad3: GorillaA_: then you don't need to worry about any workarounds for either storing intermediate data or accept intermediate submissions
[10:10:28] norc: And even then you could use local storage.
[10:11:46] GorillaA_: ok but it would be more difficult for validations etc
[10:12:41] norc: GorillaA_: Do you have a specific need to submit each specific step?
[10:14:21] kknight: has joined #RubyOnRails
[10:19:06] wd40s: has joined #RubyOnRails
[10:20:16] GorillaA_: it would require more work
[10:22:39] workmaster2n: has joined #RubyOnRails
[10:22:43] workmad3: GorillaA_: how would having one large form submit at once be more difficult for validations or require more work?
[10:23:25] workmad3: GorillaA_: the only bit it would require 'work' on is the javascript, and that's offset by the work to set up routes and rails code to handle intermediate steps
[10:24:41] moeabdol1: has joined #RubyOnRails
[10:26:46] Moeh: has joined #RubyOnRails
[10:30:48] siaw23: has joined #RubyOnRails
[10:34:19] sandelius: has joined #RubyOnRails
[10:34:20] truenito: has joined #RubyOnRails
[10:35:05] sonofdirt: has joined #RubyOnRails
[10:36:17] allcentury: has joined #RubyOnRails
[10:36:24] camilasan: has joined #RubyOnRails
[10:41:33] artto: has joined #RubyOnRails
[10:47:49] alaing_: has joined #RubyOnRails
[10:51:25] jamey-uk: has joined #RubyOnRails
[10:53:11] alaing: has joined #RubyOnRails
[10:53:49] alaing: hi does anyone know how I can copy or move a paperclip attachment from one model to another
[10:53:58] sleungcy: has joined #RubyOnRails
[10:56:02] alaing: basically a user uploads a file to my TemporaryAttachment model which stores the file under the rails root public folder. A form is shown for them to complete and fill in before submitting the form. Only once they have submitted should the attachment move from TemporaryAttachment model to DocAttachment model which would store the file on AWS S3
[11:00:46] jamey-uk: I'm trying to get my head around routes for nested resources. I'm getting this error: https://skills-experience-tool.herokuapp.com/users/1/skills/2/edit. The skills "new" and "delete" actions work but not editing or updating. What am I missing? (Codebase is here: https://github.com/jameyg/skills-experience-tool)
[11:04:43] soroot: has joined #RubyOnRails
[11:05:31] flashpoint9: has joined #RubyOnRails
[11:06:39] k3rn31: has joined #RubyOnRails
[11:08:28] rodfersou: has joined #RubyOnRails
[11:08:29] tbuehlmann: jamey-uk: without having a look at the code, I assume this will work: `simple_form_for [@user, @skill] …`
[11:08:42] siaw23: has joined #RubyOnRails
[11:09:09] srinidhi: has joined #RubyOnRails
[11:09:22] KevinSjoberg: has joined #RubyOnRails
[11:09:54] jamey-uk: tbuehlmann: That's exactly what I tried first. It gives me exactly the same error...
[11:10:48] chouhoulis: has joined #RubyOnRails
[11:11:22] tbuehlmann: I don't see where you define @user in the SkillsController
[11:11:28] tbuehlmann: so that might be nil?
[11:14:08] jamey-uk: tbuehlmann: OK so this? https://github.com/jameyg/skills-experience-tool/commit/ce24b78dc0e324d90c1e4c0e5a929677323dad96
[11:14:32] jamey-uk: tbuehlmann: That gives this error instead: https://skills-experience-tool.herokuapp.com/users/1/skills/2/edit
[11:18:02] quazimodo: has joined #RubyOnRails
[11:19:07] tbuehlmann: ah, there is a naming problem. your model is named UserSkill and the route is named skills
[11:19:47] jamey-uk: so UserSkill is the join table between User and Skill
[11:19:52] jamey-uk: like in this diagram: https://github.com/jameyg/skills-experience-tool/blob/master/erd.pdf
[11:20:07] tbuehlmann: `simple_form_for user_skill_path(@user, @skill)` will work
[11:20:49] adre: has joined #RubyOnRails
[11:20:52] tbuehlmann: so you are actually editing user_skills there, not skills
[11:21:07] jamey-uk: thanks :) so that fixes the edit route
[11:21:27] jamey-uk: but then breaks the new route… would it best for me to rename my controller to be "user_skills". Or where should I be adjusting the name?
[11:21:55] jamey-uk: I'm confusing myself with the join model I think
[11:22:12] tbuehlmann: you could work around that on all places, but I'd just rename the route, controller and views to user_skills
[11:22:43] jamey-uk: Ah OK, so in routes.rb it'd be "resources :user_skills" instead
[11:23:03] jamey-uk: and rename the views directory to user_skills too I suppose?
[11:24:24] allcentury: has joined #RubyOnRails
[11:25:23] Axsuul: has joined #RubyOnRails
[11:26:22] tbuehlmann: if you are unhappy about the route being named "user_skills" instead of just "skills", you could simple configure that in the routes with `resources :user_skills, path: 'skills'`
[11:26:34] tbuehlmann: but I'd first repair all the other places where the routes are wrong
[11:27:41] jamey-uk: so I think I'm nearly there, should just "form_for [@user, @skill]" work now?
[11:28:27] chouhoulis: has joined #RubyOnRails
[11:28:42] tbuehlmann: I'd rename that to @user_skill, too, but yeah, that should work eventually
[11:29:58] syath: has joined #RubyOnRails
[11:32:13] jamey-uk: tbuehlmann: It works! https://skills-experience-tool.herokuapp.com/users/1/user_skills/2/edit :)
[11:35:59] artto: has joined #RubyOnRails
[11:36:34] jamey-uk: tbuehlmann: so if I try renaming the instance variable to @user_skill on the new action, it says "undefined method `user_skills_path'. did you mean? user_user_skill_path"
[11:38:22] rodfersou: has joined #RubyOnRails
[11:43:59] blockchan: has joined #RubyOnRails
[11:47:02] blockchan1: has joined #RubyOnRails
[11:47:44] sleungcy: has joined #RubyOnRails
[11:47:46] srinidhi: has joined #RubyOnRails
[11:48:13] jamey-uk: has joined #RubyOnRails
[11:51:40] tbuehlmann: where does rails say that exactly?
[11:54:09] alaing: http://stackoverflow.com/questions/37747295/can-you-copy-move-an-uploaded-file-from-one-model-to-another-model
[11:56:54] lightt: has joined #RubyOnRails
[11:57:00] rikkipitt: has joined #RubyOnRails
[12:01:50] moeabdol2: has joined #RubyOnRails
[12:02:34] soroot: has joined #RubyOnRails
[12:03:10] sk0r: has joined #RubyOnRails
[12:05:29] k3rn31: has joined #RubyOnRails
[12:05:34] srinidhi: has joined #RubyOnRails
[12:06:28] ElFerna: has joined #RubyOnRails
[12:06:47] Niham: has joined #RubyOnRails
[12:07:44] artto: has joined #RubyOnRails
[12:12:48] ldnunes: has joined #RubyOnRails
[12:13:04] adre: has joined #RubyOnRails
[12:13:21] m_antis: has joined #RubyOnRails
[12:13:37] sandelius: has joined #RubyOnRails
[12:17:28] sergio_101: has joined #RubyOnRails
[12:17:37] quazimodo: has joined #RubyOnRails
[12:17:43] groatyoats: has joined #RubyOnRails
[12:21:21] jancel: has joined #RubyOnRails
[12:22:10] dionysus69: has joined #RubyOnRails
[12:23:50] soroot: he guy, I'm currently working on a rails project with an mongodb and want to do the authentication with bcrypt, but i alwas get an "undefined local variable or method `has_secure_password' " error. maybe someone sees the issue https://ptpb.pw/Lexu
[12:23:58] sonofdirt: has joined #RubyOnRails
[12:27:35] c355E3B: has joined #RubyOnRails
[12:27:52] tbuehlmann: SoRoot: I don't think Mongoid::Document includes such a method
[12:28:39] binaryplease: has joined #RubyOnRails
[12:29:06] sevenseacat: its an ActiveModel method, no?
[12:30:19] soroot: tbuehlmann: so what can I use instead?
[12:30:57] rvanlieshout: you could try to include it in the model
[12:31:02] tbuehlmann: you could include/extend ActiveModel::SecurePassword and if that doesn't work, you could copy the code, it's not much
[12:31:17] tbuehlmann: https://github.com/rails/rails/blob/869a90512f36b04914d73cbf58317d953caea7c5/activemodel/lib/active_model/secure_password.rb#L53
[12:31:51] Xentil: has joined #RubyOnRails
[12:32:03] flashpoint9: has joined #RubyOnRails
[12:34:38] triangles: has joined #RubyOnRails
[12:34:40] artto: has joined #RubyOnRails
[12:34:52] blackmesa: has joined #RubyOnRails
[12:37:53] pawnbox: has joined #RubyOnRails
[12:38:53] tknz: has joined #RubyOnRails
[12:39:41] soroot: tbuehlmann: include ActiveModel::ScurePassword did it. thx man
[12:41:47] sleungcy: has joined #RubyOnRails
[12:47:17] rikkipitt: has joined #RubyOnRails
[12:51:10] qba73: has joined #RubyOnRails
[12:54:46] fmcgeough: has joined #RubyOnRails
[12:56:34] der-landgraf: has joined #RubyOnRails
[12:57:40] der-landgraf: has joined #RubyOnRails
[12:58:43] noobsu: has joined #RubyOnRails
[12:59:29] phredus: has joined #RubyOnRails
[13:00:38] ramortegui: has joined #RubyOnRails
[13:00:54] dstarh: has joined #RubyOnRails
[13:01:32] honeyroasted: has joined #RubyOnRails
[13:01:51] roamingdog: has joined #RubyOnRails
[13:03:21] jamey-uk: tbuehlmann: It's here: https://skills-experience-tool.herokuapp.com/users/1/user_skills/2/edit. My commit: https://github.com/jameyg/skills-experience-tool/commit/b97ab044a33db2d7266840724499d6dbc06958a9. (Ignore the typo, I corrected it and redeployed.)
[13:04:10] tbuehlmann: you are missing the @user again: `simple_form_for [@user, @user_skill]`
[13:04:37] blockchan: has joined #RubyOnRails
[13:04:56] sk0r: has joined #RubyOnRails
[13:04:56] jamey-uk: tbuehlmann: oh :) I guess I'm really lacking in my understanding of this still, thank you
[13:05:16] jamey-uk: I don't really understand the logic that form_for employs to infer the correct URL
[13:05:18] tbuehlmann: your routes are nested, when you want to reach a nested route you have to provide the full path of objects
[13:06:03] jamey-uk: ah right, so the parent and the child
[13:06:11] jamey-uk: it makes sense, I just hadn't logically got there intuitively
[13:06:45] lxsameer: has joined #RubyOnRails
[13:08:56] hutchy: has joined #RubyOnRails
[13:08:56] jancel: has joined #RubyOnRails
[13:10:04] roamingdog: has joined #RubyOnRails
[13:12:01] dannyguk: has joined #RubyOnRails
[13:12:04] blackmesa: has joined #RubyOnRails
[13:16:26] sharkman: has joined #RubyOnRails
[13:16:33] chouhoulis: has joined #RubyOnRails
[13:16:55] aegis3121: has joined #RubyOnRails
[13:17:03] morfin: has joined #RubyOnRails
[13:18:28] morfin: what do you do if need to have relations between different entities and other type(as example posts and comments, news and comments, articles and comments)?
[13:18:56] morfin: STI?polymorphism?or just create separate table for different types of relations?
[13:19:05] KevinSjoberg: has joined #RubyOnRails
[13:20:05] snowy: has joined #RubyOnRails
[13:23:22] chouhoulis: has joined #RubyOnRails
[13:27:48] Axsuul: has joined #RubyOnRails
[13:28:42] pawnbox: has joined #RubyOnRails
[13:29:01] workmad3: morfin: that's normally handled with a polymorphic association in rails (which has nothing to do with STI)
[13:30:35] dionysus70: has joined #RubyOnRails
[13:33:26] morfin: i heard polymorphic associations are not good
[13:34:32] artto: has joined #RubyOnRails
[13:35:41] nertzy2: has joined #RubyOnRails
[13:36:02] sleungcy: has joined #RubyOnRails
[13:37:29] aegis3121: has joined #RubyOnRails
[13:37:47] sonofdirt: has joined #RubyOnRails
[13:38:54] Niham: has joined #RubyOnRails
[13:41:13] mdw: has joined #RubyOnRails
[13:43:40] mdw: has joined #RubyOnRails
[13:44:13] yellow5: has joined #RubyOnRails
[13:44:31] mdw: has joined #RubyOnRails
[13:45:51] sharkman: wow morfiin why o polymorphc associations suck
[13:46:54] apeiros: sharkman: mind to explain why?
[13:47:11] frem_: has joined #RubyOnRails
[13:47:17] sharkman: im asking why, morfin above wrote that
[13:47:42] apeiros: didn't read that way
[13:48:46] sandelius: has joined #RubyOnRails
[13:49:52] sevenseacat: "morfin: i heard polymorphic associations are not good"
[13:49:56] sevenseacat: read that way to me
[13:50:02] dhoelzer: morfin: Whoever told you that it's not good to use polymorphic associations didn't know what they were talking about.
[13:50:27] dhoelzer: In context, I think it was more a commentary on whether or not they should be used, not whether or not they have been implemented well.
[13:50:30] apeiros: sevenseacat: yes, morfins statement read that way. but sharkman's didn't read as a question.
[13:50:58] sevenseacat: you miss one letter and everyone's a critic
[13:51:27] apeiros: sevenseacat: I read it as "oh", I see now that they missed a "d" and the "?"
[13:51:45] apeiros: dhoelzer: they do have a specific disadvantage - you can't have proper foreign keys for them
[13:52:16] apeiros: sevenseacat: also "not good" != "suck"
[13:52:22] Ergo: has joined #RubyOnRails
[13:55:15] dhoelzer: apeiros: That's true, but they certainly aren't bad practice. They fill a very important need.
[13:56:02] quazimodo: has joined #RubyOnRails
[13:56:08] soroot: has joined #RubyOnRails
[13:57:01] apeiros: dhoelzer: sure. not saying anything else. but it's certainly far from "whoever said polys are not good has no idea".
[13:57:34] workmad3: yeah... I was considering pointing that out in my initial pointer to them, but it's Friday and I CBA :)
[13:58:50] k3rn31: has joined #RubyOnRails
[13:59:07] apeiros: personally I do use polys, but I try to avoid them, as I value database consistency quite a bit.
[14:00:05] norc: It depends on the problem. For some polymorphic associations can be quite useful. I would say that paper trail is a decent example of their usefulness.
[14:00:21] workmad3: apeiros: pretty similar here... I try to avoid them and only use them if avoiding them results in a really difficult schema
[14:00:41] apeiros: workmad3: same
[14:00:56] workmad3: norc: 'It depends on the problem' <-- true for every single decision you make ;)
[14:01:32] lubekpl: has joined #RubyOnRails
[14:01:46] norc: workmad3: Indeed. As such generalised statements such as "A sucks" or "B is the greatest thing" are not fairly useful.
[14:03:29] apeiros: so generic statements suck? :D
[14:04:44] lupine: weeelllll, heuristics are a thing
[14:04:49] lupine: that's the whole point of design patternsa
[14:05:59] lupine: (activerecord-the-pattern is, of course, an anti-pattern)
[14:07:35] schmoot: has joined #RubyOnRails
[14:08:34] gingray: has joined #RubyOnRails
[14:09:12] lupine: a pattern patterning pattern heuristic might be to evaluate patterns based on how many other patterns they violate
[14:09:29] lupine: activerecord-the-pattern performs poorly in such an evaluation
[14:10:02] lupine: on the upside, it does free you from needing to put much upfront thought into your database accesses
[14:10:05] jancel: has joined #RubyOnRails
[14:10:50] apeiros: lupine: paraphrasing: you say AR violates a lot of other patterns?
[14:11:01] eljimbo: has joined #RubyOnRails
[14:11:03] sergey_makagon: has joined #RubyOnRails
[14:11:05] lupine: aye, I don't think that's particularly contentious
[14:11:23] Fernando-Basso: Can I make a view helper be used in the mailer?
[14:11:39] Fernando-Basso: I am getting "undefined method app_title".
[14:11:46] apeiros: lupine: I haven't actually bothered until today to figure which patterns violate which other patterns - I'm curious, which patterns does AR violate?
[14:11:58] lupine: SRP would be an obvious, and egregious, example
[14:12:42] IFrank00: has joined #RubyOnRails
[14:12:43] apeiros: AR (the pattern, not rails' AR) does that? I'd say a models SRP is mapping objects to tables. no?
[14:13:07] lupine: that's one thing it does. it also deals with persistence, projections, business logic, etc, etc
[14:13:26] lupine: dhh is strongly of the opinion that rolling all this together is a win, of course
[14:13:29] JesseH2: has joined #RubyOnRails
[14:13:40] lupine: and maybe he's right for rails's sweet spot
[14:14:08] apeiros: lupine: no, business logic is rails' AR, not the pattern. or am I mistaken?
[14:14:23] apeiros: and of course, mapping objects to tables involves persistence…
[14:14:52] lupine: it's generally included in the pattern, but we're both likely to bleed over into AR's specific implementation of it, of course
[14:14:58] lupine: apeiros: it really doesn't
[14:15:27] apeiros: how do you map an object to a table without persistence? now I'm really curious :D
[14:15:45] lupine: it's a mapping of attributes to other-named attributes and back again
[14:15:49] lupine: what you store it in is by the by
[14:16:05] lupine: as is query construction ^^
[14:16:10] naftilos76: has joined #RubyOnRails
[14:16:59] apeiros: lupine: #ruby-offtopic? don't want to spam this channel…
[14:17:10] lupine: activerecord vs. repository vs. other options has been raging for years, I doubt we're going to solve it ^^
[14:17:34] apeiros: oh, I'm not about solving. I'm just being curious.
[14:17:59] lxsameer: has joined #RubyOnRails
[14:19:07] workmad3: lupine: SRP is a principle not a pattern btw...
[14:20:35] lupine: sure, I'm not being hugely precise
[14:21:07] workmad3: lupine: well, it's a fairly important distinction given what you were proposing as a metric ;)
[14:21:20] lupine: only if I were being precise about pattern vs. principle, which I was not
[14:22:12] workmad3: lupine: well, 'violating a pattern' is somewhat meaningless... most patterns that aren't specialisations are going to prohibit a huge number of other patterns (in fact, pretty much all of them if you're following SRP) so by that metric, all patterns are also anti-patterns
[14:22:38] workmad3: lupine: but if you're going to use a metric based on violating the SOLID principles or some other set of design principles, then you're on stronger grounds ;)
[14:22:42] lupine: to varying amounts
[14:22:44] emptyflask: has joined #RubyOnRails
[14:23:15] lupine: "OMG this pattern excludes use of this other pattern so it is bad" is obviously insane
[14:23:49] mauro1254: Hi guys, is it possible to share session between two rails app (app1 rails 4.2.6, app2 rails 5.0.0rc1) using activerecord session store?
[14:24:29] workmad3: lupine: I'd also point out that design principles like SRP fill a very different role to design patterns (for starters, principles are much more open to interpretation and give much less guidance on how to fulfil them), so using the terms interchangably is a minefield
[14:24:30] vedu: What is correct way to rotate logs in production? I tried this, but in vain: http://stackoverflow.com/questions/37750650/rails-how-to-correctly-rotate-logs
[14:25:00] lupine: TBH this is getting far too detailed for a throwaway comment, so I'll leave you to it
[14:25:15] workmad3: vedu: depends on what your log management situation is
[14:25:33] phredus: has joined #RubyOnRails
[14:25:58] agent_white: has joined #RubyOnRails
[14:26:11] vedu: workmad3: I just want to delete the logs if they get over 1 MB
[14:26:23] vedu: that SO question is asked by me
[14:26:26] lxsameer: has joined #RubyOnRails
[14:28:08] sonofdirt: has joined #RubyOnRails
[14:30:04] sleungcy: has joined #RubyOnRails
[14:31:12] prithaj: has joined #RubyOnRails
[14:31:22] svankmajer: has joined #RubyOnRails
[14:33:13] tjbiddle: has joined #RubyOnRails
[14:33:33] Rodya_: has joined #RubyOnRails
[14:33:37] sonofdirt: has joined #RubyOnRails
[14:33:42] tjbiddle: Anyone here using Stripe? Just wondering if anyone has examples of subscription plans - or can share their flow in general?
[14:34:44] tjbiddle: It seems I'll want something like "Here are the plans available - here are ones you can switch to" - they click the appropriate stripejs form. When I had rendered the page, I would have made it include their stripe customer ID if one was already made - and show the appropriate form, otherwise, enter in credit card?
[14:34:54] polishdub: has joined #RubyOnRails
[14:37:11] kies: has joined #RubyOnRails
[14:41:45] Axilla: vedu: log rotater
[14:41:49] Axilla: logrotate*
[14:42:01] vedu: axilla: yeah I am going through that :)
[14:42:09] Axilla: that's all you need then
[14:44:43] polishdub: has joined #RubyOnRails
[14:50:30] tildes_: has joined #RubyOnRails
[14:54:19] adavia: has joined #RubyOnRails
[14:55:18] vedu: axilla: do you use it in production? I got a crash due a race condition when I was using the ruby log rotate. This wont happen in logrotate?
[14:56:01] diegoviola: has joined #RubyOnRails
[14:57:49] davidw: has joined #RubyOnRails
[14:58:35] sonofdirt: has joined #RubyOnRails
[15:00:27] matejkonrad: has joined #RubyOnRails
[15:02:00] Leepoff: has joined #RubyOnRails
[15:03:03] Circuit8: Hey guys, about to start a big rails project. Im thinking of just going ahead and using Rails5 seeing as it only has 3 issues left on Github. Just wondering if I'm going to have any problems with gems not being compatible, or anything else I'm not aware of?
[15:04:23] squaresurf: has joined #RubyOnRails
[15:07:43] macsteps: has joined #RubyOnRails
[15:08:00] marr123: has joined #RubyOnRails
[15:08:10] groatyoats: has joined #RubyOnRails
[15:08:34] aegis3121: has joined #RubyOnRails
[15:09:34] tubbo: Circuit8: typically, gems that don't have a released version compatible with rails 5 will be compatible on the master branch. so i've had good luck with just making those gems pull from github rather than rubygems.
[15:09:56] tubbo: but i've noticed more and more gems are releasing .pre or .beta releases that can at least get you developing a rails 5 app.
[15:09:58] wd40s: has joined #RubyOnRails
[15:10:09] tubbo: vedu: everyone uses logrotate in production.
[15:10:14] workmad3: Circuit8: or they may have a `rails5` branch with support
[15:10:31] tubbo: honestly though i think you'd have to be wary of those gems
[15:10:39] vedu: tubbo: okay that settles it then :D
[15:10:59] tubbo: like they might not be supported/maintained much because it's really not hard at all for the maintainer to release a .pre or .beta to rubygems
[15:11:07] workmad3: tubbo: or you set up logging to stdout and capture with runit... or configure logging to syslog and handle it there, or go to syslog and ship to a remote service...
[15:11:12] tubbo: and trust me, people will complain
[15:11:13] dionysus69: has joined #RubyOnRails
[15:11:37] tubbo: workmad3: that may be true, but your OS is probably using logrotate as well ;)
[15:11:56] workmad3: tubbo: right... but a centralised greylog service holding your logs in mongodb isn't ;)
[15:11:58] tubbo: or maybe every single company i've ever worked for has just had that set up?
[15:12:07] tubbo: workmad3: i hope not
[15:12:27] workmad3: tubbo: but yeah... for single-server setups, it's hard to beat logrotate
[15:12:40] tubbo: i'm iffy on the syslog thing
[15:12:45] Sylario: has joined #RubyOnRails
[15:12:55] tubbo: i'm all for logging as event streams, but reading those streams in syslog was always a little painful to me
[15:13:09] tubbo: i wish there was a easy way to just read different tagged logs...or maybe i'm just dumb and don't know it
[15:13:14] workmad3: tubbo: I think runit handles its own logrotation without logrotate btw
[15:13:23] tubbo: oh it does? i haven't used runit in ages
[15:13:31] ksoze: has joined #RubyOnRails
[15:14:21] tjbiddle: has joined #RubyOnRails
[15:14:26] workmad3: tubbo: and yeah, a plain old syslog server can be pretty annoying to deal with... I tend to replace with rsyslog 8+ (as it has nicer config options) and if possible just use it as a transport layer to a better logging system
[15:15:00] yellow5: has joined #RubyOnRails
[15:15:27] workmad3: the main reason to then have a syslog setup is so you can easily grab the logs from all the various services set up to use syslog without reconfiguring every damn thing on the system :)
[15:16:38] n1lo: has joined #RubyOnRails
[15:16:44] beingjohnm: anybody have any tips for migrating a rails appliction from integer id to UUID? I see somebody created a gem to do it (https://github.com/kreatio-sw/webdack-uuid_migration) but would love to hear advice before going down the path.
[15:17:11] workmad3: or the other thing that's quite common - getting your logs into syslog so you can take advantage of log monitoring tools (like ossec, fail2ban, etc.) to provide automated responses to various events
[15:19:22] Circuit8: tubbo: OK I see. So to conclude: the gems that dont have rails5 support, you shouldnt be using anyway!
[15:20:28] tubbo: Circuit8: well, i'm not gonna tell you what to do...but i'd at least pop over to their github and see what's going on
[15:20:42] tubbo: that's kind-of the deal with draper. i have to manually hack a file in draper's source so that rails doesn't shit the bed when i call `rake` :P
[15:20:52] tubbo: and no one is really maintaining it anymore.
[15:24:11] sleungcy: has joined #RubyOnRails
[15:25:18] disgrntld: has joined #RubyOnRails
[15:26:36] hobodave: has joined #RubyOnRails
[15:27:58] chopin: has joined #RubyOnRails
[15:28:06] kgrz: has joined #RubyOnRails
[15:29:37] jancel: has joined #RubyOnRails
[15:30:41] shinnya: has joined #RubyOnRails
[15:32:21] Circuit8: tubbo: Oh what? I have draper in my list of gems to try with this project
[15:32:36] BaNzounet: has joined #RubyOnRails
[15:32:40] tubbo: yeah that one is a bit annoying to get working w/rails 5 last i checked
[15:32:58] tubbo: you have to first install activemodel-serializers-xml, then you have to hack draper's lib/tasks/test.rake and basically delete it because its useless
[15:33:04] tubbo: for some reason its being included in your rake tasks
[15:33:13] Circuit8: tubbo: OK I see
[15:33:32] tubbo: or you could just make your own presenter class by extending ActiveModel::Naming and subclassing Delegator.. ;)
[15:33:38] tubbo: presenter base class*
[15:33:49] Circuit8: tubbo: Yeah that doesn't sound too tough
[15:34:12] Rodya_: has joined #RubyOnRails
[15:34:24] lxsameer: has joined #RubyOnRails
[15:34:26] Circuit8: tubbo: I think I'll try and install rails 5 with the gems I wanna use and see what fireworks go off
[15:34:34] cschneid: has joined #RubyOnRails
[15:34:41] Circuit8: tubbo: Thanks
[15:34:57] pawnbox: has joined #RubyOnRails
[15:35:44] BaNzounet: Hey, if I've a has_many relation such as @current_user.coupons, is it possible to have a scope in Coupon (e.g. : `scope, -> { where(foo: user_id) }`), where I could use the user_id attributes to avoid doing : @current_user.coupons.valid(@current_user.id)
[15:36:16] macsteps: has joined #RubyOnRails
[15:40:25] samuel02: has joined #RubyOnRails
[15:40:49] codeshah: has joined #RubyOnRails
[15:42:41] tubbo: Circuit8: go for it!
[15:43:39] tubbo: BaNzounet: you can just do @current_user.coupons...because Coupon belongs_to User...
[15:45:12] BaNzounet: tubbo: Sorry wrong example, I should have say another scope .valid where I could use the current user_id
[15:45:57] BaNzounet: to do something like `@current_user.coupons.valid` and in valid `where(foo: user_id)`
[15:45:58] artto: has joined #RubyOnRails
[15:46:25] AlexJakeGreen: has joined #RubyOnRails
[15:47:47] macsteps: has joined #RubyOnRails
[15:48:00] rueben_: has joined #RubyOnRails
[15:48:21] sonofdirt: has joined #RubyOnRails
[15:49:08] BaNzounet: I cannot use a join, I'm using the user_id in a sub query inside that scope
[15:50:26] emptyflask: has joined #RubyOnRails
[15:54:36] Oliphaunte: has joined #RubyOnRails
[15:54:39] tubbo: BaNzounet: my answer hasn't changed, so there's something you must be doing that you're not tellin gme
[15:54:42] tubbo: telling me*
[15:55:12] jamey-uk: has left #RubyOnRails: ()
[15:55:20] tubbo: BaNzounet: do you want to select by a different field in the coupons table or something?
[15:55:46] tubbo: if that's the case, you might want to create another has_many, or think about a self-referential JOIN
[15:56:10] tubbo: like has_many :valid_users or something. you can also apply a proc to a has_many if you need further drilling down
[15:56:21] tubbo: BaNzounet: !querying for more on that advanced AR querying stuff
[15:56:21] helpa: BaNzounet: http://guides.rubyonrails.org/active_record_querying.html - ActiveRecord Querying Guide by Ryan Bigg
[15:56:46] tubbo: wait a second hold on
[15:57:01] tubbo: thought that was an advanced guide for some reason
[15:57:19] kies: has joined #RubyOnRails
[15:58:24] SteenJobs: has joined #RubyOnRails
[15:59:10] whathappens: has joined #RubyOnRails
[15:59:19] Malgorath: has joined #RubyOnRails
[16:00:28] smathy: has joined #RubyOnRails
[16:00:44] emptyflask: has joined #RubyOnRails
[16:00:45] Malgorath: I'm doing an inspect on a variable (g.inspect) and get the results #<ProcessListGroup id: 2, shortname: "ENG", fullname: "Engineers", description: "description", created_at: "2016-06-10 10:29:15", updated_at: "2016-06-10 10:29:15"> in the view, but when I try to do <%= g.shortname %> I get an error undefined method 'shortname' for nil:NilClass
[16:02:29] tubbo: Malgorath: you must be doing g.inspect at a point in your code when g is not nil, but in your erb template you haven't set up a g local variable
[16:03:53] BaNzounet: tubbo: To give you the full picture I've some coupon that can only be used if he hasn't ordered yet, so in my valid scope, I do (SELECT COUNT(*) FROM orders WHERE user_id = ?), and in that scope (`def self.valid`) user_id doesn't exist
[16:04:52] alfiemax: has joined #RubyOnRails
[16:05:06] Malgorath: tubbo: <strong>[<% g = t.todo_item.group %><%= g.shortname %>]</strong> (change g.shortname to g.inspect and it works)
[16:08:36] SteenJobs: hey guys - anyone know how to include two separate nginx.conf in a rails app, one for prod and one for staging?
[16:10:08] nettoweb: has joined #RubyOnRails
[16:11:20] Malgorath: has joined #RubyOnRails
[16:11:52] Oliphaunte: has joined #RubyOnRails
[16:12:03] [Butch]: has joined #RubyOnRails
[16:12:21] Malgorath: tubbo, the only reason I added the <%= g.inspect %> was because I was orginally getting an issue with t.todo_list.group.shortname giving the nil error
[16:12:26] GreatDanton: has joined #RubyOnRails
[16:14:03] axl_: has joined #RubyOnRails
[16:14:25] David_H_Smith: has joined #RubyOnRails
[16:15:39] jancel: has joined #RubyOnRails
[16:16:16] dblessing: has joined #RubyOnRails
[16:18:11] sleungcy: has joined #RubyOnRails
[16:18:20] Malgorath: >.< nvm, just needed to add a def to model to get it to default to what I wanted.
[16:18:35] VeryBewitching: has joined #RubyOnRails
[16:20:21] artto: has joined #RubyOnRails
[16:21:27] VeryBewitching: Trying to make use of Tyrant and am getting 'no implicit conversion of Symbol into Integer' when calling auth = Tyrant::Authenticatable.new(@member), anyone have any experience with Tyrant around?
[16:23:33] tildes_: has joined #RubyOnRails
[16:24:30] andywww: has joined #RubyOnRails
[16:24:40] dannyguk: has joined #RubyOnRails
[16:29:28] moeabdol2: has joined #RubyOnRails
[16:30:46] lubekpl: has joined #RubyOnRails
[16:31:00] zave: has joined #RubyOnRails
[16:32:23] alfiemax: has joined #RubyOnRails
[16:35:00] Rodya_: has joined #RubyOnRails
[16:37:44] mdw: has joined #RubyOnRails
[16:42:20] whathappens: has joined #RubyOnRails
[16:42:29] Dreamer3_: has joined #RubyOnRails
[16:47:46] flashpoint9: has joined #RubyOnRails
[16:49:57] ravster: has joined #RubyOnRails
[16:50:34] arup_r: has joined #RubyOnRails
[16:50:55] smathy: VeryBewitching, !gist your code and the full error (incl stack)
[16:50:55] helpa: VeryBewitching: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[16:52:18] banister: has joined #RubyOnRails
[16:53:59] emptyflask: has joined #RubyOnRails
[16:54:16] SteenJobs: any idea why the shared_path and current_path vars for capistrano are not reflecting my deploy_to path? instead it’s defaulting to /var/www. this is when accessing the vars in separate staging/production deploy files
[16:54:35] pilne: has joined #RubyOnRails
[16:54:50] flashpoint9: has joined #RubyOnRails
[16:55:21] VeryBewitching: smathy: https://gist.github.com/bewitchingme/cf953dac1ab8ff7d8cb4c40bce1a9505
[16:55:22] pragmatism: has joined #RubyOnRails
[16:55:59] dorje: has joined #RubyOnRails
[16:56:27] VeryBewitching: smathy: It *looks* like it's failing after Disposable::Twin::Setup#setup_properties! I tried to debug it with RubyMine, once it loops through the fields in the schema it dies with that error.
[16:57:15] VeryBewitching: smathy: https://github.com/apotonick/disposable/blob/master/lib/disposable/twin/setup.rb#L21
[16:58:34] sumobob: has joined #RubyOnRails
[16:59:08] sharkman: has joined #RubyOnRails
[16:59:09] dorje_: has joined #RubyOnRails
[17:01:01] chouhoul_: has joined #RubyOnRails
[17:01:37] smathy: VeryBewitching, you haven't shown the stack trace into the gems.
[17:02:06] aegis3121: has joined #RubyOnRails
[17:02:48] chouhoul_: has joined #RubyOnRails
[17:03:28] VeryBewitching: smathy: https://gist.github.com/bewitchingme/cf953dac1ab8ff7d8cb4c40bce1a9505
[17:03:36] codeshah: has joined #RubyOnRails
[17:05:01] artto: has joined #RubyOnRails
[17:05:11] norc: has joined #RubyOnRails
[17:09:22] SteenJobs: aright - it seems like cap is setting the various puma related paths before deploy_to gets executed, so it uses the default value for those paths - does anyone have experience setting up separate prod and staging envs with capistrano that involve puma config?
[17:10:18] smathy: VeryBewitching, right, so that means that @model here https://github.com/apotonick/disposable/blob/master/lib/disposable/twin/struct.rb#L9 is an Array, not an AR model as expected.
[17:11:26] smathy: ...which makes no sense.
[17:11:35] rikkipitt: has joined #RubyOnRails
[17:12:17] smathy: VeryBewitching, I'd jump into the gitter chat and ask there, seems like your code is doing the right thing: http://trailblazer.to/
[17:12:50] SteenJobs: tubbo: it doesn’t look like staging.rb/productin.rb override deploy.rb…it seems deploy.rb is executed first
[17:12:56] dblessing: has joined #RubyOnRails
[17:13:38] dorje: has joined #RubyOnRails
[17:13:49] smathy: SteenJobs, those two statements don't gel. The way for the {staging,production}.rb to override deploy.rb IS for deploy.rb to be executed first.
[17:14:28] pixilla: has joined #RubyOnRails
[17:15:16] SteenJobs: smathy: to clarify - if i’m setting specific stage config in deploy.rb using vars such as shared_path/current_path, but deploy_path is set in {staging,production}.rb, they’re nil when deploy.rb is executed and therefore the default /var/www path is being used
[17:15:23] SteenJobs: is the current hypothesis
[17:15:52] VeryBewitching: smathy: Ya, I have, quiet in there today.
[17:16:46] dorje_: has joined #RubyOnRails
[17:19:48] smathy: SteenJobs, you shouldn't be setting deploy_path anywhere, only deploy_to
[17:19:56] SteenJobs: ya that’s what i meant
[17:19:57] SteenJobs: sorry mistyped
[17:20:00] sonofdirt: has joined #RubyOnRails
[17:20:08] SteenJobs: the server isn’t working so super under pressure and stressed
[17:20:14] SteenJobs: deploy_to is set separately in each env file
[17:20:18] smathy: SteenJobs, !gist it all
[17:20:18] helpa: SteenJobs: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[17:20:29] SteenJobs: right now it’s all a mess, i keep moving things around
[17:20:32] SteenJobs: i’ll gist how ti is now
[17:21:48] mostlybadfly: has joined #RubyOnRails
[17:22:19] smathy: Gist how you think it should be.
[17:24:02] snowy: has joined #RubyOnRails
[17:25:03] sergey_makagon: has joined #RubyOnRails
[17:25:04] SteenJobs: smathy: https://gist.github.com/jesiegel1/534882088bb738828cd356b066df18cc
[17:25:17] SteenJobs: lemme update
[17:25:41] pilne: before i dive into rails (i do want to, but i do have a use case), i'm picturing a setup with a database of users, for login, and "what they can access" type stuff. and a database of data collected from the user's input. separate databases in my head. is this (or something that will behave as such) easy to do in rails?
[17:26:36] SteenJobs: smathy: updated
[17:29:49] noobsu_: has joined #RubyOnRails
[17:31:31] guacamole: has joined #RubyOnRails
[17:31:34] mwlang: has joined #RubyOnRails
[17:32:28] mwlang: any recommendations for a gravatar gem? rubytoolbox doesn’t seem to organize these into a category that lets me see popularity easily and the first four I looked at are all 3 or 4 years stale.
[17:34:12] ksoze: has joined #RubyOnRails
[17:34:25] SteenJobs: smathy: i can’t get shared_path and current_path to be the correct values
[17:35:17] xybre: mwlang: it's not much code. https://github.com/Wixel/ruby-gravatar/blob/master/lib/rb-gravatar.rb
[17:35:42] tildes_: has joined #RubyOnRails
[17:35:46] Rodya_: has joined #RubyOnRails
[17:37:09] snowy: has joined #RubyOnRails
[17:37:13] mwlang: thanks, xybre. that might be best route to take.
[17:37:29] adre: has joined #RubyOnRails
[17:40:02] Malgorath: I have a resouce :task_list is there a way to pass a variable in my route file to it like you can do with get ":tasklist_id/addtaskitem"
[17:44:00] andywww: has joined #RubyOnRails
[17:44:43] andywww: has left #RubyOnRails: ()
[17:45:07] dblessing: has joined #RubyOnRails
[17:46:03] andywww: has joined #RubyOnRails
[17:46:24] sergey_makagon: has joined #RubyOnRails
[17:46:40] andywww: if typhoeus is a pretty good wrapper to the url library, where does faraday sit in the equation?
[17:46:48] andywww: curl, not url
[17:47:08] andywww: does it replace something? or is it a different component?
[17:47:18] jancel: has joined #RubyOnRails
[17:47:52] Coldblackice: has joined #RubyOnRails
[17:48:48] cnk: has joined #RubyOnRails
[17:49:54] arup_r: has joined #RubyOnRails
[17:50:42] aegis3121: has joined #RubyOnRails
[17:51:33] sonofdirt: has joined #RubyOnRails
[17:57:18] dblessing: has joined #RubyOnRails
[17:58:37] wd40s: has joined #RubyOnRails
[17:59:44] yellow5: has joined #RubyOnRails
[17:59:53] ravster: pilne: Rails out of the box supports only one DB at a time. Multiple DBs are possible, but that is going to entail a lot more custom work.
[18:00:17] tubbo: pilne: why do you want separate databases?
[18:00:51] Axsuul: has joined #RubyOnRails
[18:01:01] sypheren: has joined #RubyOnRails
[18:01:08] hackeron: has joined #RubyOnRails
[18:02:03] ksoze: has joined #RubyOnRails
[18:04:24] pilne: i don't "need" them, it was just the first solution my brain came up with, as long as i can have a user login, with three kinds of users (vendor, employee, admin), and a place that stores their inputted data. i'll be happy as a pig in slops
[18:04:59] tubbo: pilne: couldn't they be all tables within the same database? (a "database" has a specific meaning in this case fwiw)
[18:05:15] tubbo: like one could say "we have a database of user profile data", but that could just be one table in a postgresql database
[18:05:33] pilne: i don't see why not, i'm moderately new to webdev, not programming, and definitely new to rails, i do have a bit of ruby experience.
[18:05:42] sharkman: has joined #RubyOnRails
[18:06:11] tubbo: pilne: that would certainly be easier for rails to deal with
[18:06:23] tubbo: but realistically, you shouldn't really be thinking about the database much when trying to decide what goes in your app.
[18:06:40] tubbo: rails abstracts that for you. the kind of stuff you're looking to do here doesn't seem too complex, rails will handle it just fine in 1 db
[18:07:41] codeshah: has joined #RubyOnRails
[18:08:00] djbkd: has joined #RubyOnRails
[18:08:21] mdw: has joined #RubyOnRails
[18:09:14] chouhoulis: has joined #RubyOnRails
[18:10:20] chouhoulis: has joined #RubyOnRails
[18:11:58] helpa-bot: has joined #RubyOnRails
[18:12:50] sergey_m_: has joined #RubyOnRails
[18:15:06] blackmesa: has joined #RubyOnRails
[18:15:40] Oliphaunte: has joined #RubyOnRails
[18:16:44] Leepoff: has joined #RubyOnRails
[18:17:37] helpa: has joined #RubyOnRails
[18:18:42] iooner: has joined #RubyOnRails
[18:21:25] pilne: tyvm tubbo :)
[18:21:48] Megamos: has joined #RubyOnRails
[18:22:11] manfrin: has joined #RubyOnRails
[18:24:10] agit0: has joined #RubyOnRails
[18:24:23] sergey_makagon: has joined #RubyOnRails
[18:25:32] DoctorMonocular: has joined #RubyOnRails
[18:29:44] sleungcy: has joined #RubyOnRails
[18:30:15] helpa-bot: has joined #RubyOnRails
[18:30:46] davidklsn: has joined #RubyOnRails
[18:31:10] yfeldblum: has joined #RubyOnRails
[18:31:32] sleungcy: has joined #RubyOnRails
[18:32:16] helpa: has joined #RubyOnRails
[18:32:42] EzekielGabrielse: has joined #RubyOnRails
[18:33:50] arup_r: has joined #RubyOnRails
[18:34:47] andywww: has joined #RubyOnRails
[18:35:11] EzekielGabrielse: Needing some help with active model serializers. How do you render only meta data via an arbitrary hash? I would do `render: {meta: {...}}.to_json`, but I want the automatic key transform from AMS.
[18:35:16] diegoaguilar: has joined #RubyOnRails
[18:35:27] Dimik: has joined #RubyOnRails
[18:36:30] Rodya_: has joined #RubyOnRails
[18:39:28] smathy: SteenJobs, right, so remember when you read this page I linked you to http://capistranorb.com/documentation/getting-started/configuration/ and remember when you read about using lambdas to delay evaluation until it's actually needed? Do that.
[18:42:02] sleungcy: has left #RubyOnRails: ()
[18:43:48] arup_r: hi smathy :)
[18:44:33] codeshah: has joined #RubyOnRails
[18:46:36] kies: has joined #RubyOnRails
[18:49:13] svankmajer: has joined #RubyOnRails
[18:50:14] Pazician: has joined #RubyOnRails
[18:50:14] Pazician: has joined #RubyOnRails
[18:51:19] B1n4r10: has joined #RubyOnRails
[18:54:52] samuel02: has joined #RubyOnRails
[18:55:10] zeke: has joined #RubyOnRails
[18:55:18] jas02: has joined #RubyOnRails
[18:55:41] crova: has joined #RubyOnRails
[18:58:25] crova: Greetings ! Can anyone please look at my loop and suggest how could I set to UPDATE record rather than INSERT if the ID already exists? https://gist.github.com/crova/7a78bd5428b876103e6b75f6470199e0
[18:58:42] crova: this is only working when the db is empty
[19:01:45] rikkipitt: has joined #RubyOnRails
[19:03:40] sonofdirt: has joined #RubyOnRails
[19:09:19] noobsu: has joined #RubyOnRails
[19:10:35] djbkd: has joined #RubyOnRails
[19:11:48] Leepoff: has joined #RubyOnRails
[19:11:53] tubbo: crova: what loop?
[19:12:20] tubbo: crova: oh you mean in the .each? yeah you can just do Shoot.find_or_create_by(row) there
[19:12:38] crova: yeah, that part indeed
[19:12:49] crova: let me give it a try
[19:13:17] Megamos: has joined #RubyOnRails
[19:13:58] andywww: has left #RubyOnRails: ()
[19:15:11] crova: your suggestion works, but I stumbled into another problem :)
[19:15:20] ur5us: has joined #RubyOnRails
[19:15:25] crova: thanks for the input, that will be pretty handy
[19:20:28] whathappens: has joined #RubyOnRails
[19:24:24] arup_r1: has joined #RubyOnRails
[19:30:29] jancel: has joined #RubyOnRails
[19:34:10] Darmani: has joined #RubyOnRails
[19:35:05] crova: tubbo how can I evaluate only the ids on the solution you provided me?
[19:35:17] crova: I tried a few things and none worked
[19:35:42] DoctorMonocular: having a weird issue -- I have a model that accepts_nested_attributes for another model, and a form that reflects that. The models are populated correctly, but the nested form doesn't populate with the nested model's data, the fields are just blank. The only weird thing about it is that the nested model is like belongs_to :different_model / has_one :nested, through: :different_model / accepts_nested
[19:35:42] DoctorMonocular: _attributes_for :nested -- I imagien that doesn't make a difference, but I'm a little stumped
[19:36:36] naftilos76: has joined #RubyOnRails
[19:37:10] Rodya_: has joined #RubyOnRails
[19:38:24] DoctorMonocular: crova: I'm coming in late but it seems like you can just do something like Shoot.find_or_initialize_by(row[:id]), shoot.update!(row)
[19:38:25] DoctorMonocular: something like that
[19:38:37] Jasaka: has joined #RubyOnRails
[19:39:15] sergey_makagon: has joined #RubyOnRails
[19:39:20] Jasaka: has joined #RubyOnRails
[19:40:00] Jasaka|NA: has joined #RubyOnRails
[19:40:18] mdw: is it possible to get a ISO 8601 format string from Time.now .... YYYY-MM-DDTHH:MM:SSZ
[19:40:42] mdw: .iso8601 doesn't seem to give me the full format
[19:41:05] blackmesa: has joined #RubyOnRails
[19:41:16] crova: DoctorMonocular: thanks for the input, I get undefined method on "update", but that's a different error than before, so I'll try to figure it
[19:41:44] mdw: agh, I can figure this out
[19:41:45] mdw: ignore me
[19:41:56] techsethi: has joined #RubyOnRails
[19:42:30] Darmani: mdw: Wish I could help man >.<
[19:42:31] DoctorMonocular: crova: update (no bang) will work, but it won't throw an exception, so code accordingly
[19:42:44] workmad3: has joined #RubyOnRails
[19:42:46] mdw: Darmani I can do it, being lazy :-)
[19:42:47] tubbo: mdw: to_s(:iso8601) =)
[19:42:52] tubbo: kinda hard to find imho
[19:43:17] mdw: tubbo oh, that... is great :-)
[19:43:23] tubbo: mdw: call it as to_s, not to_formatted_s, but here's all the options: http://api.rubyonrails.org/classes/DateTime.html#method-i-to_formatted_s
[19:43:25] tubbo: yes, very useful.
[19:44:00] w0bni: has joined #RubyOnRails
[19:44:21] crova: DoctorMonocular: thanks
[19:44:58] Synthead: is there a way I can take the changes on one model and apply it to another?
[19:47:01] tildes_: has joined #RubyOnRails
[19:47:29] Jasaka: has joined #RubyOnRails
[19:48:07] manfrin: has joined #RubyOnRails
[19:49:15] arup_r1: depends on situations
[19:49:28] techsethi: has joined #RubyOnRails
[19:49:29] norc: mdw, 2016-06-10T12:48:50-07:00 -- what more are you asking for?
[19:49:40] arup_r1: Synthead: can u say it in real usecase scenarios?
[19:49:48] dorje: has joined #RubyOnRails
[19:49:48] mdw: norc :-)
[19:50:25] norc: mdw, note that is using Time#iso8601 :)
[19:51:09] B1n4r10: has joined #RubyOnRails
[19:52:00] Jasaka: has joined #RubyOnRails
[19:52:47] dorje_: has joined #RubyOnRails
[19:53:22] diegoviola: has joined #RubyOnRails
[19:58:45] emptyflask: has joined #RubyOnRails
[20:00:42] tvon: has joined #RubyOnRails
[20:00:51] dorje: has joined #RubyOnRails
[20:01:11] mikecmpbll: has joined #RubyOnRails
[20:03:03] hobodave_: has joined #RubyOnRails
[20:04:31] iamdevnul: so i have a seemingly strange issue that i can't nail down. We have a RoR app that in production will currently throw errors related to variables being nil that should not be. They seem to be one offs for the most part, but they do show up in airbrake all over the place, even in situations where it seems like it would be impossible for a variable to be nil
[20:05:19] iamdevnul: for instance, i'm building a hash that is to be used for an elasticsearch query. There are two variables, begin_date and end_date that are ruby dates
[20:05:26] iamdevnul: they get added to multiple filters in this ash
[20:05:45] moep: has joined #RubyOnRails
[20:06:06] brandon_j: has joined #RubyOnRails
[20:06:24] iamdevnul: but one of the filters in the middle causes an elasticsearch error because begin_date and end_date were nil and caused a malformed query, even though they are properly set before and after that error in the same query
[20:06:39] tubbo: Synthead: there's this really cool feature of computers called "copy" and "paste"
[20:07:20] tubbo: Synthead: but also, what about a concern?
[20:07:37] tubbo: iamdevnul: !code i think might be necessary
[20:07:37] helpa: iamdevnul: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[20:08:53] brandon_j: I have a form that accepts an email and message. When it's submitted, the `create` action creates a variable called `email` which calls Email.find_or_initialize_by(address: params[:message][:email]). Then, I create a message object with @message = email.deposits.new(message_params). How do I validate both the address and message, and be able to display any errors when I redirect to the `new` action?
[20:09:35] Synthead: I figured out a solution: second_model.assign_sttributes(first_model.changes.map {|f, c| [f, c[1]]}.to_h)
[20:09:47] Synthead: s/sttributes/attributes/
[20:09:50] brandon_j: @message = email.messages.new ***
[20:10:02] Malgorath: has left #RubyOnRails: ("Leaving")
[20:10:04] norc: brandon_j, how about you gist some actual code.
[20:10:25] Synthead: brandon_j: you're probably looking for active record validators
[20:10:55] Synthead: brandon_j: there's a whole science to it: http://guides.rubyonrails.org/active_record_validations.html
[20:11:54] moep: has joined #RubyOnRails
[20:12:01] Synthead: brandon_j: if you want to get really specific, you can create a class that inherits ActiveModel::Validator and validate with it: http://guides.rubyonrails.org/active_record_validations.html#validates-with
[20:12:41] Synthead: brandon_j: but don't reinvent wheels; if you think what you're doing should be common code, it probably is :)
[20:13:37] Synthead: brandon_j: here's what you can do with your validation errors, too: http://guides.rubyonrails.org/active_record_validations.html#validates-with
[20:13:40] brandon_j: norc, Synthead: https://gist.github.com/anonymous/701e0c8a2c916308a0746629f357f65c
[20:13:46] Synthead: oops, I meant http://guides.rubyonrails.org/active_record_validations.html#working-with-validation-errors
[20:14:13] norc: brandon_j, ActiveModel validations are your friend.
[20:14:35] Synthead: ^ I'm with stdout
[20:14:38] brandon_j: As of now, the email validates regex for emails. But Rails doesn't show the error when the email field has an error.
[20:14:54] brandon_j: the email model**
[20:15:23] whathappens: has joined #RubyOnRails
[20:15:58] Synthead: brandon_j: check that last link I sent you :)
[20:16:07] brandon_j: will do Synthead, thanks!
[20:16:57] moeabdol2: has joined #RubyOnRails
[20:17:28] Darmani: Hey guys, I keep getting an error when I use the created_at method :[
[20:17:29] Darmani: https://gist.github.com/mfifth/58c46883c45d2348d5f2b0b576fbb695
[20:17:33] Darmani: I don't know whyy.
[20:18:03] manfrin_: has joined #RubyOnRails
[20:19:09] cnk: Darmani: where is that def message_time in your code?
[20:19:41] cnk: wherever it is, created_at isn't in scope
[20:19:52] cnk: is that in app/models/message.rb ?
[20:20:11] Darmani: I forgot to include it ._.
[20:20:14] Darmani: https://gist.github.com/mfifth/58c46883c45d2348d5f2b0b576fbb695
[20:20:16] Darmani: it's there now.
[20:20:35] haraigo: has joined #RubyOnRails
[20:20:36] cnk: try self.created_at.strftime()
[20:21:07] cnk: and double check your migration has created_at
[20:21:30] Darmani: cnk: my migration?
[20:21:32] crova: DoctorMonocular: I got your suggestion to work, but it iterates through each row and saves it to the same row. at the end I only get one saved row on the database https://gist.github.com/crova/a512af8cba33153bd9b571268c0d3ed4
[20:21:34] cnk: actually do those in reverst order - check for field
[20:21:50] cnk: Does your messages db table hae a created_at column?
[20:22:11] djbkd: has joined #RubyOnRails
[20:22:17] Darmani: cnk: I thought that was a method included with ActiveRecord o.o
[20:22:36] jancel: has joined #RubyOnRails
[20:22:44] Darmani: oh maaan i'm stupid lol
[20:22:47] cnk: AR will fill it in if you put it in your model definition - aka include in your migration
[20:23:07] cnk: but it needs somewhere to record it
[20:23:18] crova: https://gist.github.com/crova/12a3d47d0675aa3ae7a8d3e917478377 sorry, he is the link
[20:23:24] Darmani: cnk: I didn't add it to the db ._.
[20:23:24] cnk: fix that - and ignore my self.created_at
[20:23:27] Darmani: how do I add it?
[20:23:46] cnk: rails g migration AddTimestampsToMessages
[20:24:05] Talltree: is there an official guide on how to put the rails app into production correctly?
[20:24:08] cnk: that might figure it out all by itself - otherwise edit the migraiton to add a column
[20:24:23] cnk: Talltree: there are a couple of books
[20:24:34] Talltree: cnk: anything free?
[20:24:36] cnk: but 'correctly' is in the eye of the beholder
[20:24:48] Darmani: cnk: but what does the actual migration look like?
[20:24:51] cnk: lots of blog posts
[20:24:51] smathy: Darmani, and use the generators next time, they'll do it for you.
[20:25:08] Darmani: smathy: Generators?
[20:25:33] cnk: http://guides.rubyonrails.org/active_record_migrations.html
[20:25:33] Talltree: form what i see its just installing something like puma, configuring the app for the production enviroment, turn off asset compression etc
[20:25:50] Talltree: get a service for it going
[20:25:58] Talltree: and starting it, apply nginx on top
[20:26:00] jenrzzz: has joined #RubyOnRails
[20:26:07] Talltree: or is there something wrong with that?
[20:26:08] Guest57: has joined #RubyOnRails
[20:26:37] Darmani: cnk: that's useful. thanks ^^
[20:26:49] Akuma: has joined #RubyOnRails
[20:27:03] cnk: Talltree: There are a lot of options
[20:27:14] cnk: I usually find the Digital Ocean docs good
[20:27:15] cnk: https://www.digitalocean.com/community/tutorials/deploying-a-rails-app-on-ubuntu-14-04-with-capistrano-nginx-and-puma
[20:27:30] Sheperson: has joined #RubyOnRails
[20:27:43] cnk: but you really need to tell us something about your constraints if you want good advice
[20:27:56] whathappens: has joined #RubyOnRails
[20:28:03] cnk: do you have yoru own machines? VM? how many different apps do you need to run?
[20:28:12] Talltree: i own a debian server
[20:28:20] Talltree: with nginx, and some domains allready running
[20:28:24] cnk: Personally I have used Passenger since time immemorial so that's my go-to solution
[20:28:46] cnk: but proxying to puma is also a fine option
[20:28:58] Talltree: its a virutal root, with 2 physical cores and 6 gb ram, so plenty
[20:29:18] Darmani: cnk: https://gist.github.com/mfifth/58c46883c45d2348d5f2b0b576fbb695
[20:29:19] cnk: OK I would use those DO docs as an outline and adapt
[20:29:21] Darmani: does that look correct?
[20:29:29] Talltree: i compared the "productions servers" for rails and found puma to be working best and fitting
[20:29:49] Talltree: without any experience with them tho.,..
[20:29:49] cnk: Darmani: Probably. Try it and see
[20:30:11] Talltree: so using a special user acc for rails is a must-have right?
[20:30:16] art-solopov: has joined #RubyOnRails
[20:30:17] Darmani: cnk: what do you mean probably lol
[20:30:38] cnk: I mean that I don't do enough rails to eyeball that level of detail
[20:30:47] iamdevnul: tubbo: https://gist.github.com/mjgreer/fc633a1c65bd8b569d52201595e8ee7f
[20:30:53] cnk: try it and then look at your messages table in the db
[20:31:09] Darmani: cnk: lol ok
[20:31:13] iamdevnul: the first part is the ruby code that produced the elasticsearch query hash starting on line 28
[20:31:45] eljimbo: has joined #RubyOnRails
[20:31:56] srinidhi: has joined #RubyOnRails
[20:31:57] iamdevnul: as you can see, @beginning_date and @end_date are used multiple times and are just fine, then on line 37 there is an empty branch of the hash that shouldn't be
[20:32:09] iamdevnul: and this was completely a one off, not reproduceable
[20:33:58] rikkipitt: has joined #RubyOnRails
[20:34:04] audibleblink: how does one run a single rspec example when it's in a shared exammple group?
[20:38:03] Rodya_: has joined #RubyOnRails
[20:38:27] Darmani: cnk: well I guess it worked... I didn't get an error message.
[20:39:13] noobsu_: has joined #RubyOnRails
[20:39:24] reduce: has left #RubyOnRails: ("http://quassel-irc.org - Chat comfortably. Anywhere.")
[20:39:52] Darmani: but now strftime isn't a method? Does that need another migration??
[20:40:12] manfrin: has joined #RubyOnRails
[20:40:29] cnk: rake db:schema dump and add the definition of the messages table to your gist
[20:41:03] Darmani: cnk: I have to dump the entire schema??
[20:41:41] cnk: dump just means write the definition of the schema to a file
[20:42:12] cnk: Do whatever you need to do to show my what your database actually has for the messages table
[20:42:27] cnk: the definition of that table - not the data
[20:43:29] Darmani: cnk: https://gist.github.com/mfifth/58c46883c45d2348d5f2b0b576fbb695
[20:44:16] shinnya: has joined #RubyOnRails
[20:44:22] cnk: I do't want your migrations, I want to see what the database has now. There are a lot of ways to get differences between your migrations and yoru db
[20:44:28] cnk: you on mysql?
[20:44:37] cnk: log in and type 'describe messages'
[20:44:53] Darmani: no I'm on Postgres o.o
[20:45:07] cnk: ok log in and type \d messages;
[20:46:11] Darmani: cnk: "did not find any relation named messages"
[20:46:35] cnk: \dt messages
[20:46:39] kies: has joined #RubyOnRails
[20:46:58] Darmani: cnk: "no matching relations found"
[20:47:10] cnk: I suspect you are not in the right database
[20:47:33] iooner: has joined #RubyOnRails
[20:47:39] cnk: your migration created a table named messages - assuming you ran the migration
[20:48:03] Darmani: cnk: I did run the migration but I didn't create a table I just added timestamps..
[20:48:05] sharkman: has joined #RubyOnRails
[20:48:26] cnk: CreateMessagesMigration.rb created a table
[20:48:49] Darmani: cnk: There it is!
[20:48:53] Darmani: I was in the wrong db.
[20:49:02] mwlang: xybre: thanks for that gravatar code. saved me a lot of time there and I was able to pull in just the one method I really needed: https://gist.github.com/mwlang/0a950cf4a57dc3158840bc306aca27df
[20:49:04] qejk: has joined #RubyOnRails
[20:50:01] Darmani: cnk: https://gist.github.com/mfifth/58c46883c45d2348d5f2b0b576fbb695
[20:50:28] iooner: has joined #RubyOnRails
[20:50:40] cnk: OK. so you have your column
[20:51:01] cnk: but, since you just added it, all instances will be null
[20:51:31] cnk: and I bet yoru no method strftime says no method on Nil or something like that
[20:51:41] Darmani: cnk: that's exactly what it says.
[20:51:45] cnk: so you need to fill in created_at everywhere
[20:52:12] Darmani: cnk: everywhere?
[20:52:18] rafaelfranca: has joined #RubyOnRails
[20:52:24] cnk: or make your message time check to see that created_at isn't blank before calling strftime
[20:52:39] cnk: update messages set created_at = time.now();
[20:52:49] cnk: or whatever PG's now method is called
[20:53:56] Darmani: cnk: https://gist.github.com/mfifth/58c46883c45d2348d5f2b0b576fbb695
[20:54:02] Darmani: like that?
[20:54:08] cnk: but you probably still want to edit message_time to be: created_at.blank? ? '' : created_at.strftime(<yourthing>)
[20:54:59] cnk: remove that created_at method in message.rb
[20:55:12] cnk: Rails will do that for you (and you don't want Time, you want a timestamp)
[20:55:18] Darmani: cnk: But it works now... :[
[20:55:47] cnk: No, you put a bandaid over it, but your data is still wrong
[20:56:11] Darmani: cnk: fine I'll take it off but I still don't understand what you want.
[20:57:38] cnk: I commented on your gist
[20:57:55] whathappens: has joined #RubyOnRails
[20:58:44] Darmani: cnk: I saw that... So now the method checks if it's blank? And if it is it creates a timestamp?
[20:58:44] cnk: When you have that created_at method, you won't ever see the actual value in the database, you would end up with now - always
[20:59:15] cnk: If it's blank, it returns ''. If it isnt' blank, it returns a formatted times
[20:59:28] whathapp_: has joined #RubyOnRails
[21:00:02] cnk: it's a ternary. You may want to rewrite it as an if then else set of lines
[21:00:22] whathapp_: has joined #RubyOnRails
[21:00:38] spencer: has joined #RubyOnRails
[21:00:50] Darmani: cnk: It's fine I know what a ternary is.
[21:01:17] whathapp_: has joined #RubyOnRails
[21:01:29] cnk: I like them but they did look a little weird to me the first time I saw one
[21:01:50] Darmani: cnk: They are still weird I don't use them very often hahaha
[21:02:31] whathappens: has joined #RubyOnRails
[21:02:47] Darmani: cnk: Well thank you. I am in your debt once again
[21:03:03] cnk: So sorted out? great.
[21:03:37] Darmani: cnk: Kind of... I was just following the tutorial and I'm glad it works now but I'm going to change it a bit.
[21:03:56] spejamchr: has joined #RubyOnRails
[21:04:05] cnk: Excellent. That's how one learns
[21:05:11] whathappens: has joined #RubyOnRails
[21:07:25] ecksit: has joined #RubyOnRails
[21:08:01] Megamos: has joined #RubyOnRails
[21:12:22] audibleblink: following up:
[21:12:27] audibleblink: looked through that man pages and found `-t`
[21:12:28] audibleblink: labelled the spec -> it 'returns that matching records', :stop do…end
[21:12:30] audibleblink: then ran `rspec -t ‘stop`
[21:12:46] DoctorMonocular: crova, the gist you linked is 404
[21:13:26] crova: DoctorMonocular: https://gist.github.com/crova/12a3d47d0675aa3ae7a8d3e917478377 there you go
[21:13:32] FreddieFresh: has joined #RubyOnRails
[21:13:33] Rodya_: has joined #RubyOnRails
[21:14:08] DoctorMonocular: what does the .dig() method do?
[21:14:44] DoctorMonocular: also, that is defintly not what I meant about how to use update
[21:15:10] SteenJobs: has joined #RubyOnRails
[21:15:24] SteenJobs: smathy: i was lazy loading, using the cap 3 syntax of -> { value }
[21:15:38] SteenJobs: smathy: but it wasn’t working - although i’m wondering if i needed to restart puma every time i committed my changes
[21:16:12] crova: it let me isolate a part of the object; shoots = ["message", "code", "data"]
[21:16:29] crova: dig allows me to get only the json within "data"
[21:16:51] DoctorMonocular: so shoots is a collection of Shoot models, and dig pulls out just a specific field of those models?
[21:17:00] DoctorMonocular: like shoots.map(&:data)?
[21:17:24] DoctorMonocular: and the campaign_records is a field of data?
[21:17:59] DoctorMonocular: I'm going to refactor your code to give you some ideas here, hang on
[21:18:22] crova: campaign_records contains the fields for the model in my database
[21:18:48] crova: I just want to get that api response once a day, updating existing records, and inputs the new ones
[21:19:25] k3rn31: has joined #RubyOnRails
[21:19:29] siaw23: has joined #RubyOnRails
[21:19:33] crova: do you want to see an extract?
[21:20:29] DoctorMonocular: na, just give me a moment
[21:20:33] fox_mulder_cp: hm. folks, i'm really intrested in manuals for newbies for rails + react|angular|some_js_front. may be u seems some when learn some js frontend framework? i'm intressted to find one framework which seems friendly for me
[21:20:41] crova: take your time
[21:22:35] DoctorMonocular: crova: https://gist.github.com/PeteMichaud/fd5ccea6f4d792188f459d3405d5e18d
[21:23:13] crova: let me check, thanks
[21:23:20] DoctorMonocular: something like that is going to be way easier to work with, and that code should approximately work depending on whether the data records match the shoot model, and what the campaign_id field is actually called
[21:24:16] crova: I didn't know what to do with campaign_id, so I did not created it on the model
[21:24:21] crova: bad decision?
[21:24:40] DoctorMonocular: well, from what I can tell, it's necessary to make the code work
[21:24:53] DoctorMonocular: let me see what the data record hash has in it?
[21:25:02] crova: sure, let me pull one
[21:28:01] moeabdol2: has joined #RubyOnRails
[21:28:55] crova: DoctorMonocular: https://gist.github.com/crova/12a3d47d0675aa3ae7a8d3e917478377 there is the migration also
[21:30:27] DoctorMonocular: I'm guess campaign_name is a unique identifier
[21:30:28] bruce_lee: has joined #RubyOnRails
[21:30:28] bruce_lee: has joined #RubyOnRails
[21:30:38] DoctorMonocular: so use that instead of campaign_id
[21:30:56] crova: actually, no, it is not
[21:31:24] crova: i can make it be from now on, but not for the existing records, there will be duplicated names
[21:31:34] DoctorMonocular: sometimes you'll have a shoot/campaign that has the same name as a different shoot/campain
[21:31:36] crova: only unique record on the api response is the id :/
[21:32:19] DoctorMonocular: ok, so use the id -- put campaign_id in your shoot model, and use that as the unique id to find the shoot
[21:32:26] DoctorMonocular: you'll have an id, which is for the shoot
[21:32:45] DoctorMonocular: and a campaign_id which is the id used in the external system that you just use to match the two
[21:33:00] DoctorMonocular: I also suggest that you don't just take whatever that API is giving you
[21:33:04] DoctorMonocular: you know how to use strong params?
[21:33:15] DoctorMonocular: like params.require(:blah).permit(...)
[21:33:29] crova: I tried that, but failed to make something work
[21:34:01] DoctorMonocular: the problem was probably that the hash didn't live under the :blah
[21:34:14] DoctorMonocular: like { blah: { ...record... } }
[21:34:28] crova: I've met ruby and rails for about 2 weeks now, so I'm still getting learning everything
[21:34:28] DoctorMonocular: so you could do params.require(:blah)
[21:34:39] DoctorMonocular: instead I'm guessing you were doing just { ... record ... }
[21:34:50] DoctorMonocular: yup, you have to start somewhere :)
[21:34:55] lxsameer: has joined #RubyOnRails
[21:35:08] crova: it could be, I'll try to work something out
[21:35:18] crova: first with the solution you suggested on the gist
[21:35:28] crova: and thanks for all the inputs
[21:35:36] DoctorMonocular: anyway, that's secondary to getting the campaign id matching
[21:35:40] DoctorMonocular: yeah, no problem
[21:37:25] r1nzl3r: has joined #RubyOnRails
[21:37:43] solars: has joined #RubyOnRails
[21:38:25] yfeldblum: has joined #RubyOnRails
[21:39:36] hobodave: has joined #RubyOnRails
[21:41:01] nettoweb: has joined #RubyOnRails
[21:45:26] sypheren: has joined #RubyOnRails
[21:46:10] blackmesa: has joined #RubyOnRails
[21:48:06] B1n4r10: has joined #RubyOnRails
[21:48:09] fox_mulder_cp: tubbo: hi. does u use some js front framework in your apps?
[21:51:18] jancel: has joined #RubyOnRails
[21:59:47] mikecmpbll: has joined #RubyOnRails
[22:03:09] d5sx43: has joined #RubyOnRails
[22:03:10] SteenJobs: is there a helper for generating a url for an image in the asset pipeline, so i can use it as “src” within an <img> tag?
[22:03:24] SteenJobs: i’m asking specifically because using image_tag isn’t an option
[22:04:14] RuvyTuesdays: has joined #RubyOnRails
[22:04:48] dstarh: has joined #RubyOnRails
[22:05:44] Meow-J: has joined #RubyOnRails
[22:07:00] jenrzzz: has joined #RubyOnRails
[22:07:00] jenrzzz: has joined #RubyOnRails
[22:07:34] m_antis: has joined #RubyOnRails
[22:07:44] norfumpit_: has joined #RubyOnRails
[22:07:48] et09: has joined #RubyOnRails
[22:08:13] et09: is there a rails-level way to say, when Foo.mapping_id == Bar.mapping_id, set Foo.bar_id = Bar.id
[22:08:17] et09: for an entire table
[22:10:25] norfumpi-: has joined #RubyOnRails
[22:10:36] mikecmpbll: has joined #RubyOnRails
[22:11:58] fox_mulder_cp: et09: active records relations?
[22:12:19] fox_mulder_cp: et09: or u about recurse relations for only ONE table?
[22:12:35] et09: trying to do a bulk insert of both tables (via activerecord-import) with a matching asigned random id, and then join them afterwards
[22:13:22] fox_mulder_cp: et09: u can read about nested attributes and building resource with it
[22:13:55] agent_white: has joined #RubyOnRails
[22:14:17] et09: that won't work
[22:14:28] et09: it's literally a single insert statement for many thousands of records on both tables
[22:14:57] fox_mulder_cp: et09: it's a task desctiption?
[22:15:17] fox_mulder_cp: batch innserting into tables?
[22:16:25] fox_mulder_cp: ACTION have a bad, bad friday with not planned VoIP migration after main customer's voip server died
[22:16:44] PlasmaStar: has joined #RubyOnRails
[22:16:58] flashpoint9: has joined #RubyOnRails
[22:17:34] fox_mulder_cp: for a some last hout
[22:18:01] choke: has joined #RubyOnRails
[22:18:24] rikkipitt: has joined #RubyOnRails
[22:20:26] okdas: has joined #RubyOnRails
[22:20:26] okdas: has joined #RubyOnRails
[22:21:18] SteenJobs: has joined #RubyOnRails
[22:22:11] fikse: has joined #RubyOnRails
[22:22:32] gloscombe: has joined #RubyOnRails
[22:22:32] fikse: how do you create a user that can run your rails app? what kind of privileges are appropriate?
[22:22:40] arBmind: has joined #RubyOnRails
[22:22:59] neanderslob: has joined #RubyOnRails
[22:23:40] allcentury: has joined #RubyOnRails
[22:24:56] fox_mulder_cp: fikse: default linux user
[22:25:26] fox_mulder_cp: app starts with non-privileged rights with described rights in poshtgresql/mysql
[22:30:05] DoctorMonocular: has joined #RubyOnRails
[22:30:46] SteenJobs: anyone have a script that can convert <img> tags to image_tag
[22:31:54] tanuki: has joined #RubyOnRails
[22:32:08] emptyflask: has joined #RubyOnRails
[22:32:38] owenjones: has joined #RubyOnRails
[22:36:41] Tref: has joined #RubyOnRails
[22:38:51] choke: i hate when i'm a bonehead... having all sorts of rspec issues with an AMS and after an hour realize i forgot to add "_serializer" onto the file :(
[22:40:22] cnk: grrr I hate that
[22:40:46] cnk: stuff not getting found - and giving strange error messages?
[22:41:34] choke: was telling me Api::V1::PlacesController::PlaceSerializer wasn't a thing
[22:41:47] rbr: SteenJobs: image_path/image_url
[22:42:12] SteenJobs: rbr: thanks, found it. but now i’m stuck with 25 img tags that need to be fixed, and without a script to do it, i may as well just code this from scratch
[22:42:30] workmad3: choke: were you by any chance referencing `PlaceSerializer` directly from `PlacesController`? :)
[22:42:58] choke: yeah: render json: resources, each_serializer: PlaceSerializer
[22:43:11] choke: took me a while to figure it out, just had to look at my vim a little closer lol
[22:43:14] workmad3: choke: because that's the standard error message for "This constant doesn't exist, so we're displaying the error message with the currenty nesting as a namespace"
[22:43:27] workmad3: s/currenty/current
[22:43:47] globalall0c: has joined #RubyOnRails
[22:44:15] workmad3: choke: my current trick is to forget the `_spec` on rspec files btw :) then you don't get any errors... you just don't get your specs running when you just do `rspec`
[22:44:33] workmad3: but it can be pretty hard to notice that 3 specs aren't running out of 300 :(
[22:47:23] choke: i kinda like the errors -- though these deprecation notices are driving me nuts ( i really need to fork the gems and update them but can't care to do it just yet )
[22:49:58] duncannz: has joined #RubyOnRails
[22:53:05] jancel: has joined #RubyOnRails
[22:53:29] lightt: has joined #RubyOnRails
[22:56:04] workmad3: choke: yeah, I wasn't saying that dropping the `_spec` was intentional or good... it's a dumb-ass mistake I keep on making, then spotting a week later and facepalming
[22:57:23] sonofdirt: has joined #RubyOnRails
[22:57:35] brandoncc: has joined #RubyOnRails
[22:57:51] DoctorMonocular: has joined #RubyOnRails
[22:58:38] xlegoman: has joined #RubyOnRails
[22:59:00] workmad3: choke: there isn't really much thats good about writing specs and then not running them :D
[22:59:50] diegoaguilar: has joined #RubyOnRails
[23:00:24] tildes_: has joined #RubyOnRails
[23:00:35] ravster: has joined #RubyOnRails
[23:00:36] brandonc`: has joined #RubyOnRails
[23:01:09] dorje: has joined #RubyOnRails
[23:01:24] choke: more issues... https://gist.github.com/jblac/f9745ca85e87e28b0cea34136f62432d appears as though my AMS isn't actually running just based on the rspec/json_schema output
[23:04:50] codepete: has joined #RubyOnRails
[23:05:21] Talltree: ... currently watching a talk about whats new in es6, and it feels a lot like regular ruby :D
[23:06:23] jenrzzz: has joined #RubyOnRails
[23:06:35] ezekg: has left #RubyOnRails: ()
[23:07:44] xlegoman: has joined #RubyOnRails
[23:08:17] brandoncc: has joined #RubyOnRails
[23:09:08] mostlybadfly: has joined #RubyOnRails
[23:09:43] jancel: has joined #RubyOnRails
[23:09:45] moeabdol2: has joined #RubyOnRails
[23:10:48] dorje: has joined #RubyOnRails
[23:14:27] DoctorMonocular: has joined #RubyOnRails
[23:15:40] dorje: has joined #RubyOnRails
[23:18:19] ur5us: has joined #RubyOnRails
[23:18:25] dorje_: has joined #RubyOnRails
[23:19:14] brandoncc: has joined #RubyOnRails
[23:19:20] ur5us: has joined #RubyOnRails
[23:21:39] brandoncc: has joined #RubyOnRails
[23:22:36] brandoncc: has joined #RubyOnRails
[23:23:05] robbyoconnor: has joined #RubyOnRails
[23:25:52] owenjones: has joined #RubyOnRails
[23:26:22] mikecmpbll: has joined #RubyOnRails
[23:31:18] chipotle: has joined #RubyOnRails
[23:32:20] choke: hmm.. apparently, changing render json: resources, each_serializer: PlaceSerializer doesn't strip it to only the attributes -- but
[23:32:50] choke: render json: resources, serializer: ActiveModel::Serializer::CollectionSerializer, each_serializer: PlaceSerializer does... too many uses of "serializer"
[23:37:50] ur5us: has joined #RubyOnRails
[23:38:57] dalbuschat: has joined #RubyOnRails
[23:40:11] dblessing: has joined #RubyOnRails
[23:43:28] banister: has joined #RubyOnRails
[23:44:34] macsteps: has joined #RubyOnRails
[23:51:19] tildes_: has joined #RubyOnRails
[23:52:33] DoctorMonocular: has joined #RubyOnRails
[23:54:59] binaryplease: has joined #RubyOnRails