« Back to channel list

#RubyOnRails - 04 March 2019

« Back 1 day Forward 1 day »
[00:12:15] crankharder: has joined #RubyOnRails
[00:32:14] mangold: has joined #RubyOnRails
[00:32:17] crankharder: has joined #RubyOnRails
[00:50:38] davidh38: has joined #RubyOnRails
[02:00:17] duderonomy: has joined #RubyOnRails
[02:20:31] tdy1: has joined #RubyOnRails
[02:42:23] bambanx: has joined #RubyOnRails
[02:54:48] kvda: has joined #RubyOnRails
[03:10:41] Saukk: has joined #RubyOnRails
[03:14:21] crankharder: has joined #RubyOnRails
[03:15:44] cschneid: has joined #RubyOnRails
[03:43:14] gambl0r3: has joined #RubyOnRails
[03:46:26] bambanx: has joined #RubyOnRails
[04:04:49] srruby: has joined #RubyOnRails
[04:05:38] srruby: For a rails app that only has a few hundred users, is it necessary to put the db on its own server?
[04:08:11] Radar: srruby: no
[04:10:10] braincrash: has joined #RubyOnRails
[04:15:52] jackhum: has joined #RubyOnRails
[04:19:21] srruby: Radar: Thanks.
[04:21:04] vcavallo: has joined #RubyOnRails
[04:30:49] MrCrackPotBuilde: has joined #RubyOnRails
[06:13:01] conta: has joined #RubyOnRails
[06:18:19] ariedler: has joined #RubyOnRails
[06:34:01] srinidhi: has joined #RubyOnRails
[07:12:49] reber: has joined #RubyOnRails
[07:48:55] gs: has joined #RubyOnRails
[07:54:42] MrCrackPotBuilde: if you have two users say user and say admin. both have an address and a current address. there is a third table that takes the address of the user or admin depending on setting (ie current location or set address) how can i share the table with user if admin says its ok.
[07:55:28] MrCrackPotBuilde: would i place a column like share with and the user can see the details if there id is in the table
[07:57:41] MrCrackPotBuilde: i thouht about having a method that first checks if the user is authenticated and then checks if the users name is in the table at share_with
[07:57:55] MrCrackPotBuilde: if it is grab that info
[08:08:29] fox_mulder_cp: MrCrackPotBuilde: you can use Devise for autentication and some like cancancan, pundit or some like rolify to autorization
[08:10:31] fox_mulder_cp: and create some like user.is_admin field and model rigths like user_id,can_do_some, can_do_some2,can_do_some3...
[08:18:57] ariedler: has joined #RubyOnRails
[08:25:51] kvda: has joined #RubyOnRails
[08:25:59] MrCrackPotBuilde: fox_mulder_cp thanks but i already have auth set up. I think polymorphism is probably what im looking for but ive never used it so need to read up on it
[08:34:42] crankharder: has joined #RubyOnRails
[08:43:36] Ergo: has joined #RubyOnRails
[08:45:53] Sylario: has joined #RubyOnRails
[08:49:46] lxsameer: has joined #RubyOnRails
[08:53:47] blackmesa: has joined #RubyOnRails
[08:54:27] srinidhi: has joined #RubyOnRails
[08:55:51] ur5us: has joined #RubyOnRails
[09:00:23] G: has joined #RubyOnRails
[09:19:24] ur5us: has joined #RubyOnRails
[09:35:05] MrCrackPotBuilde: has joined #RubyOnRails
[09:39:04] mangold: has joined #RubyOnRails
[10:04:00] srinidhi: has joined #RubyOnRails
[10:19:44] ariedler: has joined #RubyOnRails
[10:28:38] spectra: has joined #RubyOnRails
[11:03:54] wethu: has joined #RubyOnRails
[11:10:58] ldk: has joined #RubyOnRails
[11:14:07] Technodrome: has joined #RubyOnRails
[11:17:32] helpa: has joined #RubyOnRails
[11:32:49] tdy1: has joined #RubyOnRails
[11:37:17] gregf_: has joined #RubyOnRails
[11:40:22] Leifr: has joined #RubyOnRails
[11:42:33] tdy1: has joined #RubyOnRails
[11:43:08] conta: has joined #RubyOnRails
[11:46:38] lankanmon: has joined #RubyOnRails
[11:57:23] mangold: has joined #RubyOnRails
[12:11:13] gambl0r3: has joined #RubyOnRails
[12:12:14] mojtaba: has joined #RubyOnRails
[12:20:12] crankharder: has joined #RubyOnRails
[12:27:31] tdy1: has joined #RubyOnRails
[12:37:26] crankharder: has joined #RubyOnRails
[12:39:29] tdy1: has joined #RubyOnRails
[12:59:35] uks: has joined #RubyOnRails
[13:02:06] za1b1tsu: has joined #RubyOnRails
[13:19:55] jackhum: has joined #RubyOnRails
[13:29:14] davidh38: has joined #RubyOnRails
[13:29:45] syndikate: Anybody migrated from feature spec to system specs? I am seeing to be having problem in configuring chrome for capybara
[13:40:31] fox_mulder_cp: syndikate: why you need configure chrome for capybara/
[13:40:52] fox_mulder_cp: chrome - browser, capybara only test framework
[13:41:18] syndikate: Okay, I want to run chrome in headless mode
[13:41:42] syndikate: I am not able to understand what to set it to get It running on an existing applicationn
[13:41:47] tbuehlmann: adding `driven_by :selenium, using: :headless_chrome, screen_size: [1400, 1400]` doesn't work for you?
[13:43:22] syndikate: Nope, I whatever I change it brings up chrome and not headless. I have both old Capybara config setting for default driver and the driven_by as well. Let me share config?
[13:48:57] syndikate: tbuehlmann, http://dpaste.com/2BX3F67
[13:49:06] syndikate: Sorry if any of that is stupid I am just starting to pick this up
[13:51:42] tbuehlmann: remove all the Capybara.register_driver stuff and the Capybara.server_port and try again
[13:52:34] tbuehlmann: also, do you have the `js: true` metadata in the example that you're testing?
[13:53:03] tbuehlmann: https://github.com/tbuehlmann/til/blob/master/rails/headless-system-tests.md - this is all I got and that works for me
[13:53:51] crankharder: has joined #RubyOnRails
[13:54:47] pavelz: hi I have routing issue
[13:55:46] pavelz: namespace :admin get 'hello/:id' end end -> I don't get hlper admin_hello, just admin. but if I remove the param then it returns to admin_hello_path .
[13:56:33] pavelz: is there a way to parametrarize namespaces get urls to be like /admin/hello/bob ?
[13:59:28] syndikate: tbuehlmann, I think there are many issues, let me do some clean up and get back
[14:01:01] tbuehlmann: syndikate: sure
[14:01:18] tbuehlmann: pavelz: add an `as: 'hello'` option to your route
[14:01:34] tbuehlmann: I'd also reconsider this, maybe `resources` is what you want
[14:28:47] tdy1: has joined #RubyOnRails
[14:31:15] crankharder: has joined #RubyOnRails
[14:35:00] jackhum: has joined #RubyOnRails
[14:37:10] tdy1: has joined #RubyOnRails
[14:38:55] syndikate: tbuehlmann, I have `Rspec.feature` is it mandatory to have that changed to `Rspec.describe` ?
[14:42:09] davidh38: has joined #RubyOnRails
[14:43:02] tbuehlmann: I think that'll change the type to :feature, maybe overriding it
[14:55:11] shansen: has joined #RubyOnRails
[15:06:02] tdy1: has joined #RubyOnRails
[15:10:30] blackmesa: has joined #RubyOnRails
[15:21:49] szulak_: has joined #RubyOnRails
[15:30:31] Dbugger: has joined #RubyOnRails
[15:35:25] dviola: has joined #RubyOnRails
[15:41:00] srruby: has joined #RubyOnRails
[15:46:59] srruby: has joined #RubyOnRails
[15:49:09] xco: has joined #RubyOnRails
[15:49:32] xco: I’m reading this and trying to find the sense/use case for #rewhere https://coderwall.com/p/deix-w/rails-rewhere-activerecord-method
[15:49:37] xco: here there’s this example
[15:50:05] xco: Post.where(published: true).rewhere(published: false) # => WHERE `published` = 0
[15:50:16] xco: what’s the point in doing that
[15:50:31] xco: if you want WHERE `published` = 0
[15:50:33] xco: why not do
[15:50:43] xco: Post.where(published: false)
[15:50:49] xco: why do first
[15:50:51] blackmesa: has joined #RubyOnRails
[15:51:05] xco: Post.where(published: true) then append .rewhere(published: false)
[15:51:09] xco: it doesn’t make any sense to me
[15:51:13] xco: any help will be appreciated
[15:57:33] tbuehlmann: .where(published: true) could be a default which is overridable by the user
[15:59:54] xco: tbuehlmann: thanks. so if it’s overridable but the user, to say false we can still do JUST Post.where(published: false) assuming the user changed it to false and JUST do Post.where(published: true) assuming the user didn’t override it
[16:00:42] tbuehlmann: it's often easier to first apply the defaults and only later apply the user's needs
[16:07:44] shansen: has joined #RubyOnRails
[16:10:08] xco: ok thanks a lot :)
[16:14:41] odinsbane: has joined #RubyOnRails
[16:14:55] odinsbane: Does anybody know why, ActiveRecord::SessionStore::Session.all would kill an application?
[16:15:15] v01d4lph4: has joined #RubyOnRails
[16:17:49] odinsbane: hmm, it looks like my sessions table is absolutely full of crap.
[16:21:20] conta: has joined #RubyOnRails
[16:24:31] Saukk: has joined #RubyOnRails
[16:27:21] orbyt_: has joined #RubyOnRails
[16:49:51] szulak_: has joined #RubyOnRails
[17:04:18] MrCrackPotBuilde: has joined #RubyOnRails
[17:26:09] [Butch]: has joined #RubyOnRails
[17:30:43] blackmesa: has joined #RubyOnRails
[17:36:45] srinidhi: has joined #RubyOnRails
[17:38:01] xco: has joined #RubyOnRails
[17:38:38] dionysus70: has joined #RubyOnRails
[17:38:51] orbyt_: has joined #RubyOnRails
[17:40:38] dionysus70: is there a performance tradeoff when using content_tags ? I am figuring out how stimulus js works and I figured that content_tag with data { target: "", action: "" } readability is much greater than regular html
[17:40:46] conta1: has joined #RubyOnRails
[17:46:25] [Butch]: has joined #RubyOnRails
[17:50:00] orbyt_: has joined #RubyOnRails
[17:50:32] Xiti: has joined #RubyOnRails
[18:03:27] cr1xu5: has joined #RubyOnRails
[18:10:35] cagomez: has joined #RubyOnRails
[18:11:13] cagomez: has joined #RubyOnRails
[18:11:50] cagomez: has joined #RubyOnRails
[18:13:30] dionysus70: interesting article, so I made a good decision by removing jquery https://www.sitepoint.com/xmlhttprequest-vs-the-fetch-api-whats-best-for-ajax-in-2019/
[18:30:29] ariedler: has joined #RubyOnRails
[18:32:52] ams__: has joined #RubyOnRails
[18:33:27] annaseo: has joined #RubyOnRails
[18:40:26] davidfetter_work: has joined #RubyOnRails
[18:42:21] xco: has joined #RubyOnRails
[18:52:00] orbyt_: has joined #RubyOnRails
[18:54:11] davidh38: has joined #RubyOnRails
[19:00:47] reber: has joined #RubyOnRails
[19:02:53] ravenousmoose: has joined #RubyOnRails
[19:05:50] xco: has joined #RubyOnRails
[19:15:37] mike274: has joined #RubyOnRails
[19:22:31] srruby: has joined #RubyOnRails
[19:24:33] xco: has joined #RubyOnRails
[19:25:40] davidh38: has joined #RubyOnRails
[19:34:49] istrasci: has joined #RubyOnRails
[19:35:25] sameerynho: has joined #RubyOnRails
[19:37:48] uks: has joined #RubyOnRails
[19:45:54] istrasci: If I have the following scenario, how do I get all the unique colleges a student is associated with (preferably using an association instead of a method)? https://gist.github.com/istrasci/175a4f404735fb5661150b4cbeadcba2
[19:47:50] cnsvc_: has joined #RubyOnRails
[19:59:01] agent_white: has joined #RubyOnRails
[20:06:46] conta: has joined #RubyOnRails
[20:07:09] levifig: has joined #RubyOnRails
[20:09:04] davidh38: has joined #RubyOnRails
[20:09:20] kanzure: has joined #RubyOnRails
[20:18:49] ur5us: has joined #RubyOnRails
[20:25:48] xco: has joined #RubyOnRails
[20:31:27] ariedler: has joined #RubyOnRails
[20:38:25] xco: has joined #RubyOnRails
[20:50:51] szulak_: has joined #RubyOnRails
[20:52:47] LightStalker: has joined #RubyOnRails
[20:54:20] ravenousmoose: has joined #RubyOnRails
[21:02:28] tdy1: has joined #RubyOnRails
[21:08:14] szulak_: has joined #RubyOnRails
[21:10:55] Radar: GOOD MORNING
[21:21:08] wethu: has joined #RubyOnRails
[21:31:36] srruby: has joined #RubyOnRails
[21:34:14] srruby: My client has an app withA
[21:44:16] szulak_: has joined #RubyOnRails
[21:46:20] agent_white: has joined #RubyOnRails
[21:47:02] Technodrome: ACTION is burned out with my python job 
[21:47:45] Inside: has joined #RubyOnRails
[21:47:53] Inside: heyo~ how do you guys deal with a single model that has different ACL levels?
[21:48:24] wethu: has joined #RubyOnRails
[21:48:38] Inside: Do you 1) Create a base model and then subclass it into BaseModelAdmin and BaseModelUser and then create BaseModelAdminController, BaseModelUserController with varying permitted params?
[21:49:54] Inside: 2) Keep everything in one model & controller?
[21:51:23] helpa: has joined #RubyOnRails
[21:52:39] bvdw8: has joined #RubyOnRails
[22:00:43] TessaM: has joined #RubyOnRails
[22:07:51] armyriad: has joined #RubyOnRails
[22:11:29] DigitalDarwin: has joined #RubyOnRails
[22:11:45] bga57: has joined #RubyOnRails
[22:12:19] DigitalDarwin: what's the difference between './bin/bundle exec rspec spec' and './bin/bundle exec rake spec'?
[22:12:43] DigitalDarwin: the 1st one fails with factory girl errors. Not sure what the differences are
[22:12:49] conta: has joined #RubyOnRails
[22:16:51] xco: has joined #RubyOnRails
[22:21:45] TheMoonMaster: DigitalDarwin: one is calling rspec, the other is calling the rake task spec
[22:29:23] orbyt_: has joined #RubyOnRails
[22:32:16] kvda: has joined #RubyOnRails
[22:32:17] ariedler: has joined #RubyOnRails
[22:35:30] DigitalDarwin: TheMoonMaster: how do I know if I should be using rspec?
[22:36:23] gambl0r3: has joined #RubyOnRails
[22:38:41] Xiti: has joined #RubyOnRails
[22:41:40] davidh38: has joined #RubyOnRails
[22:46:54] Inside: what do you mean by that
[22:47:06] orbyt_: has joined #RubyOnRails
[23:02:26] Radar: DigitalDarwin: `bundle exec rspec` is the common way to run them. You can use that to target a particular test too: `bundle exec rspec spec/models/user_spec.rb`
[23:09:05] DigitalDarwin: why would one of the commands fail but the other pass
[23:16:16] davidfetter_work: hi. I'm a DBA doing some code archeology. Is there a way to get a model to spit out all the foreign key constraints implicit in has_one, has_many, etc.?
[23:17:41] davidfetter_work: people in the distant past, for what were likely good reasons at the time, did not include actual foreign_key directives.
[23:29:10] Net: davidfetter_work: YourModel.reflect_on_all_associations(:belongs_to).map(&:foregin_key) maybe
[23:29:44] Radar: DigitalDarwin: Different code paths that they load.
[23:29:46] Radar: DigitalDarwin: !gist
[23:29:46] helpa: DigitalDarwin: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[23:39:33] tdy: has joined #RubyOnRails
[23:39:43] Net: davidfetter_work: that will only show belongs_to associations
[23:40:11] Net: (which, I believe, should be the only columns in the table with fk constraints)
[23:44:57] ariedler: has joined #RubyOnRails
[23:51:25] davidfetter_work: Net: I think has_one and has_many should, too. I guess I can do those separately