« Back to channel list

#RubyOnRails - 30 May 2018

« Back 1 day Forward 1 day »
[00:01:36] jstrong: I have DatabaseCleaner installed with truncation strategy yet when I run my test suite and the first example is hit all my tables are deleted from the test database
[00:02:01] jstrong: This is my spec_helper.rb file: https://gist.github.com/laspluviosillas/910afd3f2bd575cce42bfc8dbaf0f353
[00:02:03] jstrong: any suggestions?
[00:16:58] Radar: Highly unusual.
[00:17:08] Radar: jstrong: what are the database queries that are running during that test run?
[00:17:26] jstrong: Yes, so I piped the ActiveRecord logger to STDOUT
[00:17:41] Radar: And what do you see?
[00:18:13] jstrong: One minute
[00:19:42] jstrong: I think I figured it out and that comment helped, heh
[00:19:58] Radar: What was it?
[00:20:28] jstrong: Not totally out of the woods yet but I’m using a shared database across a couple of Rails’ apps and one is configured (correctly) to use structure.sql instead of schema.rb
[00:20:34] jstrong: this new one, however, is not. and schema.rb does not exist on it
[00:20:43] jstrong: so I think it’s killing everything because of that
[00:21:37] Radar: Yeahhh that'll do it.
[00:21:59] jstrong: Ayyy and there we go, that was it :)
[00:22:01] jstrong: thanks for responding btw
[00:22:27] Radar: It's what I am here for.,
[00:22:48] jstrong: Radar: What’s interesting is that running rspec in development mode doesn’t have that behaviour
[00:31:49] Radar: development mode isn't configured to attempt to load from db/schema.rb on every bootup
[00:32:04] Radar: https://gist.github.com/laspluviosillas/910afd3f2bd575cce42bfc8dbaf0f353#file-spec_helper-rb-L31
[00:32:09] Radar: but rails_helper.rb is
[00:32:28] Radar: Your gist calls it spec_helper.rb but I'm pretty sure it's rails_helper.rb that you've included htere
[00:39:53] Kilo`byte: has joined #RubyOnRails
[00:40:18] tjbp: has joined #RubyOnRails
[00:42:50] rfoust: has joined #RubyOnRails
[00:46:31] orbyt_: has joined #RubyOnRails
[00:50:08] alfiemax: has joined #RubyOnRails
[00:51:22] jane_booty_doe: has joined #RubyOnRails
[00:52:15] jane_booty_doe: has joined #RubyOnRails
[00:54:15] jane_booty_doe2: has joined #RubyOnRails
[00:55:36] jstrong: has joined #RubyOnRails
[01:07:31] cschneid: has joined #RubyOnRails
[01:14:54] Technodrome: has joined #RubyOnRails
[01:20:31] cschneid: has joined #RubyOnRails
[01:21:58] Guest21588: has joined #RubyOnRails
[01:22:36] jstrong: has joined #RubyOnRails
[01:27:11] Jameser: has joined #RubyOnRails
[01:29:45] Tempesta: has joined #RubyOnRails
[01:30:03] jane_booty_doe: has joined #RubyOnRails
[01:31:06] cschneid: has joined #RubyOnRails
[01:32:59] tjbp: has joined #RubyOnRails
[01:36:08] Jameser: has joined #RubyOnRails
[01:39:40] sevenseacat: has joined #RubyOnRails
[01:43:41] jstrong: has joined #RubyOnRails
[01:43:51] alfiemax: has joined #RubyOnRails
[01:45:14] xtsee: has joined #RubyOnRails
[01:45:55] wilornel: has joined #RubyOnRails
[01:54:55] jstrong: has joined #RubyOnRails
[02:01:52] Guest21588: has joined #RubyOnRails
[02:03:01] MrCrackPotBuilde: has joined #RubyOnRails
[02:07:41] MrCrackPotBuilde: could i use a on document load function then have a on document ready function inside that function ??
[02:09:47] MrCrackPotBuilde: ah the answer to that is no. as of rails 5 turbo links was rewritten.
[02:09:58] moei: has joined #RubyOnRails
[02:10:29] SteenJobs: has joined #RubyOnRails
[02:13:21] Technodrome: has joined #RubyOnRails
[02:17:06] Guest21588: has joined #RubyOnRails
[02:28:04] jstrong: has joined #RubyOnRails
[02:35:21] cschneid: has joined #RubyOnRails
[02:40:12] nickenchuggets: has joined #RubyOnRails
[02:47:05] jstrong: has joined #RubyOnRails
[02:48:26] cschneid: has joined #RubyOnRails
[02:56:49] Guest21588: has joined #RubyOnRails
[03:05:30] cschneid: has joined #RubyOnRails
[03:11:03] braincrash: has joined #RubyOnRails
[03:12:31] jstrong: has joined #RubyOnRails
[03:21:54] jstrong: has joined #RubyOnRails
[03:23:12] cschneid: has joined #RubyOnRails
[03:33:24] chouhoulis: has joined #RubyOnRails
[03:40:57] cschneid: has joined #RubyOnRails
[03:42:49] tdy: has joined #RubyOnRails
[03:44:03] Saukk: has joined #RubyOnRails
[03:52:01] Guest21588: has joined #RubyOnRails
[03:54:13] cschneid: has joined #RubyOnRails
[03:54:57] alfiemax: has joined #RubyOnRails
[04:10:49] cschneid: has joined #RubyOnRails
[04:16:07] apeiros: has joined #RubyOnRails
[04:32:18] madbear: has joined #RubyOnRails
[04:34:04] madbear: good morning, i did just set up our rails env on my old, just call it laptop... 4GB of ram, running the environment 'rails s', no problem
[04:35:10] madbear: running tests eats that memory up and start a swapping party
[04:37:00] Guest21588: has joined #RubyOnRails
[04:37:37] tfitts: has joined #RubyOnRails
[04:40:54] cschneid: has joined #RubyOnRails
[04:44:06] Guest21588: has joined #RubyOnRails
[04:51:12] Ryzokuken: has joined #RubyOnRails
[04:52:01] Guest21588: has joined #RubyOnRails
[04:57:43] vedu_: has joined #RubyOnRails
[05:05:04] apeiros: has joined #RubyOnRails
[05:07:18] Guest21588: has joined #RubyOnRails
[05:09:55] srinidhi: has joined #RubyOnRails
[05:17:22] Guest21588: has joined #RubyOnRails
[05:17:22] kapil___: has joined #RubyOnRails
[05:20:16] tcopeland: has joined #RubyOnRails
[05:31:59] Guest21588: has joined #RubyOnRails
[05:38:52] bijan_: has joined #RubyOnRails
[05:47:36] cschneid: has joined #RubyOnRails
[05:49:04] bijan_: has joined #RubyOnRails
[05:57:57] reber: has joined #RubyOnRails
[06:04:55] mices: has joined #RubyOnRails
[06:07:05] mices: I generated a mailer named GeneralMailer but when I try to call it from the admin_controller.rb i get an error not recognized undefined method `GeneralMailer' for #<AdminController:0x007f0c70a660c0>
[06:08:02] mices: could it be because i'm calling it from a post request without any respond_to ?
[06:08:49] mices: i'm using a form for subject and message to send mail to all users so i put in the subject message and click submit
[06:09:22] mices: i was trying to do it with a get request but rails kept asking for post so i said let me see what'll happen if i change it to post
[06:09:31] mices: now i'm not sure which would be preferred
[06:12:52] conta: has joined #RubyOnRails
[06:14:06] Mutsuhito: has joined #RubyOnRails
[06:14:07] Mutsuhito: has joined #RubyOnRails
[06:21:49] Guest21588: has joined #RubyOnRails
[06:42:17] cschneid: has joined #RubyOnRails
[06:56:06] dionysus69: has joined #RubyOnRails
[07:02:09] Guest21588: has joined #RubyOnRails
[07:02:58] yottanami: has joined #RubyOnRails
[07:04:05] csk157: has joined #RubyOnRails
[07:07:18] bijan_: has joined #RubyOnRails
[07:07:29] armyriad: has joined #RubyOnRails
[07:08:28] yottanami: Here is my Concern methods https://github.com/yottanami/indie-otp/blob/master/lib/user_helper.rb and I am trying to call the method in my main app so I used it like this http://dpaste.com/0MZGRPC but the current_user is undefined.
[07:09:43] sevenseacat: I'm surprised the include works, because your UserHelper doesnt have that namespace
[07:11:31] bijan_: has joined #RubyOnRails
[07:14:01] yottanami: sevenseacat, I also tried change it to this http://dpaste.com/1M4RS4R but does not work yet and There is no error during include
[07:17:30] tbuehlmann: it works because that's how ruby resolves constants. as long as there's the namespace existing, the constant is found. this will work as well: Indie::Otp::AnyModelFromAppModels
[07:18:43] tbuehlmann: I thought they removed that behaviour from ruby 2.5, but it doesn't seem so
[07:19:28] tbuehlmann: or maybe it's rails autoloading?
[07:19:35] tbuehlmann: probably that
[07:21:58] tbuehlmann: this is even weirder, I can't even
[07:23:38] yottanami: has joined #RubyOnRails
[07:23:50] yottanami: sevenseacat, Sorry I disconnected
[07:23:56] bijan_: has joined #RubyOnRails
[07:25:47] yottanami: sevenseacat, Did I miss your message?
[07:26:13] yottanami: Do you have any idea how can I solve it?
[07:28:10] tbuehlmann: https://gist.github.com/tbuehlmann/c03f13a31a715a13b886dd49ef281f8a fun times
[07:32:56] bijan_: has joined #RubyOnRails
[07:36:26] psychoslave: has joined #RubyOnRails
[07:37:07] bijan__: has joined #RubyOnRails
[07:37:58] yottanami: has joined #RubyOnRails
[07:41:34] bijan_: has joined #RubyOnRails
[07:41:52] Guest21588: has joined #RubyOnRails
[07:45:06] cschneid: has joined #RubyOnRails
[07:47:52] Guest21588: has joined #RubyOnRails
[07:50:11] bijan_: has joined #RubyOnRails
[07:50:48] yottanami: tbuehlmann, Thanks for your help, I moved the module to sub directories it seems there is no problem during include but current_user is undefined yet
[07:54:18] bijan__: has joined #RubyOnRails
[07:56:05] srinidhi: has joined #RubyOnRails
[07:57:54] tbuehlmann: yottanami: can you gist what you have now?
[07:59:19] mikecmpbll: has joined #RubyOnRails
[07:59:23] Dbugger: has joined #RubyOnRails
[07:59:48] yottanami: tbuehlmann, sure let me push it
[08:01:58] conta: has joined #RubyOnRails
[08:02:57] wethu: has joined #RubyOnRails
[08:05:28] jane_booty_doe: has joined #RubyOnRails
[08:05:42] yottanami: tbuehlmann, Here is the module https://github.com/yottanami/indie-otp/blob/master/lib/indie/otp.rb and here is the controller https://gist.github.com/yottanami/85de2d8bdc7b084b6ac991e83eb368b4
[08:07:20] tbuehlmann: you are including Indie::Otp::UserHelper in your controller. where does that come from?
[08:07:33] tbuehlmann: btw, you can add several files to a single gist
[08:09:50] yottanami: tbuehlmann, it was for the previews module that I removed
[08:10:04] yottanami: tbuehlmann, I just need to use current_user from that Gem
[08:10:27] yottanami: tbuehlmann, Now should I include it in my controller?
[08:11:30] yottanami: should it be concern?
[08:13:54] tbuehlmann: where is that method defined exactly?
[08:17:54] yottanami: tbuehlmann, It is in my engine, and I need to use it in main application controllers
[08:18:01] yottanami: tbuehlmann, you can see the whole project here: https://github.com/yottanami/indie-otp/
[08:20:37] tbuehlmann: right now the methods resides in Indie::Otp, so you'd need to include that module
[08:20:52] armyriad: has joined #RubyOnRails
[08:24:27] cschneid: has joined #RubyOnRails
[08:26:30] ellcs: has joined #RubyOnRails
[08:27:24] yottanami: tbuehlmann, You mean I need something like this in my controller? `include Indie::Otp`
[08:28:59] yottanami: tbuehlmann, Yes it works in this way. thank you very much
[08:54:46] ellcs: has joined #RubyOnRails
[08:59:41] cschneid: has joined #RubyOnRails
[09:02:21] wethu: has joined #RubyOnRails
[09:10:22] alfiemax_: has joined #RubyOnRails
[09:32:33] GeorgesLeYeti: has joined #RubyOnRails
[09:34:05] cschneid: has joined #RubyOnRails
[09:35:13] GeorgesLeYeti: I have a set of 3 integer variables (a, b and c). One and only one variable must be define. For example a = 3 => b = c = nil OR b = 5 => a = c = nil. And i would like to check if these conditions are ok
[09:36:14] GeorgesLeYeti: I thought about (!a.nil? && b.nil? && c.nil?) || (a.nil? && !b.nil? && c.nil?) || (a.nil? && b.nil? && !c.nil)
[09:36:55] GeorgesLeYeti: But if i had more variables writing this seems infinite
[09:40:35] roshanavand: has joined #RubyOnRails
[09:42:54] conta: has joined #RubyOnRails
[09:48:33] tbuehlmann: if #present? suffices, you could do [a, b, c].one?(&:present?)
[09:57:51] ur5us: has joined #RubyOnRails
[10:10:10] cschneid: has joined #RubyOnRails
[10:11:52] GeorgesLeYeti: tbuehlmann, Ty a lot it works
[10:13:52] rikkipitt: has joined #RubyOnRails
[10:18:55] conta: has joined #RubyOnRails
[10:21:06] MrCrackPotBuilde: has joined #RubyOnRails
[10:32:48] FernandoBasso: has joined #RubyOnRails
[10:45:38] cschneid: has joined #RubyOnRails
[10:47:43] reber: has joined #RubyOnRails
[10:49:52] Jameser: has joined #RubyOnRails
[11:27:34] Jameser: has joined #RubyOnRails
[11:28:03] cschneid: has joined #RubyOnRails
[11:36:01] reber: has left #RubyOnRails: ("Leaving")
[11:39:24] lypsis: has joined #RubyOnRails
[11:40:28] Cavallari: has joined #RubyOnRails
[11:41:25] jane_booty_doe: has joined #RubyOnRails
[11:49:09] lypsis: has joined #RubyOnRails
[11:49:34] dblessing: has joined #RubyOnRails
[11:53:05] maxx88: has joined #RubyOnRails
[11:56:16] jane_booty_doe: How the hell do you debug controllers
[11:57:02] johndunn: has joined #RubyOnRails
[11:57:22] Dbugger: You can use binding.pry
[11:57:36] Dbugger: https://github.com/pry/pry
[11:57:59] eelster: has joined #RubyOnRails
[12:00:37] jane_booty_doe: Dbugger, how do I use that with rspec?
[12:01:11] jane_booty_doe: Does it just give me access to local variables in the scenario (doing feature specs)
[12:02:58] acovrig: has joined #RubyOnRails
[12:04:34] Dbugger: jane_booty_doe, did you meant "test" when you said "debug"?
[12:05:09] jane_booty_doe: Dbugger, well no my test is failing, and I can't figure out why
[12:05:32] Dbugger: reproduce the steps manually, outside the test
[12:05:47] Dbugger: not sure if test is the right place to do debugging
[12:06:02] jane_booty_doe: Good point actually
[12:07:44] cschneid: has joined #RubyOnRails
[12:16:21] jane_booty_doe: Factory was causing it. Of course
[12:27:22] acovrig: has joined #RubyOnRails
[12:30:17] tcopeland: has joined #RubyOnRails
[12:47:37] mjolnird: has joined #RubyOnRails
[12:48:08] chouhoulis: has joined #RubyOnRails
[12:57:03] chalmagean: has joined #RubyOnRails
[12:58:05] dblessing: has joined #RubyOnRails
[13:06:00] ellcs: has joined #RubyOnRails
[13:08:21] johndunn: has left #RubyOnRails: ()
[13:10:04] Saukk: has joined #RubyOnRails
[13:14:51] anikras: has joined #RubyOnRails
[13:18:19] cschneid: has joined #RubyOnRails
[13:21:05] rfoust: has joined #RubyOnRails
[13:23:14] Sylario: has joined #RubyOnRails
[13:23:48] jstrong: has joined #RubyOnRails
[13:25:03] chouhoulis: has joined #RubyOnRails
[13:27:51] uks: has joined #RubyOnRails
[13:29:59] jstrong: has joined #RubyOnRails
[13:33:12] apeiros: has joined #RubyOnRails
[13:33:33] jstrong: has joined #RubyOnRails
[13:35:24] xhoy: Anybody any experience with access key's on mobile browsers? (how do i do alt+shift+<accesskey> in amobile browser without a keyboard?)
[13:39:50] jstrong: has joined #RubyOnRails
[13:42:52] jstrong: has joined #RubyOnRails
[13:45:14] Technodrome: has joined #RubyOnRails
[13:56:26] charlielor: has joined #RubyOnRails
[13:57:21] charlielor: I have Date::DATE_FORMATS[:release_date] = "%B %Y" in my date_formats.erb initializers folder and in my index file, I have <%= movie.released_on.to_s(:release_date) %> but it’s not working.
[13:57:29] charlielor: Any suggestion is much appreciated.
[13:57:52] charlielor: It kept showing: 2018-04-12
[13:58:58] RougeR: has joined #RubyOnRails
[13:59:54] RougeR: i need some help with how to set up a search function on a nested resource
[14:02:14] jstrong: has joined #RubyOnRails
[14:07:24] lxsameer: has joined #RubyOnRails
[14:10:49] alfiemax: has joined #RubyOnRails
[14:12:42] tbuehlmann: charlielor: I don't know, but you could install the i18n-debug gem and check what translations is looked up by calling that
[14:13:43] charlielor: tbuehlmann: Thanks! I have checked the ruby on rails api documentation and a couple youtube video and it seems like what I have should work but it’s not so I’m a bit confused.
[14:13:53] charlielor: I like to know what I did wrong so I can correct it next time.
[14:14:18] tbuehlmann: yeah, as said, maybe the lookup is just slighty different
[14:15:52] tbuehlmann: oh, it's not even using i18n, nevermind
[14:16:54] tbuehlmann: try `Time::DATE_FORMATS[:release_date] = "%B %Y"`
[14:20:41] SteenJobs: has joined #RubyOnRails
[14:20:48] RougeR: wow well that was a farse
[14:20:54] RougeR: pluralisation starts again
[14:21:12] RougeR: id managed to call my controller membership rather than memberships
[14:21:19] RougeR: had to pull it all apart and put it all back together
[14:22:35] charlielor: tbuehlmann: I did tried Time::DATE_FORMATS[:release_date] = "%B %Y" and it still shows 2018-04-12 instead. The issue seems to be <%= movie.released_on.to_s(:release_date) %>
[14:23:24] charlielor: As soon as I changed to :release_date it defaults to 2018-04-12. If I change it it to :long then it’ll show April 12, 2018
[14:24:18] charlielor: For it does look like the connection from :release_date to the custom date is not there, but it’s not there, there should be an error somehow, I assumed.
[14:25:20] tbuehlmann: what version of rails is this?
[14:29:52] tbuehlmann: get to go, but you could check the source code of that to_s method. in my case (rails 5.2), setting Time::DATE_FORMATS[:release_date] worked
[14:30:51] mostlybadfly: has joined #RubyOnRails
[14:31:43] jstrong: has joined #RubyOnRails
[14:32:09] dbugger_: has joined #RubyOnRails
[14:34:14] Ergo: has joined #RubyOnRails
[14:35:00] RougeR: question:
[14:35:04] jstrong: has joined #RubyOnRails
[14:35:17] RougeR: why does rails not throw a warning when you try to create a model/controller with non conventional pluralisation
[14:35:49] bijan_: has joined #RubyOnRails
[14:35:51] Psy-Q: i'm trying to throw together a REST APi with jsonapi-rb and rails in API mode. it seems i have to construct the URLs (e.g. for "self") myself, there are no URL helpers or the like for use inside the serializer?
[14:37:44] jstrong: has joined #RubyOnRails
[14:44:38] RougeR: how do i edit default rails tasks
[14:44:46] RougeR: rails g controller
[14:51:54] chouhoulis: has joined #RubyOnRails
[14:52:41] mices: has joined #RubyOnRails
[14:52:50] jstrong: has joined #RubyOnRails
[14:53:10] mices: anyone can help me debug this mailer
[14:53:15] mices: https://gist.github.com/mices/38bff77686c832a797dac365ad545609
[14:53:53] mices: the controller action accepts input from a form for subject and message fields
[14:54:09] mices: message is the body of the email
[14:56:09] Technodrome: has joined #RubyOnRails
[14:56:31] grizwako: has joined #RubyOnRails
[14:56:50] grizwako: Hi everyone :)
[14:57:29] grizwako: I am new to Ruby and Rails, trying to execute a function when model is being saved.
[14:57:36] jstrong: has joined #RubyOnRails
[14:58:56] grizwako: Something like: INSERT INTO entries (key) VALUES (function('text'))
[15:00:12] grizwako: How do I tell Rails to just copy one attribute AS-IS and not wrap it into quotes?
[15:00:32] charlielor: has left #RubyOnRails: ()
[15:00:50] jottr: has joined #RubyOnRails
[15:04:47] grizwako: basically, I am trying to modify a model, when it is being saved, it should encrypt one attribute via pgcrypto module.
[15:06:57] bijan_: has joined #RubyOnRails
[15:10:28] tuelz: has joined #RubyOnRails
[15:11:53] tuelz: is there a idiomatic way to wrap an activerecord field in a serialization/deserialization method? I've got a uuid field that is being serialized into hex values that I'd like for the rest of my application when referencing it to get the deserialized version of it
[15:11:59] FernandoBasso: has joined #RubyOnRails
[15:12:54] RougeR: https://gist.github.com/CodePint/de576891dd2889e90ae820fa451d6fa8
[15:12:57] RougeR: check it out
[15:13:01] tuelz: so right now if I just put a method for the field on the model - I can get it to deserialize cleanly for instances of that model
[15:13:06] tuelz: thanks looking now RougeR
[15:13:18] RougeR: sorry this was for soemthing else
[15:13:26] tuelz: oh, haha no problem!
[15:13:34] RougeR: i just spent 2 hours without realising i didnt pluralise a controller months back
[15:13:50] RougeR: so i went in to the rails controller generator config files and added a validation
[15:16:32] Technodrome: has joined #RubyOnRails
[15:19:54] bijan_: has joined #RubyOnRails
[15:21:46] jcarl43: has joined #RubyOnRails
[15:24:09] bijan__: has joined #RubyOnRails
[15:24:51] FernandoBasso: has joined #RubyOnRails
[15:26:14] cagomez: has joined #RubyOnRails
[15:28:39] bijan_: has joined #RubyOnRails
[15:30:59] airdisa: has joined #RubyOnRails
[15:32:39] bijan__: has joined #RubyOnRails
[15:35:39] airdisa: has joined #RubyOnRails
[15:37:00] bijan_: has joined #RubyOnRails
[15:40:28] lord4163: has joined #RubyOnRails
[15:47:08] airdisa: has joined #RubyOnRails
[15:48:35] bijan_: has joined #RubyOnRails
[15:52:50] bijan__: has joined #RubyOnRails
[15:55:41] alfiemax: has joined #RubyOnRails
[15:58:28] kanzure: has joined #RubyOnRails
[16:00:11] dblessing: has joined #RubyOnRails
[16:05:44] bijan_: has joined #RubyOnRails
[16:10:02] bijan__: has joined #RubyOnRails
[16:11:03] kapil___: has joined #RubyOnRails
[16:11:05] conta: has joined #RubyOnRails
[16:11:26] kapil___: How to get comment on rails models table?
[16:13:21] kapil___: I can get comment from column, but I cannot get it from table.
[16:14:19] bijan_: has joined #RubyOnRails
[16:16:35] guacamole: has joined #RubyOnRails
[16:24:14] alfiemax: has joined #RubyOnRails
[16:27:35] bijan_: has joined #RubyOnRails
[16:39:11] alfiemax: has joined #RubyOnRails
[16:39:20] sent-hil: has joined #RubyOnRails
[16:39:48] bijan_: has joined #RubyOnRails
[16:44:44] bijan__: has joined #RubyOnRails
[16:45:58] cagomez: has joined #RubyOnRails
[16:53:21] bijan_: has joined #RubyOnRails
[16:54:40] Puffball: has joined #RubyOnRails
[16:57:38] bijan_: has joined #RubyOnRails
[17:01:35] bijan__: has joined #RubyOnRails
[17:06:58] conta: has joined #RubyOnRails
[17:10:08] bijan_: has joined #RubyOnRails
[17:14:00] Technodrome: has joined #RubyOnRails
[17:19:01] Saukk: has joined #RubyOnRails
[17:23:03] bijan_: has joined #RubyOnRails
[17:24:58] weird_error: has joined #RubyOnRails
[17:31:26] vedu_: has joined #RubyOnRails
[17:33:00] manjaroi3_: has joined #RubyOnRails
[17:33:03] manjaroi3_: Hi. Complete ruby noob here (never written a line of code) but been tasked with maintaining someone elses application, and I have been told I need to run rake db:migrate, but when I do I get "connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432", but thats not what my $DB_HOST variable says, I dont understand why its trying to connect to that db
[17:35:20] dblessing: has joined #RubyOnRails
[17:35:47] ellcs: has joined #RubyOnRails
[17:35:53] bijan_: has joined #RubyOnRails
[17:35:54] hahuang65_: has joined #RubyOnRails
[17:37:03] lxsameer: has joined #RubyOnRails
[17:39:59] SteenJobs: has joined #RubyOnRails
[17:40:09] bijan__: has joined #RubyOnRails
[17:43:35] havenwood: manjaroi3_: What's in your database config file?: config/database.yml
[17:44:47] bijan_: has joined #RubyOnRails
[17:44:55] manjaroi3_: havenwood, http://pastebin.centos.org/798986/
[17:45:39] havenwood: manjaroi3_: check: printing DB_HOST
[17:45:50] havenwood: manjaroi3_: and: printing DB_DATABASE
[17:46:15] havenwood: db database seems redundant
[17:46:38] manjaroi3_: havenwood, those environment values are properly set
[17:47:07] lxsameer: has joined #RubyOnRails
[17:47:48] havenwood: manjaroi3_: hmm, what part is different in the logs than in the env var?
[17:48:11] manjaroi3_: havenwood, not sure I understand that question
[17:48:41] havenwood: manjaroi3_: You're seeing "/var/run/postgresql/.s.PGSQL.5432" but from the DB_HOST env var what are you expecting?
[17:48:48] havenwood: What's different than expected?
[17:49:35] manjaroi3_: $DB_HOST is myservice.postgres.database.azure.com
[17:53:03] bijan_: has joined #RubyOnRails
[17:56:03] johndunn: has joined #RubyOnRails
[17:56:36] eelster: has joined #RubyOnRails
[17:57:11] lxsameer: has joined #RubyOnRails
[17:57:26] bijan__: has joined #RubyOnRails
[18:04:29] bijan_: has joined #RubyOnRails
[18:07:24] lxsameer: has joined #RubyOnRails
[18:10:03] mikecmpbll: has joined #RubyOnRails
[18:11:01] russt: has joined #RubyOnRails
[18:14:28] vedu_: has joined #RubyOnRails
[18:17:09] lxsameer: has joined #RubyOnRails
[18:18:13] dblessing: has joined #RubyOnRails
[18:27:08] lxsameer: has joined #RubyOnRails
[18:27:21] cagomez: I have a JSONB column which is an array of users (each is a JSON object). is there a way to set a default value for a k, v pair for my user JSON objects? ie set a default "email" key with an empty string
[18:29:44] maxx88: has left #RubyOnRails: ()
[18:37:15] lxsameer: has joined #RubyOnRails
[18:38:22] ellcs: has joined #RubyOnRails
[18:45:42] GodFather: has joined #RubyOnRails
[18:46:37] chalmagean: has joined #RubyOnRails
[18:47:20] lxsameer: has joined #RubyOnRails
[18:53:56] psychoslave_: has joined #RubyOnRails
[18:56:20] hotpancakes: has joined #RubyOnRails
[18:57:18] lxsameer: has joined #RubyOnRails
[19:00:13] cagomez: has joined #RubyOnRails
[19:06:14] hotpancakes: has joined #RubyOnRails
[19:07:03] lxsameer: has joined #RubyOnRails
[19:11:11] KeyJoo: has joined #RubyOnRails
[19:13:52] alfiemax_: has joined #RubyOnRails
[19:15:50] cagomez: has joined #RubyOnRails
[19:17:03] lxsameer: has joined #RubyOnRails
[19:25:39] Inside: has joined #RubyOnRails
[19:26:09] jottr: has joined #RubyOnRails
[19:27:08] lxsameer: has joined #RubyOnRails
[19:30:35] alfiemax: has joined #RubyOnRails
[19:30:52] ellcs: has joined #RubyOnRails
[19:31:35] cagomez: has joined #RubyOnRails
[19:36:59] lxsameer: has joined #RubyOnRails
[19:40:01] fryguy: hrmm, trying to fix an issue in one of my environments where `bin/rails c` complains that rake isn't installed, but `bundle show rake` shows it as being installed, and `bundle install` doesn't do anything and lists it as already installed. Not sure where else to look for mixup
[19:47:13] lxsameer: has joined #RubyOnRails
[19:49:28] cagomez: has joined #RubyOnRails
[19:52:40] cjohnson: Why would you not
[19:52:43] cjohnson: bundle exec rails c
[19:52:47] cjohnson: If you're using bundle
[19:53:25] agent_white: has joined #RubyOnRails
[19:57:10] lxsameer: has joined #RubyOnRails
[20:05:04] jackhum: has joined #RubyOnRails
[20:07:07] lxsameer: has joined #RubyOnRails
[20:11:48] fryguy: that results in the same behavior
[20:12:48] eckhardt: has joined #RubyOnRails
[20:17:13] lxsameer: has joined #RubyOnRails
[20:22:32] apeiros_: has joined #RubyOnRails
[20:27:09] lxsameer: has joined #RubyOnRails
[20:33:46] uksio: has joined #RubyOnRails
[20:35:50] Technodrome: has joined #RubyOnRails
[20:37:07] lxsameer: has joined #RubyOnRails
[20:47:13] lxsameer: has joined #RubyOnRails
[20:57:04] lxsameer: has joined #RubyOnRails
[20:59:38] tdy: has joined #RubyOnRails
[21:02:05] dviola: has joined #RubyOnRails
[21:07:24] lxsameer: has joined #RubyOnRails
[21:10:53] Inside: I have the worst bug ever that's existed for 1.5 years now
[21:10:58] Inside: and I can't recreate it
[21:11:19] Inside: Very occasionally a record will get POST'd twice to the database
[21:11:44] lupine: do you have a frontend load balancer or reverse proxy of any sort?
[21:12:16] Inside: Well - it's nginx?
[21:12:43] lupine: that'd be it. probably fine, but worth checking what it does when a request gets a 500 response
[21:12:50] lupine: if it blindly retries the request, there's your bug
[21:13:14] lupine: (lighthttpd is bad by default, nginx is good by default, but both can be configured to the opposite behaviour)
[21:13:39] Cache_Money: has joined #RubyOnRails
[21:17:14] lxsameer: has joined #RubyOnRails
[21:18:45] Inside: https://gist.github.com/Insood/c82d3df87d4b40e8f413d90fc192961f
[21:18:49] orbyt_: has joined #RubyOnRails
[21:20:07] Inside: So someone visits root, clicks on "Unit Serial Numbers", which forces the first request through turbolinks, but <head> is different so the page gets fully reloaded, then the form gets filled out and the first POST... then a second post five seconds later.
[21:21:35] lupine: hmm, if it's as reliable as all that, forget the reverse proxy
[21:21:41] lupine: does it still happen if you disable turbolinks?
[21:21:59] Inside: it doesn't happen all the time either...
[21:22:13] Inside: Like once or twice per week, haha.
[21:22:42] Inside: I actually have turbolinks disabled in the UnitSerialNumbers controller which is why I it (I presume) forces the second reload
[21:23:08] lupine: then what does "forces the first request through turbolinks" mean?
[21:25:38] Inside: well - when you click on a link, turbolinks does a GET, right? Then it compares the contents -- but I have a no_turbolinks layout which has data-no-turbolink everywhery -- so I presume that it just reloads the page from scratch
[21:26:21] Inside: wait.. fudge
[21:26:24] Inside: that's not what's happening at all
[21:26:43] Inside: or is it?
[21:26:58] lupine: dunno. which is half the problem of turbolinks
[21:27:06] lxsameer: has joined #RubyOnRails
[21:27:11] Inside: it's magic(tm)
[21:27:24] lupine: it turns very simple, reliable operations into very buggy, unreliable ones
[21:27:48] lupine: I'm not confident that it's the source of your problem but I'd certainly try hard to rule it out
[21:28:10] Inside: Do you have it enabled on your site(s)?
[21:28:40] lupine: difficult to rule anything out without a reproducer, of course
[21:28:57] lupine: are you set up for a/b testing in production?
[21:28:59] Inside: This is for an internal site that's mostly forms
[21:29:17] Inside: Nah, I've got like... 2 persons that use this specific controller
[21:29:40] lupine: heh, we've also overlooked the most likely explanation by far
[21:29:47] lupine: is it possible to accidentally double-click the submit button?
[21:29:55] Inside: I've got data-disable-with on there
[21:31:13] Inside: I've talked to the operator and he says that occasionally the browser will 'Freeze up' and then it generates two serial numbers in a row (as evidenced by two labels popping out of the printer through a rube goldberg websockets->ffi->winprint contraption)
[21:32:20] hotpancakes: has joined #RubyOnRails
[21:33:15] lupine: as a workaround, you could embed a uniq id into the form and reject requests that look like duplicates. stripe and mastodon both do this
[21:33:41] Inside: https://stackoverflow.com/questions/48179256/chrome-reinitiates-ajax-post-request-after-a-10-second-timeout
[21:33:46] Inside: holy crap, is it a chrome thing?!
[21:33:50] lupine: https://stripe.com/docs/api#idempotent_requests
[21:34:04] lupine: you'd have to hope not
[21:34:43] lupine: presumably you can rule it in (or out) by trying to exercise that specific behaviour
[21:34:55] lupine: add a sleep(20) to the controller, see if you get a repeat
[21:35:03] Inside: just did that , nada..
[21:35:27] Inside: but - in production nginx runs with 4 workers
[21:35:39] Inside: well no - the log shows the same worker is handinling the subsequent POSTs
[21:37:15] lxsameer: has joined #RubyOnRails
[21:38:32] havenwood: lupine: Eww, Stripe! Fixed ;-P https://docs.connect.squareup.com/basics/api101/idempotency
[21:39:18] Inside: ACTION putputs.
[21:39:42] Inside: I guess I can do that too
[21:43:41] ellcs: has joined #RubyOnRails
[21:47:04] lxsameer: has joined #RubyOnRails
[21:48:57] orbyt_: has joined #RubyOnRails
[21:49:23] ur5us: has joined #RubyOnRails
[21:50:46] Technodrome: has joined #RubyOnRails
[21:51:58] tdy: has joined #RubyOnRails
[21:57:12] lxsameer: has joined #RubyOnRails
[22:05:45] eckhardt: has joined #RubyOnRails
[22:07:14] lxsameer: has joined #RubyOnRails
[22:26:21] Radar: GOOD MORNING
[22:28:02] deevil: has joined #RubyOnRails
[22:30:58] cagomez: has joined #RubyOnRails
[22:47:09] lxsameer: has joined #RubyOnRails
[22:57:22] hotpancakes: has joined #RubyOnRails
[22:59:00] cagomez: has joined #RubyOnRails
[23:03:23] wethu: has joined #RubyOnRails
[23:06:33] cschneid: has joined #RubyOnRails
[23:08:24] rfoust: has joined #RubyOnRails
[23:10:34] Inside: GOOD MORNING RADAR-SEMPAI
[23:20:20] Radar: Inside: o/
[23:34:36] mikecmpbll: has joined #RubyOnRails
[23:38:56] mikecmpbll: has joined #RubyOnRails
[23:55:36] dblessing: has joined #RubyOnRails
[23:56:58] lxsameer: has joined #RubyOnRails