#RubyOnRails - 03 January 2019
« Back 1 day Forward 1 day »
[10:16:38] GeorgesLeYeti: I have a question. I have 2 web applications and both should use the same user database but each application are using different data.
[10:17:07] GeorgesLeYeti: Should I make 1 big database for the 2 applications ? Or 3 database : 1 for user and 1 for each application ?
[10:28:57] Radar: write establish_connection :other_database inside the model, as a class method call
[15:59:59] tweaks: I have a 4.2.x project that needs to 301 redirect all routes with a trailing slash to the non-trailing version for SEO purposes to avoid duplicate content issues. The app is on Heroku so it looks like I’ll have to use something like https://github.com/jtrupiano/rack-rewrite, but wanted to see if anyone had other ideas before adding a middleware gem.
[16:00:39] Ookma-Kyi: Is Rails a good fit for my project: https://git.tuxfamily.org/aleeiousmmo/source.git/tree/
[16:07:07] tbuehlmann: they will probably all work very well, it's up to you and what tech you know/want to learn
[16:20:36] tbuehlmann: I don't know the exact requirements and I don't know django and nodejs enough to make a good suggestion
[16:24:35] nickjj: is everyone leaving? laracasts is insanely popular and it's driven by a PHP framework, tons of people are using it
[16:27:18] nickjj: i don't even use php or laravel but i know of the site, mainly because i've seen it come up for search results even for non-php related terms
[16:27:41] nickjj: but i once looked through it, there's a ridiculous amount of engagement from people on that site
[17:00:29] andywww: has anyone run into any problems with the passenger team version of nginx? I can’t seem to get it to work with Ubuntu 18+/Debian 9+
[17:01:37] andywww: there are only a handful of commands to run if you follow the passenger website but it seems neither are playing ball
[18:59:54] orbyt_: What is the best way to handle routes that accept a fairly large amount or query params?
[19:15:11] orbyt_: I have a restful resource, for example "star", and i'd like to be able to query for example all stars in a main sequence stage and larger than the sun and at least 3 light years away
[19:15:29] orbyt_: i'm wondering if theres a better pattern than hardcoding all the possible combinations in my controller
[19:16:06] tbuehlmann: a simple start for that usecase could be a bunch of model scope that you'd just call: Star.with_foo(params[:foo])
[19:18:11] orbyt_: how would that work exactly? Like I could have Star.in_main_sequence, but then what about other parts of the query?
[19:19:40] tbuehlmann: Star.in_main_sequence(params[:whatever]).larger_than_the_sun(params[:whatever]) and so on
[19:21:21] orbyt_: what is params[:whatever] in your example? Would that be a query like ?stage=main-sequence where that scope than toggles a boolean?
[19:22:40] orbyt_: Well Star.in_main_sequence wouldn't make sense with a different stage, i.e. `?stage=red-giant`, right?
[19:24:33] tbuehlmann: I don't know the exact usecase. so you can filter on stages? if so, have a ?stage=name-of-stage query param