« Back to channel list

#RubyOnRails - 23 July 2016

« Back 1 day Forward 1 day »
[00:00:53] wethu: has joined #RubyOnRails
[00:01:24] quazimod1: has joined #RubyOnRails
[00:03:46] DoctorMonocular: has joined #RubyOnRails
[00:03:52] macsteps: has joined #RubyOnRails
[00:05:50] Oliphaunte: has joined #RubyOnRails
[00:06:47] Axilla: has joined #RubyOnRails
[00:07:23] jonyijoe: Hey! Whats the best way to implement multi-tenancy for a rails5 app?
[00:07:43] Radar: jonyijoe: !mtwr
[00:07:43] helpa: jonyijoe: Multitenancy With Rails - https://leanpub.com/multi-tenancy-rails-2 - An excellent book that teaches you about building a Multitenanted Rails application. Written by Ryan Bigg.
[00:08:39] Radar: jonyijoe: Read this 80k+ word book that I wrote about the process of making an app multi-tenanted.
[00:08:52] jonyijoe: Im fine with it
[00:09:11] jonyijoe: I want to understand how to do this not just use apartment and ignore the magic :P
[00:11:31] Dimik--: has joined #RubyOnRails
[00:13:13] cleopatra: has joined #RubyOnRails
[00:15:47] arBmind1: has joined #RubyOnRails
[00:21:18] kies: has joined #RubyOnRails
[00:23:46] travismathis: has joined #RubyOnRails
[00:26:28] SteenJobs: wooohooo! thanks to a wonderful fella in the upstart chat, i finally have my God upstart script working. so for those who often wonder, “well who’s monitoring God?” i finally have the answer :D
[00:27:47] cleopatra: hello people :)
[00:32:05] abhinavmehta: has joined #RubyOnRails
[00:34:43] Oliphaunte: has joined #RubyOnRails
[00:39:25] DoctorMonocular: has joined #RubyOnRails
[00:41:27] jheathco: has joined #RubyOnRails
[00:50:38] dkam__: has joined #RubyOnRails
[00:56:05] rupert: has joined #RubyOnRails
[00:58:17] erikcw: has joined #RubyOnRails
[00:58:29] douglascorrea: has joined #RubyOnRails
[00:59:23] erikcw: Having a tough time getting includes() to work -- see anything wrong with what I'm doing here? [17] pry(main)> aa=feeds.includes(trackable: [:comments], :owner)
[00:59:23] erikcw: SyntaxError: unexpected ')', expecting =>
[01:02:00] DoctorMonocular: hey, weird question -- I have a script meant for the command line that lives under my app directory. When I try to run my rails server it includes that script and hard errors because the script expects input, whereas rails is just including it. How can I set up this script to not really run that code unless it's called by the command line as opposed to simply included?
[01:02:12] dkam___: has joined #RubyOnRails
[01:02:40] n90b0jjf: has joined #RubyOnRails
[01:05:29] adam12: DoctorMonocular: stick it somewhere else - like lib or bin
[01:05:47] adam12: erikcw: Reverse order. :owner first, trackable: [:comments] after
[01:08:37] pur3eval: has joined #RubyOnRails
[01:12:53] dvinciguerra_: has joined #RubyOnRails
[01:13:12] hahuang61: has joined #RubyOnRails
[01:13:49] erikcw: adam12: thanks -- can you tell me why that is?
[01:14:29] rickmasta: has joined #RubyOnRails
[01:14:43] adam12: erikcw: It's a Ruby thing. You have a symbol and a hash. Ruby allows un-wrapped hash attributes at the end of a method definition. It doesnt' support them at the begninning.
[01:15:11] adam12: erikcw: So your new version is closer to includes(:owner, { trackable: [:comments] }), if you look at the hidden curly braces.
[01:16:45] EbokianKnight: has joined #RubyOnRails
[01:16:58] adam12: erikcw: If you look at the method definition for includes() it's likely something like includes(*symbols, hash={}). Not sure if that helps.
[01:17:00] erikcw: adam12: I see
[01:18:31] EbokianKnight: I have a quick question to pose: "the epoch time in seconds in which Token will expire" <== What exactly is this asking for. A DateTimeStamp in the future delivered in seconds? The number of seconds until the thing is expired?
[01:18:40] EbokianKnight: Something else?
[01:18:59] erikcw: adam12: So I'm running this in rails console. Trying to get rid of an n+1 bug. When I access one of the attributes of the object, I see the query still scrolls across my screen. Looks like includes isn't doing anything...
[01:19:44] Oliphaunte: has joined #RubyOnRails
[01:20:00] adam12: erikcw: Share some code, or the few lines you've entered into the Rails console so we can see what you're doing.
[01:20:12] EbokianKnight: includes definitely does. Although you might be looking at the information wrong. Are you certain that each following mention isnt jbuilder and is in fact another seperate query?
[01:20:56] adam12: EbokianKnight: Epoch time is the number of seconds since some specific time in 1970. I'd assume that the token will expire at that universal time, which all Unix systems can figure out.
[01:21:12] EbokianKnight: Alright thanks.
[01:21:34] adam12: EbokianKnight: Or rather, the epoch time in seconds is a value that gets ADDED to that date in 1970 to give you a date/timestamp.
[01:21:52] EbokianKnight: I know what you meant.
[01:22:02] erikcw: adam12: 35: aa=feeds.includes(:owner, trackable: [:comments])[0]
[01:22:03] erikcw: 36: aa.owner
[01:22:41] EbokianKnight: Why invoke [0]?
[01:23:00] erikcw: wanted to grab the first object
[01:23:42] adam12: erikcw: Are you not expecting the second query, but rather a JOIN?
[01:25:06] adam12: s/query/SELECT to be more clear.
[01:25:12] erikcw: adam12: I'm seeing a large id IN (...) query on the first line. Then when I invoke aa.owner I see another select
[01:25:38] erikcw: I don't really care if it is a JOIN or an IN -- though I suspect join would be more efficient in my case
[01:25:49] adam12: You can force a join using join()
[01:26:01] adam12: but Rails normally figures it out, somehow. a JOIN isn't always more efficient.
[01:26:30] adam12: joins() rather (with the s)
[01:26:51] erikcw: Ok, let's stick with the default IN query then
[01:27:32] adam12: The JOIN can sometimes work against you, as I believe it's default to INNER JOIN which requires both sides of the JOIN to be present.
[01:27:37] rehat: has joined #RubyOnRails
[01:27:49] adam12: There's also preload() - I can never remember the difference.
[01:29:32] adam12: and eager_join(). LOL
[01:30:43] adam12: err eager_load. I'm on a roll of spelling mistakes tonight.
[01:31:28] tercenya: has joined #RubyOnRails
[01:31:49] jstransky: has joined #RubyOnRails
[01:33:31] ElFerna: has joined #RubyOnRails
[01:38:39] _Tariq: has joined #RubyOnRails
[01:41:04] abhinavmehta: has joined #RubyOnRails
[01:41:54] Ebok: has joined #RubyOnRails
[01:45:55] harfangk: has joined #RubyOnRails
[01:46:08] qguv: has joined #RubyOnRails
[01:46:25] rickmasta: has joined #RubyOnRails
[01:51:55] adre: has joined #RubyOnRails
[01:59:27] petor: has joined #RubyOnRails
[02:02:08] rollinDyno: has joined #RubyOnRails
[02:04:05] akshat_: has joined #RubyOnRails
[02:06:01] jtong: has joined #RubyOnRails
[02:07:10] patie: has joined #RubyOnRails
[02:08:06] Rodya_: has joined #RubyOnRails
[02:10:23] dgncn: has joined #RubyOnRails
[02:13:14] douglascorrea: has joined #RubyOnRails
[02:17:11] boomer: has joined #RubyOnRails
[02:17:30] jtong: has joined #RubyOnRails
[02:24:02] manfrin: has joined #RubyOnRails
[02:28:54] jtong: has joined #RubyOnRails
[02:31:07] Oliphaunte: has joined #RubyOnRails
[02:38:08] dkam___: has joined #RubyOnRails
[02:38:16] hwcomcn: has joined #RubyOnRails
[02:40:39] jtong: has joined #RubyOnRails
[02:42:52] jenrzzz: has joined #RubyOnRails
[02:43:19] rickmasta: has joined #RubyOnRails
[02:43:46] yoongkang: has joined #RubyOnRails
[02:47:03] hwcomcn: has joined #RubyOnRails
[02:48:04] hwcomcn: has joined #RubyOnRails
[02:49:40] abhinavmehta: has joined #RubyOnRails
[02:51:49] jtong: has joined #RubyOnRails
[02:53:12] benlieb: has joined #RubyOnRails
[02:59:54] Dimik--: has joined #RubyOnRails
[03:08:38] jtong: has joined #RubyOnRails
[03:11:27] rickmasta: has joined #RubyOnRails
[03:13:57] hahuang61: has joined #RubyOnRails
[03:14:30] jtong: has joined #RubyOnRails
[03:16:21] cschneid: has joined #RubyOnRails
[03:16:27] hwcomcn: has joined #RubyOnRails
[03:19:02] hwcomcn: has joined #RubyOnRails
[03:20:46] k3rn31: has joined #RubyOnRails
[03:20:49] Oliphaunte: has joined #RubyOnRails
[03:21:30] Leepoff: has joined #RubyOnRails
[03:25:48] jtong: has joined #RubyOnRails
[03:26:49] hwcomcn: has joined #RubyOnRails
[03:29:10] benlieb: has joined #RubyOnRails
[03:29:16] hwcomcn: has joined #RubyOnRails
[03:30:00] conta: has joined #RubyOnRails
[03:31:45] hwcomcn: has joined #RubyOnRails
[03:37:03] jtong: has joined #RubyOnRails
[03:38:32] mingsheng: has joined #RubyOnRails
[03:39:29] hwcomcn: has joined #RubyOnRails
[03:39:51] mingsheng: Novice question: playing around with STI. How do I execute a method in the parent class as the child?
[03:40:09] mingsheng: single table inheritance
[03:40:17] DoctorMonocular: has joined #RubyOnRails
[03:41:29] rickmasta: has joined #RubyOnRails
[03:41:42] mingsheng: i have a callback method in the parent class that does something like { self.image = url }, but i need it to run not as a ParentClass but as ChildClass
[03:44:03] benlieb: has joined #RubyOnRails
[03:44:10] daveomcd: has joined #RubyOnRails
[03:44:18] DoctorMonocular: has joined #RubyOnRails
[03:44:35] hwcomcn: has joined #RubyOnRails
[03:45:28] akshat: has joined #RubyOnRails
[03:45:31] mingsheng: the way im currently doing it is... { a = self.becomes ParentClass; a.img = url ... }
[03:47:55] _3dwardsharp: has joined #RubyOnRails
[03:48:31] jtong: has joined #RubyOnRails
[03:50:09] Niham: has joined #RubyOnRails
[03:50:47] _3dwardsharp: hello. so stumbled across this: https://nvisium.com/blog/2015/06/22/using-rails-5-attributes-api-today-in/ which seems super cool, and i'm trying to implement it. however after i've done such, in the console when i try to load a record i get (Object doesn't support #inspect) which i guess has to do with the LinkList's initialize method.
[03:54:32] jtong: has joined #RubyOnRails
[03:55:48] Niham: has joined #RubyOnRails
[03:58:17] abhinavmehta: has joined #RubyOnRails
[03:59:48] mostlybadfly: has joined #RubyOnRails
[03:59:49] nacsurte: has joined #RubyOnRails
[04:00:51] petor: has joined #RubyOnRails
[04:07:08] pontiki: has joined #RubyOnRails
[04:11:05] wd40s: has joined #RubyOnRails
[04:14:12] cleopatra: I have error: uninitialized constant User::TestConcern https://gist.github.com/ArpiaPsuv/e8eb18924b27cae4c584305a8d0592c3
[04:14:22] cleopatra: how i can fix it?
[04:15:26] pontiki: https://gist.github.com/ArpiaPsuv/e8eb18924b27cae4c584305a8d0592c3#file-user-rb-L3 should be "include"
[04:15:39] _3dwardsharp: ...i think you need to require 'active_support/concern' in concern_test.rb
[04:17:44] beilabs: has joined #RubyOnRails
[04:18:55] habitullence_: has joined #RubyOnRails
[04:19:08] roamingdog: has joined #RubyOnRails
[04:19:44] Kilo`byte: has joined #RubyOnRails
[04:23:50] benlieb: has joined #RubyOnRails
[04:24:49] cleopatra: pontiki, I've changed the line but I have the same error, also i add require 'active_support/concern'
[04:25:19] theery: has joined #RubyOnRails
[04:27:52] quazimodo: has joined #RubyOnRails
[04:28:49] wd40s: has joined #RubyOnRails
[04:32:28] quazimod1: has joined #RubyOnRails
[04:33:33] pontiki: maybe you need to require the concern... i don't remember if you do
[04:34:45] cleopatra: check the update git https://gist.github.com/ArpiaPsuv/e8eb18924b27cae4c584305a8d0592c3/revisions
[04:36:42] pontiki: you have not anywhere in there required concern_test.rb that i can see...
[04:37:15] pontiki: and if you name your file and module inconsistently then you will definitely need to include it
[04:37:38] benlieb: has joined #RubyOnRails
[04:40:06] wd40s: has joined #RubyOnRails
[04:47:35] Oliphaunte: has joined #RubyOnRails
[04:48:10] Niham: has joined #RubyOnRails
[04:49:14] moeabdol1: has joined #RubyOnRails
[04:52:29] rickmasta: has joined #RubyOnRails
[04:53:15] cleopatra: pontiki, already fix Thank you so much
[04:53:48] yoongkang: has joined #RubyOnRails
[04:55:48] beilabs_: has joined #RubyOnRails
[04:59:26] pawnbox: has joined #RubyOnRails
[05:00:16] moeabdol1: has joined #RubyOnRails
[05:02:34] jtong: has joined #RubyOnRails
[05:02:54] rafaelfranca: has joined #RubyOnRails
[05:05:33] pawnbox: has joined #RubyOnRails
[05:06:06] jedmund: has joined #RubyOnRails
[05:08:08] jtong: has joined #RubyOnRails
[05:08:36] wd40s: has joined #RubyOnRails
[05:13:52] k3rn31: has joined #RubyOnRails
[05:14:42] hahuang61: has joined #RubyOnRails
[05:15:48] alfiemax: has joined #RubyOnRails
[05:19:23] jtong: has joined #RubyOnRails
[05:20:03] blackhuey: has joined #RubyOnRails
[05:21:44] wd40s: has joined #RubyOnRails
[05:23:29] dkam___: has joined #RubyOnRails
[05:24:11] dionysus69: has joined #RubyOnRails
[05:27:04] nacsurte: has joined #RubyOnRails
[05:30:01] jetpack_joe: has joined #RubyOnRails
[05:30:44] jtong: has joined #RubyOnRails
[05:31:34] danman: has joined #RubyOnRails
[05:31:36] dunpeal: has joined #RubyOnRails
[05:32:16] zachrab: has joined #RubyOnRails
[05:34:02] tego101: has joined #RubyOnRails
[05:36:36] abhinavmehta: has joined #RubyOnRails
[05:37:21] tercenya: has joined #RubyOnRails
[05:38:18] conta: has joined #RubyOnRails
[05:41:26] duncannz: has joined #RubyOnRails
[05:42:04] jtong: has joined #RubyOnRails
[05:43:07] Oliphaunte: has joined #RubyOnRails
[05:43:19] wd40s: has joined #RubyOnRails
[05:43:22] MaDErroR123: has joined #RubyOnRails
[05:48:20] wd40s: has joined #RubyOnRails
[05:49:11] lxsameer: has joined #RubyOnRails
[05:51:16] zachrab: has joined #RubyOnRails
[05:53:22] adre: has joined #RubyOnRails
[05:53:51] jtong: has joined #RubyOnRails
[05:54:38] tildes: has joined #RubyOnRails
[05:58:09] beilabs: has joined #RubyOnRails
[05:58:22] cd-rum: has joined #RubyOnRails
[05:59:57] phrozen77: has joined #RubyOnRails
[06:01:37] vedu: Why is it specified gen_random_uuid() rather than using the default uuid_generate_v4() for UUID primary keys? ref: http://guides.rubyonrails.org/active_record_postgresql.html#uuid-primary-keys
[06:02:33] conta: has joined #RubyOnRails
[06:07:53] harfangk: has joined #RubyOnRails
[06:08:14] wd40s: has joined #RubyOnRails
[06:09:09] rogue_koder: has joined #RubyOnRails
[06:10:58] Cohedrin: has joined #RubyOnRails
[06:11:06] pawnbox: has joined #RubyOnRails
[06:13:47] Fire-Dragon-DoL1: has joined #RubyOnRails
[06:14:02] Fire-Dragon-DoL1: has left #RubyOnRails: ()
[06:17:50] cd-rum_: has joined #RubyOnRails
[06:19:14] tercenya: has joined #RubyOnRails
[06:23:03] yfeldblum: has joined #RubyOnRails
[06:23:08] beilabs: has joined #RubyOnRails
[06:28:03] jtong: has joined #RubyOnRails
[06:28:30] beilabs: has joined #RubyOnRails
[06:29:11] wd40s: has joined #RubyOnRails
[06:31:09] yfeldblum: has joined #RubyOnRails
[06:31:53] yoongkang: has joined #RubyOnRails
[06:32:26] beilabs_: has joined #RubyOnRails
[06:34:05] apotry: has joined #RubyOnRails
[06:35:09] srinidhi: has joined #RubyOnRails
[06:35:49] abhinavmehta: has joined #RubyOnRails
[06:37:17] Oliphaunte: has joined #RubyOnRails
[06:37:43] dkam___: has joined #RubyOnRails
[06:39:23] jtong: has joined #RubyOnRails
[06:39:52] Hyuk: has joined #RubyOnRails
[06:40:48] hwcomcn: has joined #RubyOnRails
[06:44:16] daveomcd: has joined #RubyOnRails
[06:44:56] AndrewIsHere: has joined #RubyOnRails
[06:49:47] ur5us: has joined #RubyOnRails
[06:50:46] jtong: has joined #RubyOnRails
[06:55:02] pawnbox: has joined #RubyOnRails
[06:56:21] tildes: has joined #RubyOnRails
[06:56:40] beilabs: has joined #RubyOnRails
[06:57:00] wd40s: has joined #RubyOnRails
[06:58:43] DoctorMonocular: has joined #RubyOnRails
[07:01:43] solars: has joined #RubyOnRails
[07:02:05] jtong: has joined #RubyOnRails
[07:13:52] pickandmix: has joined #RubyOnRails
[07:14:34] wd40s: has joined #RubyOnRails
[07:15:26] hahuang61: has joined #RubyOnRails
[07:16:16] sevenseacat: has joined #RubyOnRails
[07:17:57] fox_mulder_cp: wow, i add public_activity for my control panel app
[07:18:53] jtong: has joined #RubyOnRails
[07:19:35] GnuYawk: has joined #RubyOnRails
[07:22:38] Dimik--: has joined #RubyOnRails
[07:24:35] jtong: has joined #RubyOnRails
[07:26:00] wd40s: has joined #RubyOnRails
[07:28:15] jedmund: has joined #RubyOnRails
[07:29:20] der-landgraf: has joined #RubyOnRails
[07:30:10] jstransky: has joined #RubyOnRails
[07:33:32] dunpeal: has joined #RubyOnRails
[07:36:00] jtong: has joined #RubyOnRails
[07:36:03] alfiemax: has joined #RubyOnRails
[07:39:01] AzaToth: has joined #RubyOnRails
[07:39:02] k3rn31: has joined #RubyOnRails
[07:40:19] jedmund: has joined #RubyOnRails
[07:42:29] Hyuk: has joined #RubyOnRails
[07:44:32] abhinavmehta: has joined #RubyOnRails
[07:45:11] wd40s: has joined #RubyOnRails
[07:46:00] ur5us: has joined #RubyOnRails
[07:47:17] jtong: has joined #RubyOnRails
[07:49:32] apotry: has joined #RubyOnRails
[07:52:32] arBmind: has joined #RubyOnRails
[07:54:06] darutoko: has joined #RubyOnRails
[07:54:57] abhinav: has joined #RubyOnRails
[07:56:50] abhinav: has left #RubyOnRails: ()
[08:01:49] yoongkang: has joined #RubyOnRails
[08:04:38] jtong: has joined #RubyOnRails
[08:05:24] travismathis: has joined #RubyOnRails
[08:08:51] wd40s: has joined #RubyOnRails
[08:10:46] GnuYawk: has joined #RubyOnRails
[08:14:47] chouhoulis: has joined #RubyOnRails
[08:15:41] Mia: has joined #RubyOnRails
[08:15:41] Mia: has joined #RubyOnRails
[08:15:59] jtong: has joined #RubyOnRails
[08:16:11] hahuang61: has joined #RubyOnRails
[08:18:13] GnuYawk: has joined #RubyOnRails
[08:20:50] marienz: has joined #RubyOnRails
[08:21:42] Mirubiri: has joined #RubyOnRails
[08:27:20] jtong: has joined #RubyOnRails
[08:28:46] jenrzzz: has joined #RubyOnRails
[08:29:44] pydave6367: has joined #RubyOnRails
[08:32:11] Gister: has joined #RubyOnRails
[08:33:06] jtong: has joined #RubyOnRails
[08:38:59] srinidhi: has joined #RubyOnRails
[08:40:16] marr: has joined #RubyOnRails
[08:42:10] shinnya: has joined #RubyOnRails
[08:43:36] abhinavmehta: has joined #RubyOnRails
[08:44:15] jtong_: has joined #RubyOnRails
[08:46:15] AndrewIsHere: has joined #RubyOnRails
[08:47:00] travismathis: has joined #RubyOnRails
[08:47:37] MaDErroR123: has joined #RubyOnRails
[08:49:08] lxsameer: has joined #RubyOnRails
[08:49:57] jtong: has joined #RubyOnRails
[08:50:29] harfangk: has joined #RubyOnRails
[08:54:25] chouhoulis: has joined #RubyOnRails
[08:55:51] pawnbox: has joined #RubyOnRails
[08:56:19] Pupeno: has joined #RubyOnRails
[08:57:38] chipotle: has joined #RubyOnRails
[09:06:57] jtong: has joined #RubyOnRails
[09:07:22] arifba: has joined #RubyOnRails
[09:07:36] arifba: Can someone have a look?
[09:07:38] arifba: https://gist.github.com/anonymous/d7e0b7e88c2c0090d0b386486c1e9b1c
[09:07:46] arifba: It's probably something really simple and silly
[09:10:32] wd40s: has joined #RubyOnRails
[09:10:35] snowy: has joined #RubyOnRails
[09:12:36] sevenseacat: arif__: current_page? is a view helper, not a controller method.
[09:12:40] jtong: has joined #RubyOnRails
[09:14:14] yoongkang: has joined #RubyOnRails
[09:14:29] arifba: @sevenseacat How can I accomplish what I'm trying to then? Is there another way to find the current path?
[09:14:47] sevenseacat: why do you need to know the current path?
[09:15:15] sevenseacat: are you trying to combine what should be two controller actions, into one?
[09:15:21] snowy: has joined #RubyOnRails
[09:15:59] arifba: I just want to render different actions based on what the current path is
[09:16:16] sevenseacat: thats not what your code is doing
[09:16:42] sevenseacat: render :action is a misnomer
[09:17:17] arifba: well that's what i was intending to do...
[09:17:32] arifba: render :action works fine when i don't include the current_page? method
[09:18:00] sevenseacat: whats in your masonry action? whats in your index action? why are they different?
[09:19:02] arifba: index action basically shows all posts in normal view while masonry action shows them in masonry view (responsive grid)
[09:19:13] tildes: has joined #RubyOnRails
[09:19:32] sevenseacat: why are they different actions? :/
[09:19:57] sevenseacat: why are they different URLs?
[09:21:08] arifba: Initially I just ajax-ed the masonry views, but then I decided to make it a separate url for cases when javascript is turned off
[09:21:22] arifba: also, the ajax was messing with my infinite scrolling and stuff
[09:21:25] arifba: or am i doing it wrong?
[09:22:21] sevenseacat: I don't really get what you're trying to do, but that controller code is smelly
[09:23:57] jenrzzz: has joined #RubyOnRails
[09:23:57] jenrzzz: has joined #RubyOnRails
[09:25:02] arifba: Now I just want to do this -- when the User clicks on TOP (i.e. the top method), I want the Top posts to be shown in either normal or masonry view depending on the page the user is currently in
[09:25:07] arifba: if that makes any sense..
[09:25:14] arifba: i'm probably doing it all wrong though
[09:25:25] arifba: but is there no alternative of current_page?
[09:26:19] douglascorrea: has joined #RubyOnRails
[09:26:40] dkam___: has joined #RubyOnRails
[09:26:54] tercenya: has joined #RubyOnRails
[09:32:30] lxsameer: has joined #RubyOnRails
[09:34:09] MaDErroR123: has joined #RubyOnRails
[09:35:23] dunpeal: has joined #RubyOnRails
[09:36:55] wd40s: has joined #RubyOnRails
[09:39:51] apotry: has joined #RubyOnRails
[09:41:03] jtong: has joined #RubyOnRails
[09:41:32] conta: has joined #RubyOnRails
[09:42:16] FooMunki: has joined #RubyOnRails
[09:52:23] jtong: has joined #RubyOnRails
[09:54:51] adre: has joined #RubyOnRails
[09:58:40] yoongkang: has joined #RubyOnRails
[10:01:46] banisterfiend: has joined #RubyOnRails
[10:02:10] siaW: has joined #RubyOnRails
[10:03:49] jtong: has joined #RubyOnRails
[10:05:12] sdwrage: has joined #RubyOnRails
[10:07:06] conta: has joined #RubyOnRails
[10:13:21] chipotle: has joined #RubyOnRails
[10:15:07] jtong: has joined #RubyOnRails
[10:15:54] chipotle: has joined #RubyOnRails
[10:16:13] alfiemax: has joined #RubyOnRails
[10:16:56] hahuang61: has joined #RubyOnRails
[10:17:56] wd40s: has joined #RubyOnRails
[10:23:45] chipotle: has joined #RubyOnRails
[10:26:51] jtong: has joined #RubyOnRails
[10:28:37] chipotle: has joined #RubyOnRails
[10:31:38] Axilla: has joined #RubyOnRails
[10:32:51] chipotle: has joined #RubyOnRails
[10:32:59] yfeldblum: has joined #RubyOnRails
[10:38:33] chipotle: has joined #RubyOnRails
[10:40:50] chipotle: has joined #RubyOnRails
[10:43:12] chipotle: has joined #RubyOnRails
[10:43:53] armyriad: has joined #RubyOnRails
[10:45:37] chipotle: has joined #RubyOnRails
[10:46:51] glasz_: has joined #RubyOnRails
[10:47:07] roamingdog: has joined #RubyOnRails
[10:47:32] AndrewIsHere: has joined #RubyOnRails
[10:47:59] chipotle: has joined #RubyOnRails
[10:49:21] jtong: has joined #RubyOnRails
[10:50:21] chipotle: has joined #RubyOnRails
[10:51:39] elomatreb: has joined #RubyOnRails
[10:51:43] lele: has joined #RubyOnRails
[10:52:41] chipotle: has joined #RubyOnRails
[10:52:43] darutoko: has joined #RubyOnRails
[10:54:21] many: has joined #RubyOnRails
[10:54:36] Kuukunen-: has joined #RubyOnRails
[10:59:14] ndrst: has joined #RubyOnRails
[10:59:25] jedmund: has joined #RubyOnRails
[11:00:42] jtong: has joined #RubyOnRails
[11:02:22] ishahnaz: has joined #RubyOnRails
[11:03:24] quazimodo: has joined #RubyOnRails
[11:04:27] P4Titan: has joined #RubyOnRails
[11:05:22] P4Titan: Hi all. I am having this issue where the `session` variable is nil upon page refresh, but the cookie still stays. So whenever I do something on the page, like click on an internal link, `session` then gets updated and non-nil
[11:05:33] P4Titan: Why is it that on page refresh, it is nil though?
[11:05:40] benlieb: has joined #RubyOnRails
[11:06:02] tildes: has joined #RubyOnRails
[11:06:39] jtong: has joined #RubyOnRails
[11:06:41] FernandoBasso: has joined #RubyOnRails
[11:07:43] Oliphaunte: has joined #RubyOnRails
[11:08:40] quazimod1: has joined #RubyOnRails
[11:09:57] roshanavand: has joined #RubyOnRails
[11:13:15] srinidhi: has joined #RubyOnRails
[11:13:28] pawnbox: has joined #RubyOnRails
[11:13:52] roshanavand: has joined #RubyOnRails
[11:16:09] Velizar: has joined #RubyOnRails
[11:18:00] jtong: has joined #RubyOnRails
[11:18:53] P4Titan: Would anyone have a clue?
[11:19:28] yoongkang: has joined #RubyOnRails
[11:20:51] c355E3B: has joined #RubyOnRails
[11:23:37] pawnbox: has joined #RubyOnRails
[11:26:35] roshanavand: has joined #RubyOnRails
[11:32:55] DoubleMalt: has joined #RubyOnRails
[11:34:02] pickandmix: has joined #RubyOnRails
[11:34:54] jtong: has joined #RubyOnRails
[11:37:17] dunpeal: has joined #RubyOnRails
[11:38:09] yoongkang: has joined #RubyOnRails
[11:40:44] cd-rum: has joined #RubyOnRails
[11:44:41] cd-rum_: has joined #RubyOnRails
[11:49:27] yoongkang: has joined #RubyOnRails
[11:52:43] pawnbox_: has joined #RubyOnRails
[11:54:34] Pupeno: has joined #RubyOnRails
[11:55:17] PotatoChipz: has joined #RubyOnRails
[11:55:48] wd40s: has joined #RubyOnRails
[11:56:27] PotatoChipz: Hi guys, what do you usually use for a polymorphic hierarchy model? Is acts_as_dag gem any good?
[12:01:55] Oliphaunte: has joined #RubyOnRails
[12:05:20] Pupeno: has joined #RubyOnRails
[12:08:57] jtong: has joined #RubyOnRails
[12:10:50] triangles: has joined #RubyOnRails
[12:12:06] tk_: has joined #RubyOnRails
[12:12:39] wd40s: has joined #RubyOnRails
[12:13:22] Pupeno: has joined #RubyOnRails
[12:13:22] Pupeno: has joined #RubyOnRails
[12:14:49] jtong: has joined #RubyOnRails
[12:15:44] sagax: has joined #RubyOnRails
[12:16:00] lizard2010: sagax, hello
[12:17:42] hahuang61: has joined #RubyOnRails
[12:24:32] wd40s: has joined #RubyOnRails
[12:25:54] yoongkang: has joined #RubyOnRails
[12:26:00] jtong: has joined #RubyOnRails
[12:26:09] oystersauce8: has joined #RubyOnRails
[12:29:14] roamingdog: has joined #RubyOnRails
[12:30:58] gingray: has joined #RubyOnRails
[12:32:45] alfiemax: has joined #RubyOnRails
[12:37:25] pawnbox: has joined #RubyOnRails
[12:37:31] jtong: has joined #RubyOnRails
[12:38:39] mooru: has joined #RubyOnRails
[12:39:43] tildes: has joined #RubyOnRails
[12:42:11] JamesGames: has joined #RubyOnRails
[12:42:52] qejk: has joined #RubyOnRails
[12:43:18] jtong: has joined #RubyOnRails
[12:47:26] abhinavmehta: has joined #RubyOnRails
[12:48:15] JamesGames: has joined #RubyOnRails
[12:48:49] AndrewIsHere: has joined #RubyOnRails
[12:49:16] JamesGames: hey!!! I have a sort-of nube question. Im trying to get dnd to trigger an action, but will it work? no. ANyway, here's the codehttps://gist.github.com/anonymous/ac3a01e2108b5f4939dcec29b40b292b
[12:51:50] roshanavand: has joined #RubyOnRails
[12:52:48] xall: has joined #RubyOnRails
[12:52:56] JamesGames: You will probably see the error instantly
[12:53:16] wd40s: has joined #RubyOnRails
[12:53:25] Pupeno: has joined #RubyOnRails
[12:54:41] jtong: has joined #RubyOnRails
[12:55:40] yottanami: has joined #RubyOnRails
[12:56:12] Oliphaunte: has joined #RubyOnRails
[12:57:02] alfiemax: has joined #RubyOnRails
[12:59:29] yottanami: I am trying ro deploy my project using capistrano. I tried assets precompile as production in my local machine and it works without any error but on server I got this error http://dpaste.com/1SJD3HF
[12:59:36] jhass: JamesGames: you never call .save
[13:00:04] yottanami: How can I find out the more information about the error?
[13:00:09] JamesGames: jhass: ok. In controller?
[13:00:32] JamesGames: jhass: why is it breaking the program?
[13:01:04] jhass: assigning attributes to a model does not write them to the database yet
[13:01:06] jhass: .save does
[13:01:35] jhass: yottanami: therubyracer or nodejs?
[13:02:08] JamesGames: jhass: Program doesn't work still. I put in targetitem.save
[13:02:29] jhass: doesn't work is a terrible problem description, you know
[13:03:17] JamesGames: the items dont click, they don't move when dragged. I will check the console for a better answer
[13:03:22] yottanami: jhass, I use default setting. I think sprockets use nodejs. am I right?
[13:03:52] jhass: yottanami: execjs will use whatever is available, node, therubyracer, one or two others iirc
[13:04:40] jhass: https://github.com/rails/execjs#execjs
[13:04:48] jhass: well a whole bunch more in fact
[13:04:55] JamesGames: jhass: here is the console output; what am i looking for? https://gist.github.com/anonymous/42ab4e58fe0672222cba6cf18b246a4b
[13:05:51] yottanami: jhass, So it is using nodeJs
[13:05:53] jhass: JamesGames: there's never a request, your JS is more likely than not borked
[13:06:01] yottanami: jhass, How can I find out more about my error?
[13:06:14] abhinavmehta: has joined #RubyOnRails
[13:06:39] yottanami: Can it be because of nodejs version different?
[13:06:56] yottanami: instaling therubyracer can be helpful?
[13:09:04] Markhor1991: has joined #RubyOnRails
[13:09:38] jhass: yottanami: https://github.com/rails/execjs/blob/master/lib/execjs/external_runtime.rb#L211-L221 doesn't seem to provide any debug output
[13:10:23] arup_r: has joined #RubyOnRails
[13:10:25] jhass: strace -s 1000 -f -e execve to see what it's calling I guess
[13:10:30] jhass: then do that call on console
[13:10:34] jhass: see how/why it fails
[13:10:42] jhass: or switch the runtime I guess, yeah
[13:11:28] banisterfiend: has joined #RubyOnRails
[13:11:37] yottanami: You mean running strace on server terminal?
[13:12:06] yottanami: jhass, Switch the runtime? what does it means?
[13:12:36] matthewd: yottanami: You could also just hack a puts into https://github.com/rails/execjs/blob/master/lib/execjs/external_runtime.rb#L212, to see what the first argument there looks like
[13:14:16] dkam___: has joined #RubyOnRails
[13:14:25] darutoko: has joined #RubyOnRails
[13:15:31] tercenya: has joined #RubyOnRails
[13:15:44] yottanami: matthewd, puts io or io.read?
[13:16:39] matthewd: yottanami: p(binary.split(' ') << filename)
[13:22:35] douglascorrea: has joined #RubyOnRails
[13:24:13] benlieb: has joined #RubyOnRails
[13:24:15] harfangk: has joined #RubyOnRails
[13:29:46] jtong: has joined #RubyOnRails
[13:32:20] Pupeno: has joined #RubyOnRails
[13:34:03] yottanami: matthewd, I just changed like this https://github.com/Yellowen/execjs/blob/master/lib/execjs/external_runtime.rb#L214 and here is the output http://dpaste.com/0Z73HQ6
[13:34:19] yottanami: It seems the tmp files are deleted
[13:35:23] pawnbox: has joined #RubyOnRails
[13:35:28] jtong: has joined #RubyOnRails
[13:38:52] matthewd: yottanami: Ah, right :/
[13:39:09] dunpeal: has joined #RubyOnRails
[13:40:46] matthewd: yottanami: Maybe see which side of the #success? conditional it's taking... `p [$?, output]` after the close?
[13:41:34] yottanami: matthewd, Is any chance to disable capistrano and upload precompiled files from local? because I can compile it on my machine
[13:42:34] matthewd: You should be able to turn off precompilation in capistrano (though I don't know how), and then just commit public/assets/, if you like
[13:43:05] matthewd: Personally my strongest interest is in understanding why you're getting such a singularly unhelpful error
[13:44:56] roamingdog: has joined #RubyOnRails
[13:47:05] Rodya_: has joined #RubyOnRails
[13:50:13] dkamioka: has joined #RubyOnRails
[13:50:34] darutoko: has joined #RubyOnRails
[13:50:45] nyasha: has joined #RubyOnRails
[13:52:10] jtong: has joined #RubyOnRails
[13:53:27] anmn: has joined #RubyOnRails
[13:56:23] adre: has joined #RubyOnRails
[13:58:14] alfiemax: has joined #RubyOnRails
[14:02:03] eljimador: has joined #RubyOnRails
[14:03:04] Ebok: has joined #RubyOnRails
[14:03:08] roshanavand: has joined #RubyOnRails
[14:03:37] jtong: has joined #RubyOnRails
[14:06:55] yottanami: matthewd, The output is http://dpaste.com/11XABXS
[14:07:06] yottanami: matthewd, for `p [$?, output]
[14:07:48] matthewd: Oh! That'll do it.
[14:08:06] matthewd: If the process is getting killed, most likely it's hitting OOM
[14:11:29] benlieb: has joined #RubyOnRails
[14:15:17] jtong: has joined #RubyOnRails
[14:18:02] yottanami: matthewd, So all of that is because of memory limitation! so it looks I have to precompile on local
[14:18:14] alfiemax: has joined #RubyOnRails
[14:18:26] hahuang61: has joined #RubyOnRails
[14:19:35] King_Rex: has joined #RubyOnRails
[14:20:56] jtong: has joined #RubyOnRails
[14:22:44] blackmesa: has joined #RubyOnRails
[14:23:06] matthewd: yottanami: Yeah, looks like it. Thanks for chasing it down, though.. I'll work out how we can improve on the [lack of] error message you were seeing.
[14:27:24] yottanami: matthewd, Thank you for helps. I just added config.assets.precompile = false but got new error http://dpaste.com/3FFHXCH
[14:28:45] matthewd: That's not what that config does; if you want to stop capistrano from doing the precompile, you'll probably need to change something in its configuration file
[14:34:43] Guest_83847: has joined #RubyOnRails
[14:35:16] Guest_83847: Allah is doing
[14:35:23] Guest_83847: sun is not doing Allah is doing
[14:35:28] Devalo: has joined #RubyOnRails
[14:35:30] Guest_83847: moon is not doing Allah is doing
[14:35:37] Guest_83847: stars are not doing Allah is doing
[14:35:45] Guest_83847: planets are not doing Allah is doing
[14:35:51] Guest_83847: galaxies are not doing Allah is doing
[14:35:57] Guest_83847: oceans are not doing Allah is doing
[14:35:58] ChanServ: +q *!*@gateway/web/cgi-irc/kiwiirc.com/ip.119.159.33.63
[14:36:23] yottanami: matthewd, You mean more than config.assets.precompile = false in production.rb ?
[14:36:41] ElFerna: has joined #RubyOnRails
[14:39:51] matthewd: yottanami: That's not a capistrano config file, and is not a valid config setting for rails... where did you find something that suggested it?
[14:40:39] macsteps: has joined #RubyOnRails
[14:41:05] yottanami: matthewd, I find out I should change the capfile and I changed but I got this message now http://dpaste.com/0FHKHTN how can I find out which part is making the problem?
[14:41:39] matthewd: That's still because you have the above wrong config setting
[14:41:47] benlieb: has joined #RubyOnRails
[14:43:24] jtong: has joined #RubyOnRails
[14:49:37] pawnbox: has joined #RubyOnRails
[14:54:01] roshanavand: has joined #RubyOnRails
[14:54:42] jtong: has joined #RubyOnRails
[14:54:49] Guest_83847: has joined #RubyOnRails
[14:57:36] Guest_83847: has left #RubyOnRails: ()
[14:59:47] roamingdog: has joined #RubyOnRails
[15:00:49] asianMike: has joined #RubyOnRails
[15:01:41] Oliphaunte: has joined #RubyOnRails
[15:05:46] DoubleMalt: has joined #RubyOnRails
[15:06:23] jtong: has joined #RubyOnRails
[15:09:36] SteenJobs: has joined #RubyOnRails
[15:12:13] chouhoulis: has joined #RubyOnRails
[15:13:32] bga57: has joined #RubyOnRails
[15:13:54] jtong: has joined #RubyOnRails
[15:15:55] Tempesta: has joined #RubyOnRails
[15:17:45] arup_r: has joined #RubyOnRails
[15:17:55] Keepbro: has joined #RubyOnRails
[15:18:44] Keepbro: Just wanted to ask a noobie question regarding my first rails project
[15:20:52] douglascorrea: has joined #RubyOnRails
[15:22:17] wd40s: has joined #RubyOnRails
[15:22:43] arup_r: Keepbro: Go ahead! :)
[15:25:47] fox_mulder_cp: Keepbro: no ask about ask. just only ask
[15:26:23] adavia: has joined #RubyOnRails
[15:27:20] akshat: has joined #RubyOnRails
[15:29:51] marvik: has joined #RubyOnRails
[15:30:56] shinnya: has joined #RubyOnRails
[15:30:56] jhack: has joined #RubyOnRails
[15:31:54] boomer: has joined #RubyOnRails
[15:33:09] DoctorMonocular: has joined #RubyOnRails
[15:33:48] alfiemax: has joined #RubyOnRails
[15:33:49] Keepbro: I am making a blog site - its the basic tutorial one but I want to style it with bootstrap and I have been following a guide to do it and so far so good. I made a website a while back and I want to import the fonts I downloaded onto the applicationhtmlerb file. Can I do that?
[15:33:58] Leepoff: has joined #RubyOnRails
[15:34:23] Keepbro: like i said noob question but I only started learning to code a little while ago
[15:35:27] Keepbro: is it the same as doing it in html - ie link href=fontgooglepoopfont rel=stylesheet type=text/css?
[15:38:38] marvik: has left #RubyOnRails: ()
[15:40:11] SteenJobs: any idea why “God.load "#{path}/*.god” would throw a non-absolute path error, where path = “/home/deploy/apps/my_app/releases/20160723151211/config/god”?
[15:40:31] SteenJobs: Keepbro: are they googlefonts?
[15:40:44] SteenJobs: if they’re google fonts, you can just add the appropriate link to your application.html.erb
[15:41:08] SteenJobs: else if they’re custom fonts, you have to add them with the correct syntax to your CSS files, and you’ll have to make sure they’re included in the asset pipeline
[15:41:25] marvik_: has joined #RubyOnRails
[15:47:17] Keepbro: one is a custom bootstrap font and the other is a google font - they both worked when I had my original website - I was adding new articles as pages. I've now updated and made a blog web app but want to use the fonts again. My question really is whether rails html is the same regular html and the same <head> <link> tags work the same?
[15:48:03] Keepbro: sorry meant to say "whether rails html is the same as regular html"
[15:49:04] eljimmy: has joined #RubyOnRails
[15:50:03] AndrewIsHere: has joined #RubyOnRails
[15:51:52] jtong: has joined #RubyOnRails
[15:52:15] fox_mulder_cp: Keepbro: rails html = regulat html + some tech template tags such as <% if %> or <%= current_user %>
[15:53:01] fox_mulder_cp: u can add to html all what u need :)
[15:53:40] pawnbox: has joined #RubyOnRails
[15:53:51] fox_mulder_cp: but good way download some locally and compile js/css in one app asset
[15:54:06] nyasha: has joined #RubyOnRails
[15:54:23] fox_mulder_cp: via gems such as bootstrap-sass or add in into vendor's directory
[15:54:46] darutoko: has joined #RubyOnRails
[15:55:19] fox_mulder_cp: some years ago jquery cdn was hacked, and some sited which use jquery from cdn was compromated
[15:56:24] dgynn: has joined #RubyOnRails
[16:00:58] Keepbro: ok cool - so just to confirm doing html for rails app is pretty much exactly the same as doing regular html for a shitty website then? I can bring everything I've learned doing html and css to a rails app withonly some smallish differences almost all of which is ruby and rails stuff?
[16:01:31] Keepbro: oh and dont use the jquery cdn? or is it safe now?
[16:02:17] sevenseacat: use the version of jquery provided by jquery-rails.
[16:02:38] fox_mulder_cp: Keepbro: please, read official rails guide for blog, then rails 4 in actions, than agile development with rails 4
[16:03:11] fox_mulder_cp: its a good points to restart rails for me last winter :)
[16:03:58] fox_mulder_cp: it's a easy guides for writing your rails apps )
[16:05:08] fox_mulder_cp: Keepbro: and before it - confident ruby and ruby by Flanagan
[16:05:32] GnuYawk: has joined #RubyOnRails
[16:07:10] jhass: has joined #RubyOnRails
[16:08:27] coffeejunk: has joined #RubyOnRails
[16:08:31] Oliphaunte: has joined #RubyOnRails
[16:09:03] banisterfiend: has joined #RubyOnRails
[16:09:07] chouhoulis: has joined #RubyOnRails
[16:09:10] Keepbro: okey dokey - thank you guys - Keepbro away - until next time he comes across an amazingly simple problem that he needs experts to exasperatingly explain to him
[16:09:34] _fortis: has joined #RubyOnRails
[16:09:35] Keepbro: May the internet rain money and hookers on you all
[16:14:02] SteenJobs: soooo close. got “Upstart —monitoring—> God —monitoring—> resque” working on staging (everything on staging is under root’s home), but now on production, where the only difference is the user, i’m getting non-absolute home errors when starting the Upstart service :(
[16:14:16] SteenJobs: ughhh. works fine when starting god from the proj dir
[16:14:39] jtong: has joined #RubyOnRails
[16:14:57] chipotle: has joined #RubyOnRails
[16:15:26] fox_mulder_cp: SteenJobs: ooh, can u help me - i try start resque as production service, but it can't access to db
[16:15:27] SteenJobs: does that make Upstart even more omnicient than The Omnicient One?
[16:15:37] SteenJobs: fox_mulder_cp: sup
[16:16:24] SteenJobs: hmm - well first thing i’d recommend is using God to monitor your other processes, this way you really only need an Upstart script for God, and then you can use ruby code to monitor your other processes, rather than having a separate script for each
[16:16:25] fox_mulder_cp: in development mode all ok, but when i try to start app in production - resque worker fails to sql connect..
[16:16:51] SteenJobs: i can take a look - although since God manages my resque workers, my upstart script doesn’t directly interact with resque
[16:16:57] SteenJobs: gist me the error and your upstart script
[16:17:32] SteenJobs: (sevenseacat: my how far we’ve come…although production land is much scarier haha)
[16:18:55] SteenJobs: how in the world is “/home/deploy/apps/my_app/current
[16:19:01] douglascorrea: has joined #RubyOnRails
[16:19:04] roshanavand: has joined #RubyOnRails
[16:19:11] hahuang61: has joined #RubyOnRails
[16:19:12] SteenJobs: “ throwing non-absolute home
[16:20:09] jtong: has joined #RubyOnRails
[16:21:16] rubyonrails999: has joined #RubyOnRails
[16:21:38] rubyonrails999: Hello. This is the final piece of the puzzle. How do I make a separate join table for each user? My current join table is called Itemica (it holds the items) and I need one of these for each user.....
[16:22:43] sevenseacat: no you don't.
[16:23:23] sevenseacat: you maybe want a user_id as one of the columns on your Itemica table
[16:26:28] r3vDev: has joined #RubyOnRails
[16:28:39] tercenya: has joined #RubyOnRails
[16:33:02] Cohedrin: has joined #RubyOnRails
[16:34:26] bga57: has joined #RubyOnRails
[16:34:34] arup_r: has joined #RubyOnRails
[16:35:28] roshanavand: has joined #RubyOnRails
[16:36:50] Oliphaunte: has joined #RubyOnRails
[16:37:07] jtong: has joined #RubyOnRails
[16:38:13] chipotle: has joined #RubyOnRails
[16:41:44] pawnbox: has joined #RubyOnRails
[16:43:12] SteenJobs: ok - turns out setting setuid/setgid to deploy was causing the issue, my guess is because it uses a tilde when not the root user - any idea how to fix?
[16:44:55] rogue_koder: has joined #RubyOnRails
[16:48:32] jtong: has joined #RubyOnRails
[16:49:42] mozzarella: has joined #RubyOnRails
[16:52:26] macsteps: has joined #RubyOnRails
[16:59:53] jtong: has joined #RubyOnRails
[17:01:10] barajasfab: has joined #RubyOnRails
[17:01:52] SteenJobs: fox_mulder_cp: figured it out?
[17:02:13] fryguy: has joined #RubyOnRails
[17:03:28] adavia: is it possible to subscribe to a channel after an ajax request using actioncable?
[17:06:12] Axsuul: has joined #RubyOnRails
[17:10:48] zacts: has joined #RubyOnRails
[17:11:12] jtong: has joined #RubyOnRails
[17:13:48] roshanavand: has joined #RubyOnRails
[17:15:29] roshanavand: has joined #RubyOnRails
[17:15:33] fox_mulder_cp: SteenJobs: i think. that i lost seeding db :)
[17:15:51] srinidhi: has joined #RubyOnRails
[17:21:52] roshanavand: has joined #RubyOnRails
[17:22:38] jtong: has joined #RubyOnRails
[17:24:33] tbuehlmann: adavia: sure
[17:25:45] diegoviola: has joined #RubyOnRails
[17:26:51] adavia: tbuehlmann: i am trying to do something like App.cable.subscriptions.create in the complete callback of the request but it doesnt seem to subscribe
[17:29:02] tbuehlmann: is the callback called at all?
[17:29:31] adavia: i have posted the issue here http://stackoverflow.com/questions/38536687/rails-actioncable-subscribe-to-a-channel-after-an-ajax-request
[17:31:45] tbuehlmann: you're not subscribing in the callback, or am I wrong?
[17:32:55] Oliphaunte: has joined #RubyOnRails
[17:33:14] jhack: has joined #RubyOnRails
[17:33:55] jtong: has joined #RubyOnRails
[17:33:59] adavia: tbuehlmann: doing App.Messages would call MessagesChannel#subscribed which in turn should be subscribing as the doc says
[17:36:05] SteenJobs: what’s the fundamental difference between a Time object and a DateTime object, if they both include a date?
[17:36:45] SteenJobs: more generally, if im building an installments payment system which requires comparing dates, would you recommend using DateTime or Time?
[17:37:01] fryguy: http://stackoverflow.com/questions/1261329/whats-the-difference-between-datetime-and-time-in-ruby
[17:38:08] sevenseacat: the date/time stuff in ruby is a mess
[17:39:45] jtong: has joined #RubyOnRails
[17:39:53] roshanavand: has joined #RubyOnRails
[17:40:12] AndrewIsHere: has joined #RubyOnRails
[17:40:31] Dimik: has joined #RubyOnRails
[17:41:34] wd40s: has joined #RubyOnRails
[17:41:44] SteenJobs: fryguy: thanks, i temporarily forgot google exists :D
[17:42:10] SteenJobs: sevenseacat: if you want to feel a bit better, take a look at Swift/iOS’s date/time classes. Ruby is a godsend compared to that haha
[17:42:29] SteenJobs: there are like 7 different classes that you need to interact with, and it’s just miserable to do datetime computations and manipulations
[17:43:27] SteenJobs: just seems dangerous to have both DateTime and Time, because it seems you need to make sure to be consistent throughout your code
[17:44:32] jhass: they largely quack the same these days and can be losslessly converted into each other
[17:44:36] harfangk: SteenJobs hey don't say bad things about my dear NSDate, NSCalendar, NSDateComponents, and their respective formatters and other shenenigans!
[17:44:48] SteenJobs: mahhhh man/woman
[17:45:08] jhass: can't be worse than Java though
[17:45:46] SteenJobs: harfangk: trust me, i absolutely love doing iOS dev. the design patterns and OO nature of using the SDK just feels awesome and elegant. but jeeeeez, my last watchOS app involved a bunch of date manipulations and it was an absolute nightmare haha
[17:46:55] harfangk: well it does sound natural to me that a watchOS app would involve a bunch of date manipulations
[17:47:00] harfangk: after all, it's... a watch
[17:47:45] douglascorrea: has joined #RubyOnRails
[17:48:04] harfangk: it's funny how all these convenience classes and methods end up becoming inconvenient
[17:48:18] kies: has joined #RubyOnRails
[17:48:24] harfangk: whether it's Date/DateTime in Rails or NSDate and other stuff in Cocoa
[17:48:49] roshanavand: has joined #RubyOnRails
[17:49:06] SteenJobs: haha true - more because i needed dynamic times since the app, on both the watch and the phone, was geared towards the hebrew calendar, which begins at sundown. it was nuts.
[17:49:16] SteenJobs: with rails, there’s a freaking method distance_of_time_in_words()!!!!
[17:49:41] SteenJobs: awesome to know there’s another iOS dev here though :)
[17:50:09] GnuYawk: has left #RubyOnRails: ()
[17:50:29] GnuYawk: has joined #RubyOnRails
[17:51:09] harfangk: hebrew calendar... wow that's not something i want to deal with haha
[17:51:22] GnuYawk: hahahah harfangk !
[17:53:43] SteenJobs: yea had to do a bunch of NSDate conversions which was annoying
[17:54:20] SteenJobs: random q - why does Charge.where('due_date < ? AND charge_id != ?', DateTime.now, nil) not work, but rather requiers “charge_id IS NOT ?”
[17:54:36] arup_r: has joined #RubyOnRails
[17:56:38] SteenJobs: same thing with equality - can’t use “=“, need to use IS
[17:56:39] douglascorrea: has joined #RubyOnRails
[17:57:02] SteenJobs: found the answer
[17:57:50] adre: has joined #RubyOnRails
[17:58:03] wd40s: has joined #RubyOnRails
[17:58:34] tercenya: has joined #RubyOnRails
[17:58:49] arup_r: what is IS ?
[18:00:36] sumobob: has joined #RubyOnRails
[18:01:09] zacts: has joined #RubyOnRails
[18:01:41] jhass: SteenJobs: could also do .where(charge: nil).where("due_date < ?", DateTime.now)
[18:03:32] AndrewIsHere: has joined #RubyOnRails
[18:04:52] wd40s: has joined #RubyOnRails
[18:11:20] tbuehlmann: adaedra: shouldn't App.cable.subscriptions.create() create a subscription object and you're assigning App.Messages to it?
[18:11:50] jhass: adavia: ^
[18:13:54] jtong: has joined #RubyOnRails
[18:13:57] roshanavand: has joined #RubyOnRails
[18:15:19] adavia: tbuehlmann: well thats what i am trying to figure it out
[18:16:07] abhinavmehta: has joined #RubyOnRails
[18:17:27] tbuehlmann: it's not a function you're getting back from it, is that the misunderstanding?
[18:19:03] marahin: has joined #RubyOnRails
[18:19:56] hahuang61: has joined #RubyOnRails
[18:21:34] adavia: tbuehlmann: but then how would be the way to subscribe in a scenario like this?
[18:22:23] tbuehlmann: the easiest way would be to duplicate the code and call it in the callback
[18:25:09] xall: has joined #RubyOnRails
[18:31:47] AndrewIsHere: has joined #RubyOnRails
[18:31:59] adavia: tbuehlmann: well that might work. Ill check how to stay DRY with it
[18:35:10] SteenJobs: has joined #RubyOnRails
[18:35:35] SteenJobs: jhass: tis true, both would be fine
[18:36:02] SteenJobs: writing an integrity checker to run every day and make sure all charges/installments have gone through
[18:38:08] rodfersou: has joined #RubyOnRails
[18:38:33] pLaTo0n: has joined #RubyOnRails
[18:39:01] Velizar: has joined #RubyOnRails
[18:39:20] rogue_koder: has joined #RubyOnRails
[18:39:58] xall: has joined #RubyOnRails
[18:43:33] bjhaid: has joined #RubyOnRails
[18:43:40] bjhaid: has left #RubyOnRails: ()
[18:45:00] gremly: has joined #RubyOnRails
[18:48:25] roshanavand: has joined #RubyOnRails
[18:49:44] Rodya_: has joined #RubyOnRails
[18:50:22] wd40s: has joined #RubyOnRails
[18:51:44] SteenJobs: best resource for using AR to handle read/write locks? have resque delayed jobs and a daily integrity checker that i need to make sure aren’t acessing the same object simultaneously
[18:52:48] AnoHito: has joined #RubyOnRails
[18:52:56] SteenJobs: since the delayed jobs charge customers, and the integrity checker makes sure all installments/charges have been paid if it’s past their due date (so it’s possible that the integrity checker will check a charge while the job is in the queue)
[18:53:49] jtong: has joined #RubyOnRails
[18:54:50] fox_mulder_cp: SteenJobs: resque - it's a car. if u want go to cinema, u route it to cinema
[18:55:18] roamingdog: has joined #RubyOnRails
[18:55:31] SteenJobs: i just need to avoid a race condition, in case a job is executed while the integrity checker is running
[18:55:34] Papierkorb: SteenJobs: you're looking for the SELECT FOR UPDATE clause of psql
[18:55:57] fox_mulder_cp: SteenJobs: good way add a field for current status in model
[18:55:59] SteenJobs: btw, check this out if you haven’t heard about it http://sakurity.com/blog/2015/05/21/starbucks.html
[18:56:09] SteenJobs: i don’t see how that would fix the race condition
[18:56:22] Papierkorb: SteenJobs: No idea how to do this with AR, but the gist is something like this: UPDATE foo SET status = "running" WHERE id = (SELECT id FROM foo WHERE status = "waiting" FOR UPDATE) LIMIT 1 RETURNING *;
[18:56:22] SteenJobs: it can check current status by checking charge_id == nil or not
[18:56:47] fox_mulder_cp: SteenJobs: state: 'wait for conveting' -> state: 'converted'
[18:57:06] SteenJobs: Papierkorb: awesome. i finally had the opportunity to learn SQL proper since a friend was taking an SQL class for his MBA and needed help, so needed to learn it to help him :)
[18:57:29] Papierkorb: SteenJobs: the "trick" is to lock the table using the FOR UPDATE, then update the row to have the new status and then return the whole row. Oh, and iirc the LIMIT needs to be inside the sub-query :)
[18:57:39] fox_mulder_cp: SteenJobs: and run resque worker if state 'wait for converting'
[18:57:55] Papierkorb: SteenJobs: I do this using the Sequel gem for my job/worker stuff
[18:59:01] SteenJobs: fox_mulder_cp: i’m still not sure that would avoid the potential race condition, i’d have to think about it
[18:59:06] Papierkorb: SteenJobs: On another note, if you have PostgreSQL questions, #postgresql is pretty active and helpful too. Sure, they can't help you with ActiveRecord, but with everything else PSQL :)
[18:59:16] SteenJobs: but the cleanest way seems to be just using a write lock
[18:59:43] SteenJobs: Papierkorb: haha yea, that’s my next step if need be, but would def like to take the chance to delve deeper into AR’s db management stuff if possible
[19:01:30] Devalo: has joined #RubyOnRails
[19:02:05] fox_mulder_cp: SteenJobs: Resque.enqueue(CreateWebAppJob, self.id) if self.state == 'wait'
[19:02:19] SteenJobs: ha yea i got that part mah man
[19:02:56] SteenJobs: my point is i’m not convinced simply adding a state attribute would prevent a potential race condition should the two jobs be accessing the same charge simultaneously
[19:03:13] SteenJobs: gotta think about the sequence of events carefully
[19:03:24] roshanavand: has joined #RubyOnRails
[19:03:57] fox_mulder_cp: SteenJobs: u don't need lock via sql, KISS it, and use property such as state
[19:04:22] Papierkorb: fox_mulder_cp: When you get a Race Condition you can end up KISSing a contract goodbey
[19:04:38] fox_mulder_cp: and use right hooks, for block doubled tasks
[19:04:50] Papierkorb: won't help. the race conditions occurs elsewhere
[19:04:59] dunpeal: has joined #RubyOnRails
[19:04:59] jtong: has joined #RubyOnRails
[19:05:10] fox_mulder_cp: sql lock - another level of
[19:08:43] Diabolik: i don't know if anyone here has experience with cocoon
[19:08:56] Diabolik: but i have a form that im using for creating a new association
[19:09:09] Diabolik: https://gist.github.com/askl56/449956e303c8429431fa9078361419cc
[19:09:35] Diabolik: but when it is used for editing the parent association
[19:09:38] Diabolik: i get this:
[19:09:50] Diabolik: https://gist.github.com/askl56/449956e303c8429431fa9078361419cc
[19:09:59] Diabolik: * https://www.dropbox.com/s/bye5zbns8f57wts/Screenshot%202016-07-23%2020.05.33.png?dl=0
[19:10:29] Diabolik: im presuming js is the only way of fixing this?
[19:10:44] Leepoff: has joined #RubyOnRails
[19:10:59] siaW: has joined #RubyOnRails
[19:12:30] GnuYawk: has joined #RubyOnRails
[19:13:41] DoctorMonocular: has joined #RubyOnRails
[19:16:35] nacsurte: has joined #RubyOnRails
[19:18:14] daveomcd: has joined #RubyOnRails
[19:18:45] roshanavand: has joined #RubyOnRails
[19:19:03] duncannz: has joined #RubyOnRails
[19:20:01] moep: has joined #RubyOnRails
[19:21:14] Oliphaunte: has joined #RubyOnRails
[19:28:57] sergey_makagon: has joined #RubyOnRails
[19:34:26] AndrewIsHere: has joined #RubyOnRails
[19:38:30] tego101: has joined #RubyOnRails
[19:39:30] Pupeno: has joined #RubyOnRails
[19:41:41] weaksauce: has joined #RubyOnRails
[19:41:46] Pupeno: has joined #RubyOnRails
[19:42:56] AndrewIsHere: has joined #RubyOnRails
[19:42:58] ur5us: has joined #RubyOnRails
[19:43:13] jtong: has joined #RubyOnRails
[19:43:44] wd40s: has joined #RubyOnRails
[19:44:46] openstruct: has joined #RubyOnRails
[19:46:34] openstruct: I'm using active_model_serializer and want to return a JSON object that pulls bits of data from 4 different models...anyone have suggestions on how to best do this?
[19:47:11] sumobob: are there relations between your models?
[19:47:25] openstruct: So that's where it gets a little hairy
[19:47:25] sumobob: active-model_serializer can take a has_many and has_one
[19:47:56] openstruct: I guess my issue is, I only want pieces of each model and it feels odd to change all the serializers to cater to this one endpoint.
[19:48:23] openstruct: Maybe I should make a PORO and serialize that?
[19:48:33] openstruct: But I still need ActiveModel, heh.
[19:48:46] sumobob: thats a great question, I actually am in the same issue, but since its not public facing i opted to send more than nescessary
[19:48:52] yfeldblum: has joined #RubyOnRails
[19:48:56] sumobob: and filter client side
[19:49:33] openstruct: Yeah, that's an option for sure! I figured I'd make a new MyObjectSummarySerializer and specify the attributes almost like a presenter.
[19:50:25] centrx: has joined #RubyOnRails
[19:50:30] Oliphaunte: has joined #RubyOnRails
[19:50:59] openstruct: Could also specify specific serializers for each association.
[19:51:13] openstruct: Part of me thinks I'm abusing AMS
[19:53:21] sumobob: serializers for each association? is that an option cuz you have lots of has_many :throughs?
[19:54:26] openstruct: Two belongs_to and a single has_one, but I only need specific data from each thing. It's a bit "graphy" where I'm trying to summarize a user's activity. Looks like I can add scopes to associations though, which will do wonders.
[19:54:30] jtong: has joined #RubyOnRails
[19:57:08] roamingdog: has joined #RubyOnRails
[19:59:06] openstruct: sumobob: Just in case this helps you - I used `ActiveModelSerializers::SerializableResource.new(MyModel, serializer: MyModelSummarySerializer).as_json`
[19:59:27] Axsuul: has joined #RubyOnRails
[19:59:53] openstruct: By specifying this new serializer, I just made methods to grab the data I want from each association. I think it's still JSON API compliant, too.
[20:00:07] sumobob: Oh thats awesome, so I can sort of bypass the serializer builtins and hard wire all sorts of custom onew
[20:00:22] ur5us: has joined #RubyOnRails
[20:00:59] openstruct: Yup - I actually didn't even specify the associations just did stuff like `object.articles.most_recent.title`. Again, not sure if this is going against what AMS stands for.
[20:02:27] workmad3: has joined #RubyOnRails
[20:05:53] jtong: has joined #RubyOnRails
[20:06:20] roshanavand: has joined #RubyOnRails
[20:07:17] chouhoulis: has joined #RubyOnRails
[20:08:06] macsteps: has joined #RubyOnRails
[20:08:32] sumobob: if it works it works haha
[20:08:54] sumobob: now what I'm working on is gettign devise_token_auth to return my serialized model
[20:09:04] sumobob: rather than the default
[20:09:11] sumobob: on api calls
[20:09:47] openstruct: Can't you override the controller method for whichever action?
[20:11:33] jedmund: has joined #RubyOnRails
[20:12:27] douglascorrea: has joined #RubyOnRails
[20:14:14] sagax: has joined #RubyOnRails
[20:15:32] sumobob: has joined #RubyOnRails
[20:17:14] jtong: has joined #RubyOnRails
[20:18:04] jhack: has joined #RubyOnRails
[20:20:42] hahuang61: has joined #RubyOnRails
[20:21:53] dionysus69: has joined #RubyOnRails
[20:22:16] Mia: has joined #RubyOnRails
[20:22:33] workmad3: has joined #RubyOnRails
[20:28:36] jtong: has joined #RubyOnRails
[20:33:28] alex88: has joined #RubyOnRails
[20:34:38] alex88: Hi there, I've a strange issue https://requestb.in/ugtb7yug?inspect the first request is sent with httpie, the second one using a load test tool. To me they seems identical, but rails in the first one accepts all the parameters, in the second one it shows 'Parameters: {"machine_log"=>{}}' and so no data in the hash
[20:34:42] alex88: any clue on what could be?
[20:39:25] alex88: seems there's just 1 byte difference
[20:39:26] zacts: has joined #RubyOnRails
[20:39:37] centrx: has joined #RubyOnRails
[20:40:08] jtong: has joined #RubyOnRails
[20:41:29] qejk: has joined #RubyOnRails
[20:42:22] wd40s: has joined #RubyOnRails
[20:42:59] dotty: has joined #RubyOnRails
[20:43:14] dotty: Anyone know why enabling Cloudflare might break Rails CSRF protection?
[20:43:27] AndrewIsHere: has joined #RubyOnRails
[20:43:32] dotty: The tokens aren't being cached, I'm observing them change with each refresh
[20:44:50] gingray: has joined #RubyOnRails
[20:45:18] chouhoulis: has joined #RubyOnRails
[20:45:20] sergey_makagon: has joined #RubyOnRails
[20:46:13] Cache_Money: has joined #RubyOnRails
[20:48:16] tego101: has joined #RubyOnRails
[20:48:45] Pupeno: has joined #RubyOnRails
[20:48:48] roshanavand: has joined #RubyOnRails
[20:50:05] xall: has joined #RubyOnRails
[20:51:52] jtong: has joined #RubyOnRails
[20:52:45] DoctorMonocular: has joined #RubyOnRails
[20:54:27] Oliphaunte: has joined #RubyOnRails
[20:59:00] sumobob: has joined #RubyOnRails
[21:02:02] alex88: dotty: where did you read that?
[21:02:21] alex88: even if they're cached, they don't break CSRF protection, they'll break the requests
[21:02:35] Oliphaunte: has joined #RubyOnRails
[21:03:02] dotty: alex88: Sorry that's what I meant - the requests are failing
[21:03:30] xall: has joined #RubyOnRails
[21:03:44] dotty: I *think* I've figured it out. Related to how I've set up SSL I think (using SSL via CloudFlare, hence why turning CloudFlare off is fixing the issue)
[21:04:13] dotty: Just running some tests now re. SSL, will post log entries if I don't get anywhere. Thanks alex88
[21:04:16] alex88: mhhh cloudflare probably just sends you the http request, it should be transparent
[21:08:31] jtong: has joined #RubyOnRails
[21:14:13] jhack: has joined #RubyOnRails
[21:15:19] xall: has joined #RubyOnRails
[21:15:20] watersoul: has joined #RubyOnRails
[21:17:10] dvinciguerra_: has joined #RubyOnRails
[21:17:50] daveomcd: has joined #RubyOnRails
[21:19:03] roshanavand: has joined #RubyOnRails
[21:19:23] arBmind: has joined #RubyOnRails
[21:19:26] JamesGames: has joined #RubyOnRails
[21:20:04] rodfersou: has joined #RubyOnRails
[21:20:07] chouhoulis: has joined #RubyOnRails
[21:20:14] jtong: has joined #RubyOnRails
[21:20:33] JamesGames: hey peeps. Im trying to populate a table by attribute, the controller does NOT like it. Not sure what I am doing wrong
[21:20:35] JamesGames: https://gist.github.com/anonymous/e4d6901be5cf6a15459bea16cca03c13
[21:21:14] agent_white: has joined #RubyOnRails
[21:22:06] jhack: has joined #RubyOnRails
[21:22:09] rickmasta: has joined #RubyOnRails
[21:23:28] fox_mulder_cp: JamesGames: seems that u drop required params in def setupItemica(userid, owner)
[21:24:05] fox_mulder_cp: read errors, and logs, and be force with u )
[21:24:40] abhinavmehta: has joined #RubyOnRails
[21:25:56] jtong: has joined #RubyOnRails
[21:26:03] roamingdog: has joined #RubyOnRails
[21:26:17] JamesGames: the force be with you too, old friend
[21:29:59] SAGE___: has joined #RubyOnRails
[21:31:42] blackmesa: has joined #RubyOnRails
[21:31:53] meoblast001: has joined #RubyOnRails
[21:33:27] jtong: has joined #RubyOnRails
[21:35:12] funrep: has joined #RubyOnRails
[21:35:38] zacts: has joined #RubyOnRails
[21:36:14] seaworthy: has joined #RubyOnRails
[21:42:06] Brando753-o_O_o: has joined #RubyOnRails
[21:43:04] pickandmix: has joined #RubyOnRails
[21:45:14] roamingdog: has joined #RubyOnRails
[21:47:05] rakm: has joined #RubyOnRails
[21:47:27] Pupeno: has joined #RubyOnRails
[21:47:53] armyriad: has joined #RubyOnRails
[21:48:28] jtong: has joined #RubyOnRails
[21:49:47] banisterfiend: has joined #RubyOnRails
[21:49:59] bga57: has joined #RubyOnRails
[21:50:43] weaksauce: has joined #RubyOnRails
[21:53:32] Oliphaunte: has joined #RubyOnRails
[21:59:11] adre: has joined #RubyOnRails
[21:59:33] sypheren: has joined #RubyOnRails
[22:00:07] jtong: has joined #RubyOnRails
[22:01:13] one_zero: has joined #RubyOnRails
[22:03:23] armyriad: has joined #RubyOnRails
[22:10:48] centrx: has joined #RubyOnRails
[22:11:18] jtong: has joined #RubyOnRails
[22:13:50] Pupeno: has joined #RubyOnRails
[22:14:33] rickmasta: has joined #RubyOnRails
[22:18:25] jhack: has joined #RubyOnRails
[22:19:30] GnuYawk: has joined #RubyOnRails
[22:20:53] dkamioka: has joined #RubyOnRails
[22:21:25] hahuang61: has joined #RubyOnRails
[22:22:34] jtong: has joined #RubyOnRails
[22:23:37] solars: has joined #RubyOnRails
[22:25:39] one_zero: has joined #RubyOnRails
[22:25:59] SteenJobs: has joined #RubyOnRails
[22:27:19] SteenJobs: Papierkorb: hey sorry got disconnected before. seems like AR has methods that take a block, for optimistic and pessimistic locks
[22:31:36] amperry: has joined #RubyOnRails
[22:32:52] cd-rum: has joined #RubyOnRails
[22:33:54] jtong: has joined #RubyOnRails
[22:35:09] akshat: has joined #RubyOnRails
[22:36:02] amperry: when you run db:schema:load, that's only reading from your schema.rb file, right?
[22:36:38] fox_mulder_cp: my day was very loong. so good night
[22:36:40] rickmasta: has joined #RubyOnRails
[22:36:40] akshat_: has joined #RubyOnRails
[22:37:17] Pupeno: has joined #RubyOnRails
[22:38:16] amperry: I ask because I'm getting an error: "Mysql2::Error: Cannot delete or update a parent row: a foreign key constraint fails: DROP TABLE `leases` CASCADE", but I don't see where in the file it would be asking to DROP the table.
[22:39:56] SteenJobs: jhass: is the Locking class only rails 5??
[22:40:01] beauby: has joined #RubyOnRails
[22:41:21] Rodya_: has joined #RubyOnRails
[22:43:23] jhass: amperry: yes
[22:43:46] jhass: it cleans the db first though
[22:45:01] AndrewIsHere: has joined #RubyOnRails
[22:45:04] amperry: jhass: any idea why would that cause the Mysql2 error "Cannot delete or update a parent row"?
[22:45:04] cd-rum: has joined #RubyOnRails
[22:45:17] jtong: has joined #RubyOnRails
[22:46:13] jhass: because it does that quite stupidly one after the other
[22:46:24] jhass: so your foreign key constraints start to fail
[22:46:47] jhass: I usually do rake db:drop db:create db:schema:load because of that
[22:47:04] amperry: jhass: let me give that a try
[22:49:16] amperry: jhass: that did it. Thanks!
[22:54:09] Oliphaunte: has joined #RubyOnRails
[22:56:41] jtong: has joined #RubyOnRails
[22:58:30] SteenJobs: jhass: works in rails 4
[22:58:42] SteenJobs: although i can’t seem to get it to reload the instance after the lock is released /:
[22:59:36] amperry: side note, anyone know of a channel for mysql users other than #mysql?
[23:00:42] qejk: has joined #RubyOnRails
[23:01:16] roamingdog: has joined #RubyOnRails
[23:01:18] King_Rex: has joined #RubyOnRails
[23:01:22] jhack: has joined #RubyOnRails
[23:02:19] jhass: what's wrong with #mysql?
[23:02:38] jhass: There's #maria
[23:03:34] amperry: jhass: #mysql requires you to register your nick, and I was unable to do that
[23:04:24] jhass: then how do you talk here oO
[23:04:37] amperry: this channel doesn't require it
[23:04:48] jhass: usually it does :/
[23:05:10] jhass: anyway, /msg NickServ help
[23:05:14] jhass: just do it
[23:05:30] amperry: tried that before, but I can try it again
[23:06:48] cleopatras: has joined #RubyOnRails
[23:06:59] wd40s: has joined #RubyOnRails
[23:10:39] Pupeno: has joined #RubyOnRails
[23:10:39] Pupeno: has joined #RubyOnRails
[23:12:35] qejk: has joined #RubyOnRails
[23:13:53] douglascorrea: has joined #RubyOnRails
[23:16:29] amperry: has left #RubyOnRails: ("ERC (IRC client for Emacs 24.5.1)")
[23:21:58] rickmasta: has joined #RubyOnRails
[23:24:13] SteenJobs: anyone have a clue why this is the case: https://gist.github.com/jesiegel1/6690e70a3f176eada1cdad687680e36b
[23:26:04] jhass: they don't magically run concurrently
[23:26:24] SteenJobs: i’m running them from separate console tabs
[23:27:01] SteenJobs: jhass: if only that was my issue….i’d be a happy man
[23:27:54] SteenJobs: i run lock() in one window, and then run test_lock() in the other
[23:28:36] Oliphaunte: has joined #RubyOnRails
[23:29:02] SteenJobs: jhass: after the lock is released, test_lock should be reloading the row from the table…but alas it doesnt’ appear to be doing so
[23:29:22] jhass: no, I don't think it should
[23:30:02] SteenJobs: https://github.com/rails/rails/blob/08c0ef777f29048ca3e22e2b86c53bd3790c74fc/activerecord/lib/active_record/locking/pessimistic.rb#L71
[23:30:44] jhass: that's before it's yielded and certainly not relevant to test_lock
[23:30:46] matthewd: SteenJobs: How is that relevant? test_lock isn't calling with_lock
[23:31:13] jtong: has joined #RubyOnRails
[23:31:36] SteenJobs: matthewd: when test_lock queries the object, the query is delayed until lock releases the locked row, so then presumably the query should return the updated activation object
[23:32:19] matthewd: SteenJobs: No, it's not
[23:33:15] SteenJobs: can you explain to me why…?
[23:34:14] qejk: has joined #RubyOnRails
[23:34:21] dvinciguerra_: has joined #RubyOnRails
[23:36:11] SteenJobs: matthewd: seems from almost every resource i’ve read online that it IS the case, but if it’s not i’d like to know why not
[23:36:16] blackhuey: has joined #RubyOnRails
[23:38:05] SteenJobs: matthewd, jhass: i mean by definition, if test_lock has secured a lock, shouldn’t that prevent any other process from obtaining the record until the lock is released?
[23:38:38] matthewd: SteenJobs: No, because that's not how SQL locks work
[23:38:49] matthewd: SteenJobs: What resource are you reading that claims otherwise?
[23:39:17] SteenJobs: matthewd: i’ll send in a sec, but just want to understand first - doesn’t a write lock with SQL prevent other processes from reading that row? whereas a read lock simply prevents updating
[23:41:26] matthewd: (Depending on your transaction isolation level,) no.
[23:42:24] SteenJobs: matthewd: http://blog.thefrontiergroup.com.au/2015/11/handling-race-conditions-rails-pessimistic-locking/
[23:42:28] theery: has joined #RubyOnRails
[23:42:36] jtong: has joined #RubyOnRails
[23:43:19] SteenJobs: matthewd: clearly i misunderstood, i trust your judgment/experience over mine - here’s the use case:
[23:43:28] matthewd: > You’ll notice in the second console that the execution of u.save will hang until the first console finishes the whole process
[23:44:26] SteenJobs: matthewd: > “when using with_lock: …. 11. Request B reloads the client record in order to obtain the latest state of the object”
[23:44:48] matthewd: Right. But you're not... yeah, that. :)
[23:45:08] SteenJobs: that was confusing - it’s if both processes are running the same function, which calls with_lock
[23:45:30] SteenJobs: the second one can’t obtain the lock until the first releases it, and then when Process B enters the with_lock block, it will reload the resource
[23:46:17] SteenJobs: matthewd: is that the case?
[23:48:11] dalbusch1t: has joined #RubyOnRails
[23:48:39] SteenJobs: matthewd: use case: i have delayed resque jobs that when executed charge a user with stripe, and then saves the charge_id to the corresponding charge object in the db - i also have a resque scheduled job that acts as an integrity checker to make sure all installments have been paid by their due date (example stripe timesout). i need to make sure the user isn’t charged twice if the delayed job and the scheduled job run at the same
[23:48:39] SteenJobs: time on the same charge object
[23:49:49] wd40s: has joined #RubyOnRails
[23:50:10] tjbiddle: has joined #RubyOnRails
[23:52:39] ur5us: has joined #RubyOnRails
[23:54:00] jtong: has joined #RubyOnRails
[23:54:36] matthewd: SteenJobs: Right, so yes you'll want to lock in both
[23:55:31] abhinavmehta: has joined #RubyOnRails
[23:56:09] SteenJobs: matthewd: ok awesome - just tested in console, i ran the same lock method, with “with_lock” in both, in two console windows, and it worked. title was not updated accordingly :)
[23:56:16] Leepoff: has joined #RubyOnRails
[23:56:33] SteenJobs: charging a client an extra 10k is not a good thing haha
[23:57:44] theery: has joined #RubyOnRails
[23:59:48] inkyoto: has joined #RubyOnRails
[23:59:55] theery_: has joined #RubyOnRails