#RubyOnRails - 20 May 2017
« Back 1 day Forward 1 day »
[03:24:19] amperry: hey folks, if I've got a Property and I need to reference User twice, once as manager and once as supervisor, is it okay to have two 'has_one' lines, e.g., 'has_one :user, foreign_key: :manager_id' and 'has_one :user, foreign_key: :supervisor_id'?
[03:32:27] fryguy: you'll need to change the syntax a little bit more than that though, otherwise you'll define #user twice
[03:33:07] fryguy: you'll want to do 'has_one :manager' and 'has_one :supervisor' and specify foreign key and class name
[03:33:47] fryguy: http://guides.rubyonrails.org/association_basics.html#has-one-association-reference
[03:35:57] amperry: fryguy: so something like: 'has_one :supervisor, class_name: :user, foreign_key: :supervisor_id' ?
[08:10:14] ar1a: Hey, I'm trying to save this object but it keeps failing, and no notice or alert is being printed
[08:11:23] ar1a: it doesn't look like one of the text_areas is being pushed in the form, i think maybe because im doing stuff to it with jquery?
[10:31:20] Violentr: <ViolentR> Can anyone help me ? i have an issue with gem Faraday trying to authenticate with user and password
[12:04:23] shilon: hi everyone! Anyone knows why Faker::Company.logo after seed returns logo: nil after seeding. Every other Faker methods work fine. P.S.: I’m using CarrierWave and I have a default logo, could it be the problem?
[17:04:21] nettoweb_: Hello guys, Im deploy my RoR app with Capistrano and Puma... When finish the deploy I get this: 502 Bad Gateway but when I ssh on my server and start uma this way: bundle exec puma -e production -b unix:///home/deploy/myapp/shared/tmp/sockets/puma.sock it works fine
[17:05:35] nettoweb_: In my nginx log I'm getting this: connect() to unix:/home/deploy/myapp/shared/tmp/sockets/puma.sock failed (111: Connection refused)
[17:16:11] desnudopenguino: it looks like puma isn't being started, or it is, but not with the socket that nginx is expecting, you might get more action over at #capistrano
[17:46:37] nettoweb_: desnudopenguino: https://gist.github.com/osnysantos/5823105cac97fc1c20abfb9f063e699c
[17:58:11] desnudopenguino: i don't use capistrano or puma, but from the look of it, you have it set up alright. for whatever reason puma isn't starting. is there a way to validate the config file? Does the user that runs capistrano have access to write to the pid and socket file directories?